initial commit
This commit is contained in:
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
|
||||
$(function () {
|
||||
// Admin Panel settings
|
||||
|
||||
//****************************
|
||||
/* This is for the mini-sidebar if width is less then 1170*/
|
||||
//****************************
|
||||
var setsidebartype = function () {
|
||||
var width =
|
||||
window.innerWidth > 0 ? window.innerWidth : this.screen.width;
|
||||
if (width < 1199) {
|
||||
$("#main-wrapper").attr("data-sidebartype", "mini-sidebar");
|
||||
$("#main-wrapper").addClass("mini-sidebar");
|
||||
} else {
|
||||
$("#main-wrapper").attr("data-sidebartype", "full");
|
||||
$("#main-wrapper").removeClass("mini-sidebar");
|
||||
}
|
||||
};
|
||||
$(window).ready(setsidebartype);
|
||||
$(window).on("resize", setsidebartype);
|
||||
//****************************
|
||||
/* This is for sidebartoggler*/
|
||||
//****************************
|
||||
$(".sidebartoggler").on("click", function () {
|
||||
$("#main-wrapper").toggleClass("mini-sidebar");
|
||||
if ($("#main-wrapper").hasClass("mini-sidebar")) {
|
||||
$(".sidebartoggler").prop("checked", !0);
|
||||
$("#main-wrapper").attr("data-sidebartype", "mini-sidebar");
|
||||
} else {
|
||||
$(".sidebartoggler").prop("checked", !1);
|
||||
$("#main-wrapper").attr("data-sidebartype", "full");
|
||||
}
|
||||
});
|
||||
$(".sidebartoggler").on("click", function () {
|
||||
$("#main-wrapper").toggleClass("show-sidebar");
|
||||
});
|
||||
})
|
||||
@@ -0,0 +1,244 @@
|
||||
$(function () {
|
||||
// Function to fetch data for users by role chart
|
||||
function fetchUsersByRoleData() {
|
||||
$.ajax({
|
||||
url: '/api/users-by-role-data',
|
||||
method: 'GET',
|
||||
success: function (response) {
|
||||
|
||||
// =====================================
|
||||
// Data Berdasarkan Role Pengguna
|
||||
// =====================================
|
||||
var users_by_role = {
|
||||
chart: {
|
||||
type: 'bar',
|
||||
height: 330,
|
||||
fontFamily: "'Plus Jakarta Sans', sans-serif",
|
||||
foreColor: "#ffffff",
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
horizontal: false,
|
||||
columnWidth: '55%',
|
||||
endingShape: 'rounded'
|
||||
},
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
colors: ['#000000']
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
show: true,
|
||||
width: 2,
|
||||
colors: ['transparent']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'Jumlah'
|
||||
}
|
||||
],
|
||||
xaxis: {
|
||||
categories: ['Administrator', 'Ahli bedah mulut', 'Dokter', 'Operator', 'Peneliti', 'Perawat'],
|
||||
},
|
||||
yaxis: {
|
||||
title: {
|
||||
text: 'Jumlah Pengguna',
|
||||
forceNiceScale: true,
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
opacity: 1,
|
||||
colors: ['#d2d8d7']
|
||||
},
|
||||
tooltip: {
|
||||
theme: "dark",
|
||||
fillSeriesColor: false,
|
||||
}
|
||||
};
|
||||
|
||||
// Update chart configuration with fetched data
|
||||
users_by_role.series[0].data = response.data.map(Number);
|
||||
|
||||
// Render chart
|
||||
var chart = new ApexCharts(document.querySelector("#users_by_role"), users_by_role);
|
||||
chart.render();
|
||||
|
||||
//var total_data_users_by_role = users_by_role.series[0].data[0] + users_by_role.series[0].data[1] + users_by_role.series[0].data[2] + users_by_role.series[0].data[3] + users_by_role.series[0].data[4];
|
||||
var total_data_users_by_role = response.data.reduce((total, current) => total + Number(current), 0);
|
||||
document.querySelector("#total_data_users_by_role").textContent = total_data_users_by_role;
|
||||
},
|
||||
error: function (error) {
|
||||
console.error('Error fetching users by role data:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Function to fetch data for jenis terapi chart
|
||||
function fetchDataJenisTerapi() {
|
||||
$.ajax({
|
||||
url: '/api/data-jenis-terapi',
|
||||
method: 'GET',
|
||||
success: function (response) {
|
||||
|
||||
// =====================================
|
||||
// Data Jenis Terapi
|
||||
// =====================================
|
||||
var data_jenis_terapi = {
|
||||
color: "#adb5bd",
|
||||
labels: ["Gnatoplasty", "Labioplasty", "Palatoplasty"],
|
||||
chart: {
|
||||
width: 180,
|
||||
type: "donut", // Mengubah tipe chart menjadi donut
|
||||
fontFamily: "'Plus Jakarta Sans', sans-serif",
|
||||
foreColor: "#ffffff",
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
startAngle: 0,
|
||||
endAngle: 360,
|
||||
expandOnClick: false,
|
||||
},
|
||||
donut: { // Menambahkan plotOptions untuk donut
|
||||
size: '65%', // Ukuran bagian donut relatif terhadap pie (dalam persen)
|
||||
labels: {
|
||||
show: true,
|
||||
name: {
|
||||
offsetY: 15,
|
||||
},
|
||||
value: {
|
||||
offsetY: -15,
|
||||
formatter: function (val) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
show: false,
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
},
|
||||
legend: {
|
||||
show: false,
|
||||
},
|
||||
colors: ["#ffb234", "#ffcf8f", "#ff9764"],
|
||||
responsive: [{
|
||||
breakpoint: 991,
|
||||
options: {
|
||||
chart: {
|
||||
width: 150,
|
||||
},
|
||||
},
|
||||
}],
|
||||
tooltip: {
|
||||
theme: "dark",
|
||||
fillSeriesColor: false,
|
||||
},
|
||||
};
|
||||
|
||||
// Update chart configuration with fetched data
|
||||
data_jenis_terapi.series = response.data.map(Number);
|
||||
|
||||
var chart = new ApexCharts(document.querySelector("#data_jenis_terapi"), data_jenis_terapi);
|
||||
chart.render();
|
||||
|
||||
var labioplastyValue = data_jenis_terapi.series[1];
|
||||
document.querySelector("#labioplastyValue").textContent = labioplastyValue;
|
||||
var palatoplastyValue = data_jenis_terapi.series[2];
|
||||
document.querySelector("#palatoplastyValue").textContent = palatoplastyValue;
|
||||
var gnatoplastyValue = data_jenis_terapi.series[0];
|
||||
document.querySelector("#gnatoplastyValue").textContent = gnatoplastyValue;
|
||||
|
||||
//var total_data_jenis_terapi = data_jenis_terapi.series[0] + data_jenis_terapi.series[1] + data_jenis_terapi.series[2];
|
||||
var total_data_jenis_terapi = data_jenis_terapi.series.reduce((total, current) => total + current, 0);
|
||||
document.querySelector("#total_data_jenis_terapi").textContent = total_data_jenis_terapi;
|
||||
},
|
||||
error: function (error) {
|
||||
console.error('Error fetching jenis terapi data:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Function to fetch data for jenis kelamin chart
|
||||
function fetchDataJenisKelamin() {
|
||||
$.ajax({
|
||||
url: '/api/data-jenis-kelamin',
|
||||
method: 'GET',
|
||||
success: function (response) {
|
||||
|
||||
// =====================================
|
||||
// Data Jenis Kelamin
|
||||
// =====================================
|
||||
var data_jenis_kelamin = {
|
||||
color: "#adb5bd",
|
||||
series: [33, 24],
|
||||
labels: ["Laki-Laki", "Perempuan"],
|
||||
chart: {
|
||||
width: 180,
|
||||
type: "pie",
|
||||
fontFamily: "'Plus Jakarta Sans', sans-serif",
|
||||
foreColor: "#ffffff",
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
startAngle: 0,
|
||||
endAngle: 360,
|
||||
expandOnClick: false,
|
||||
},
|
||||
},
|
||||
stroke: {
|
||||
show: false,
|
||||
},
|
||||
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
},
|
||||
|
||||
legend: {
|
||||
show: false,
|
||||
},
|
||||
colors: ["#4693ff", "#e680ff"],
|
||||
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 991,
|
||||
options: {
|
||||
chart: {
|
||||
width: 150,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
tooltip: {
|
||||
theme: "dark",
|
||||
fillSeriesColor: false,
|
||||
},
|
||||
};
|
||||
// Update chart configuration with fetched data
|
||||
data_jenis_kelamin.series = response.data.map(Number);
|
||||
var chart = new ApexCharts(document.querySelector("#data_jenis_kelamin"), data_jenis_kelamin);
|
||||
chart.render();
|
||||
|
||||
var maleValue = data_jenis_kelamin.series[0];
|
||||
document.querySelector("#maleValue").textContent = maleValue;
|
||||
var femaleValue = data_jenis_kelamin.series[1];
|
||||
document.querySelector("#femaleValue").textContent = femaleValue;
|
||||
//var total_data_jenis_kelamin = data_jenis_kelamin.series[0] + data_jenis_kelamin.series[1];
|
||||
var total_data_jenis_kelamin = data_jenis_kelamin.series.reduce((total, current) => total + current, 0);
|
||||
document.querySelector("#total_data_jenis_kelamin").textContent = total_data_jenis_kelamin;
|
||||
},
|
||||
error: function (error) {
|
||||
console.error('Error fetching jenis kelamin data:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Call the functions to fetch data initially
|
||||
fetchUsersByRoleData();
|
||||
fetchDataJenisTerapi();
|
||||
fetchDataJenisKelamin();
|
||||
});
|
||||
@@ -0,0 +1,165 @@
|
||||
$(function () {
|
||||
|
||||
// =====================================
|
||||
// Data Berdasarkan Role Pengguna
|
||||
// =====================================
|
||||
var users_by_role = {
|
||||
chart: {
|
||||
type: 'bar',
|
||||
height: 330,
|
||||
fontFamily: "'Plus Jakarta Sans', sans-serif",
|
||||
foreColor: "#ffffff",
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
horizontal: false,
|
||||
columnWidth: '55%',
|
||||
endingShape: 'rounded'
|
||||
},
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
colors: ['#000000']
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
show: true,
|
||||
width: 2,
|
||||
colors: ['transparent']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'Jumlah',
|
||||
data: [23, 46, 11, 8, 3]
|
||||
}
|
||||
],
|
||||
xaxis: {
|
||||
categories: ['Dokter', 'Perawat', 'Ahli bedah mulut', 'Peneliti', 'Operator'],
|
||||
},
|
||||
yaxis: {
|
||||
title: {
|
||||
text: 'Jumlah Pengguna'
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
opacity: 1,
|
||||
colors: ['#abf7f7']
|
||||
},
|
||||
tooltip: {
|
||||
theme: "dark",
|
||||
fillSeriesColor: false,
|
||||
}
|
||||
};
|
||||
|
||||
// Render chart
|
||||
var chart = new ApexCharts(document.querySelector("#users_by_role"), users_by_role);
|
||||
chart.render();
|
||||
|
||||
|
||||
// =====================================
|
||||
// Data Jenis Terapi
|
||||
// =====================================
|
||||
var data_jenis_terapi = {
|
||||
color: "#adb5bd",
|
||||
series: [7, 67, 123],
|
||||
labels: ["Labioplasty", "Palatoplasty", "Gnatoplasty"],
|
||||
chart: {
|
||||
width: 180,
|
||||
type: "pie",
|
||||
fontFamily: "'Plus Jakarta Sans', sans-serif",
|
||||
foreColor: "#ffffff",
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
startAngle: 0,
|
||||
endAngle: 360,
|
||||
expandOnClick: false,
|
||||
},
|
||||
},
|
||||
stroke: {
|
||||
show: false,
|
||||
},
|
||||
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
},
|
||||
|
||||
legend: {
|
||||
show: false,
|
||||
},
|
||||
colors: ["#f30404", "#f38004", "#f3b304"],
|
||||
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 991,
|
||||
options: {
|
||||
chart: {
|
||||
width: 150,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
tooltip: {
|
||||
theme: "dark",
|
||||
fillSeriesColor: false,
|
||||
},
|
||||
};
|
||||
|
||||
var chart = new ApexCharts(document.querySelector("#data_jenis_terapi"), data_jenis_terapi);
|
||||
chart.render();
|
||||
|
||||
|
||||
// =====================================
|
||||
// Data Jenis Kelamin
|
||||
// =====================================
|
||||
var data_jenis_kelamin = {
|
||||
color: "#adb5bd",
|
||||
series: [33, 24],
|
||||
labels: ["Laki-Laki", "Perempuan"],
|
||||
chart: {
|
||||
width: 180,
|
||||
type: "pie",
|
||||
fontFamily: "'Plus Jakarta Sans', sans-serif",
|
||||
foreColor: "#ffffff",
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
startAngle: 0,
|
||||
endAngle: 360,
|
||||
expandOnClick: false,
|
||||
},
|
||||
},
|
||||
stroke: {
|
||||
show: false,
|
||||
},
|
||||
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
},
|
||||
|
||||
legend: {
|
||||
show: false,
|
||||
},
|
||||
colors: ["#4693ff", "#e680ff"],
|
||||
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 991,
|
||||
options: {
|
||||
chart: {
|
||||
width: 150,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
tooltip: {
|
||||
theme: "dark",
|
||||
fillSeriesColor: false,
|
||||
},
|
||||
};
|
||||
|
||||
var chart = new ApexCharts(document.querySelector("#data_jenis_kelamin"), data_jenis_kelamin);
|
||||
chart.render();
|
||||
|
||||
})
|
||||
@@ -0,0 +1,13 @@
|
||||
$(function() {
|
||||
$("#price-range").slider({
|
||||
range: "max",
|
||||
min: 0.5, // Change this to change the min value
|
||||
max: 35, // Change this to change the max value
|
||||
value: 4, // Change this to change the display value
|
||||
step: .5, // Change this to change the increment by value.
|
||||
slide: function(event, ui) {
|
||||
$("#priceRange").val(ui.value + " years");
|
||||
}
|
||||
});
|
||||
$("#priceRange").val( $("#price-range").slider("value") + " years");
|
||||
});
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
Template Name: Admin Template
|
||||
Author: Wrappixel
|
||||
|
||||
File: js
|
||||
*/
|
||||
// ==============================================================
|
||||
// Auto select left navbar
|
||||
// ==============================================================
|
||||
$(function () {
|
||||
"use strict";
|
||||
var url = window.location + "";
|
||||
var path = url.replace(
|
||||
window.location.protocol + "//" + window.location.host + "/",
|
||||
""
|
||||
);
|
||||
var element = $("ul#sidebarnav a").filter(function () {
|
||||
return this.href === url || this.href === path; // || url.href.indexOf(this.href) === 0;
|
||||
});
|
||||
element.parentsUntil(".sidebar-nav").each(function (index) {
|
||||
if ($(this).is("li") && $(this).children("a").length !== 0) {
|
||||
$(this).children("a").addClass("active");
|
||||
$(this).parent("ul#sidebarnav").length === 0
|
||||
? $(this).addClass("active")
|
||||
: $(this).addClass("selected");
|
||||
} else if (!$(this).is("ul") && $(this).children("a").length === 0) {
|
||||
$(this).addClass("selected");
|
||||
} else if ($(this).is("ul")) {
|
||||
$(this).addClass("in");
|
||||
}
|
||||
});
|
||||
|
||||
element.addClass("active");
|
||||
$("#sidebarnav a").on("click", function (e) {
|
||||
if (!$(this).hasClass("active")) {
|
||||
// hide any open menus and remove all other classes
|
||||
$("ul", $(this).parents("ul:first")).removeClass("in");
|
||||
$("a", $(this).parents("ul:first")).removeClass("active");
|
||||
|
||||
// open our new menu and add the open class
|
||||
$(this).next("ul").addClass("in");
|
||||
$(this).addClass("active");
|
||||
} else if ($(this).hasClass("active")) {
|
||||
$(this).removeClass("active");
|
||||
$(this).parents("ul:first").removeClass("active");
|
||||
$(this).next("ul").removeClass("in");
|
||||
}
|
||||
});
|
||||
$("#sidebarnav >li >a.has-arrow").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user