Commit 651b6127 authored by Manggar Mahardhika's avatar Manggar Mahardhika

push

parent 4af4bf0f
......@@ -7,6 +7,8 @@ from django.db import connection as conn
# Create your views here.
from rest_framework.renderers import JSONRenderer, TemplateHTMLRenderer
import random
@api_view(('GET',))
@renderer_classes((TemplateHTMLRenderer, JSONRenderer))
def search_auto(request):
......@@ -637,14 +639,17 @@ def editrumahsakit(request):
luastanah = request.POST.get('luastanah')
tinggibangunan = request.POST.get('tinggibangunan')
# gambar = request.POST.get('gambar')
alamat = request.POST.get('alamat')
if alamat is None:
alamat = "alamat"
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = "bpk"
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
......@@ -653,8 +658,24 @@ def editrumahsakit(request):
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namars}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
num = random.randrange(1, 10000000000000)
namafile = "rs.svg"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
with conn.cursor() as editrs:
editrs.execute("""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' where id = %s"""%(co_edit, namars, alamat, remark, luasbangunan, luastanah, tinggibangunan, perangkat, idrs))
editrs.execute("""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"""%(co_edit, namars, alamat, remark, luasbangunan, luastanah, tinggibangunan, perangkat, filename, idrs))
conn.commit()
with conn.cursor() as hasledit:
......@@ -672,10 +693,43 @@ def editcagarbudaya(request):
remark = request.POST.get('remark')
gambar = request.POST.get('gambar')
alamat = request.POST.get('alamat')
if alamat is None:
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
point = request.POST.get("point")
cood_edit = json.loads(point)
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
num = random.randrange(1, 10000000000000)
namafile = "loc.svg"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
with conn.cursor() as editcagar:
editcagar.execute("""update geo_cagar_budaya set namobj = '%s', alamat = '%s', remark = '%s', luas = '%s', gambar = '%s', perangkat = '%s' where id = %s"""% (namobj, alamat, remark, luas, gambar, perangkat, idcagar))
editcagar.execute("""update geo_cagar_budaya set namobj = '%s', alamat = '%s', remark = '%s', luas = '%s', perangkat = '%s', gambar = '%s' where id = %s"""% (namobj, alamat, remark, luas, perangkat, filename, idcagar))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -696,12 +750,16 @@ def editkantoradmin(request):
# gambar = request.POST.get('gambar')
alamat = request.POST.get('alamat')
if alamat is None:
alamat = "alamat"
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = "Bpk"
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
......@@ -710,8 +768,20 @@ def editkantoradmin(request):
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
namafile = "lurah.svg"
with conn.cursor() as editka:
editka.execute("""update geo_kantor_administrasi set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = %s, luas_tanah = %s, tinggi_bangunan = %s, perangkat = '%s', alamat = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, idkantor))
editka.execute("""update geo_kantor_administrasi set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = %s, luas_tanah = %s, tinggi_bangunan = %s, perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, filename, idkantor))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -732,12 +802,16 @@ def editlayanankesehatan(request):
# gambar = request.POST.get('gambar')
alamat = request.POST.get('alamat')
if alamat is None:
alamat = "alamat"
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = "bpk"
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
......@@ -746,8 +820,20 @@ def editlayanankesehatan(request):
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
namafile = "rs.svg"
with conn.cursor() as editka:
editka.execute("""update geo_layanan_kesehatan set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = %s, luas_tanah = %s, tinggi_bangunan = %s, perangkat = '%s', alamat = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, idlakes))
editka.execute("""update geo_layanan_kesehatan set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = %s, luas_tanah = %s, tinggi_bangunan = %s, perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, filename, idlakes))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -768,12 +854,16 @@ def editpuskesmas(request):
# gambar = request.POST.get('gambar')
alamat = request.POST.get('alamat')
if alamat is None:
alamat = "alamat"
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = "bpk"
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
......@@ -782,8 +872,20 @@ def editpuskesmas(request):
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
namafile = "rs.svg"
with conn.cursor() as editrs:
editrs.execute("""update geo_puskesmas set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, idpus))
editrs.execute("""update geo_puskesmas set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, filename, idpus))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -807,12 +909,16 @@ def editibadah(request):
perangkat = request.POST.get('perangkat')
alamat = request.POST.get('alamat')
if alamat is None:
alamat = "alamat"
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = "bpk"
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
......@@ -820,9 +926,25 @@ def editibadah(request):
cood_edit = json.loads(point)
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
num = random.randrange(1, 10000000000000)
namafile = "masjid.svg"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
with conn.cursor() as editrs:
editrs.execute("""update geo_sarana_ibadah set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, idsarib))
editrs.execute("""update geo_sarana_ibadah set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, filename, idsarib))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -845,12 +967,16 @@ def editsekolah(request):
# gambar = request.POST.get('gambar')
alamat = request.POST.get('alamat')
if alamat is None:
alamat = "alamat"
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = "bpk"
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
......@@ -858,9 +984,25 @@ def editsekolah(request):
cood_edit = json.loads(point)
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
num = random.randrange(1, 10000000000000)
namafile = "sekolah.svg"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
with conn.cursor() as editrs:
editrs.execute("""update geo_sarana_pendidikan set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, idsekolah))
editrs.execute("""update geo_sarana_pendidikan set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, filename, idsekolah))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -884,11 +1026,15 @@ def editspbu(request):
alamat = request.POST.get('alamat')
if alamat is None:
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
......@@ -896,9 +1042,25 @@ def editspbu(request):
cood_edit = json.loads(point)
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
num = random.randrange(1, 10000000000000)
namafile = "masjid.svg"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
with conn.cursor() as editrs:
editrs.execute("""update geo_spbu set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, idspbu))
editrs.execute("""update geo_spbu set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, filename, idspbu))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -921,11 +1083,15 @@ def editstasiun(request):
alamat = request.POST.get('alamat')
if alamat is None:
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
......@@ -933,9 +1099,25 @@ def editstasiun(request):
cood_edit = json.loads(point)
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
num = random.randrange(1, 10000000000000)
namafile = "kereta.svg"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
with conn.cursor() as editrs:
editrs.execute("""update geo_stasiun set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, idstasiun))
editrs.execute("""update geo_stasiun set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, filename, idstasiun))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -956,11 +1138,15 @@ def editterminal(request):
alamat = request.POST.get('alamat')
if alamat is None:
alamat = 'alamat'
elif alamat == '':
alamat = 'alamat'
else:
alamat = request.POST.get('alamat')
perangkat = request.POST.get('perangkat')
if perangkat is None:
perangkat = 'bpk'
elif perangkat == '':
perangkat = 'bpk'
else:
perangkat = request.POST.get('perangkat')
......@@ -968,9 +1154,25 @@ def editterminal(request):
cood_edit = json.loads(point)
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
num = random.randrange(1, 10000000000000)
namafile = "terminal_batu_kuning.png"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
with conn.cursor() as editrs:
editrs.execute("""update geo_terminal_bus set namobj = '%s', remark = '%s', luas = '%s', perangkat = '%s', alamat = '%s' where id = %s"""%(namobj, remark, luas, perangkat, alamat, idterm))
editrs.execute("""update geo_terminal_bus set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas = '%s', perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit, namobj, remark, luas, perangkat, alamat, filename, idterm))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -1005,9 +1207,26 @@ def editgardu(request):
cood_edit = json.loads(point)
co_edit = cood_edit['geometry']['coordinates']
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/img/image/')
try:
format = (file.name).split(".")
num = random.randrange(1, 10000000000000)
namafile = f"{namobj}_{num}.{format[-1:][0]}"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
except:
num = random.randrange(1, 10000000000000)
namafile = "terminal_batu_kuning.png"
filename = fss.save(namafile, file)
# print(file.name)
url = fss.url(filename)
with conn.cursor() as editrs:
editrs.execute("""update geo_gardu_listrik set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, idgardu))
editrs.execute("""update geo_gardu_listrik set geom = st_geomfromgeojson('{"type":"Point", "coordinates":%s, "crs":{"type":"name","properties":{"name":"EPSG:4326"}}}'), namobj = '%s', remark = '%s', luas_bangunan = '%s', luas_tanah = '%s', tinggi_bangunan = '%s', perangkat = '%s', alamat = '%s', gambar = '%s' where id = %s"""%(co_edit, namobj, remark, luas_bangunan, luat_tanah, tinggi_bangunan, perangkat, alamat, filename, idgardu))
conn.commit()
with conn.cursor() as hasiledit:
......@@ -1030,7 +1249,6 @@ from PIL import Image
@api_view(('POST',))
def cobagam(request):
file = request.FILES.get('file')
fss = FileSystemStorage(location='static/image/kelurahan/')
filename = fss.save(file.name, file)
url = fss.url(filename)
......
from decimal import Context
from typing import get_origin
# from decimal import Context
# from typing import get_origin
from django.db.models.expressions import F
from django.http import response
from django.views import View, generic
......
......@@ -348,8 +348,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -371,7 +375,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -511,37 +515,41 @@
var hasil = (JSON.stringify(poinin.toGeoJSON()))
$("#coordinateZoneedit").val(hasil);
})
}
})
});
$(document).on("click", "#saveeditadm", function() {
var idka = $('#id').val();
var poi = $('#coordinateZoneedit').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('id',idka)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luasbangunan', $('#luas_bangunan').val())
data.append('luastanah', $('#luas_tanah').val())
data.append('tinggibangunan', $('#tinggi_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:kantor' %}",
data: {
'id': idka,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luasbangunan': $('#luas_bangunan').val(),
'luastanah': $('#luas_tanah').val(),
'tinggibangunan': $('#tinggi_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert('sukses')
location.reload()
}
})
});
var layanan_kesehatan = "{{ layanan_kesehatan }}".replace(/&#x27;/g, '"');
......@@ -714,8 +722,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -737,7 +749,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -885,23 +897,26 @@
$(document).on("click", "#saveeditlk", function() {
var idka = $('#idlk').val();
var poi = $('#coordinateZoneeditlk').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('id',idka)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luasbangunan', $('#luas_bangunan').val())
data.append('luastanah', $('#luas_tanah').val())
data.append('tinggibangunan', $('#tinggi_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:layanankesehatan' %}",
data: {
'id': idka,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luasbangunan': $('#luas_bangunan').val(),
'luastanah': $('#luas_tanah').val(),
'tinggibangunan': $('#tinggi_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert('sukses')
location.reload()
......@@ -1080,8 +1095,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -1103,7 +1122,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -1251,23 +1270,26 @@
$(document).on("click", "#saveeditpuskes", function() {
var idka = $('#idpuskes').val();
var poi = $('#coordinateZoneeditpuskes').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('idpus',idka)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luasbangunan', $('#luas_bangunan').val())
data.append('luastanah', $('#luas_tanah').val())
data.append('tinggibangunan', $('#tinggi_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:puskesmas' %}",
data: {
'idpus': idka,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luasbangunan': $('#luas_bangunan').val(),
'luastanah': $('#luas_tanah').val(),
'tinggibangunan': $('#tinggi_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert('sukses')
location.reload()
......@@ -1446,8 +1468,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -1469,7 +1495,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -1600,23 +1626,26 @@
$(document).on("click", "#saveeditrs", function() {
var idrs = $('#idrs').val();
var poi = $('#coordinateZoneeditrs').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('idrs',idrs)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luasbangunan', $('#luas_bangunan').val())
data.append('luastanah', $('#luas_tanah').val())
data.append('tinggibangunan', $('#tinggi_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:rumahsakit' %}",
data: {
'idrs': idrs,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luasbangunan': $('#luas_bangunan').val(),
'luastanah': $('#luas_tanah').val(),
'tinggibangunan': $('#tinggi_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert('sukses')
location.reload()
......@@ -1855,8 +1884,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -1878,7 +1911,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
......@@ -2014,23 +2047,25 @@
$(document).on("click", "#saveeditsi", function() {
var idsi = $('#idsi').val();
var poi = $('#coordinateZoneeditsi').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('idsi',idsi)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luasbangunan', $('#luas_bangunan').val())
data.append('luastanah', $('#luas_tanah').val())
data.append('tinggibangunan', $('#tinggi_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:ibadah' %}",
data: {
'idsi': idsi,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luasbangunan': $('#luas_bangunan').val(),
'luastanah': $('#luas_tanah').val(),
'tinggibangunan': $('#tinggi_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert('sukses')
location.reload()
......@@ -2250,8 +2285,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -2273,7 +2312,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -2420,23 +2459,26 @@
$(document).on("click", "#saveeditsp", function() {
var idsp = $('#idsp').val();
var poi = $('#coordinateZoneeditsp').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('idsp',idsp)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luasbangunan', $('#luas_bangunan').val())
data.append('luastanah', $('#luas_tanah').val())
data.append('tinggibangunan', $('#tinggi_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:sekolah' %}",
data: {
'idsp': idsp,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luasbangunan': $('#luas_bangunan').val(),
'luastanah': $('#luas_tanah').val(),
'tinggibangunan': $('#tinggi_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert('sukses')
location.reload()
......@@ -2615,8 +2657,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -2638,7 +2684,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -2771,22 +2817,25 @@
var idspbu = $('#idspbu').val();
var poi = $('#coordinateZoneeditspbu').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('idspbu',idspbu)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luasbangunan', $('#luas_bangunan').val())
data.append('luastanah', $('#luas_tanah').val())
data.append('tinggibangunan', $('#tinggi_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:spbu' %}",
data: {
'idspbu': idspbu,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luasbangunan': $('#luas_bangunan').val(),
'luastanah': $('#luas_tanah').val(),
'tinggibangunan': $('#tinggi_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert("sukses")
location.reload()
......@@ -2965,8 +3014,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -2988,7 +3041,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -3120,22 +3173,25 @@
var idst = $('#idst').val();
var poi = $('#coordinateZoneeditst').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('idst',idst)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luasbangunan', $('#luas_bangunan').val())
data.append('luastanah', $('#luas_tanah').val())
data.append('tinggibangunan', $('#tinggi_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:stasiun' %}",
data: {
'idst': idst,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luasbangunan': $('#luas_bangunan').val(),
'luastanah': $('#luas_tanah').val(),
'tinggibangunan': $('#tinggi_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert("sukses")
location.reload()
......@@ -3277,8 +3333,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -3300,7 +3360,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -3413,21 +3473,24 @@
$(document).on("click", "#saveedittr", function() {
var idtr = $('#idtr').val();
var poi = $('#coordinateZoneedittr').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('idtr',idtr)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luas', $('#luas_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:terminal' %}",
data: {
'idtr': idtr,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luas': $('#luas_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert("sukses")
location.reload()
......@@ -3569,8 +3632,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -3592,7 +3659,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f4 +`.`+ feature.administrasi.f6 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f4 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -3717,21 +3784,24 @@
$(document).on("click", "#saveeditcb", function() {
var idcb = $('#idcb').val();
var poi = $('#coordinateZoneeditcb').val();
console.log(poi)
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('idcb',idcb)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luas', $('#luas_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:cagarbudaya' %}",
data: {
'idcb': idcb,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luas': $('#luas_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert("sukses")
location.reload()
......@@ -3910,8 +3980,12 @@
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="form-group">
<div id="map-for-edit" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<label style="margin-top: 10px; margin-left: 50px;" for="exampleFormControlFile1">Input Foto</label>
<input style="margin-top: 10px; margin-left: 50px;" type="file" class="form-control-file" id="uploadFile">
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="file" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
</div>
......@@ -3933,7 +4007,7 @@
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src="static/img/image/`+ feature.administrasi.f8 +`.`+ feature.administrasi.f11 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
<img src="static/img/image/`+ feature.administrasi.f8 +`" alt="Image" style="width: 100%;max-height: 237px;height:237">
</th>
</tr>
</thead>
......@@ -4066,22 +4140,26 @@
$(document).on("click", "#saveeditgl", function() {
var idgl = $('#idgl').val();
var poi = $('#coordinateZoneeditgl').val();
var data = new FormData();
data.append("file", $("input[id^='file']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
data.append('idgl',idgl)
data.append('namobj', $('#namobj').val())
data.append('remark', $('#remark').val())
data.append('luasbangunan', $('#luas_bangunan').val())
data.append('luastanah', $('#luas_tanah').val())
data.append('tinggibangunan', $('#tinggi_bangunan').val())
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi)
$.ajax({
url: "{% url 'api:gardu' %}",
data: {
'idgl': idgl,
'namobj': $('#namobj').val(),
'remark': $('#remark').val(),
'luasbangunan': $('#luas_bangunan').val(),
'luastanah': $('#luas_tanah').val(),
'tinggibangunan': $('#tinggi_bangunan').val(),
'alamat': $('#alamat').val(),
'perangkat': $('#perangkat').val(),
'point': poi
},
data: data,
dataType: 'json',
type: 'POST',
processData: false,
contentType: false,
success: function(data) {
alert("sukses")
location.reload()
......
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