diff --git a/API/urls.py b/API/urls.py index ce9636266868ea3a0ba8e3d82fb8f3b41cce70a5..aaa950111b9878d2496f361d79a86ea5fc94b2e1 100644 --- a/API/urls.py +++ b/API/urls.py @@ -48,6 +48,7 @@ urlpatterns = [ path('dkantor', views.deletekantoradmin, name='dkantor'), path('change-tipe', views.changetipe, name='change-tipe'), + path('change-jenis', views.changejenis, name='change-jenis'), path('c_bangunan', views.createbang, name='c_bangunan'), path('create-jalan', views.createjalan, name='create-jalan'), diff --git a/API/views.py b/API/views.py index fe29e9277e9f2dc1499b9256a337aaa92f6e1ba9..44ef7b098cad668efc2ae0e608202ae93caeaa43 100644 --- a/API/views.py +++ b/API/views.py @@ -82,7 +82,7 @@ def building(request): # kulon lor, wetan lor, wetan kidul, kulon kidul, kulon lor with conn.cursor() as buldings: - buldings.execute("SELECT json_build_object('type', 'Feature', 'properties', (id, name, information), 'administrasi',(address_1, address_2, address_3, provinsi, alamat, luas_bangunan, luas_tanah, tinggi_bangunan, gambar, pemilik), 'geometry', ST_AsGeoJSON(geom :: geometry) :: json) FROM geo_bangunan WHERE st_intersects(geom,'SRID=0;POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))')"% (kulon, lor, wetan, lor, wetan, kidul, kulon, kidul, kulon, lor)) + buldings.execute("SELECT json_build_object('type', 'Feature', 'properties', (id, name, information), 'administrasi',(address_1, address_2, address_3, provinsi, alamat, luas_bangunan, luas_tanah, tinggi_bangunan, gambar, pemilik, db_tipe, remark, point_id, point_name), 'geometry', ST_AsGeoJSON(geom :: geometry) :: json) FROM geo_bangunan WHERE st_intersects(geom,'SRID=0;POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))')"% (kulon, lor, wetan, lor, wetan, kidul, kulon, kidul, kulon, lor)) prov_res = buldings.fetchall() polbang = [] @@ -193,7 +193,7 @@ def editpoly(request): if request.method == 'GET': id_poly = request.GET.get("id_poly") with conn.cursor() as buldings: - buldings.execute("SELECT json_build_object('type', 'Feature', 'properties', (id, name, information, 'osm'), 'administrasi',(address_1, address_2, address_3, provinsi, alamat, luas_bangunan, luas_tanah, tinggi_bangunan, gambar, pemilik), 'geometry', ST_AsGeoJSON(geom :: geometry) :: json) FROM geo_bangunan WHERE id = %s"% int(id_poly)) + buldings.execute("SELECT json_build_object('type', 'Feature', 'properties', (id, name, information, 'osm'), 'administrasi',(address_1, address_2, address_3, provinsi, alamat, luas_bangunan, luas_tanah, tinggi_bangunan, gambar, pemilik, db_tipe, remark, point_id), 'geometry', ST_AsGeoJSON(geom :: geometry) :: json) FROM geo_bangunan WHERE id = %s"% int(id_poly)) build = buldings.fetchall() return Response(build[0][0]) @@ -1512,6 +1512,9 @@ def createbang(request): po_create = p_create.replace(', ','],[') name = request.GET.get('name') + tipedb = request.GET.get('tipedb') + poin = request.GET.get('poin') + remark = request.GET.get('remark') info = request.GET.get('info') atalam = request.GET.get('alamat') lb = request.GET.get('lb') @@ -1545,7 +1548,20 @@ def createbang(request): else: lt = lt + if tipedb == "": + tdb = "bangunan" + else: + tdb = tipedb + + if poin == "": + pointopeto = 0 + else: + pointopeto = poin + if remark == "": + rem = "bangunan" + else: + rem = remark if atalam == "": alamat = "None" @@ -1573,7 +1589,6 @@ def createbang(request): ltb = ltbang except: ltb = 0 - print(ltb) if kilimep == "": pemilik = "unnamed" else: @@ -1581,7 +1596,6 @@ def createbang(request): print(pemilik) - # try: with conn.cursor() as kel: kel.execute("SELECT desa, kecamatan, kab_kota, provinsi FROM geo_data_kelurahan WHERE st_intersects(geom, 'SRID=4326;POINT(%s)'::geometry)"% latlng) @@ -1590,7 +1604,7 @@ def createbang(request): administrasi = adm[0] with conn.cursor() as buldings: - buldings.execute("""INSERT INTO geo_bangunan(geom, name, information, sumber, alamat, address_1, address_2, address_3, provinsi, no, luas_bangunan, luas_tanah, tinggi_bangunan, lantai, gambar, pemilik) VALUES (ST_GeomFromEWKT('SRID=0;MULTIPOLYGON(((%s)))'), '%s', '%s', 'new', '%s', '%s', '%s', '%s', '%s', '0', '%s', '%s', '%s', '%s', '%s', '%s')"""% (p_create, name, info, alamat, administrasi[0], administrasi[1], administrasi[2], administrasi[3], lb, lt, tb, ltb, namafile, pemilik )) + buldings.execute("""INSERT INTO geo_bangunan(geom, name, information, sumber, alamat, address_1, address_2, address_3, provinsi, no, luas_bangunan, luas_tanah, tinggi_bangunan, lantai, gambar, pemilik, point_id, type_id, remark, db_tipe) VALUES (ST_GeomFromEWKT('SRID=0;MULTIPOLYGON(((%s)))'), '%s', '%s', 'new', '%s', '%s', '%s', '%s', '%s', '0', '%s', '%s', '%s', '%s', '%s', '%s', %s, '1', '%s', '%s')"""% (p_create, name, info, alamat, administrasi[0], administrasi[1], administrasi[2], administrasi[3], lb, lt, tb, ltb, namafile, pemilik, pointopeto, rem, tdb )) conn.commit() data = {'status':'Success'} @@ -1678,12 +1692,15 @@ def createjalan(request): def changetipe(request): tipe_point = request.GET.get('tipe') - if tipe_point == 'administrasi': + if tipe_point == 'bangunan': + tipepoint = [['Rumah'],['Ruko'],['Pabrik'],['Pasar/Swalayan']] + + if tipe_point == 'kantor_administrasi': with conn.cursor() as point: point.execute("""SELECT DISTINCT remark FROM geo_kantor_administrasi""") tipepoint = point.fetchall() - if tipe_point == 'layanankesehatan': + if tipe_point == 'layanan_kesehatan': with conn.cursor() as point: point.execute("""SELECT DISTINCT remark FROM geo_layanan_kesehatan""") tipepoint = point.fetchall() @@ -1693,22 +1710,22 @@ def changetipe(request): point.execute("""SELECT DISTINCT remark FROM geo_puskesmas""") tipepoint = point.fetchall() - if tipe_point == 'rumahsakit': + if tipe_point == 'rumah_sakit': with conn.cursor() as point: point.execute("""SELECT DISTINCT remark FROM geo_rumah_sakit""") tipepoint = point.fetchall() - if tipe_point == 'saranaibadah': + if tipe_point == 'sarana_ibadah': with conn.cursor() as point: point.execute("""SELECT DISTINCT remark FROM geo_sarana_ibadah""") tipepoint = point.fetchall() - if tipe_point == 'saranapendidikan': + if tipe_point == 'sarana_pendidikan': with conn.cursor() as point: point.execute("""SELECT DISTINCT remark FROM geo_sarana_pendidikan""") tipepoint = point.fetchall() - if tipe_point == 'cagarbudaya': + if tipe_point == 'cagar_budaya': with conn.cursor() as point: point.execute("""SELECT DISTINCT remark FROM geo_cagar_budaya""") tipepoint = point.fetchall() @@ -1723,12 +1740,12 @@ def changetipe(request): point.execute("""SELECT DISTINCT remark FROM geo_stasiun""") tipepoint = point.fetchall() - if tipe_point == 'terminalbus': + if tipe_point == 'terminal_bus': with conn.cursor() as point: point.execute("""SELECT DISTINCT remark FROM geo_terminal_bus""") tipepoint = point.fetchall() - if tipe_point == 'gardulistrik': + if tipe_point == 'gardu_listrik': with conn.cursor() as point: point.execute("""SELECT DISTINCT remark FROM geo_gardu_listrik""") tipepoint = point.fetchall() @@ -1736,6 +1753,19 @@ def changetipe(request): respon = {'result':tipepoint} return Response(respon) +@api_view(('GET',)) +def changejenis(request): + tipe_point = request.GET.get('tipe') + jenis_point = request.GET.get('jenis') + if tipe_point == 'bangunan': + tipepoint1 = [['0','-']] + else: + with conn.cursor() as point: + point.execute("""SELECT id, namobj FROM geo_%s where remark = '%s'"""% (tipe_point, jenis_point)) + tipepoint1 = point.fetchall() + respon = {'result':tipepoint1} + return Response(respon) + @api_view(('POST',)) def createpoint(request): gambar = request.FILES.get('gambar') diff --git a/templates/includes/insert.html b/templates/includes/insert.html index 4d0380b79fae8bc6b2c5b62794c751b41fe5aec3..2d426f77d7d499160aeda0c335593823a5811e0e 100644 --- a/templates/includes/insert.html +++ b/templates/includes/insert.html @@ -43,16 +43,61 @@ <div class="tab-pane" id="left-tab1-feas-upl"> <div class="row" style="margin-top: 15px;"> <div class="form-group"> - <label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Nama Bangunan</label> + <label class="col-lg-3 control-label lbl-top" >Nama Bangunan</label> <div class="col-lg-9"> <input id="name_create" type="text" class="form-control" value="" required> </div> </div> </div> + + <div class="row" style="margin-top: 15px;"> + <div class="form-group"> + <label class="col-lg-3 control-label lbl-top" >Jenis Bangunan</label> + <div class="col-lg-9"> + <select style="border-bottom: 1px solid rgb(83, 83, 83) !important;" id="tipe_point_b" data-placeholder="select point.." class="select-size-md"> + <option value="null" selected disabled>-- Pilih Jenis Point --</option> + <option value="bangunan">Bangunan Biasa</option> + <option value="kantor_administrasi">Kantor Administrasi</option> + <option value="layanan_kesehatan">Layanan Kesehatan</option> + <option value="puskesmas">Puskesmas</option> + <option value="rumah_sakit">Rumah Sakit</option> + <option value="sarana_ibadah">Sarana Ibadah</option> + <option value="sarana_pendidikan">Sarana Pendidikan</option> + <option value="spbu">SPBU</option> + <option value="stasiun">Stasiun</option> + <option value="terminal_bus">Terminal Bus</option> + <option value="cagar_budaya">Cagar Budaya dan Tempat Wisata</option> + <option value="gardu_listrik">Gardu Listrik</option> + </select> + </div> + </div> + </div> + + <div class="row" style="margin-top: 15px;"> + <div class="form-group"> + <label class="col-lg-3 control-label lbl-top" >Tipe Bangunan</label> + <div class="col-lg-9"> + <select style="border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;" id="tipe_point_2_b" data-placeholder="select point.." class="select-size-md"> + <option value="null" selected disabled>-- Pilih Tipe Point --</option> + </select> + </div> + </div> + </div> + + <div class="row" style="margin-top: 15px;"> + <div class="form-group"> + <label class="col-lg-3 control-label lbl-top" >Nama Point</label> + <div class="col-lg-9"> + <select style="border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;" id="tipe_point_3_b" data-placeholder="select point.." class="select-size-md"> + <option value="null" selected disabled>-- Pilih Point --</option> + </select> + </div> + </div> + </div> <div class="row" style="margin-top: 15px;"> <div class="form-group"> - <label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Informasi Bangunan</label> + <label class="col-lg-3 control-label lbl-top" >Informasi Bangunan</label> <div class="col-lg-9"> <input id="info_create" type="text" class="form-control" value="" placeholder="Rumah/Gedung/Ruko/Pabrik/dsb" required> </div> @@ -61,7 +106,7 @@ <div class="row" style="margin-top: 15px;"> <div class="form-group"> - <label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Alamat</label> + <label class="col-lg-3 control-label lbl-top" >Alamat</label> <div class="col-lg-9"> <input id="alamat_create" type="text" class="form-control" value="" placeholder="cth : Jl. Contoh Rt 005/01 No.01" required> </div> @@ -70,12 +115,12 @@ <div class="row" style="margin-top: 15px;"> <div class="form-group"> - <label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Luas Bangunan</label> + <label class="col-lg-3 control-label lbl-top" >Luas Bangunan</label> <div class="col-lg-6"> <input id="luas_bangunan_create" type="text" class="form-control" value="" required> </div> <div class="col-lg-3"> - <select id="satuan_luas_bangunan" style="margin-top: 15px;"> + <select id="satuan_luas_bangunan" > <option>m2</option> </select> </div> @@ -84,12 +129,12 @@ <div class="row" style="margin-top: 15px;"> <div class="form-group"> - <label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Luas Tanah</label> + <label class="col-lg-3 control-label lbl-top">Luas Tanah</label> <div class="col-lg-6"> <input id="luas_tanah_create" type="text" class="form-control" value="" required> </div> <div class="col-lg-3"> - <select id="satuan_luas_tanah" style="margin-top: 15px;"> + <select id="satuan_luas_tanah"> <option>m2</option> </select> </div> @@ -98,17 +143,17 @@ <div class="row" style="margin-top: 15px;"> <div class="form-group"> - <label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Tinggi Bangunan</label> + <label class="col-lg-3 control-label lbl-top">Tinggi Bangunan</label> <div class="col-lg-6"> <input id="tinggi_bangunan_create" type="text" class="form-control" value="" required> </div> - <div class="col-lg-3" style="margin-top: 15px;">m</div> + <div class="col-lg-3">m</div> </div> </div> <div class="row" style="margin-top: 15px;"> <div class="form-group"> - <label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Jumlah Lantai</label> + <label class="col-lg-3 control-label lbl-top">Jumlah Lantai</label> <div class="col-lg-9"> <input id="lantai" type="text" class="form-control" value="" placeholder="Estimasi Per Lantai = 3m" required> </div> @@ -117,7 +162,7 @@ <div class="row" style="margin-top: 15px;"> <div class="form-group"> - <label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Pemilik</label> + <label class="col-lg-3 control-label lbl-top" >Pemilik</label> <div class="col-lg-9"> <input id="pemilik_create" type="text" class="form-control" value="" placeholder="cth : Ali Budiman, S.Si." required> </div> @@ -221,6 +266,60 @@ map.openPopup(popup); + $("#tipe_point_b").change(function() { + var tipe = $(this).val(); + + $.ajax({ + url: "{% url 'api:change-tipe' %}", + data: { + 'tipe': tipe + }, + dataType: 'json', + success: function(data) { + console.log(data) + var data_all_kab = [] + for (var i = 0; i < data['result'].length; i++) { + var data_k = data['result'][i][0]; + console.log(data_k) + var data_kab = `<option value="` + + data_k + + `">` + + data_k + + `</option>`; + data_all_kab.push(data_kab) + }; + $('#tipe_point_2_b').html(`<option value="null" selected disabled>-- Pilih Tipe Point --</option>` + data_all_kab); + } + }); + }); + + $("#tipe_point_2_b").change(function() { + var jenis = $(this).val(); + var tipx = $("#tipe_point_b").val(); + + $.ajax({ + url: "{% url 'api:change-jenis' %}", + data: { + 'tipe': tipx, + 'jenis': jenis + }, + dataType: 'json', + success: function(data) { + console.log(data) + var data_all_kab = [] + for (var i = 0; i < data['result'].length; i++) { + var data_id = data['result'][i][0]; + var data_po = data['result'][i][1]; + console.log(data_id) + console.log(data_po) + var data_kab = `<option value="` +data_id + `">` + data_po + `</option>`; + data_all_kab.push(data_kab) + }; + $('#tipe_point_3_b').html(`<option value="null" selected disabled>-- Pilih Point --</option>` + data_all_kab); + } + }); + }); + var map_create_bangunan = L.map('map-create', { editable: true, zoomControl: false, @@ -473,6 +572,9 @@ $(document).on("click", "#create_save_bangunan", function(e) { var polygin = $('#poly_create_bangunan').val(); var name_poly = $('#name_create').val(); + var tdb = $('#tipe_point_b').val(); + var remark = $('#tipe_point_2_b').val(); + var poin_id = $('#tipe_point_3_b').val(); var info_poly = $('#info_create').val(); var alamat_poly = $('#alamat_create').val(); var lb_poly = $('#luas_bangunan_create').val(); @@ -486,6 +588,9 @@ data: { 'polygon': polygin, 'name': name_poly, + 'tipedb': tdb, + 'poin': poin_id, + 'remark': remark, 'info': info_poly, 'alamat': alamat_poly, 'lb': lb_poly, diff --git a/templates/includes/js-m.html b/templates/includes/js-m.html index 2c3c45547f915d17ee1249b4be7d1867b5c71c9f..dff27e59e8f115084d6c7ce9aa0673faed39f9d6 100644 --- a/templates/includes/js-m.html +++ b/templates/includes/js-m.html @@ -4815,6 +4815,22 @@ } else { var path_img = `"static/image/bangunan/` + feature.administrasi.f9 + `"` } + console.log(feature.administrasi.f11) + // if (feature.administrasi.f11 != 'None'){ + // var cbb = `<option value="null" disabled>-- Pilih Jenis Point --</option> + // <option value="bangunan" `if(feature.administrasi.f11 != 'bangunan'){`selected`};` >Bangunan Biasa</option> + // <option value="kantor_administrasi">Kantor Administrasi</option> + // <option value="layanan_kesehatan">Layanan Kesehatan</option> + // <option value="puskesmas">Puskesmas</option> + // <option value="rumah_sakit">Rumah Sakit</option> + // <option value="sarana_ibadah">Sarana Ibadah</option> + // <option value="sarana_pendidikan">Sarana Pendidikan</option> + // <option value="spbu">SPBU</option> + // <option value="stasiun">Stasiun</option> + // <option value="terminal_bus">Terminal Bus</option> + // <option value="cagar_budaya">Cagar Budaya dan Tempat Wisata</option> + // <option value="gardu_listrik">Gardu Listrik</option>` + // } // var list_history = feature.properties.f7 @@ -4857,7 +4873,7 @@ <div class="col-md-4"> <input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunan" value="`+feature.geometry+`"> <table> - <tr> + <tr style="margin-top: 10px"> <th> Image </th> @@ -4878,6 +4894,43 @@ <input type="text" name="namebangunan" id="namebangunan" class="form-control" value="`+feature.properties.f2+`"> </td> </tr> + <tr> + <th>Jenis Bangunan</th> + <td> + <input type="text" class="hidden" name="tipe1" id="tipe111" value="`+feature.administrasi.f11+`"> + <input type="text" class="hidden" name="tipe1" id="tipe222" value="`+feature.administrasi.f12+`"> + <input type="text" class="hidden" name="tipe1" id="tipe333" value="`+feature.administrasi.f13+`"> + <input type="text" class="hidden" name="tipe1" id="tipe444" value="`+feature.administrasi.f14+`"> + <select style="border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;" id="tipe_point_b_e" data-placeholder="select point.." class="select-size-md"> + <option value="null" selected disabled>-- Pilih Jenis Point --</option> + <option value="bangunan">Bangunan Biasa</option> + <option value="kantor_administrasi">Kantor Administrasi</option> + <option value="layanan_kesehatan">Layanan Kesehatan</option> + <option value="puskesmas">Puskesmas</option> + <option value="rumah_sakit">Rumah Sakit</option> + <option value="sarana_ibadah">Sarana Ibadah</option> + <option value="sarana_pendidikan">Sarana Pendidikan</option> + <option value="spbu">SPBU</option> + <option value="stasiun">Stasiun</option> + <option value="terminal_bus">Terminal Bus</option> + <option value="cagar_budaya">Cagar Budaya dan Tempat Wisata</option> + <option value="gardu_listrik">Gardu Listrik</option> + </td> + </tr> + <tr> + <th>Tipe Bangunan</th> + <td> + <select style="border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;" id="tipe_point_2_b_e" data-placeholder="select point.." class="select-size-md"> + <option value="null" selected disabled>-- Pilih Tipe Point --</option> + </td> + </tr> + <tr> + <th>Point Bangunan</th> + <td> + <select style="border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;" id="tipe_point_3_b_e" data-placeholder="select point.." class="select-size-md"> + <option value="null" selected disabled>-- Pilih Point --</option> + </td> + </tr> <tr> <th>Informasi Bangunan</th> <td> @@ -5063,6 +5116,10 @@ $("#modal_bangunan_edit").html(content_edit); $("#modal_bangunan_delete").html(content_delete); }); + // $("#tipe_point_b_e").val('feature.administrasi.f11').change(); + // $('#tipe_point_b_e').val(feature.properties.f11).attr('selected','selected'); + // $('#tipe_point_b_e option[value=bangunan]').attr('selected','selected'); + // $('#idbangunan').val(feature.properties.f1); // $('#namebangunan').val(feature.properties.f2); // $('#infobangunan').val(feature.properties.f3); @@ -5205,6 +5262,83 @@ var id_poly = $('#idbangunan').val(); loaderPage(true); + var tipe1 = $('#tipe111').val(); + $('#tipe_point_b_e option[value='+tipe1+']').attr('selected','selected'); + // $("#tipe_point_b_e option").val(tipe1).change(); + + $("#tipe_point_b_e").change(function() { + var tipe = $(this).val(); + + $.ajax({ + url: "{% url 'api:change-tipe' %}", + data: { + 'tipe': tipe + }, + dataType: 'json', + success: function(data) { + console.log(data) + var data_all_kab = [] + for (var i = 0; i < data['result'].length; i++) { + var data_k = data['result'][i][0]; + + // if (feature.administrasi.f12 == data_k){ + // var data_kab = `<option value="` + data_k + `" selected>` + data_k + `</option>`; + // } else{ + // var data_kab = `<option value="` + data_k + `">` + data_k + `</option>`; + // } + var data_kab = `<option value="` + data_k + `">` + data_k + `</option>`; + data_all_kab.push(data_kab) + }; + $('#tipe_point_2_b_e').html(`<option value="null" selected disabled>-- Pilih Tipe Point --</option>` + data_all_kab); + } + }); + }); + + var tipe2 = $('#tipe222').val(); + // $('#tipe_point_2_b_e option[value='+tipe2+']').attr('selected','selected'); + if (tipe2 == 'null') { + $('#tipe_point_2_b_e').html(`<option value="null" selected disabled>-- Pilih Tipe Point --</option>`); + } else{ + $('#tipe_point_2_b_e').html(`<option value="`+tipe2+`" selected disabled>`+tipe2+`</option>`); + } + + $("#tipe_point_2_b_e").change(function() { + var jenis = $(this).val(); + var tipx = $("#tipe_point_b_e").val(); + + $.ajax({ + url: "{% url 'api:change-jenis' %}", + data: { + 'tipe': tipx, + 'jenis': jenis + }, + dataType: 'json', + success: function(data) { + console.log(data) + var data_all_kab = [] + for (var i = 0; i < data['result'].length; i++) { + var data_id = data['result'][i][0]; + var data_po = data['result'][i][1]; + console.log(data_id) + console.log(data_po) + var data_kab = `<option value="` +data_id + `">` + data_po + `</option>`; + data_all_kab.push(data_kab) + }; + $('#tipe_point_3_b_e').html(`<option value="null" selected disabled>-- Pilih Point --</option>` + data_all_kab); + } + }); + }); + + var tipe3 = $('#tipe333').val(); + var tipe4 = $('#tipe444').val(); + // $('#tipe_point_3_b_e option[value='+tipe3+']').attr('selected','selected'); + + if (tipe3 == 'null') { + $('#tipe_point_3_b_e').html(`<option value="null" selected disabled>-- Pilih Point --</option>`); + } else{ + $('#tipe_point_3_b_e').html(`<option value="`+tipe3+`" selected disabled>`+tipe4+`</option>`); + } + $.ajax({ url: "{% url 'api:edit' %}", data: { @@ -5221,7 +5355,7 @@ map_edit.setView([data['geometry']['coordinates'][0][0][0][1], data['geometry']['coordinates'][0][0][0][0]], 19); - + // $("#tipe_point_b_e").val(data['administrasi'][]).change(); let lop_poly_edit = data['geometry']['coordinates'][0][0]; let list_poly_edit = []; for (var i = 0; i < lop_poly_edit.length; i++) { @@ -5238,8 +5372,11 @@ }) } }) + }); + + $(document).on("click", "#btnsavebangunan", function() { var data = new FormData(); data.append("file", $("input[id^='imgbangunan']")[0].files[0]); @@ -5397,12 +5534,12 @@ // [-4.1283969, 104.1674575] // ]).addTo(map_bang) - // $(document).on("click", "#btn_perbaikan_bangunan", function() { + $(document).on("click", "#btn_perbaikan_bangunan", function() { // if (map_bang.hasLayer(polyxxx)) { // polyxxx.remove() // } // var id_polyx = $('#idbangunan').val(); - // $("#input_perbaikan_bang").css("display", "block"); + $("#input_perbaikan_bang").css("display", "block"); // $.ajax({ // url: "{% url 'apps:input-perbaikan-bang' %}", @@ -5433,7 +5570,7 @@ // } // }) - // }) + }) </script> {% include 'includes/insert.html' %} \ No newline at end of file diff --git a/templates/includes/modal.html b/templates/includes/modal.html index fcde0d08e48a858a27e6328ca1311196fafd56df..795f7feea2abe9340b08b68a436e398ac0ad9e9b 100644 --- a/templates/includes/modal.html +++ b/templates/includes/modal.html @@ -476,17 +476,17 @@ <div class="col-lg-9"> <select style="border-bottom: 1px solid rgb(83, 83, 83) !important;" id="tipe_point" data-placeholder="select point.." class="select-size-md"> <option value="null" selected disabled>-- Pilih Jenis Point --</option> - <option value="administrasi">Kantor Administrasi</option> - <option value="layanankesehatan">Layanan Kesehatan</option> + <option value="kantor_administrasi">Kantor Administrasi</option> + <option value="layanan_kesehatan">Layanan Kesehatan</option> <option value="puskesmas">Puskesmas</option> - <option value="rumahsakit">Rumah Sakit</option> - <option value="saranaibadah">Sarana Ibadah</option> - <option value="saranapendidikan">Sarana Pendidikan</option> + <option value="rumah_sakit">Rumah Sakit</option> + <option value="sarana_ibadah">Sarana Ibadah</option> + <option value="sarana_pendidikan">Sarana Pendidikan</option> <option value="spbu">SPBU</option> <option value="stasiun">Stasiun</option> - <option value="terminalbus">Terminal Bus</option> - <option value="cagarbudaya">Cagar Budaya dan Tempat Wisata</option> - <option value="gardulistrik">Gardu Listrik</option> + <option value="terminal_bus">Terminal Bus</option> + <option value="cagar_budaya">Cagar Budaya dan Tempat Wisata</option> + <option value="gardu_listrik">Gardu Listrik</option> </select> </div>