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
1356d6e8
Commit
1356d6e8
authored
Nov 16, 2021
by
Manggar Mahardhika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix perbaikan bangunan dan jalan
parent
4a9869d6
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
487 additions
and
437 deletions
+487
-437
Application/views.py
Application/views.py
+50
-31
static/image/jalan/31298_2078820644653.jpg
static/image/jalan/31298_2078820644653.jpg
+0
-0
static/image/jalan/31298_2779504045678.jpg
static/image/jalan/31298_2779504045678.jpg
+0
-0
static/image/jalan/31298_3376109986740.jpg
static/image/jalan/31298_3376109986740.jpg
+0
-0
static/image/jalan/31298_349710341068.jpg
static/image/jalan/31298_349710341068.jpg
+0
-0
static/image/jalan/31298_3926153716478.jpg
static/image/jalan/31298_3926153716478.jpg
+0
-0
static/image/jalan/31298_4944070250589.jpg
static/image/jalan/31298_4944070250589.jpg
+0
-0
static/image/jalan/31298_7657306178120.jpg
static/image/jalan/31298_7657306178120.jpg
+0
-0
templates/includes/js-m.html
templates/includes/js-m.html
+25
-12
templates/includes/js-o.html
templates/includes/js-o.html
+259
-120
templates/includes/modal.html
templates/includes/modal.html
+3
-124
templates/maps/perbaikan.html
templates/maps/perbaikan.html
+150
-150
No files found.
Application/views.py
View file @
1356d6e8
...
@@ -823,7 +823,8 @@ import re
...
@@ -823,7 +823,8 @@ import re
import
json
import
json
@
api_view
((
'POST'
,))
@
api_view
((
'POST'
,))
def
saveperbaikan
(
request
):
def
saveperbaikan
(
request
):
type_id
=
request
.
POST
.
get
(
"type_id"
)
# type_id = request.POST.get("type_id")
type_id
=
2
id_object
=
request
.
POST
.
get
(
"object_id"
)
id_object
=
request
.
POST
.
get
(
"object_id"
)
name
=
request
.
POST
.
get
(
"name"
)
name
=
request
.
POST
.
get
(
"name"
)
type
=
request
.
POST
.
get
(
"type"
)
type
=
request
.
POST
.
get
(
"type"
)
...
@@ -852,42 +853,60 @@ def saveperbaikan(request):
...
@@ -852,42 +853,60 @@ def saveperbaikan(request):
fss_p
=
FileSystemStorage
(
location
=
'/var/www/django/oku.khansia.co.id/media/proposal/'
)
fss_p
=
FileSystemStorage
(
location
=
'/var/www/django/oku.khansia.co.id/media/proposal/'
)
fss_b
=
FileSystemStorage
(
location
=
'/var/www/django/oku.khansia.co.id/media/bukti_penyelesaian/'
)
fss_b
=
FileSystemStorage
(
location
=
'/var/www/django/oku.khansia.co.id/media/bukti_penyelesaian/'
)
coord
=
json
.
loads
(
str
(
coor
))
#
coord = json.loads(str(coor))
pjg_perbaikan
=
re
.
sub
(
'[^0-9.]+'
,
''
,
str
(
pjg_perbaikan
))
pjg_perbaikan
=
re
.
sub
(
'[^0-9.]+'
,
''
,
str
(
pjg_perbaikan
))
lbr_perbaikan
=
re
.
sub
(
'[^0-9.]+'
,
''
,
str
(
lbr_perbaikan
))
lbr_perbaikan
=
re
.
sub
(
'[^0-9.]+'
,
''
,
str
(
lbr_perbaikan
))
luas
=
re
.
sub
(
'[^0-9.]+'
,
''
,
str
(
luas
))
luas
=
re
.
sub
(
'[^0-9.]+'
,
''
,
str
(
luas
))
if
coord
[
'features'
][
0
][
'geometry'
][
'type'
]
==
'LineString'
:
#
if coord['features'][0]['geometry']['type'] == 'LineString':
print
(
"oke"
)
#
print("oke")
for
co
in
coord
[
'features'
]:
#
for co in coord['features']:
ll
=
str
(
co
[
"geometry"
][
'coordinates'
])
#
ll = str(co["geometry"]['coordinates'])
ll
+=
ll
#
ll += ll
ll
=
ll
.
replace
(
", "
,
" "
)
#
ll = ll.replace(", "," ")
ll
=
ll
.
replace
(
"]][["
,
"),("
)
#
ll = ll.replace("]][[","),(")
ll
=
ll
.
replace
(
"] ["
,
", "
)
#
ll = ll.replace("] [",", ")
ll
=
ll
.
replace
(
"]]"
,
")"
)
#
ll = ll.replace("]]",")")
ll
=
ll
.
replace
(
"[["
,
"("
)
#
ll = ll.replace("[[","(")
coordinat
=
f
'MULTILINESTRING({ll})'
# coordinat = f'MULTILINESTRING({ll})'
print
(
ll
)
# print(ll)
if
coord
[
'features'
][
0
][
'geometry'
][
'type'
]
==
'Polygon'
:
# if coord['features'][0]['geometry']['type'] == 'Polygon':
print
(
'tidakoke'
)
# print('tidakoke')
try
:
yak
=
str
(
coor
)
format
=
(
proposal
.
name
)
.
split
(
"."
)
suk
=
yak
.
replace
(
"""{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":"""
,
""
)
num
=
random
.
randrange
(
1
,
10000000000000
)
sik
=
suk
.
replace
(
"""}}"""
,
""
)
nproposal
=
f
"{name}_{num}.{format[-1:][0]}"
cor
=
sik
.
replace
(
"""[[["""
,
"("
)
nproposal
=
nproposal
.
replace
(
" "
,
"-"
)
coran
=
cor
.
replace
(
"""]]]"""
,
")"
)
filename_p
=
fss_p
.
save
(
nproposal
,
proposal
)
ll
=
coran
.
replace
(
","
,
" "
)
url_p
=
fss_p
.
url
(
filename_p
)
ii
=
ll
.
replace
(
"] ["
,
","
)
mm
=
ii
.
replace
(
'{"type":"FeatureCollection" "features":'
,
''
)
nn
=
mm
.
replace
(
'}'
,
''
)
corcoran
=
f
'MULTILINESTRING({nn})'
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
)
format_
=
(
bukti_selesai
.
name
)
.
split
(
"."
)
format_
=
(
bukti_selesai
.
name
)
.
split
(
"."
)
nbukti
=
f
"{name}_{num}.{format_[-1:][0]}"
nbukti
=
f
"{name}_{num}.{format_[-1:][0]}"
nbukti
=
nbukti
.
replace
(
" "
,
"-"
)
nbukti
=
nbukti
.
replace
(
" "
,
"-"
)
filename_b
=
fss_b
.
save
(
nbukti
,
bukti_selesai
)
filename_b
=
fss_b
.
save
(
nbukti
,
bukti_selesai
)
url_b
=
fss_b
.
url
(
filename_b
)
url_b
=
fss_b
.
url
(
filename_b
)
print
(
"-------------------"
)
print
(
str
(
corcoran
))
print
(
"-------------------"
)
print
(
str
(
type_id
),(
"-"
),
str
(
id_object
),(
"-"
),
str
(
name
),(
"-"
),
str
(
type
),(
"-"
),
str
(
tgl_selesai
),(
"-"
),
str
(
tgl_perbaikan
),(
"-"
),
str
(
tgl_disetujui
),(
"-"
),
str
(
anggaran
),(
"-"
),
str
(
pj
),(
"-"
),
str
(
pj_lapangan
),(
"-"
),
str
(
kontraktor
),(
"-"
),
str
(
pjg_perbaikan
),(
"-"
),
str
(
lbr_perbaikan
),(
"-"
),
str
(
jenis_perbaikan
),(
"-"
),
str
(
nproposal
),(
"-"
),
str
(
nbukti
))
print
(
"-------------------"
)
try
:
with
conn
.
cursor
()
as
data_per
:
with
conn
.
cursor
()
as
data_per
:
data_per
.
execute
(
"""
data_per
.
execute
(
"""
INSERT INTO tbl_perbaikan (
INSERT INTO tbl_perbaikan (
...
@@ -927,7 +946,7 @@ def saveperbaikan(request):
...
@@ -927,7 +946,7 @@ def saveperbaikan(request):
%
s,
%
s,
%
s,
%
s,
'
%
s',
'
%
s',
ST_GeomFromText('
%
s')
ST_GeomFromText('
%
s')
)
)
"""
%
(
"""
%
(
int
(
type_id
),
int
(
type_id
),
...
@@ -946,7 +965,7 @@ def saveperbaikan(request):
...
@@ -946,7 +965,7 @@ def saveperbaikan(request):
float
(
pjg_perbaikan
),
float
(
pjg_perbaikan
),
float
(
lbr_perbaikan
),
float
(
lbr_perbaikan
),
jenis_perbaikan
,
jenis_perbaikan
,
co
ordinat
))
co
rcoran
))
conn
.
commit
()
conn
.
commit
()
data
=
"Sukses"
data
=
"Sukses"
info
=
"Data Telah Berhasil di Perbaharui"
info
=
"Data Telah Berhasil di Perbaharui"
...
...
static/image/jalan/31298_2078820644653.jpg
0 → 100644
View file @
1356d6e8
91.2 KB
static/image/jalan/31298_2779504045678.jpg
0 → 100644
View file @
1356d6e8
91.2 KB
static/image/jalan/31298_3376109986740.jpg
0 → 100644
View file @
1356d6e8
454 KB
static/image/jalan/31298_349710341068.jpg
0 → 100644
View file @
1356d6e8
273 KB
static/image/jalan/31298_3926153716478.jpg
0 → 100644
View file @
1356d6e8
273 KB
static/image/jalan/31298_4944070250589.jpg
0 → 100644
View file @
1356d6e8
91.2 KB
static/image/jalan/31298_7657306178120.jpg
0 → 100644
View file @
1356d6e8
243 KB
templates/includes/js-m.html
View file @
1356d6e8
...
@@ -4883,7 +4883,6 @@
...
@@ -4883,7 +4883,6 @@
}
else
{
}
else
{
var
alamak
=
feature
.
administrasi
.
f3
;
var
alamak
=
feature
.
administrasi
.
f3
;
}
}
if
(
feature
.
administrasi
.
f10
==
'
bpk
'
)
{
if
(
feature
.
administrasi
.
f10
==
'
bpk
'
)
{
var
raja
=
""
;
var
raja
=
""
;
...
@@ -8001,11 +8000,18 @@
...
@@ -8001,11 +8000,18 @@
$
(
"
#modal_detail_non_kelurahan
"
).
modal
(
'
show
'
);
$
(
"
#modal_detail_non_kelurahan
"
).
modal
(
'
show
'
);
var
geogeo
=
geocodeService
.
reverse
().
latlng
(
e
.
latlng
).
run
(
function
(
error
,
result
)
{
var
geogeo
=
geocodeService
.
reverse
().
latlng
(
e
.
latlng
).
run
(
function
(
error
,
result
)
{
if
(
result
.
address
.
Address
!=
''
)
{
// tay = result.address.Address;
var
alamat
=
result
.
address
.
Address
+
`, `
// if (feature.administrasi.f3 == 'None') {
}
else
{
// if (tay != '') {
var
alamat
=
''
// var alamak = tay;
};
// } else {
// alamak = ""
// }
// } else {
// var alamak = feature.administrasi.f3;
// }
if
(
feature
.
administrasi
.
f9
==
'
None
'
)
{
if
(
feature
.
administrasi
.
f9
==
'
None
'
)
{
var
path_img
=
"
static/img/image_null.jpg
"
var
path_img
=
"
static/img/image_null.jpg
"
...
@@ -8318,8 +8324,8 @@
...
@@ -8318,8 +8324,8 @@
<input type="text" class="hidden" id="id_bang_perbaikan" value="`
+
feature
.
properties
.
f1
+
`" disable>
<input type="text" class="hidden" id="id_bang_perbaikan" value="`
+
feature
.
properties
.
f1
+
`" disable>
<input type="text" class="hidden" id="type_id_bang">
<input type="text" class="hidden" id="type_id_bang">
<div id="map-insert-renov-bang" style="height: 375px;width: 100%">
<div id="map-insert-renov-bang" style="height: 375px;width: 100%">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="row">
<div class="row">
...
@@ -8387,9 +8393,7 @@
...
@@ -8387,9 +8393,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -8443,7 +8447,7 @@
...
@@ -8443,7 +8447,7 @@
</p>
</p>
<p>
<p>
<span>
<span>
`
+
alamat
+
feature
.
administrasi
.
f1
+
`, `
+
feature
.
administrasi
.
f2
+
`, `
+
feature
.
administrasi
.
f3
+
`, `
+
feature
.
administrasi
.
f4
+
`
`
+
feature
.
administrasi
.
f1
+
`, `
+
feature
.
administrasi
.
f2
+
`, `
+
feature
.
administrasi
.
f3
+
`, `
+
feature
.
administrasi
.
f4
+
`
</span>
</span>
</p>
</p>
</th>
</th>
...
@@ -8496,7 +8500,7 @@
...
@@ -8496,7 +8500,7 @@
</div>
</div>
<div>
<div>
<span>
<span>
`
+
alamat
+
feature
.
administrasi
.
f1
+
`, `
+
feature
.
administrasi
.
f2
+
`, `
+
feature
.
administrasi
.
f3
+
`, `
+
feature
.
administrasi
.
f4
+
`
`
+
feature
.
administrasi
.
f1
+
`, `
+
feature
.
administrasi
.
f2
+
`, `
+
feature
.
administrasi
.
f3
+
`, `
+
feature
.
administrasi
.
f4
+
`
</span>
</span>
</div>
</div>
...
@@ -9014,10 +9018,16 @@
...
@@ -9014,10 +9018,16 @@
};
};
polylyly
=
L
.
polygon
(
list_poly_edit
).
addTo
(
map_bang
)
polylyly
=
L
.
polygon
(
list_poly_edit
).
addTo
(
map_bang
)
polylyly
.
enableEdit
();
//
polylyly.enableEdit();
var
hasil
=
(
JSON
.
stringify
(
polylyly
.
toGeoJSON
()))
var
hasil
=
(
JSON
.
stringify
(
polylyly
.
toGeoJSON
()))
// console.log(polylyly)
// console.log(hasil)
// $("#coorbangbaru").val(hasil);
$
(
'
#save-perbaikan_bang
'
).
click
(
function
()
{
$
(
'
#save-perbaikan_bang
'
).
click
(
function
()
{
$
(
"
#coorbangbaru
"
).
val
(
hasil
);
$
(
"
#coorbangbaru
"
).
val
(
hasil
);
console
.
log
(
hasil
);
// console.log("tes");
})
})
}
}
})
})
...
@@ -9083,6 +9093,9 @@
...
@@ -9083,6 +9093,9 @@
data
.
append
(
keyss
[
0
],
data_umum
[
i
][
keyss
[
0
]])
data
.
append
(
keyss
[
0
],
data_umum
[
i
][
keyss
[
0
]])
}
}
// console.log(data)
// console.log(data_umum)
$
.
ajax
({
$
.
ajax
({
url
:
"
{% url 'apps:save-perbaikan-bang' %}
"
,
url
:
"
{% url 'apps:save-perbaikan-bang' %}
"
,
data
:
data
,
data
:
data
,
...
...
templates/includes/js-o.html
View file @
1356d6e8
This diff is collapsed.
Click to expand it.
templates/includes/modal.html
View file @
1356d6e8
...
@@ -1648,130 +1648,9 @@
...
@@ -1648,130 +1648,9 @@
</div>
</div>
</div>
</div>
<div
class=
"content-wrapper modal"
id=
"input_perbaikan"
style=
"display: none;padding: 60px;margin-left: 10%;border-radius:10px;top: -40px;"
>
<div
id=
"input_perbaikan"
class=
"modal fade"
>
<div
class=
"content modal-md"
style=
"padding: 15px;max-height: 550px;"
>
<!-- <div class="content-wrapper modal" id="input_perbaikan" style="display: none;padding: 60px;margin-left: 10%;border-radius:10px;top: -40px;"> -->
<!-- Main charts -->
<div
class=
"panel panel-flat"
style=
"display: none;width: 1000px;"
>
<div
class=
"panel-header"
style=
"height: 50px;background: #1E2233;border-top-left-radius: 10px;border-top-right-radius: 10px;"
>
<button
type=
"button"
class=
"close"
onclick=
"destroyWraper()"
style=
" width: 30px;
color: white;
height: 30px;"
>
×
</button>
<h5
class=
"modal-title title-create"
style=
"color: white;margin-left: 25px;padding-top: 10px;"
>
Input Perbaikan
</h5>
</div>
<div
class=
"panel-body"
style=
"padding-top: 10px;"
>
<div
class=
"tabbable"
>
<ul
class=
"nav nav-tabs nav-tabs-bottom nav-justified"
>
<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>
</ul>
</div>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"left-tab-input-coordinat"
>
<div
class=
"modal-body"
style=
"max-height: 450px;overflow-y: auto;"
>
<input
type=
"text"
class=
"hidden"
id=
"poly_create_input"
>
<input
type=
"text"
class=
"hidden"
id=
"id_jalan_perbaikan"
>
<input
type=
"text"
class=
"hidden"
id=
"type_id"
>
<div
id=
"map-insert"
style=
"height: 375px;width: 100%"
>
</div>
</div>
</div>
<div
class=
"tab-pane"
id=
"right-tab-input-informasi"
>
<div
class=
"modal-body"
style=
"max-height: 415px;overflow-y: auto;"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<div
class=
"form-group"
>
<label>
Nama Jalan :
</label>
<input
type=
"text"
id=
"namajalan"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Type Jalan :
</label>
<input
type=
"text"
id=
"typejalan"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kelurahan :
</label>
<input
type=
"text"
id=
"kelurahan"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kecamatan :
</label>
<input
type=
"text"
id=
"kecamatan"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Anggaran :
</label>
<input
type=
"text"
id=
"anggaran"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Pihak yang Mengesahkan :
</label>
<input
type=
"text"
id=
"pihakpengesahan"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Tanggal Disetujui :
</label>
<input
type=
"date"
id=
"tgldisetujui"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Tanggal Mulai Perbaikan :
</label>
<input
type=
"date"
id=
"tglmulaiperbaikan"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Tanggal Selesai Perbaikan :
</label>
<input
type=
"date"
id=
"tglselesaiperbaikan"
class=
"form-control"
value=
""
>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"form-group"
>
<label>
Penanggung Jawab Lapangan :
</label>
<input
type=
"text"
id=
"pjlapangan"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kontraktor :
</label>
<input
type=
"text"
id=
"kontraktor"
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"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Proposal (.pdf):
</label>
<input
type=
"file"
id=
"proposal"
>
</div>
<div
class=
"form-group"
>
<label>
Bukti Selesai Perbaikan (.png/.jpg/.jpeg/):
</label>
<input
type=
"file"
id=
"buktiselesai"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"panel-footer"
>
<button
type=
"button"
class=
"btn btn-info"
id=
"save-perbaikan"
style=
"float: right; margin-right: 40px;"
>
SAVE
</button>
<!-- <button type="button" class="btn btn-link" onclick="destroyWraper()" style="float: right;">Close</button> -->
</div>
</div>
</div>
<!-- /main charts -->
</div>
</div>
<table
id=
"table_downloader"
style=
"display: none;"
>
<table
id=
"table_downloader"
style=
"display: none;"
>
...
...
templates/maps/perbaikan.html
View file @
1356d6e8
This diff is collapsed.
Click to expand it.
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