Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
queue
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
5
Merge Requests
5
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
Indra Raja
queue
Commits
1c83ab30
Commit
1c83ab30
authored
Oct 23, 2020
by
Azy Mushofy Anwary
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dashboard
parent
0d0c8e8f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
152 additions
and
61 deletions
+152
-61
module/Application/src/Controller/ApiController.php
module/Application/src/Controller/ApiController.php
+2
-2
module/Application/src/Model/Param.php
module/Application/src/Model/Param.php
+2
-2
module/Application/src/Model/Param/Storage/Mysql.php
module/Application/src/Model/Param/Storage/Mysql.php
+7
-3
module/Application/view/application/admin/dasboard.phtml
module/Application/view/application/admin/dasboard.phtml
+18
-14
public/tamplateadmin/js/demo/chart-pie-demo.js
public/tamplateadmin/js/demo/chart-pie-demo.js
+123
-40
No files found.
module/Application/src/Controller/ApiController.php
View file @
1c83ab30
...
@@ -1984,7 +1984,7 @@ class ApiController extends \Application\Master\GlobalActionController {
...
@@ -1984,7 +1984,7 @@ class ApiController extends \Application\Master\GlobalActionController {
return
$this
->
getOutput
(
$result
->
toJson
());
return
$this
->
getOutput
(
$result
->
toJson
());
}
}
public
function
load
totalantrian
Action
(){
public
function
load
Chart
Action
(){
$result
=
new
Result
();
$result
=
new
Result
();
$request
=
$this
->
getRequest
();
$request
=
$this
->
getRequest
();
$post
=
$request
->
getPost
();
$post
=
$request
->
getPost
();
...
@@ -1996,7 +1996,7 @@ class ApiController extends \Application\Master\GlobalActionController {
...
@@ -1996,7 +1996,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$load
=
$test
->
load
totalantrian
(
);
$load
=
$test
->
load
Chart
(
$post
->
id
);
// print_r($load);die;
// print_r($load);die;
if
(
$load
->
code
==
0
){
if
(
$load
->
code
==
0
){
...
...
module/Application/src/Model/Param.php
View file @
1c83ab30
...
@@ -175,8 +175,8 @@ class Param extends Mapper {
...
@@ -175,8 +175,8 @@ class Param extends Mapper {
$data
=
$this
->
_storage
->
loadterlayani
();
$data
=
$this
->
_storage
->
loadterlayani
();
return
$data
;
return
$data
;
}
}
public
function
load
totalantrian
(
){
public
function
load
Chart
(
$id
=
null
){
$data
=
$this
->
_storage
->
load
totalantrian
(
);
$data
=
$this
->
_storage
->
load
Chart
(
$id
);
return
$data
;
return
$data
;
}
}
public
function
tampilpoli
(
$id
=
null
){
public
function
tampilpoli
(
$id
=
null
){
...
...
module/Application/src/Model/Param/Storage/Mysql.php
View file @
1c83ab30
...
@@ -514,11 +514,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
...
@@ -514,11 +514,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
}
return
$result
;
return
$result
;
}
}
public
function
load
totalantrian
(
){
public
function
load
Chart
(
$id
){
$result
=
new
Result
();
$result
=
new
Result
();
try
{
try
{
$sql
=
" SELECT count(id_dokter) FROM antrian_pasien "
;
$sql
=
" SELECT dp.id_dokter, dp.nama_dokter,ap.id_dokter, count (ap.id_dokter) as total from antrian_pasien ap, dokter_to_poli dp
WHERE ap.id_poli =
$id
and dp.id_dokter = ap.id_dokter
GROUP BY dp.id_dokter, ap.id_dokter "
;
// print_r($sql);die;
// print_r($sql);die;
...
@@ -794,7 +797,8 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
...
@@ -794,7 +797,8 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result
=
new
Result
();
$result
=
new
Result
();
try
{
try
{
$sql
=
" SELECT * FROM poli"
;
$sql
=
" SELECT * FROM poli"
;
...
...
module/Application/view/application/admin/dasboard.phtml
View file @
1c83ab30
...
@@ -80,31 +80,35 @@
...
@@ -80,31 +80,35 @@
<!-- Content Row -->
<!-- Content Row -->
<div
class=
"row"
>
<div
class=
"row
justify-content-center
"
>
<!-- Pie Chart -->
<!-- Pie Chart -->
<div
class=
"col-xl-4 col-lg-5"
>
<div
class=
"col-xl-4 col-lg-5"
>
<div
class=
"card shadow mb-4"
>
<div
class=
"card shadow mb-4"
>
<!-- Card Header - Dropdown -->
<!-- Card Header - Dropdown -->
<div
class=
"card-header py-3 d-flex flex-row align-items-center justify-content-between"
>
<div
class=
"card-header py-3 d-flex flex-row align-items-center justify-content-between"
>
<h6
class=
"m-0 font-weight-bold text-primary"
>
Revenue Sources
</h6>
<h6
class=
"m-0 font-weight-bold text-primary"
>
Jumlah Antrian
</h6>
<div
class=
"dropdown no-arrow"
>
<a
class=
"dropdown-toggle"
href=
"#"
role=
"button"
id=
"dropdownMenuLink"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
<i
class=
"fas fa-ellipsis-v fa-sm fa-fw text-gray-400"
></i>
</a>
<div
id=
"poli"
class=
"dropdown-menu dropdown-menu-right shadow animated--fade-in"
aria-labelledby=
"dropdownMenuLink"
>
</div>
</div>
</div>
</div>
<!-- Card Body -->
<!-- Card Body -->
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<div
class=
"chart-pie pt-4 pb-2"
>
<div
class=
"chart-pie pt-4 pb-2"
>
<canvas
id=
"myPieChart"
></canvas>
<canvas
id=
"myPieChart"
></canvas>
</div>
</div>
<div
class=
"mt-4 text-center small"
>
<div
id=
"nama_dokter"
class=
"mt-4 text-center small"
>
<span
class=
"mr-2"
>
<i
class=
"fas fa-circle text-primary"
></i>
Direct
</span>
<span
class=
"mr-2"
>
<i
class=
"fas fa-circle text-success"
></i>
Social
</span>
<span
class=
"mr-2"
>
<i
class=
"fas fa-circle text-info"
></i>
Referral
</span>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -116,7 +120,7 @@
...
@@ -116,7 +120,7 @@
>
</div>
</div>
</div>
</div>
...
...
public/tamplateadmin/js/demo/chart-pie-demo.js
View file @
1c83ab30
...
@@ -2,58 +2,141 @@
...
@@ -2,58 +2,141 @@
Chart
.
defaults
.
global
.
defaultFontFamily
=
'
Nunito
'
,
'
-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif
'
;
Chart
.
defaults
.
global
.
defaultFontFamily
=
'
Nunito
'
,
'
-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif
'
;
Chart
.
defaults
.
global
.
defaultFontColor
=
'
#858796
'
;
Chart
.
defaults
.
global
.
defaultFontColor
=
'
#858796
'
;
// Pie Chart Example
// Pie Chart Exampl
// var ctx = document.getElementById("myPieChart");
loadpoli
()
// var myPieChart = new Chart(ctx, {
function
loadpoli
()
{
// type: 'doughnut',
// data: {
// labels: ["Direct", "Referral", "Social"],
// datasets: [{
// data: [55, 30, 15],
// backgroundColor: ['#4e73df', '#1cc88a', '#36b9cc'],
// hoverBackgroundColor: ['#2e59d9', '#17a673', '#2c9faf'],
// hoverBorderColor: "rgba(234, 236, 244, 1)",
// }],
// },
// options: {
// maintainAspectRatio: false,
// tooltips: {
// backgroundColor: "rgb(255,255,255)",
// bodyFontColor: "#858796",
// borderColor: '#dddfeb',
// borderWidth: 1,
// xPadding: 15,
// yPadding: 15,
// displayColors: false,
// caretPadding: 10,
// },
// legend: {
// display: false
// },
// cutoutPercentage: 80,
// },
// });
jumlahantrian
()
function
jumlahantrian
()
{
var
id
=
document
.
getElementById
(
"
myPieChart
"
);
$
.
ajax
({
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
dataType
:
'
json
'
,
url
:
baseURL
+
'
/api/loadtotalantrian
'
,
url
:
baseURL
+
'
/api/loadRegisterPoli
'
,
success
:
function
(
result
)
{
if
(
result
.
code
==
0
)
{
let
data
=
result
.
data
;
y
=
'
<div class="dropdown-header">Poli</div>
'
;
for
(
x
in
data
)
{
// console.log(data[x]['nama_poli']);
y
+=
` <a onclick="loadChart(`
+
data
[
x
][
'
id_poli
'
]
+
`)" class="dropdown-item">`
+
data
[
x
][
'
nama_poli
'
]
+
`</a>`
;
}
$
(
"
#poli
"
).
append
(
y
);
}
else
{
alert
(
result
.
info
);
}
},
error
:
function
(
xhr
)
{
alert
(
xhr
.
status
+
'
-
'
+
xhr
.
statusText
);
}
});
}
$
(
document
).
ready
(
function
()
{
loadChart
(
9
)
});
function
loadChart
(
id
)
{
$
.
ajax
({
type
:
'
POST
'
,
dataType
:
'
json
'
,
url
:
baseURL
+
'
/api/loadChart
'
,
data
:
{
id
:
id
,
},
success
:
function
(
result
)
{
success
:
function
(
result
)
{
console
.
log
(
result
)
console
.
log
(
result
)
}
var
data
=
[];
var
label
=
[];
var
data1
=
result
.
data
var
nama_dokter
=
''
;
var
colour
=
[
'
primary
'
,
'
success
'
,
'
info
'
,
'
danger
'
,
'
secondary
'
];
});
if
(
result
.
code
==
0
)
{
for
(
x
in
data1
)
{
data
.
push
(
data1
[
x
].
total
);
label
.
push
(
data1
[
x
].
nama_dokter
)
}
$
(
'
#nama_dokter
'
).
empty
();
$
(
'
#myPieChart
'
).
empty
();
for
(
x
in
label
)
{
nama_dokter
+=
'
<span class="mr-2"> <i class="fas fa-circle text-
'
+
colour
[
x
]
+
'
"></i>
'
+
label
[
x
]
+
'
</span>
'
;
}
$
(
'
#nama_dokter
'
).
append
(
nama_dokter
)
// console.log(data)
var
ctx
=
document
.
getElementById
(
"
myPieChart
"
);
var
myPieChart
=
new
Chart
(
ctx
,
{
type
:
'
doughnut
'
,
data
:
{
labels
:
label
,
datasets
:
[{
data
:
data
,
backgroundColor
:
[
'
#4e73df
'
,
'
#1cc88a
'
,
'
#36b9cc
'
,
'
#dc3545
'
,
'
#6c757d
'
],
hoverBackgroundColor
:
[
'
#2e59d9
'
,
'
#17a673
'
,
'
#2c9faf
'
,
'
#a60d1c
'
,
'
#444a4f
'
],
hoverBorderColor
:
"
rgba(234, 236, 244, 1)
"
,
}],
},
options
:
{
maintainAspectRatio
:
false
,
tooltips
:
{
backgroundColor
:
"
rgb(255,255,255)
"
,
bodyFontColor
:
"
#858796
"
,
borderColor
:
'
#dddfeb
'
,
borderWidth
:
1
,
xPadding
:
15
,
yPadding
:
15
,
displayColors
:
false
,
caretPadding
:
10
,
},
legend
:
{
display
:
false
},
cutoutPercentage
:
80
,
},
});
}
else
{
var
ctx
=
document
.
getElementById
(
"
myPieChart
"
);
$
(
'
#nama_dokter
'
).
empty
();
var
myPieChart
=
new
Chart
(
ctx
,
{
type
:
'
doughnut
'
,
data
:
{
labels
:
null
,
data
:
null
,
},
});
bootbox
.
alert
({
message
:
'
Data Kosong
'
,
centerVertical
:
true
});
}
},
error
:
function
(
xhr
)
{
if
(
xhr
.
status
!=
200
)
{
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
}
else
{
alert
(
'
gagal error
'
);
}
}
});
}
}
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