Commit 4086f552 authored by Manggar Mahardhika's avatar Manggar Mahardhika

push pbb

parent d81d1276
...@@ -25,6 +25,8 @@ urlpatterns = [ ...@@ -25,6 +25,8 @@ urlpatterns = [
path('desangab', views.desangab, name='desangab'), path('desangab', views.desangab, name='desangab'),
path('building', views.building, name='building'), path('building', views.building, name='building'),
path('edit_kec', views.editkec, name='edit_kec'),
path('jalan', views.jalan, name='jalan'), path('jalan', views.jalan, name='jalan'),
path('sungai', views.sungai, name='sungai'), path('sungai', views.sungai, name='sungai'),
path('edit', views.editpoly, name='edit'), path('edit', views.editpoly, name='edit'),
......
...@@ -540,9 +540,90 @@ def kecamatan(request): ...@@ -540,9 +540,90 @@ def kecamatan(request):
( (
A.ID, A.ID,
A.kecamatan, A.kecamatan,
st_area ( A.geom :: geography ),
SUM ( b.jumlah_pen ), SUM ( b.jumlah_pen ),
SUM ( b.jumlah_kk ), SUM ( b.jumlah_kk )
st_area ( A.geom :: geography ) ),
'penduduk',
(
SUM ( b.pria),
SUM ( b.wanita),
SUM ( b.belum_kawin),
SUM ( b.kawin),
SUM ( b.cerai_hidup),
SUM ( b.cerai_mati),
SUM ( b.wajib_ktp),
SUM ( b.islam),
SUM ( b.kristen),
SUM ( b.khatolik),
SUM ( b.hindu),
SUM ( b.budha),
SUM ( b.konghucu),
SUM ( b.kepercayaan_lain),
SUM ( b.u0),
SUM ( b.u5),
SUM ( b.u10),
SUM ( b.u15),
SUM ( b.u20),
SUM ( b.u25),
SUM ( b.u30),
SUM ( b.u35),
SUM ( b.u40),
SUM ( b.u45),
SUM ( b.u50),
SUM ( b.u55),
SUM ( b.u60),
SUM ( b.u65),
SUM ( b.u70),
SUM ( b.u75)
),
'pekerjaan_pendidikan',
(
SUM ( b.tidak_sekolah),
SUM ( b.belum_tamat),
SUM ( b.tamat_sd),
SUM ( b.sltp),
SUM ( b.slta),
SUM ( b.diploma_i),
SUM ( b.diploma_ii),
SUM ( b.diploma_iv),
SUM ( b.strata_ii),
SUM ( b.strata_iii),
SUM ( b.tidak_bekerja),
SUM ( b.aparatur_pemerintah),
SUM ( b.tenaga_pendidik),
SUM ( b.wiraswasta),
SUM ( b.pertanian),
SUM ( b.tenaga_kesehatan),
SUM ( b.pensiunan),
SUM ( b.pegawai),
SUM ( b.tentara),
SUM ( b.kepolisian),
SUM ( b.pedagang),
SUM ( b.petani),
SUM ( b.peternak),
SUM ( b.nelayan),
SUM ( b.karyawan),
SUM ( b.buruh),
SUM ( b.pembantu),
SUM ( b.tukang),
SUM ( b.pendeta),
SUM ( b.pastor),
SUM ( b.ustadz),
SUM ( b.dosen),
SUM ( b.guru),
SUM ( b.pilot),
SUM ( b.pengacara),
SUM ( b.notaris),
SUM ( b.arsitek),
SUM ( b.akuntan),
SUM ( b.konsultan),
SUM ( b.dokter),
SUM ( b.bidan),
SUM ( b.perawat),
SUM ( b.psikiater),
SUM ( b.sopir),
SUM ( b.lainnya)
), ),
'geometry', 'geometry',
ST_AsGeoJSON ( A.geom :: geometry ) :: json ST_AsGeoJSON ( A.geom :: geometry ) :: json
...@@ -564,6 +645,30 @@ def kecamatan(request): ...@@ -564,6 +645,30 @@ def kecamatan(request):
data = {'kecamatan':kec_res} data = {'kecamatan':kec_res}
return Response(data) return Response(data)
@api_view(('GET',))
@renderer_classes((TemplateHTMLRenderer, JSONRenderer))
def editkec(request):
idkec = request.GET.get("id_kec")
with conn.cursor() as kec:
kec.execute(f"""SELECT
json_build_object (
'type',
'Feature',
'administrasi',
(
A.ID,
A.kecamatan
),
'geometry',
ST_AsGeoJSON ( A.geom :: geometry ) :: json
)
FROM
geo_data_kecamatan A
where a.id = {idkec}""")
kec_res_ = kec.fetchall()
# data = {'gen':kec_res_}
return Response(kec_res_[0][0])
@api_view(('GET',)) @api_view(('GET',))
@renderer_classes((TemplateHTMLRenderer, JSONRenderer)) @renderer_classes((TemplateHTMLRenderer, JSONRenderer))
def desangab(request): def desangab(request):
......
...@@ -55,6 +55,12 @@ MIDDLEWARE = [ ...@@ -55,6 +55,12 @@ MIDDLEWARE = [
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
] ]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
]
}
ROOT_URLCONF = 'OKU.urls' ROOT_URLCONF = 'OKU.urls'
TEMPLATES = [ TEMPLATES = [
...@@ -85,6 +91,7 @@ DATABASES = { ...@@ -85,6 +91,7 @@ DATABASES = {
'NAME': 'oku_gis_new', 'NAME': 'oku_gis_new',
'USER': 'postgres', 'USER': 'postgres',
'PASSWORD' : 'khansia215758', 'PASSWORD' : 'khansia215758',
# 'HOST': '30.10.10.100',
'HOST': '30.10.20.102', 'HOST': '30.10.20.102',
'PORT': '5432', 'PORT': '5432',
# 'HOST': '103.126.28.66', # 'HOST': '103.126.28.66',
......
...@@ -7,7 +7,6 @@ Django==3.2.4 ...@@ -7,7 +7,6 @@ Django==3.2.4
django-utils-six==2.0 django-utils-six==2.0
django-widget-tweaks==1.4.8 django-widget-tweaks==1.4.8
djangorestframework==3.12.4 djangorestframework==3.12.4
Flask==2.0.1
gunicorn==20.1.0 gunicorn==20.1.0
importlib-metadata==4.8.1 importlib-metadata==4.8.1
itsdangerous==2.0.1 itsdangerous==2.0.1
......
This diff is collapsed.
...@@ -433,7 +433,7 @@ ...@@ -433,7 +433,7 @@
width: 80px; width: 80px;
height: 45px; height: 45px;
border: 1pt solid gray;"> border: 1pt solid gray;">
<a href="" class="btn">Edit</a> <a href="#" class="btn">Edit</a>
</div> </div>
</div> </div>
<div class="col-md-6" style="margin-left: -30px;margin-top: 10px;"> <div class="col-md-6" style="margin-left: -30px;margin-top: 10px;">
...@@ -672,6 +672,17 @@ ...@@ -672,6 +672,17 @@
</div> </div>
</a> </a>
</div> </div>
<div class="col-md-4 text-center">
<a href="#" class="btn btn_cek_PBB">
<div>
<img src="{% static 'img/icon-1/kelurahan.svg' %}" alt="" style="width: 35px;
height: 35px;">
</div>
<div style="margin-top: 10px;">
<span>PBB</span>
</div>
</a>
</div>
</div> </div>
</fieldset> </fieldset>
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
} }
/* start hide fitur modal */ /* start hide fitur modal */
.tab_kdb_klb { /* .tab_kdb_klb {
display: none; display: none;
} }
...@@ -61,7 +61,8 @@ ...@@ -61,7 +61,8 @@
.btn_cek_KDBKLB { .btn_cek_KDBKLB {
display: none; display: none;
} } */
/* end hide fitur modal */ /* end hide fitur modal */
</style> </style>
......
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