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
46d3747e
Commit
46d3747e
authored
Oct 05, 2021
by
Muhamad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USER PROFILE
parent
6298bfae
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
735 additions
and
139 deletions
+735
-139
API/urls.py
API/urls.py
+2
-1
API/views.py
API/views.py
+38
-13
Application/urls.py
Application/urls.py
+1
-0
Application/views.py
Application/views.py
+84
-70
static/css/layout-style.css
static/css/layout-style.css
+4
-0
static/js/action.js
static/js/action.js
+246
-48
templates/includes/modal.html
templates/includes/modal.html
+316
-3
templates/includes/sidebar.html
templates/includes/sidebar.html
+40
-0
templates/layout/layout.html
templates/layout/layout.html
+4
-4
No files found.
API/urls.py
View file @
46d3747e
...
@@ -73,4 +73,5 @@ urlpatterns = [
...
@@ -73,4 +73,5 @@ urlpatterns = [
path
(
'deletejalan'
,
views
.
deletejalan
,
name
=
'hapus-jalan'
),
path
(
'deletejalan'
,
views
.
deletejalan
,
name
=
'hapus-jalan'
),
path
(
'search_spes'
,
views
.
search_spes
,
name
=
'search_spes'
),
path
(
'search_spes'
,
views
.
search_spes
,
name
=
'search_spes'
),
path
(
'search_lanjut'
,
views
.
search_lanjut
,
name
=
'search_lanjut'
),
path
(
'search_lanjut'
,
views
.
search_lanjut
,
name
=
'search_lanjut'
),
path
(
'load_point_id'
,
views
.
load_point_id
)
]
]
\ No newline at end of file
API/views.py
View file @
46d3747e
...
@@ -2961,47 +2961,47 @@ def user_data(request):
...
@@ -2961,47 +2961,47 @@ def user_data(request):
with
conn
.
cursor
()
as
po
:
with
conn
.
cursor
()
as
po
:
po
.
execute
(
"""
po
.
execute
(
"""
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
,'geo_kantor_administrasi'
FROM
FROM
geo_kantor_administrasi
geo_kantor_administrasi
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_layanan_kesehatan'
FROM
FROM
geo_layanan_kesehatan
geo_layanan_kesehatan
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_puskesmas'
FROM
FROM
geo_puskesmas
geo_puskesmas
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_rumah_sakit'
FROM
FROM
geo_rumah_sakit
geo_rumah_sakit
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_sarana_ibadah'
FROM
FROM
geo_sarana_ibadah
geo_sarana_ibadah
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_sarana_pendidikan'
FROM
FROM
geo_sarana_pendidikan
geo_sarana_pendidikan
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_spbu'
FROM
FROM
geo_spbu
geo_spbu
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_stasiun'
FROM
FROM
geo_stasiun
geo_stasiun
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_terminal_bus'
FROM
FROM
geo_terminal_bus
geo_terminal_bus
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_cagar_budaya'
FROM
FROM
geo_cagar_budaya
geo_cagar_budaya
UNION
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat
, 'geo_gardu_listrik'
FROM
FROM
geo_gardu_listrik
geo_gardu_listrik
"""
)
"""
)
...
@@ -3015,7 +3015,8 @@ def user_data(request):
...
@@ -3015,7 +3015,8 @@ def user_data(request):
"nama_tempat"
:
p
[
1
],
"nama_tempat"
:
p
[
1
],
"alamat"
:
p
[
2
],
"alamat"
:
p
[
2
],
"luas"
:
p
[
3
],
"luas"
:
p
[
3
],
"pj"
:
p
[
4
]
"pj"
:
p
[
4
],
"table"
:
p
[
5
]
}
}
point
.
append
(
datap
)
point
.
append
(
datap
)
...
@@ -3349,3 +3350,27 @@ def search_lanjut(request):
...
@@ -3349,3 +3350,27 @@ def search_lanjut(request):
kills
=
data_jal
kills
=
data_jal
return
Response
(
kills
)
return
Response
(
kills
)
@
api_view
((
'GET'
,))
def
load_point_id
(
request
):
id
=
request
.
GET
.
get
(
'idx'
)
dtb
=
request
.
GET
.
get
(
'db'
)
with
conn
.
cursor
()
as
poi
:
poi
.
execute
(
"""
SELECT json_build_object (
'type',
'Feature',
'properties',
(id, namobj, alamat, luas_bangunan, perangkat),
'geometry',
ST_AsGeoJSON ( geom :: geometry ) :: json
)
FROM
%
s
WHERE
id =
%
s
"""
%
(
dtb
,
id
))
poin
=
poi
.
fetchall
()
context
=
{
'result'
:
poin
}
return
Response
(
context
)
\ No newline at end of file
Application/urls.py
View file @
46d3747e
...
@@ -21,5 +21,6 @@ urlpatterns = [
...
@@ -21,5 +21,6 @@ urlpatterns = [
path
(
'get-jalan-perbaikan'
,
views
.
getjalanperbaikan
,
name
=
'get-jalan-perbaikan'
),
path
(
'get-jalan-perbaikan'
,
views
.
getjalanperbaikan
,
name
=
'get-jalan-perbaikan'
),
path
(
'get-detail-perbaikan'
,
views
.
getdetailperbaikan
,
name
=
'get-detail-perbaikan'
),
path
(
'get-detail-perbaikan'
,
views
.
getdetailperbaikan
,
name
=
'get-detail-perbaikan'
),
path
(
'get-detail-perbaikan-bang'
,
views
.
getdetailperbaikanbangunan
,
name
=
'get-detail-perbaikan-bang'
),
path
(
'get-detail-perbaikan-bang'
,
views
.
getdetailperbaikanbangunan
,
name
=
'get-detail-perbaikan-bang'
),
path
(
'loadPointbyId'
,
views
.
loadPointbyId
)
]
]
\ No newline at end of file
Application/views.py
View file @
46d3747e
...
@@ -504,6 +504,7 @@ class Dashboard(generic.TemplateView):
...
@@ -504,6 +504,7 @@ class Dashboard(generic.TemplateView):
}
}
res_all
.
append
(
data_all
)
res_all
.
append
(
data_all
)
if
request
.
user
.
is_authenticated
:
current_user
=
request
.
user
current_user
=
request
.
user
thisUser
=
current_user
.
id
thisUser
=
current_user
.
id
...
@@ -531,7 +532,7 @@ class Dashboard(generic.TemplateView):
...
@@ -531,7 +532,7 @@ class Dashboard(generic.TemplateView):
user_data
.
append
(
datas
)
user_data
.
append
(
datas
)
with
conn
.
cursor
()
as
userlist_
:
with
conn
.
cursor
()
as
userlist_
:
if
request
.
user
.
is_superuser
:
if
request
.
user
.
is_superuser
or
request
.
user
.
is_staff
:
# print("is superuser")
# print("is superuser")
sql
=
"""
sql
=
"""
SELECT
SELECT
...
@@ -556,7 +557,6 @@ class Dashboard(generic.TemplateView):
...
@@ -556,7 +557,6 @@ class Dashboard(generic.TemplateView):
ORDER BY
ORDER BY
au.username ASC"""
au.username ASC"""
else
:
else
:
if
request
.
user
.
is_staff
:
sql
=
"""
sql
=
"""
SELECT
SELECT
au.id,
au.id,
...
@@ -579,8 +579,6 @@ class Dashboard(generic.TemplateView):
...
@@ -579,8 +579,6 @@ class Dashboard(generic.TemplateView):
ag.id = aug.group_id AND
ag.id = aug.group_id AND
ORDER BY
ORDER BY
au.username ASC"""
au.username ASC"""
else
:
print
(
'not staff'
)
userlist_
.
execute
(
sql
)
userlist_
.
execute
(
sql
)
allUser
=
userlist_
.
fetchall
()
allUser
=
userlist_
.
fetchall
()
...
@@ -598,6 +596,12 @@ class Dashboard(generic.TemplateView):
...
@@ -598,6 +596,12 @@ class Dashboard(generic.TemplateView):
}
}
user_res
.
append
(
datas
)
user_res
.
append
(
datas
)
else
:
user_data
=
[{
"id"
:
"Not Login"
,
"username"
:
"Not Login"
,
"firstname"
:
"Not Login"
,
"lastname"
:
"Not Login"
,
"email"
:
"Not Login"
,
"filepath"
:
"Not Login"
}]
user_res
=
[{
"id"
:
"Not Login"
,
"username"
:
"Not Login"
,
"name"
:
"Not Login"
,
"isactive"
:
"Not Login"
,
"email"
:
"Not Login"
,
"last"
:
"Not Login"
,
"group"
:
"Not Login"
,
"filepath"
:
"Not Login"
}]
context
=
{
context
=
{
'title'
:
'Dashboard'
,
'title'
:
'Dashboard'
,
'kelurahan'
:
kel_res
,
'kelurahan'
:
kel_res
,
...
@@ -1256,3 +1260,13 @@ def editkelurahan(request):
...
@@ -1256,3 +1260,13 @@ def editkelurahan(request):
prov
=
res_edit_poly
[
0
][
0
][
'administrasi'
][
4
]
prov
=
res_edit_poly
[
0
][
0
][
'administrasi'
][
4
]
context
=
{
'desa'
:
desa
,
'kec'
:
kec
,
'kab'
:
kab
,
'prov'
:
prov
,
'result_poly'
:
res_edit_poly
[
0
][
0
],
'avg_la'
:
avg_la
,
'avg_lo'
:
avg_lo
}
context
=
{
'desa'
:
desa
,
'kec'
:
kec
,
'kab'
:
kab
,
'prov'
:
prov
,
'result_poly'
:
res_edit_poly
[
0
][
0
],
'avg_la'
:
avg_la
,
'avg_lo'
:
avg_lo
}
return
Response
(
context
)
return
Response
(
context
)
@
api_view
((
'GET'
,))
def
loadPointbyId
(
request
):
tab
=
request
.
GET
.
get
(
"db"
)
id
=
request
.
GET
.
get
(
"idx"
)
tipe
=
request
.
GET
.
get
(
"type"
)
print
(
tab
,
id
,
tipe
)
context
=
{
'result'
:
'result'
}
return
Response
(
context
)
\ No newline at end of file
static/css/layout-style.css
View file @
46d3747e
...
@@ -759,6 +759,10 @@ li.active>a:after {
...
@@ -759,6 +759,10 @@ li.active>a:after {
border-bottom-right-radius
:
10px
;
border-bottom-right-radius
:
10px
;
}
}
#maps_detail_p
>
div
.leaflet-control-container
>
div
.leaflet-top.leaflet-left
>
div
>
div
{
display
:
none
;
}
@media
(
max-width
:
1025px
)
{
@media
(
max-width
:
1025px
)
{
.dock
{
.dock
{
position
:
absolute
;
position
:
absolute
;
...
...
static/js/action.js
View file @
46d3747e
...
@@ -143,11 +143,11 @@ $("#pengaturan_btn").click(function() {
...
@@ -143,11 +143,11 @@ $("#pengaturan_btn").click(function() {
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
data_user
=
[]
var
data_user
=
[]
var
number
=
1
;
var
number
=
0
;
for
(
var
i
=
0
;
i
<
data
[
'
data
'
].
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
data
[
'
data
'
].
length
;
i
++
)
{
number
+=
i
;
number
+=
1
;
var
id
=
data
[
'
data
'
][
i
][
'
id
'
];
var
id
=
data
[
'
data
'
][
i
][
'
id
'
];
var
name
=
data
[
'
data
'
][
i
][
'
name
'
];
var
name
=
data
[
'
data
'
][
i
][
'
name
'
];
var
username
=
data
[
'
data
'
][
i
][
'
username
'
];
var
username
=
data
[
'
data
'
][
i
][
'
username
'
];
...
@@ -156,6 +156,12 @@ $("#pengaturan_btn").click(function() {
...
@@ -156,6 +156,12 @@ $("#pengaturan_btn").click(function() {
var
last
=
data
[
'
data
'
][
i
][
'
last
'
];
var
last
=
data
[
'
data
'
][
i
][
'
last
'
];
var
isactive
=
data
[
'
data
'
][
i
][
'
isactive
'
];
var
isactive
=
data
[
'
data
'
][
i
][
'
isactive
'
];
if
(
isactive
==
true
)
{
var
isac
=
`<span class="label label-success">Active</span>`
}
else
{
var
isac
=
`<span class="label label-danger">Inactive</span>`
}
var
data_gab
=
`<tr>
var
data_gab
=
`<tr>
<td>`
+
number
+
`</td>
<td>`
+
number
+
`</td>
...
@@ -163,21 +169,26 @@ $("#pengaturan_btn").click(function() {
...
@@ -163,21 +169,26 @@ $("#pengaturan_btn").click(function() {
<td>`
+
username
+
`</td>
<td>`
+
username
+
`</td>
<td>`
+
email
+
`</td>
<td>`
+
email
+
`</td>
<td>`
+
last
+
`</td>
<td>`
+
last
+
`</td>
<td>`
+
isactive
+
`</td>
<td>`
+
isac
+
`</td>
<td class="text-center ">
<td class="text-center">
<a class="btn mdlFire " data-toggle="modal " data-target="#modal_detail_perbaikan " style="background-color: #5A9AFB;color: white;border-radius: 5px;width: 85px;height: 25px; ">
<ul class="icons-list">
<div style="margin-top: -5px; ">
<li class="dropdown">
<i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span>
<i class="icon-menu9"></i>
Detail</span>
</div>
</a>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a onclick="switchuserstatus('`
+
id
+
`, `
+
isactive
+
`')"><i class="icon-user-block"></i> Switch user status</a></li>
<li><a onclick="loaduserbyid('`
+
id
+
`')"><i class="icon-users"></i> Edit user</a></li>
</ul>
</li>
</ul>
</td>
</td>
</tr>`
;
</tr>`
;
data_user
.
push
(
data_gab
)
data_user
.
push
(
data_gab
)
};
};
$
(
"
#tbody_
list_user
"
).
html
(
data_user
)
$
(
"
#tbody_
user_list
"
).
html
(
data_user
)
var
data_point
=
[]
var
data_point
=
[]
var
number2
=
0
;
var
number2
=
0
;
...
@@ -190,6 +201,7 @@ $("#pengaturan_btn").click(function() {
...
@@ -190,6 +201,7 @@ $("#pengaturan_btn").click(function() {
var
alamat
=
data
[
'
point
'
][
i
][
'
alamat
'
];
var
alamat
=
data
[
'
point
'
][
i
][
'
alamat
'
];
var
luas
=
data
[
'
point
'
][
i
][
'
luas
'
];
var
luas
=
data
[
'
point
'
][
i
][
'
luas
'
];
var
pj
=
data
[
'
point
'
][
i
][
'
pj
'
]
var
pj
=
data
[
'
point
'
][
i
][
'
pj
'
]
var
db
=
data
[
'
point
'
][
i
][
'
table
'
]
var
data_gab
=
`<tr>
var
data_gab
=
`<tr>
<td>`
+
number2
+
`</td>
<td>`
+
number2
+
`</td>
...
@@ -199,25 +211,14 @@ $("#pengaturan_btn").click(function() {
...
@@ -199,25 +211,14 @@ $("#pengaturan_btn").click(function() {
<td>`
+
pj
+
`</td>
<td>`
+
pj
+
`</td>
<td class="text-center " style="padding: 0px;">
<td class="text-center " style="padding: 0px;">
<div class="row">
<div class="row">
<div class="col-md-3" style="padding: 0px;">
<a class="btn mdlFire " data-toggle="modal" onclick="modal_detail_point_pengaturan('`
+
id
+
`','`
+
db
+
`')" style="padding: 10px 12px 10px 12px;">
<a class="btn mdlFire " data-toggle="modal " data-target="#modal_detail_perbaikan " >
<div>
<div>
<img src="static/img/icon-1/detailpoi.svg" alt="">
<img src="static/img/icon-1/detailpoi.svg" alt=""
style="margin-top: -4px;"><span> Detail</span
>
</div>
</div>
</a>
</a>
</div>
</div>
<div class="col-md-3" style="padding: 0px;">
<a class="btn mdlFire " data-toggle="modal " data-target="#modal_detail_perbaikan " >
<div>
<img src="static/img/icon-1/editpoi.svg" alt="">
</div>
</a>
</div>
</div>
</td>
</td>
</tr>`
;
</tr>`
;
data_point
.
push
(
data_gab
)
data_point
.
push
(
data_gab
)
...
@@ -225,7 +226,7 @@ $("#pengaturan_btn").click(function() {
...
@@ -225,7 +226,7 @@ $("#pengaturan_btn").click(function() {
$
(
"
#tbody_
list_poin
t
"
).
html
(
data_point
)
$
(
"
#tbody_
point_lis
t
"
).
html
(
data_point
)
$
(
'
.datatable-show-all.list_user
'
).
DataTable
({
$
(
'
.datatable-show-all.list_user
'
).
DataTable
({
...
@@ -235,16 +236,6 @@ $("#pengaturan_btn").click(function() {
...
@@ -235,16 +236,6 @@ $("#pengaturan_btn").click(function() {
width
:
'
20px
'
,
width
:
'
20px
'
,
targets
:
[
0
],
targets
:
[
0
],
},
{
orderable
:
false
,
width
:
'
20px
'
,
targets
:
[
5
],
},
{
orderable
:
false
,
width
:
'
20px
'
,
targets
:
[
6
],
},
],
},
],
dom
:
'
<"float-left "B>frtip
'
,
dom
:
'
<"float-left "B>frtip
'
,
language
:
{
language
:
{
...
@@ -273,16 +264,6 @@ $("#pengaturan_btn").click(function() {
...
@@ -273,16 +264,6 @@ $("#pengaturan_btn").click(function() {
width
:
'
20px
'
,
width
:
'
20px
'
,
targets
:
[
0
],
targets
:
[
0
],
},
{
orderable
:
false
,
width
:
'
20px
'
,
targets
:
[
4
],
},
{
orderable
:
false
,
width
:
'
20px
'
,
targets
:
[
5
],
},
],
},
],
dom
:
'
<"float-left "B>frtip
'
,
dom
:
'
<"float-left "B>frtip
'
,
language
:
{
language
:
{
...
@@ -450,3 +431,220 @@ function download_point_list(type, fn, dl) {
...
@@ -450,3 +431,220 @@ function download_point_list(type, fn, dl) {
}
}
})
})
}
}
function
loadGroups
(
isSelect
)
{
var
isObject
=
{}
console
.
log
(
isSelect
)
isObject
.
func_name
=
"
loadGroups
"
;
$
.
ajax
({
url
:
"
/getallGroups/
"
,
data
:
isObject
,
dataType
:
'
json
'
,
type
:
'
post
'
,
success
:
function
(
data
)
{
let
response
=
data
;
console
.
log
(
response
)
if
(
response
.
code
==
0
)
{
var
groups
=
response
.
data
;
var
html
=
`<option value="null" selected disabled>-- Pilih Group --</option>`
;
for
(
i
in
groups
)
{
if
(
isSelect
)
{
if
(
isSelect
.
length
>=
1
)
{
for
(
j
in
isSelect
)
{
if
(
isSelect
[
j
]
==
groups
[
i
])
{
html
+=
`<option value="`
+
groups
[
i
]
+
`" selected>`
+
groups
[
i
]
+
`</option>`
;
console
.
log
(
groups
[
i
])
}
else
{
html
+=
`<option value="`
+
groups
[
i
]
+
`">`
+
groups
[
i
]
+
`</option>`
;
}
}
}
else
{
html
+=
`<option value="`
+
groups
[
i
]
+
`">`
+
groups
[
i
]
+
`</option>`
;
}
}
else
{
html
+=
`<option value="`
+
groups
[
i
]
+
`">`
+
groups
[
i
]
+
`</option>`
;
}
}
$
(
"
#select_group
"
).
html
(
html
);
$
(
"
#select_group_parent
"
).
html
(
html
);
console
.
log
(
html
)
}
else
{
$
(
"
#select_group
"
).
html
(
"
group tidak tersedia
"
);
$
(
"
#select_group_parent
"
).
html
(
"
group tidak tersedia
"
);
}
}
});
}
function
switchuserstatus
(
id
,
isactive
)
{
var
isObject
=
{}
var
params
=
id
.
split
(
"
,
"
);
isObject
.
id
=
params
[
0
];
isObject
.
stat
=
params
[
1
].
replace
(
"
"
,
""
);
console
.
log
(
params
)
if
(
isObject
.
stat
==
"
True
"
)
{
var
title
=
"
Nonaktifkan
"
;
var
text
=
"
User tidak akan bisa login jika dinonaktifkan!
"
;
}
else
{
var
title
=
"
Aktifkan
"
;
var
text
=
"
User dapat kembali login jika diaktifkan!
"
;
}
swal
({
title
:
title
+
"
user?
"
,
text
:
text
,
type
:
"
warning
"
,
showCancelButton
:
true
,
confirmButtonClass
:
"
btn-danger
"
,
confirmButtonText
:
"
Ya!
"
,
cancelButtonText
:
"
Tidak!
"
,
closeOnConfirm
:
false
,
closeOnCancel
:
false
}).
then
((
isConfirm
)
=>
{
console
.
log
(
isConfirm
)
if
(
isConfirm
.
value
)
{
$
.
ajax
({
url
:
"
/switchStatus/
"
,
data
:
isObject
,
dataType
:
'
json
'
,
type
:
'
post
'
,
success
:
function
(
data
)
{
let
response
=
data
;
if
(
isObject
.
stat
==
"
True
"
)
{
var
inf
=
"
dinonaktifkan
"
}
else
{
var
inf
=
"
diaktifkan
"
}
if
(
response
.
code
==
0
)
{
swal
({
title
:
"
sukses
"
,
text
:
"
User berhasil
"
+
inf
,
type
:
"
success
"
,
icon
:
"
success
"
,
confirmButtonColor
:
"
#00BCD4
"
}).
then
((
isok
)
=>
{
location
.
reload
();
})
}
else
{
alert
(
"
no data in database
"
)
}
}
});
}
else
{
swal
(
"
Dibatalkan
"
,
"
User status tidak berubah
"
,
"
error
"
);
}
});
}
function
loaduserbyid
(
id
)
{
$
(
"
#modal_edit_user
"
).
modal
(
"
show
"
)
var
isObject
=
{};
$
(
"
.modstit
"
).
html
(
"
Update User
"
)
$
(
"
#inUsername
"
).
attr
(
"
disabled
"
,
true
)
isObject
.
id
=
id
;
$
(
"
#iduser
"
).
val
(
id
)
$
.
ajax
({
url
:
"
/loadUserbyId/
"
,
data
:
isObject
,
dataType
:
'
json
'
,
type
:
'
post
'
,
success
:
function
(
data
)
{
let
response
=
data
;
if
(
response
.
code
==
0
)
{
var
user
=
response
.
data
;
console
.
log
(
user
)
$
(
"
#inUsername
"
).
val
(
user
.
username
);
$
(
"
#inNameF
"
).
val
(
user
.
firstname
);
$
(
"
#inNameL
"
).
val
(
user
.
lastname
);
$
(
"
#inEmail
"
).
val
(
user
.
email
);
if
(
user
.
is_staff
)
{
$
(
'
input[name=isStaff][value=true]
'
).
attr
(
'
checked
'
,
true
)
}
else
{
$
(
'
input[name=isStaff][value=false]
'
).
attr
(
'
checked
'
,
true
)
}
loadGroups
(
user
.
group
)
$
(
"
#modalAddButton
"
).
click
()
}
else
{
}
}
});
}
function
modal_detail_point_pengaturan
(
id
,
db
)
{
$
(
"
#detail_right
"
).
html
(
``
)
$
(
"
#modal_detail_point_pengaturan
"
).
modal
(
"
show
"
)
$
.
ajax
({
url
:
"
/api/load_point_id
"
,
data
:
{
'
idx
'
:
id
,
'
db
'
:
db
},
dataType
:
'
json
'
,
success
:
function
(
data
)
{
// console.log(data['result'][0][0])
$
(
"
#detail_right
"
).
html
(
`<div>
<span>
Informasi Peta Lokasi
</span>
</div>
<div id="maps_detail_p" style="height: 360px;outline: none;border-bottom-right-radius: 10px;margin-top: 10px;">
</div>`
)
var
map_poin_det
=
L
.
map
(
'
maps_detail_p
'
,
{
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
});
mapss
=
L
.
tileLayer
(
'
https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&s=Gal&apistyle=s.t:0|s.e:l|p.v:off
'
,
{
maxZoom
:
22
,
minZoom
:
4
,
}).
addTo
(
map_poin_det
);
$
(
"
.nama_point
"
).
html
(
data
[
'
result
'
][
0
][
0
][
'
properties
'
][
'
f2
'
])
$
(
"
.pj_bangunan
"
).
html
(
data
[
'
result
'
][
0
][
0
][
'
properties
'
][
'
f5
'
])
$
(
"
.luas_bangunan
"
).
html
(
data
[
'
result
'
][
0
][
0
][
'
properties
'
][
'
f4
'
])
var
marker
=
L
.
marker
([
data
[
'
result
'
][
0
][
0
][
'
geometry
'
][
'
coordinates
'
][
1
],
data
[
'
result
'
][
0
][
0
][
'
geometry
'
][
'
coordinates
'
][
0
]]).
addTo
(
map_poin_det
);
map_poin_det
.
setView
([
data
[
'
result
'
][
0
][
0
][
'
geometry
'
][
'
coordinates
'
][
1
],
data
[
'
result
'
][
0
][
0
][
'
geometry
'
][
'
coordinates
'
][
0
]],
17
)
document
.
querySelector
(
"
#maps_detail_p > div.leaflet-control-container > div.leaflet-top.leaflet-left
"
).
css
(
"
display
"
,
"
none
"
)
setTimeout
(
function
()
{
map_poin_det
.
invalidateSize
();
},
1000
);
$
(
"
#edit_point_p
"
).
click
(
function
()
{
$
(
"
#modal_edit_p_point
"
).
modal
(
"
show
"
)
})
}
});
}
\ No newline at end of file
templates/includes/modal.html
View file @
46d3747e
...
@@ -995,6 +995,7 @@
...
@@ -995,6 +995,7 @@
</div>
</div>
<thead
style=
"font-size: 12px;line-height: 14px;font-family: 'gilroysemibold';text-transform: capitalize;"
>
<thead
style=
"font-size: 12px;line-height: 14px;font-family: 'gilroysemibold';text-transform: capitalize;"
>
<tr>
<tr>
<th>
No.
</th>
<th>
No.
</th>
...
@@ -1002,11 +1003,11 @@
...
@@ -1002,11 +1003,11 @@
<th>
Alamat
</th>
<th>
Alamat
</th>
<th>
Luas Bangunan
</th>
<th>
Luas Bangunan
</th>
<th>
Penanggung Jawab
</th>
<th>
Penanggung Jawab
</th>
<th>
Action
</th>
<th>
Action
</th>
</tr>
</tr>
</thead>
</thead>
<tbody
id=
"tbody_list_point"
>
<tbody
id=
"tbody_point_list"
>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
...
@@ -1326,3 +1327,315 @@
...
@@ -1326,3 +1327,315 @@
<table
id=
"table_downloader"
style=
"display: none;"
>
<table
id=
"table_downloader"
style=
"display: none;"
>
</table>
</table>
<div
id=
"modal_edit_user"
class=
"modal fade"
>
<div
class=
"modal-dialog md"
style=
"margin-top: 100px;"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header bg-info"
style=
"background-color: #1a222f !important;"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
onclick=
"destroyfade()"
>
×
</button>
<h6
class=
"modal-title modstit"
>
Modal Tambah User
</h6>
</div>
<div
class=
"modal-body"
style=
"max-height: 450px;overflow-y: auto;"
>
<input
type=
"hidden"
id=
"iduser"
>
<div
class=
"row"
>
<div
class=
"form-group"
>
<label
class=
"col-lg-3 control-label lbl-top"
>
Username
</label>
<div
class=
"col-lg-9"
>
<input
id=
"inUsername"
type=
"text"
class=
"form-control"
value=
""
required
>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"form-group"
>
<label
class=
"col-lg-3 control-label lbl-top"
>
First Name
</label>
<div
class=
"col-lg-9"
>
<input
id=
"inNameF"
type=
"text"
class=
"form-control"
value=
""
required
>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"form-group"
>
<label
class=
"col-lg-3 control-label lbl-top"
>
Last Name
</label>
<div
class=
"col-lg-9"
>
<input
id=
"inNameL"
type=
"text"
class=
"form-control"
value=
""
required
>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"form-group"
>
<label
class=
"col-lg-3 control-label lbl-top"
>
Email
</label>
<div
class=
"col-lg-9"
>
<input
id=
"inEmail"
type=
"text"
class=
"form-control"
value=
""
required
>
</div>
</div>
</div>
<div
class=
"row"
style=
"margin-top: 20px;"
>
<div
class=
"form-group"
>
<label
class=
"col-lg-3 control-label"
>
Staff
</label>
<div
class=
"col-lg-9"
>
<label
class=
"radio-inline"
>
<input
type=
"radio"
class=
"styled"
value=
"true"
name=
"isStaff"
checked=
"checked"
>
Ya
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
class=
"styled"
value=
"false"
name=
"isStaff"
>
Tidak
</label>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"form-group"
style=
"margin-top: 10px !important;"
>
<label
class=
"col-lg-3 control-label lbl-top"
>
Groups
</label>
<div
class=
"col-lg-9"
>
<select
style=
"border-bottom: 1px solid rgb(83, 83, 83) !important;"
id=
"select_group"
data-placeholder=
"select group.."
class=
"select-size-xs"
>
<option></option>
</select>
</div>
</div>
</div>
</div>
<hr>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-link"
data-dismiss=
"modal"
onclick=
"destroyfade()"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-info"
id=
"saveuser"
>
Save changes
</button>
</div>
</div>
</div>
</div>
<div
id=
"modal_detail_point_pengaturan"
class=
"modal fade mymodal"
>
<div
class=
"modal-dialog modal-md"
style=
"top: 10%;"
>
<div
class=
"modal-content"
style=
"border-radius:10px;"
>
<div
class=
"modal-body"
style=
"padding: 0px;"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
style=
" margin: 0px 8px 0px 0px;
width: 25px;
height: 25px;
background-color: white;
top: 8px;
position: absolute;
right: 0px;
opacity: 1;
z-index: 999;
border-radius: 12px;"
>
×
</button>
<fieldset>
<div
class=
"row"
>
<div
class=
"col-md-5"
style=
"padding-right: 0px;"
>
<div
class=
"gambar_point"
>
<img
src=
"/static/img/image_null.png"
alt=
""
style=
"width:100%;height:240px;border-top-left-radius: 10px;border-bottom-left-radius: 10px;"
>
</div>
<div
style=
"font-family: 'gilroybold';margin: 10px;"
class=
"nama_point"
>
NAMADESA
</div>
<div
class=
"row isi_keterangan"
style=
"margin: 10px;"
>
<div
class=
"col-md-6"
style=
"padding: 0px;"
>
<div>
<div>
<span>
Penanggung Jawab
</span>
</div>
<div>
<span
class=
"pj_bangunan"
>
34567
</span>
</div>
</div>
</div>
<div
class=
"col-md-6"
>
<div>
<div>
<span>
Luas Bangunan
</span>
</div>
<div>
<span
class=
"luas_bangunan"
>
1234
</span>
</div>
</div>
</div>
</div>
<div
style=
"background-color: white;
bottom: -40px;
position: absolute;
right: 0px;
border: 1pt solid #E2E2E2;
border-top-left-radius: 10px;"
>
<a
href=
"#"
class=
"btn"
id=
"edit_point_p"
style=
"border-bottom-left-radius: 8px;
border-top-right-radius: 8px;
width: 100%;
height: 100%;
bottom: 0px;
color: black;"
data-toggle=
"modal"
data-target=
"#modal_adm"
data-backdrop=
"static"
data-keyboard=
"false"
><i
class=
"icon-pencil5"
></i>
Edit data
</a>
</div>
</div>
<div
class=
"col-md-7"
style=
"padding-left: 0px;"
id=
"detail_right"
>
<div>
<span>
Informasi Peta Lokasi
</span>
</div>
<div
id=
"maps_detail_p"
style=
"height: 360px;outline: none;border-bottom-right-radius: 10px;"
>
</div>
</div>
</div>
</fieldset>
</div>
<!-- <div class="btn_action">
<div class="tombol-edit-keterangan text-center" style="
background-color: #5A9AFB;
position: absolute;
width: 40px;
height: 40px;
bottom: 2px;
right: 5px;
border: 1pt solid rosybrown;
border-radius: 8px;
">
<a href="#" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a>
</div>
<div class="tombol-delete-keterangan text-center" style="
background-color: indianred;
position: absolute;
width: 40px;
height: 40px;
bottom: 2px;
right: 50px;
border: 1pt solid rosybrown;
border-radius: 10px;
">
<a href="#" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div>
</div> -->
</div>
</div>
</div>
<div
class=
"modal fade"
id=
"modal_edit_p_point"
>
<div
class=
"modal-dialog md"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header bg-info"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
onclick=
"destroyfade()"
>
×
</button>
<h6
class=
"modal-title"
>
Edit Point
</h6>
</div>
<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-upli"
data-toggle=
"tab"
>
Koordinat
</a></li>
<li
onclick=
"changetabs(this)"
><a
href=
"#right-tab2-feas-upli"
data-toggle=
"tab"
>
Informasi Umum
</a></li>
</ul>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"left-tab1-feas-upli"
>
<div
id=
"map-for-edit"
style=
"width: 400px;height: 300px;position: relative;margin-left: 100px;"
></div>
<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=
"fileadm"
name=
"images[]"
multiple
accept=
"image/jpg,image/png,image/jpeg,image/gif"
>
<input
style=
"display:none;"
id=
"gambar_adm_edit"
type=
"text"
class=
"form-control"
value=
""
required
>
</div>
</div>
</div>
<div
class=
"tab-pane"
id=
"right-tab2-feas-upli"
>
<div
class=
"modal-body"
style=
"min-height: 450px;overflow-y: auto;"
>
<div
class=
"form-group"
>
<input
style=
"display:none;"
id=
"id_adm_edit"
type=
"text"
class=
"form-control"
value=
""
required
>
<input
style=
"display:none;"
id=
"coordinateZoneedit_adm_edit"
type=
"text"
class=
"form-control"
value=
""
required
>
</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;"
>
Nama Point
</label>
<div
class=
"col-lg-9"
>
<input
id=
"namobj_adm_edit"
type=
"text"
class=
"form-control"
value=
"` + data['result'][0][0]['properties']['f2'] + `"
required
>
</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;"
>
Tipe Point
</label>
<div
class=
"col-lg-8"
>
<select
id=
"remark_adm_edit"
style=
"margin-top: 15px;"
>
<option></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;"
>
Alamat
</label>
<div
class=
"col-lg-4"
>
<input
id=
"alamat_adm_edit"
type=
"text"
class=
"form-control"
value=
"` + data['result'][0][0]['properties']['f3'] + `"
required
>
</div>
<div
class=
"col-lg-4"
style=
"margin-top: 15px;"
></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;"
>
Luas
</label>
<div
class=
"col-lg-6"
>
<input
id=
"luas_tanah_adm_edit"
type=
"text"
class=
"form-control"
value=
"` + data['result'][0][0]['properties']['f4'] + `"
required
>
</div>
<div
class=
"col-lg-3"
>
<select
id=
"satuan_luas_tanah"
style=
"margin-top: 15px;"
>
<option>
m2
</option>
<option>
Km2
</option>
<option>
Hektar
</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;"
>
Pimpinan
</label>
<div
class=
"col-lg-9"
>
<input
id=
"perangkat_adm_edit"
type=
"text"
class=
"form-control"
value=
"` + data['result'][0][0]['properties']['f5'] + `"
required
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-link"
data-dismiss=
"modal"
onclick=
"destroyfade()"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-info"
id=
"saveeditadm"
>
Save changes
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
templates/includes/sidebar.html
View file @
46d3747e
...
@@ -669,6 +669,7 @@
...
@@ -669,6 +669,7 @@
<script>
<script>
$
(
"
#sel-kec
"
).
change
(
function
()
{
$
(
"
#sel-kec
"
).
change
(
function
()
{
$
(
"
#list_perbaikan
"
).
removeClass
(
"
datatable-show-all
"
)
var
id_kec
=
$
(
this
).
val
()
var
id_kec
=
$
(
this
).
val
()
...
@@ -679,6 +680,7 @@
...
@@ -679,6 +680,7 @@
},
},
dataType
:
'
json
'
,
dataType
:
'
json
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"
#list_perbaikan
"
).
addClass
(
"
datatable-kecamatan
"
)
var
data_all_desa
=
[]
var
data_all_desa
=
[]
for
(
var
i
=
0
;
i
<
data
[
'
res_kel
'
].
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
data
[
'
res_kel
'
].
length
;
i
++
)
{
var
id_k
=
data
[
'
res_kel
'
][
i
][
0
];
var
id_k
=
data
[
'
res_kel
'
][
i
][
0
];
...
@@ -729,6 +731,43 @@
...
@@ -729,6 +731,43 @@
};
};
$
(
"
#tbody_perbaikan
"
).
html
(
data_perbaikan
)
$
(
"
#tbody_perbaikan
"
).
html
(
data_perbaikan
)
$
(
'
.datatable-kecamatan
'
).
DataTable
({
autoWidth
:
false
,
columnDefs
:
[{
orderable
:
false
,
width
:
'
20px
'
,
targets
:
[
0
],
},
{
orderable
:
false
,
width
:
'
20px
'
,
targets
:
[
6
],
},
{
orderable
:
false
,
width
:
'
20px
'
,
targets
:
[
7
],
},
],
dom
:
'
<"float-left "B>frtip
'
,
language
:
{
search
:
'
_INPUT_
'
,
searchPlaceholder
:
'
Data Perbaikan...
'
,
lengthMenu
:
'
<span>Show:</span><hr> _MENU_
'
,
paginate
:
{
'
first
'
:
'
First
'
,
'
last
'
:
'
Last
'
,
'
next
'
:
'
→
'
,
'
previous
'
:
'
←
'
}
},
drawCallback
:
function
()
{
$
(
this
).
find
(
'
tbody tr
'
).
slice
(
-
3
).
find
(
'
.dropdown, .btn-group
'
).
addClass
(
'
dropup
'
);
},
preDrawCallback
:
function
()
{
$
(
this
).
find
(
'
tbody tr
'
).
slice
(
-
3
).
find
(
'
.dropdown, .btn-group
'
).
removeClass
(
'
dropup
'
);
}
});
}
}
});
});
...
@@ -785,6 +824,7 @@
...
@@ -785,6 +824,7 @@
$
(
"
#tbody_perbaikan
"
).
html
(
data_perbaikan
)
$
(
"
#tbody_perbaikan
"
).
html
(
data_perbaikan
)
}
}
});
});
...
...
templates/layout/layout.html
View file @
46d3747e
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</div>
</div>
<div
style=
"margin-bottom: 10px;"
>
<div
style=
"margin-bottom: 10px;"
>
<a
href=
"#"
class=
"btn btn-default"
style=
"background-color: #ffffff;
<
!-- <
a href="#" class="btn btn-default" style="background-color: #ffffff;
border: 1px solid #dadce0;
border: 1px solid #dadce0;
-webkit-border-radius: 100px;
-webkit-border-radius: 100px;
border-radius: 100px;
border-radius: 100px;
...
@@ -260,7 +260,7 @@
...
@@ -260,7 +260,7 @@
padding: 8px 16px;
padding: 8px 16px;
text-align: center;
text-align: center;
text-decoration: none;
text-decoration: none;
text-overflow: ellipsis;"
id=
"pengaturan_btn"
data-toggle=
"modal"
data-target=
"#user_profile"
data-backdrop=
"static"
data-keyboard=
"false"
>
Pengaturan
</a>
text-overflow: ellipsis;" id="pengaturan_btn" data-toggle="modal" data-target="#user_profile" data-backdrop="static" data-keyboard="false">Pengaturan</a>
-->
</div>
</div>
</div>
</div>
...
@@ -270,7 +270,7 @@
...
@@ -270,7 +270,7 @@
<li>
<li>
<div
style=
"border-bottom: 0.5px solid #DCDCDC;margin-bottom:10px;"
>
<div
style=
"border-bottom: 0.5px solid #DCDCDC;margin-bottom:10px;"
>
<div
style=
"margin-bottom: 10px;"
>
<div
style=
"margin-bottom: 10px;"
>
<a
href=
"
{% url 'usermanagement' %}
"
style=
" background-color: #ffffff;
<a
href=
"
#
"
style=
" background-color: #ffffff;
color: #3c4043;
color: #3c4043;
display: table;
display: table;
font: 500 14px/16px Google Sans,Roboto,RobotoDraft,Helvetica,Arial,sans-serif;
font: 500 14px/16px Google Sans,Roboto,RobotoDraft,Helvetica,Arial,sans-serif;
...
@@ -279,7 +279,7 @@
...
@@ -279,7 +279,7 @@
padding: 14px 41px;
padding: 14px 41px;
text-align: center;
text-align: center;
text-decoration: none;
text-decoration: none;
width: 100%;"
><i
class=
"icon-user"
></i>
Kelola User
</a>
width: 100%;"
id=
"pengaturan_btn"
data-toggle=
"modal"
data-target=
"#user_profile"
data-backdrop=
"static"
data-keyboard=
"false"
><i
class=
"icon-user"
></i>
PENGATURAN
</a>
</div>
</div>
</div>
</div>
</li>
</li>
...
...
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