Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OKU-GIS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhamad
OKU-GIS
Commits
696fadf2
Commit
696fadf2
authored
Aug 06, 2021
by
Manggar Mahardhika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push go
parent
96f254b9
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
557 additions
and
64 deletions
+557
-64
Application/urls.py
Application/urls.py
+1
-0
Application/views.py
Application/views.py
+143
-2
templates/includes/content.html
templates/includes/content.html
+6
-5
templates/includes/js-m.html
templates/includes/js-m.html
+286
-56
templates/includes/modal.html
templates/includes/modal.html
+121
-1
No files found.
Application/urls.py
View file @
696fadf2
...
...
@@ -15,6 +15,7 @@ urlpatterns = [
path
(
'input-perbaikan'
,
views
.
inpuperbaikan
,
name
=
'input-perbaikan'
),
path
(
'input-perbaikan-bang'
,
views
.
inputperbaikanbangunan
,
name
=
'input-perbaikan-bang'
),
path
(
'save-perbaikan'
,
views
.
saveperbaikan
,
name
=
'save-perbaikan'
),
path
(
'save-perbaikan-bang'
,
views
.
saveperbaikanbangunan
,
name
=
'save-perbaikan-bang'
),
path
(
'load-jl-by-id-detail'
,
views
.
loadbyiddetail
,
name
=
'load-jl-by-id-detail'
),
path
(
'get-jalan-perbaikan'
,
views
.
getjalanperbaikan
,
name
=
'get-jalan-perbaikan'
),
...
...
Application/views.py
View file @
696fadf2
...
...
@@ -648,9 +648,12 @@ def inputperbaikanbangunan(request):
data_per
.
execute
(
"""
SELECT
name,
type,
type
_id
,
json_build_object ( 'type', 'Feature', 'geometry', ST_AsGeoJSON ( geom :: geometry ) :: json ),
ID
ID,
remark,
address_1,
address_2
FROM
geo_bangunan
WHERE
...
...
@@ -714,6 +717,7 @@ def saveperbaikan(request):
ll
=
ll
.
replace
(
"[["
,
"("
)
coordinat
=
f
'MULTILINESTRING({ll})'
print
(
ll
)
if
coord
[
'features'
][
0
][
'geometry'
][
'type'
]
==
'Polygon'
:
print
(
'tidakoke'
)
...
...
@@ -801,6 +805,143 @@ def saveperbaikan(request):
respon
=
{
"data"
:
data
,
"info"
:
info
,
"code"
:
code
}
return
Response
(
respon
)
# from django.core.files.storage import FileSystemStorage
# import random
# import re
# import json
@
api_view
((
'POST'
,))
def
saveperbaikanbangunan
(
request
):
type_id
=
'1'
id_object
=
request
.
POST
.
get
(
"object_idbang"
)
name
=
request
.
POST
.
get
(
"namebang"
)
type
=
request
.
POST
.
get
(
"typebang"
)
# tgl_pembuatan = request.POST.get("tgl_pembuatanbang")
tgl_perbaikan
=
request
.
POST
.
get
(
"tgl_perbaikanbang"
)
tgl_disetujui
=
request
.
POST
.
get
(
"tgl_disetujuibang"
)
anggaran
=
request
.
POST
.
get
(
"anggaranbang"
)
pj
=
request
.
POST
.
get
(
"pjbang"
)
pj_lapangan
=
request
.
POST
.
get
(
"pj_lapanganbang"
)
kontraktor
=
request
.
POST
.
get
(
"kontraktorbang"
)
jenis_perbaikan
=
request
.
POST
.
get
(
"jenis_perbaikanbang"
)
coor
=
request
.
POST
.
get
(
"coordbang"
)
# for co in coor['features']:
# ll = coor['geometry']['coordinates']
# ll += ll
# ll = ll.replace(", "," ")
# ll = ll.replace("]][[","),(")
# ll = ll.replace("] [",", ")
# ll = ll.replace("]]",")")
# ll = ll.replace("[[","(")
# corcoran = ll
# p_create = coor.replace('"','')
# po_create = p_create.replace(', ','],[')
# cood_edit = json.loads(coor)
# co_edit = cood_edit['geometry']['coordinates']
yak
=
str
(
coor
)
suk
=
yak
.
replace
(
"""{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":"""
,
""
)
sik
=
suk
.
replace
(
"""}}"""
,
""
)
cor
=
sik
.
replace
(
"""[[["""
,
"(("
)
coran
=
cor
.
replace
(
"""]]]"""
,
"))"
)
ll
=
coran
.
replace
(
","
,
" "
)
ii
=
ll
.
replace
(
"] ["
,
","
)
corcoran
=
f
'MULTIPOLYGON({ii})'
print
(
"-------------------"
)
print
(
str
(
corcoran
))
print
(
"-------------------"
)
# print(yak)
tgl_selesai
=
request
.
POST
.
get
(
"tgl_selesaibang"
)
proposal
=
request
.
FILES
.
get
(
"proposal_bang"
)
bukti_selesai
=
request
.
FILES
.
get
(
"bukti_selesai_bang"
)
fss_p
=
FileSystemStorage
(
location
=
'media/proposal/'
)
fss_b
=
FileSystemStorage
(
location
=
'media/bukti_penyelesaian/'
)
try
:
format
=
(
proposal
.
name
)
.
split
(
"."
)
num
=
random
.
randrange
(
1
,
10000000000000
)
nproposal
=
f
"{name}_{num}.{format[-1:][0]}"
nproposal
=
nproposal
.
replace
(
" "
,
"-"
)
filename_p
=
fss_p
.
save
(
nproposal
,
proposal
)
url_p
=
fss_p
.
url
(
filename_p
)
nbukti
=
f
"{name}_{num}.{format[-1:][0]}"
nbukti
=
nbukti
.
replace
(
" "
,
"-"
)
filename_b
=
fss_b
.
save
(
nbukti
,
bukti_selesai
)
url_b
=
fss_b
.
url
(
filename_b
)
with
conn
.
cursor
()
as
data_per
:
data_per
.
execute
(
"""
INSERT INTO tbl_perbaikan (
type_id,
id_object,
name,
type,
tgl_selesai,
tgl_perbaikan,
tgl_disetujui,
anggaran,
proposal,
bukti_selesai,
pj,
pj_lapangan,
kontraktor,
jenis_perbaikan,
geom
)
VALUES
(
%
s,
%
s,
'
%
s',
'
%
s',
'
%
s',
'
%
s',
'
%
s',
%
s,
'
%
s',
'
%
s',
'
%
s',
'
%
s',
'
%
s',
'
%
s',
ST_GeomFromText('
%
s')
)
"""
%
(
int
(
type_id
),
int
(
id_object
),
name
,
type
,
tgl_selesai
,
tgl_perbaikan
,
tgl_disetujui
,
int
(
anggaran
),
nproposal
,
nbukti
,
pj
,
pj_lapangan
,
kontraktor
,
jenis_perbaikan
,
corcoran
))
conn
.
commit
()
data
=
"Sukses"
info
=
"Data Telah Berhasil di Perbaharui"
code
=
0
except
:
data
=
"Pastikan Semua Data Terisi Termasuk Proposal dan Bukti Selesai"
info
=
"Oops"
code
=
1
respon
=
{
"data"
:
data
,
"info"
:
info
,
"code"
:
code
}
return
Response
(
respon
)
@
api_view
((
'GET'
,))
def
loadbyiddetail
(
request
):
id
=
request
.
GET
.
get
(
'id'
)
...
...
templates/includes/content.html
View file @
696fadf2
...
...
@@ -130,21 +130,21 @@
<ul
class=
"nav nav-tabs nav-tabs-bottom nav-justified"
>
<button
type=
"button"
class=
"close"
onclick=
"destroyWraper()"
>
×
</button>
<li
class=
"active"
><a
href=
"#left-tab-input-coordinat"
data-toggle=
"tab"
>
Koordinat
</a></li>
<li><a
href=
"#right-tab-input-informasi"
data-toggle=
"tab"
>
Insert Informasi
</a></li>
<li
class=
"active"
><a
href=
"#left-tab-input-coordinat
_bang
"
data-toggle=
"tab"
>
Koordinat
</a></li>
<li><a
href=
"#right-tab-input-informasi
_bang
"
data-toggle=
"tab"
>
Insert Informasi
</a></li>
</ul>
</div>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"left-tab-input-coordinat"
>
<div
class=
"tab-pane active"
id=
"left-tab-input-coordinat
_bang
"
>
<div
class=
"modal-body"
style=
"max-height: 450px;overflow-y: auto;"
>
<input
type=
"text"
class=
"hidden"
id=
"poly_create_input_bang"
>
<input
type=
"text"
class=
"hidden"
id=
"id_bang_perbaikan"
>
<input
type=
"text"
class=
"hidden"
id=
"type_id_bang"
>
<div
id=
"map-insert-bang"
style=
"height: 375px;width: 100%"
>
<div
id=
"map-insert-
renov-
bang"
style=
"height: 375px;width: 100%"
>
</div>
</div>
</div>
<div
class=
"tab-pane"
id=
"right-tab-input-informasi"
>
<div
class=
"tab-pane"
id=
"right-tab-input-informasi
_bang
"
>
<div
class=
"modal-body"
style=
"max-height: 415px;overflow-y: auto;"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
...
...
@@ -232,6 +232,7 @@
</div>
<div
class=
"panel-footer"
>
<input
type=
"text"
id=
"coorbangbaru"
class=
"form-control"
value=
""
>
<button
type=
"button"
class=
"btn btn-info"
id=
"save-perbaikan_bang"
style=
"float: right; margin-right: 40px;"
>
SAVE
</button>
<button
type=
"button"
class=
"btn btn-link"
onclick=
"destroyWraper()"
style=
"float: right;"
>
Close
</button>
...
...
templates/includes/js-m.html
View file @
696fadf2
This diff is collapsed.
Click to expand it.
templates/includes/modal.html
View file @
696fadf2
...
...
@@ -358,7 +358,6 @@
</div>
</div>
</div>
</div>
<div
id=
"modal_bangunan_delete"
class=
"modal fade"
>
<div
class=
"modal-dialog"
style=
"width: max-content;height: max-content;"
>
...
...
@@ -392,6 +391,127 @@
</div>
</div>
<div
id=
"input_perbaikan_bang"
class=
"modal fade"
>
<div
class=
"modal-dialog"
style=
"width: max-content;height: max-content;"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header bg-info"
style=
"background-color:#40777c;"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
>
×
</button>
<h6
class=
"modal-title"
>
Renovasi Bangunan
</h6>
</div>
<div
class=
"modal-body"
style=
"max-height: 450px;overflow-y: auto;"
>
<div
class=
"tab-pane has-padding"
id=
"panel-tab2"
>
<div
class=
"tab-pane"
id=
"bottom-justified-data"
>
<div
class=
"tabbable"
>
<ul
class=
"nav nav-tabs nav-tabs-bottom nav-justified"
>
<li
onclick=
"changetabs(this)"
class=
"active"
><a
href=
"#left-tab1-feas-upl"
data-toggle=
"tab"
>
Koordinat
</a></li>
<li
onclick=
"changetabs(this)"
><a
href=
"#right-tab2-feas-upl"
data-toggle=
"tab"
>
Informasi Umum
</a></li>
</ul>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"left-tab1-feas-upl"
>
<input
type=
"text"
class=
"hidden"
id=
"poly_create_input_bang"
>
<input
type=
"text"
class=
"hidden"
id=
"id_bang_perbaikan"
>
<input
type=
"text"
class=
"hidden"
id=
"type_id_bang"
>
<div
id=
"map-insert-renov-bang"
style=
"height: 375px;width: 100%"
>
</div>
</div>
<div
class=
"tab-pane"
id=
"right-tab2-feas-upl"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<div
class=
"form-group"
>
<label>
Nama :
</label>
<input
type=
"text"
id=
"nama_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Type :
</label>
<input
type=
"text"
id=
"type_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kelurahan :
</label>
<input
type=
"text"
id=
"kelurahan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kecamatan :
</label>
<input
type=
"text"
id=
"kecamatan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Tanggal Disetujui :
</label>
<input
type=
"date"
id=
"tgldisetujui_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Tanggal Mulai Perbaikan :
</label>
<input
type=
"date"
id=
"tglmulaiperbaikan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Tanggal Selesai Perbaikan :
</label>
<input
type=
"date"
id=
"tglselesaiperbaikan_bang"
class=
"form-control"
value=
""
>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"form-group"
>
<label>
Anggaran :
</label>
<input
type=
"text"
id=
"anggaran_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Pihak yang Mengesahkan :
</label>
<input
type=
"text"
id=
"pihakpengesahan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Penanggung Jawab Lapangan :
</label>
<input
type=
"text"
id=
"pjlapangan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kontraktor :
</label>
<input
type=
"text"
id=
"kontraktor_bang"
class=
"form-control"
value=
""
>
</div>
<!-- <div class="form-group">
<label>Panjang Jalan Keseluruhan :</label>
<input type="text" id="panjangjalanall" class="form-control" value="">
</div>
<div class="form-group">
<label>Panjang Jalan Perbaikan :</label>
<input type="text" id="panjangjalanperbaikan" class="form-control" value="">
</div>
<div class="form-group">
<label>Lebar Jalan Perbaikan :</label>
<input type="text" id="lebarjalanperbaikan" class="form-control" value="">
</div> -->
<div
class=
"form-group"
>
<label>
Jenis Perbaikan :
</label>
<input
type=
"text"
id=
"jenisperbaikan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Proposal (.pdf):
</label>
<input
type=
"file"
id=
"proposal_bang"
>
</div>
<div
class=
"form-group"
>
<label>
Bukti Selesai Perbaikan (.png/.jpg/.jpeg/):
</label>
<input
type=
"file"
id=
"buktiselesai_bang"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<input
type=
"text"
id=
"coorbangbaru"
class=
"form-control"
value=
""
>
<button
type=
"button"
class=
"btn btn-info"
id=
"save-perbaikan_bang"
style=
"float: right; margin-right: 40px;"
>
SAVE
</button>
</div>
</div>
</div>
</div>
<!-- modal tuplah -->
<div
id=
"modal-edit-tuplah"
class=
"modal fade"
>
<div
class=
"modal-dialog"
style=
"width: max-content;height: max-content;"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment