Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
frontend
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
Antrian
frontend
Commits
b6beb3c7
Commit
b6beb3c7
authored
Oct 19, 2020
by
Azy Mushofy Anwary
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tambah Gambar
parent
cd87a10e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
328 additions
and
262 deletions
+328
-262
module/Application/src/Controller/ApiController.php
module/Application/src/Controller/ApiController.php
+44
-15
module/Application/view/application/admin/dasboard.phtml
module/Application/view/application/admin/dasboard.phtml
+4
-4
module/Application/view/application/admin/kelolapoli.phtml
module/Application/view/application/admin/kelolapoli.phtml
+4
-4
public/action-js/antrian-js/action-kelolapoli.js
public/action-js/antrian-js/action-kelolapoli.js
+234
-239
public/tamplateadmin/js/demo/chart-pie-demo.js
public/tamplateadmin/js/demo/chart-pie-demo.js
+42
-0
No files found.
module/Application/src/Controller/ApiController.php
View file @
b6beb3c7
...
@@ -610,7 +610,6 @@ class ApiController extends \Application\Master\GlobalActionController {
...
@@ -610,7 +610,6 @@ class ApiController extends \Application\Master\GlobalActionController {
return
$this
->
getOutput
(
$result
->
toJson
());
return
$this
->
getOutput
(
$result
->
toJson
());
}
}
public
function
savekelolapoliAction
(){
public
function
savekelolapoliAction
(){
if
(
$this
->
isLoggedIn
()){
if
(
$this
->
isLoggedIn
()){
$result
=
new
Result
();
$result
=
new
Result
();
...
@@ -620,37 +619,66 @@ class ApiController extends \Application\Master\GlobalActionController {
...
@@ -620,37 +619,66 @@ class ApiController extends \Application\Master\GlobalActionController {
$table_poli
=
'poli'
;
$table_poli
=
'poli'
;
if
(
$request
->
isPost
())
{
if
(
$request
->
isPost
())
{
$storage
=
\Application\Model\Param\Storage
::
factory
(
$this
->
getDb
(),
$this
->
getConfig
());
$storage
=
\Application\Model\Param\Storage
::
factory
(
$this
->
getDb
(),
$this
->
getConfig
());
$param
=
new
\Application\Model\Param
(
$storage
);
$param
=
new
\Application\Model\Param
(
$storage
);
try
{
try
{
$fileupload
=
$_FILES
[
'fileupload'
][
'tmp_name'
];
// print_r($fileupload);die;
$nama_poli
=
$post
->
inama_poli
;
$nama_poli
=
$post
->
inama_poli
;
$kode_poli
=
$post
->
ikode_poli
;
$kode_poli
=
$post
->
ikode_poli
;
$deskripsi_poli
=
$post
->
ideskripsi_poli
;
$deskripsi_poli
=
$post
->
ideskripsi_poli
;
$dataArrayPoli
=
array
(
if
(
!
empty
(
$fileupload
)){
$ImageName
=
$_FILES
[
'fileupload'
][
'name'
];
$tipes
=
$_FILES
[
'fileupload'
][
'type'
];
$size
=
$_FILES
[
'fileupload'
][
'size'
];
'nama_poli'
=>
$nama_poli
,
'kode_poli'
=>
$kode_poli
,
'deskripsi_poli'
=>
$deskripsi_poli
,
);
$uploaddir
=
'./public/tamplate/img/poli/'
;
// directory file
// print_r($dataArrayPoli);die;
$alamatfile
=
$uploaddir
.
$ImageName
;
if
(
move_uploaded_file
(
$_FILES
[
'fileupload'
][
'tmp_name'
],
$alamatfile
)){
$param
->
saveGlobal
(
$dataArrayPoli
,
$table_poli
);
// print_r('berhasil');die;
/* jika upload berhasil ke folder sever */
$dataAtt
=
array
(
'nama_poli'
=>
$nama_poli
,
'image_poli'
=>
$ImageName
,
'deskripsi_poli'
=>
$deskripsi_poli
,
'kode_poli'
=>
$kode_poli
,
);
$param
->
saveGlobal
(
$dataAtt
,
$table_poli
);
$result
->
code
=
0
;
$result
->
code
=
0
;
$result
->
info
=
'ok'
;
$result
->
info
=
'ok'
;
$result
->
data
=
$dataArrayPoli
;
$result
->
data
=
$dataArrayPoli
->
data
;
}
else
{
$result
->
code
=
17
;
$result
->
info
=
'FAILED UPLOAD FILE to SERVER'
;
}
}
else
{
$result
->
info
=
'File tidak boleh kosong'
;
}
// print_r($dataArrayPoli);die;
// $param->saveGlobal($dataArrayPoli, $table_poli);
// $result->code = 0;
// $result->info = 'ok';
// $result->data = $dataArrayPoli;
}
catch
(
\Exception
$exc
)
{
}
catch
(
\Exception
$exc
)
{
...
@@ -663,6 +691,7 @@ class ApiController extends \Application\Master\GlobalActionController {
...
@@ -663,6 +691,7 @@ class ApiController extends \Application\Master\GlobalActionController {
return
$this
->
getOutput
(
$result
->
toJson
());
return
$this
->
getOutput
(
$result
->
toJson
());
}
}
public
function
editkelolapoliAction
(){
public
function
editkelolapoliAction
(){
if
(
$this
->
isLoggedIn
()){
if
(
$this
->
isLoggedIn
()){
$result
=
new
Result
();
$result
=
new
Result
();
...
...
module/Application/view/application/admin/dasboard.phtml
View file @
b6beb3c7
...
@@ -94,10 +94,10 @@
...
@@ -94,10 +94,10 @@
</a>
</a>
<div
class=
"dropdown-menu dropdown-menu-right shadow animated--fade-in"
aria-labelledby=
"dropdownMenuLink"
>
<div
class=
"dropdown-menu dropdown-menu-right shadow animated--fade-in"
aria-labelledby=
"dropdownMenuLink"
>
<div
class=
"dropdown-header"
>
Dropdown Header:
</div>
<div
class=
"dropdown-header"
>
Dropdown Header:
</div>
<a
class=
"dropdown-item"
href=
"#"
>
Action
</a>
<a
class=
"dropdown-item"
id=
"poli"
>
</a>
<
a
class=
"dropdown-item"
href=
"#"
>
Another action
</a
>
<
select
name=
"poli"
id=
"poli"
class=
"form-control"
>
<div
class=
"dropdown-divider"
></div
>
<option
disable
selected
>
Pilih
</option
>
<a
class=
"dropdown-item"
href=
"#"
>
Something else here
</a
>
</select
>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
module/Application/view/application/admin/kelolapoli.phtml
View file @
b6beb3c7
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
>
×
</button>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
>
×
</button>
</div>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<form
id=
"myForm"
>
<form
id=
"myForm"
method=
"POST"
action=
"
<?php
$this
->
basePath
(
'/api/savekelolapoli'
)
?>
"
enctype=
"multipart/form-data"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label>
Nama Poli
</label>
<label>
Nama Poli
</label>
...
@@ -70,12 +70,12 @@
...
@@ -70,12 +70,12 @@
</div>
</div>
<div
class=
"form-group "
>
<div
class=
"form-group "
>
<label>
Gambar Poli
</label>
<label>
Gambar Poli
</label>
<input
type=
"file"
name=
"
image_poli"
id=
"image
_poli"
class=
"form-control-file"
>
<input
type=
"file"
name=
"
gambar_poli"
id=
"gambar
_poli"
class=
"form-control-file"
>
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<button
type=
"
button
"
class=
"btn btn-primary"
id=
"tambah"
>
Add
</button>
<button
type=
"
submit
"
class=
"btn btn-primary"
id=
"tambah"
>
Add
</button>
<button
type=
"button"
class=
"btn btn-danger"
onclick=
"reset()"
>
Reset
</button>
<button
type=
"button"
class=
"btn btn-danger"
onclick=
"reset()"
>
Reset
</button>
<button
type=
"
submit
"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"
button
"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
</div>
</div>
</form>
</form>
</div>
</div>
...
...
public/action-js/antrian-js/action-kelolapoli.js
View file @
b6beb3c7
...
@@ -69,7 +69,8 @@ function Loadpoli() {
...
@@ -69,7 +69,8 @@ function Loadpoli() {
}
}
$
(
'
#tambah
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#tambah
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
let
nama_poli
=
$
(
'
#nama_poli
'
).
val
();
let
nama_poli
=
$
(
'
#nama_poli
'
).
val
();
let
kode_poli
=
$
(
'
#kode_poli
'
).
val
();
let
kode_poli
=
$
(
'
#kode_poli
'
).
val
();
let
deskripsi_poli
=
$
(
'
#deskripsi_poli
'
).
val
();
let
deskripsi_poli
=
$
(
'
#deskripsi_poli
'
).
val
();
...
@@ -94,41 +95,35 @@ $('#tambah').on('click', function () {
...
@@ -94,41 +95,35 @@ $('#tambah').on('click', function () {
}
else
{
}
else
{
savedatapoli
();
savedatapoli
();
}
}
})
function
saveTheoryOfDespair
()
{
function
savedatapoli
()
{
}
function
savedatapoli
()
{
let
nama_poli
=
$
(
'
#nama_poli
'
).
val
();
let
nama_poli
=
$
(
'
#nama_poli
'
).
val
();
let
kode_poli
=
$
(
'
#kode_poli
'
).
val
();
let
kode_poli
=
$
(
'
#kode_poli
'
).
val
();
let
deskripsi_poli
=
$
(
'
#deskripsi_poli
'
).
val
();
let
deskripsi_poli
=
$
(
'
#deskripsi_poli
'
).
val
();
const
fileupload
=
$
(
'
#image_poli
'
).
prop
(
'
files
'
)[
0
];
const
fileupload
=
$
(
'
#gambar_poli
'
).
prop
(
'
files
'
)[
0
];
let
formData
=
new
FormData
();
let
formData
=
new
FormData
();
formData
.
append
(
'
inama_poli
'
,
nama_poli
);
formData
.
append
(
'
ikode_poli
'
,
kode_poli
);
formData
.
append
(
'
ideskripsi_poli
'
,
deskripsi_poli
);
formData
.
append
(
'
fileupload
'
,
fileupload
);
// set file ke tipe data binary
formData
.
append
(
'
fileupload
'
,
fileupload
);
// set file ke tipe data binary
console
.
log
(
fileupload
);
let
image
=
$
(
'
#kode_poli
'
).
val
();
$
.
ajax
({
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
dataType
:
'
json
'
,
url
:
baseURL
+
'
/api/savekelolapoli
'
,
url
:
baseURL
+
'
/api/savekelolapoli
'
,
data
:
{
inama_poli
:
nama_poli
,
data
:
ikode_poli
:
kode_poli
,
// inama_poli: nama_poli,
ideskripsi_poli
:
deskripsi_poli
,
// ikode_poli: kode_poli,
},
// ideskripsi_poli: deskripsi_poli,
formData
,
cache
:
false
,
processData
:
false
,
contentType
:
false
,
success
:
function
(
response
)
{
success
:
function
(
response
)
{
...
@@ -163,10 +158,10 @@ function savedatapoli() {
...
@@ -163,10 +158,10 @@ function savedatapoli() {
});
});
}
}
function
validasipoli
(
nama_poli
,
kode_poli
)
{
function
validasipoli
(
nama_poli
,
kode_poli
)
{
var
exist
=
0
;
var
exist
=
0
;
...
@@ -200,11 +195,11 @@ function validasipoli(nama_poli, kode_poli) {
...
@@ -200,11 +195,11 @@ function validasipoli(nama_poli, kode_poli) {
});
});
return
exist
;
return
exist
;
}
}
$
(
'
#edit
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#edit
'
).
on
(
'
click
'
,
function
()
{
let
id_poli
=
$
(
'
#id_poli
'
).
val
();
let
id_poli
=
$
(
'
#id_poli
'
).
val
();
let
nama_poli
=
$
(
'
#nama_poliEdt
'
).
val
();
let
nama_poli
=
$
(
'
#nama_poliEdt
'
).
val
();
let
kode_poli
=
$
(
'
#kode_poliEdt
'
).
val
();
let
kode_poli
=
$
(
'
#kode_poliEdt
'
).
val
();
...
@@ -231,8 +226,8 @@ $('#edit').on('click', function () {
...
@@ -231,8 +226,8 @@ $('#edit').on('click', function () {
editdatapoli
(
id_poli
)
editdatapoli
(
id_poli
)
}
}
})
})
function
editdatapoli
(
id_poli
)
{
function
editdatapoli
(
id_poli
)
{
let
nama_poli
=
$
(
'
#nama_poliEdt
'
).
val
();
let
nama_poli
=
$
(
'
#nama_poliEdt
'
).
val
();
let
kode_poli
=
$
(
'
#kode_poliEdt
'
).
val
();
let
kode_poli
=
$
(
'
#kode_poliEdt
'
).
val
();
let
deskripsi_poli
=
$
(
'
#deskripsi_poliEdt
'
).
val
();
let
deskripsi_poli
=
$
(
'
#deskripsi_poliEdt
'
).
val
();
...
@@ -287,10 +282,10 @@ function editdatapoli(id_poli) {
...
@@ -287,10 +282,10 @@ function editdatapoli(id_poli) {
});
});
}
}
function
loadedit
(
param
)
{
function
loadedit
(
param
)
{
$
.
ajax
({
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
...
@@ -322,10 +317,10 @@ function loadedit(param) {
...
@@ -322,10 +317,10 @@ function loadedit(param) {
alert
(
xhr
.
status
+
'
-
'
+
xhr
.
statusText
);
alert
(
xhr
.
status
+
'
-
'
+
xhr
.
statusText
);
}
}
});
});
}
}
function
Delete
(
param
)
{
function
Delete
(
param
)
{
$
.
ajax
({
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
dataType
:
'
json
'
,
...
@@ -385,6 +380,6 @@ function Delete(param) {
...
@@ -385,6 +380,6 @@ function Delete(param) {
}
}
});
});
}
}
public/tamplateadmin/js/demo/chart-pie-demo.js
View file @
b6beb3c7
...
@@ -4,6 +4,7 @@ Chart.defaults.global.defaultFontColor = '#858796';
...
@@ -4,6 +4,7 @@ Chart.defaults.global.defaultFontColor = '#858796';
// Pie Chart Example
// Pie Chart Example
var
ctx
=
document
.
getElementById
(
"
myPieChart
"
);
var
ctx
=
document
.
getElementById
(
"
myPieChart
"
);
var
myPieChart
=
new
Chart
(
ctx
,
{
var
myPieChart
=
new
Chart
(
ctx
,
{
type
:
'
doughnut
'
,
type
:
'
doughnut
'
,
data
:
{
data
:
{
...
@@ -33,3 +34,44 @@ var myPieChart = new Chart(ctx, {
...
@@ -33,3 +34,44 @@ var myPieChart = new Chart(ctx, {
cutoutPercentage
:
80
,
cutoutPercentage
:
80
,
},
},
});
});
loadpoli
()
function
loadpoli
()
{
$
.
ajax
({
type
:
'
POST
'
,
dataType
:
'
json
'
,
url
:
baseURL
+
'
/api/loadRegisterpoli
'
,
success
:
function
(
result
)
{
if
(
result
[
'
code
'
]
==
0
)
{
//console.log (result);
var
res
=
result
[
'
data
'
];
optionseg
=
''
;
optionseg
+=
'
<option value="Pilih" disabled selected>Pilih</option>
'
;
for
(
var
i
=
0
;
i
<
res
.
length
;
i
++
)
{
optionseg
+=
'
<option value="
'
+
res
[
i
].
id_poli
+
'
">
'
+
res
[
i
].
nama_poli
+
'
</option>
'
;
}
$
(
"
select#poli
"
).
html
(
optionseg
);
}
else
{
bootbox
.
dialog
({
message
:
"
<span class='bigger-110'>
"
+
result
[
'
info
'
]
+
"
</span>
"
,
buttons
:
{
"
OK
"
:
{
"
label
"
:
"
<i class='icon-ok'></i> OK
"
,
"
className
"
:
"
btn-sm btn-danger
"
,
"
callback
"
:
function
()
{
notifyCancel
(
'
ERROR:
'
+
result
[
'
info
'
]
+
'
. Bila ada kesulitan dimohon untuk menghubungi Admin terkait
'
);
}
}
}
});
}
}
});
}
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