Commit 74ad4e71 authored by Muhamad's avatar Muhamad

dashboard, insert all kurang dikit pointnya

parent 75b657e5
...@@ -49,6 +49,8 @@ urlpatterns = [ ...@@ -49,6 +49,8 @@ urlpatterns = [
path('c_bangunan', views.createbang, name='c_bangunan'), path('c_bangunan', views.createbang, name='c_bangunan'),
path('create-jalan', views.createjalan, name='create-jalan'),
path('create-point', views.createpoint, name='create-point'),
path('edit-tuplah', login_required(views.edittuplah), name='edit-tuplah'), path('edit-tuplah', login_required(views.edittuplah), name='edit-tuplah'),
path('edit-tuplah-valid', views.edittuplahvalid, name='edit-tuplah-valid'), path('edit-tuplah-valid', views.edittuplahvalid, name='edit-tuplah-valid'),
...@@ -56,8 +58,5 @@ urlpatterns = [ ...@@ -56,8 +58,5 @@ urlpatterns = [
path('edit-jalan', views.editjalan, name='edit-jalan'), path('edit-jalan', views.editjalan, name='edit-jalan'),
path('edit-jalan-valid', views.editjalanvalid, name='edit-jalan-valid'), path('edit-jalan-valid', views.editjalanvalid, name='edit-jalan-valid'),
path('3d-maps', views.maps3d, name='3d-maps'), path('3d-maps', views.maps3d, name='3d-maps'),
] ]
\ No newline at end of file
...@@ -1535,4 +1535,146 @@ def createbang(request): ...@@ -1535,4 +1535,146 @@ def createbang(request):
respon={'data':data, 'info': info, 'status':status} respon={'data':data, 'info': info, 'status':status}
return Response(respon) return Response(respon)
# @api_view(('GET',)) @api_view(('POST',))
def createjalan(request):
polyline = request.POST.get('polyline')
name_jalan = request.POST.get('name_jalan')
panjang_jalan = request.POST.get('panjang_jalan')
lebar_jalan = request.POST.get('lebar_jalan')
tipe_jalan = request.POST.get('tipe_jalan')
img_jalan = request.FILES.get('gambar')
coord = json.loads(str(polyline))
print(coord)
try:
if coord['features'][0]['geometry']['type'] == 'LineString':
for co in coord['features']:
ll = str(co["geometry"]['coordinates'])
ll += ll
ll = ll.replace(", "," ")
ll = ll.replace("]][[","),(")
ll = ll.replace("] [",", ")
ll = ll.replace("]]",")")
ll = ll.replace("[[","(")
coordinat = f'MULTILINESTRING({ll})'
except:
if coord['geometry']['type'] == 'LineString':
ll = str(coord["geometry"]['coordinates'])
ll = ll.replace(", "," ")
ll = ll.replace("]][[","),(")
ll = ll.replace("] [",", ")
ll = ll.replace("]]",")")
ll = ll.replace("[[","(")
coordinat = f'MULTILINESTRING({ll})'
fss_p = FileSystemStorage(location='static/image/jalan/')
try:
format = (img_jalan.name).split(".")
num = random.randrange(1, 10000000000000)
ngambar = f"{name_jalan}_{num}.{format[-1:][0]}"
ngambar = ngambar.replace(" ","-")
filename_p = fss_p.save(ngambar, img_jalan)
url_p = fss_p.url(filename_p)
except:
ngambar = 'None'
try:
with conn.cursor() as jalan:
jalan.execute("""INSERT INTO geo_jalan(geom, namrjl, panjang_jalan, lebar_jalan, remark, gambar) VALUES (ST_GeomFromEWKT('SRID=4326;%s'), '%s',%s,%s,'%s','%s')"""% (coordinat, name_jalan, panjang_jalan, lebar_jalan, tipe_jalan, ngambar))
conn.commit()
data = 'SUCCESS'
info = 'data telah diperbaharui'
status = 0
except:
data = 'Opss..!!'
info = 'Hubungi Developer'
status = 1
respon={'data':data, 'info': info, 'status':status}
return Response(respon)
@api_view(('POST',))
def createpoint(request):
gambar = request.FILES.get('gambar')
co_point = request.POST.get('point')
name_create_point = request.POST.get('name_create_point')
tipe_point = request.POST.get('tipe_point')
info_create_point = request.POST.get('info_create_point')
alamat_create_point = request.POST.get('alamat_create_point')
luas_bangunan_point = request.POST.get('luas_bangunan_point')
luas_tanah_point = request.POST.get('luas_tanah_point')
tinggi_bangunan_point = request.POST.get('tinggi_bangunan_point')
lantai_point = request.POST.get('lantai_point')
pemilik_point = request.POST.get('pemilik_point')
coord = json.loads(str(co_point))
coordinat = coord['geometry']['coordinates']
fss_p = FileSystemStorage(location='static/img/image/')
try:
format = (gambar.name).split(".")
num = random.randrange(1, 10000000000000)
ngambar = f"{name_create_point}_{num}.{format[-1:][0]}"
ngambar = ngambar.replace(" ","-")
filename_p = fss_p.save(ngambar, gambar)
url_p = fss_p.url(filename_p)
except:
ngambar = 'None'
# update geo_rumah_sakit set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', alamat = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', gambar = '%s' where id = %s
try:
if tipe_point == 'administrasi':
with conn.cursor() as point:
point.execute("""INSERT INTO geo_kantor_administrasi(geom, namobj, remark, luas_bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '%s','%s', %s, %s, %s, '%s', '%s', 5,'%s')"""% (coordinat, name_create_point, info_create_point, luas_bangunan_point, luas_tanah_point, tinggi_bangunan_point, alamat_create_point, pemilik_point, ngambar))
conn.commit()
if tipe_point == 'layanankesehatan':
with conn.cursor() as point:
point.execute("""INSERT INTO geo_layanan_kesehatan(geom, namobj, remark, luas_bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '%s','%s', %s, %s, %s, '%s', '%s', 6,'%s')"""% (coordinat, name_create_point, info_create_point, luas_bangunan_point, luas_tanah_point, tinggi_bangunan_point, alamat_create_point, pemilik_point, ngambar))
conn.commit()
if tipe_point == 'puskesmas':
with conn.cursor() as point:
point.execute("""INSERT INTO geo_puskesmas(geom, namobj, remark, luas_bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '%s','%s', %s, %s, %s, '%s', '%s', 7,'%s')"""% (coordinat, name_create_point, info_create_point, luas_bangunan_point, luas_tanah_point, tinggi_bangunan_point, alamat_create_point, pemilik_point, ngambar))
conn.commit()
if tipe_point == 'rumahsakit':
with conn.cursor() as point:
point.execute("""INSERT INTO geo_rumah_sakit(geom, namobj, remark, luas_bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '%s','%s', %s, %s, %s, '%s', '%s', 8,'%s')"""% (coordinat, name_create_point, info_create_point, luas_bangunan_point, luas_tanah_point, tinggi_bangunan_point, alamat_create_point, pemilik_point, ngambar))
conn.commit()
if tipe_point == 'saranaibadah':
with conn.cursor() as point:
point.execute("""INSERT INTO geo_sarana_ibadah(geom, namobj, remark, luas_bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '%s','%s', %s, %s, %s, '%s', '%s', 9,'%s')"""% (coordinat, name_create_point, info_create_point, luas_bangunan_point, luas_tanah_point, tinggi_bangunan_point, alamat_create_point, pemilik_point, ngambar))
conn.commit()
if tipe_point == 'saranapendidikan':
with conn.cursor() as point:
point.execute("""INSERT INTO geo_sarana_pendidikan(geom, namobj, remark, luas_bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '%s','%s', %s, %s, %s, '%s', '%s', 10,'%s')"""% (coordinat, name_create_point, info_create_point, luas_bangunan_point, luas_tanah_point, tinggi_bangunan_point, alamat_create_point, pemilik_point, ngambar))
conn.commit()
if tipe_point == 'cagarbudaya':
with conn.cursor() as point:
point.execute("""INSERT INTO geo_cagar_budaya(geom, namobj, remark, luas_bangunan, luas_tanah, tinggi_bangunan, alamat, perangkat, type_id, gambar) VALUES (st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), '%s','%s', %s, %s, %s, '%s', '%s', 3,'%s')"""% (coordinat, name_create_point, info_create_point, luas_bangunan_point, luas_tanah_point, tinggi_bangunan_point, alamat_create_point, pemilik_point, ngambar))
conn.commit()
data = 'SUCCESS'
info = 'data telah diperbaharui'
status = 0
except:
data = 'Opss..!!'
info = 'Hubungi Developer'
status = 1
respon={'data':data, 'info': info, 'status':status}
return Response(respon)
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -4,8 +4,13 @@ ...@@ -4,8 +4,13 @@
<div class="navbar-header"> <div class="navbar-header">
<a class="navbar-brand gradient-text " href="{% url 'apps:dashboard' %}"> <a class="navbar-brand gradient-text " href="{% url 'apps:dashboard' %}">
<!-- <h3>NationalAddress</h3> --> <!-- <h3>NationalAddress</h3> -->
<i class="icon-location4 fa-gradient"></i> <i>
<b>&nbsp;&nbsp;OKU-GIS</b> <img src="{% static 'img/logo-ok.png' %}" alt="" style="position: absolute;
width: 26px;
top: 7px;">
</i>
<!-- <i class="icon-location4 fa-gradient"></i> -->
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OKU-GIS</b>
</a> </a>
<ul class="nav navbar-nav pull-right visible-xs-block"> <ul class="nav navbar-nav pull-right visible-xs-block">
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</div> </div>
</div> </div>
<div class="footer" id="thisFooter" style="bottom: 0px; left: 0px;"> <div class="footer" id="thisFooter" style="bottom: 10px; left: 0px;">
<input type="hidden" id="infoLongitude"> <input type="hidden" id="infoLongitude">
<input type="hidden" id="infoLatitude"> <input type="hidden" id="infoLatitude">
<input type="hidden" id="infoLimitx"> <input type="hidden" id="infoLimitx">
......
{% load static %} {% load static %}
<ul class="dock" style="right: 0;position: absolute;"> <ul class="dock" style="right: 0;position: absolute;">
<li class="fixed-plugin" style="top: 100px;"> <li class="fixed-plugin" style="top: 100px;">
<div class="dropdown show-dropdown"> <div class="dropdown show-dropdown" style="top: 1px;">
<a href="#" data-toggle="dropdown"> <a href="#" data-toggle="dropdown">
<i class="fa fa-map-o fa-2x" style="color: white; <i class="fa fa-map-o fa-2x" style="color: white;
padding: 10px; margin: 10px 10px;
border-radius: 0 0 6px 6px;
width: auto;"> </i> width: auto;"> </i>
</a> </a>
<ul class="dropdown-menu" x-placement="bottom-start"> <ul class="dropdown-menu" x-placement="bottom-start">
...@@ -62,10 +61,9 @@ ...@@ -62,10 +61,9 @@
<a href="#" data-toggle="dropdown"> <a href="#" data-toggle="dropdown">
<i class="fa fa-cog fa-2x" style="font-size: 36px; <i class="fa fa-cog fa-2x" style="font-size: 36px;
color: white; color: white;
margin: 4px; margin: 6px 9px;"> </i>
margin-left: 10px;"> </i>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu" style="top: -5px;">
<li class="header-title text-center">Sidebar Filters</li> <li class="header-title text-center">Sidebar Filters</li>
<!-- <div id="sidebar" onmouseleave="overll()"> <!-- <div id="sidebar" onmouseleave="overll()">
<div class="sidebar-wrapper"> <div class="sidebar-wrapper">
......
...@@ -353,7 +353,7 @@ ...@@ -353,7 +353,7 @@
margin-right: 3px; margin-right: 3px;
position: absolute; position: absolute;
top: calc(100% - 196px); top: calc(100% - 196px);
right: calc(50% - 0px); right: calc(95% / 2);
z-index: 99999999; z-index: 99999999;
border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0;
border: 0; border: 0;
...@@ -373,7 +373,7 @@ ...@@ -373,7 +373,7 @@
margin-right: 3px; margin-right: 3px;
position: absolute; position: absolute;
top: calc(100% - 23px); top: calc(100% - 23px);
right: calc(50% - 0px); right: calc(95%/2);
z-index: 99999999; z-index: 99999999;
border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0;
border: 0; border: 0;
...@@ -391,14 +391,29 @@ ...@@ -391,14 +391,29 @@
left: 408px !important; left: 408px !important;
transform: translate(0, 0); transform: translate(0, 0);
} }
/*.fixed-plugin {*/
/* position: absolute;*/
/* z-index: 1000;*/
/* right: 0px;*/
/* background-color: #40777c;*/
/* border-top-left-radius: 10px;*/
/* border-bottom-left-radius: 10px;*/
/* margin-top: 5px;*/
/* width: 48px;*/
/* height: 48px;*/
/* box-shadow: 0 0 20px rgb(0 0 0 / 30%);*/
/* transition: 0.3s ease-out;*/
/* display: inline-block;*/
/*}*/
.fixed-plugin { .fixed-plugin {
position: absolute; position: absolute;
z-index: 1000; z-index: 1000;
right: 0px; right: 10px;
background-color: #40777c; background-color: #40777c;
border-top-left-radius: 10px; border-top-left-radius: 10px;
border-bottom-left-radius: 10px; border-bottom-left-radius: 10px;
border-radius: 10px;
margin-top: 5px; margin-top: 5px;
width: 48px; width: 48px;
height: 48px; height: 48px;
...@@ -414,27 +429,29 @@ ...@@ -414,27 +429,29 @@
width: 550px; width: 550px;
margin-left: -560px !important; margin-left: -560px !important;
margin-top: -40px !important; margin-top: -40px !important;
top: 10px;
box-shadow: 0 0 20px rgb(0 0 0 / 30%); box-shadow: 0 0 20px rgb(0 0 0 / 30%);
border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px;
} }
li.fixed-plugin:hover { li.fixed-plugin:hover {
/*transform: scale(1.3);*/ transform: scale(1.3);
right: 0; right: 10px;
/*margin-right: 7px;*/ /*margin-right: 7px;*/
position: relative; /*position: relative;*/
}
li.fixed-plugin .dropdown-menu {
transform: scale(0.769230);
float: right;
position: absolute;
right: -550px;
width: 550px;
margin-left: -490px !important;
margin-top: -40px !important;
top: 10px;
margin-right: -550px;
} }
/*li.fixed-plugin:hover .dropdown-menu {*/
/* transform: scale(0.769230);*/
/* float: right;*/
/* position: absolute;*/
/* right: -550px;*/
/* width: 550px;*/
/* margin-left: -490px !important;*/
/* margin-top: -40px !important;*/
/* top: 0;*/
/* margin-right: -550px;*/
/*}*/
li.fixed-plugin .fa:hover { li.fixed-plugin .fa:hover {
transform: rotate(180deg); transform: rotate(180deg);
...@@ -454,6 +471,23 @@ ...@@ -454,6 +471,23 @@
display: block; display: block;
} }
#map-create-admin>div.leaflet-control-container {
display: block;
}
#map-create-admin>a.leaflet-draw-draw-polyline {
display: none!important;
}
#map-create-admin>div.leaflet-control-container>div.leaflet-top.leaflet-left>div:nth-child(1)>div>div>a.leaflet-draw-draw-polyline,
#map-create-admin>div.leaflet-control-container>div.leaflet-top.leaflet-left>div:nth-child(2) {
display: none;
}
#map-create-admin>div.leaflet-control-container>div.leaflet-top.leaflet-right {
display: none!important;
}
#map-insert>div.leaflet-control-container>div.leaflet-top.leaflet-left>div:nth-child(2) { #map-insert>div.leaflet-control-container>div.leaflet-top.leaflet-left>div:nth-child(2) {
display: none; display: none;
} }
...@@ -461,7 +495,6 @@ ...@@ -461,7 +495,6 @@
.leaflet-draw-draw-polygon, .leaflet-draw-draw-polygon,
.leaflet-draw-draw-rectangle, .leaflet-draw-draw-rectangle,
.leaflet-draw-draw-circle, .leaflet-draw-draw-circle,
.leaflet-draw-draw-marker,
.leaflet-draw-draw-circlemarker { .leaflet-draw-draw-circlemarker {
display: none!important; display: none!important;
} }
...@@ -478,6 +511,10 @@ ...@@ -478,6 +511,10 @@
.leaflet-container ul li a { .leaflet-container ul li a {
color: #333333; color: #333333;
} }
.modal-dialog {
margin-top: 48px;
}
</style> </style>
{% include 'includes/css-o.html' %} {% include 'includes/css-m.html' %} {% include 'includes/css-o.html' %} {% include 'includes/css-m.html' %}
...@@ -551,17 +588,77 @@ ...@@ -551,17 +588,77 @@
<div class="panel panel-default" id="features"> <div class="panel panel-default" id="features">
<div class="sidebar-table" id="isi_panel"> <div class="sidebar-table" id="isi_panel" style="margin-top: 48px;">
<!-- <input type="submit" value="submit"> --> <table class="table tasks-list">
<!-- <a href="" id="btn_edit_kelurahan" style="position: absolute; <thead style="text-align: center;">
top: 240px; <tr>
right: 5px;">Edit</a> --> <th class="text-center" style="padding: 0 0 0 0px;">
<table class="table table-hover tasks-list"> <img src="{% static 'img/logo-ok.png' %}" alt="" style="max-height: 368px">
</th>
<!-- panel samping js disini --> </tr>
</thead>
<tbody>
<div class="container">
<tr style="height: 100px;">
<th class="text-center">
<div>
<h1 style="font-family: Google Sans,Roboto,Arial,sans-serif;
letter-spacing: 0;
font-weight: 400;">
<span style="font-size: x-large;">
OGAN KOMERING ULU
</span>
</h1>
</div>
</th>
</tr>
</div>
<div class="container">
<tr>
<th>
<div class="form-group" style="margin-left: 80px;">
<table>
<tr>
<th>Luas Wilayah</th>
<td>: {{ global.1 }} km2</td>
</tr>
<tr>
<th>Jumlah Kecamatan</th>
<td>: {{ global.5 }} Kecamatan</td>
</tr>
<tr>
<th>Jumlah Kelurahan</th>
<td>: {{ global.6 }} Kelurahan</td>
</tr>
<tr>
<th>Jumlah Penduduk</th>
<td>: {{ global.19 }} Jiwa</td>
</tr>
<tr>
<th>Jumlah KK</th>
<td>: {{ global.20 }} KK</td>
</tr>
<tr>
<th>Jumlah Laki-laki</th>
<td>: {{ global.21 }} Jiwa</td>
</tr>
<tr>
<th>Jumlah Perempuan</th>
<td>: {{ global.22 }} Jiwa</td>
</tr>
</table>
</div>
</th>
</tr>
</div>
</tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment