You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.8 KiB
JavaScript

$.ajax({
url: "{{PATH}}/api/data/simpanan",
method: "post",
dataType: "json",
data: {
ok: 1
}, success: function (res) {
_id('sp').innerHTML = res.sp.sp;
_id('pb').innerHTML = res.sp.pb;
_id('pj').innerHTML = res.pj.pinjaman;
_id('ag').innerHTML = res.pj.angsuran;
console.log(JSON.stringify(res.simpanan));
console.log(res.pinjaman);
}, error: function (e) {
console.log(e);
throw "error connection";
}
});
const colors = ['#0074D9', '#FF4136', '#2ECC40', '#FF851B', '#7FDBFF', '#F012BE', '#3D9970', '#111111', '#01FF70', '#AAAAAA'];
var colorDanger = "#FF1744";
var DonutBar1 = Morris.Donut({
element: 'monthly-sales',
resize: true,
colors: colors,
data: [
{ label: "SM", value: 0 },
]
});
AuditDevQuery(`
SELECT kodesp label, sum(if(dk='d',jumlah,jumlah*-1)) \`value\` FROM msimpan GROUP BY kodesp HAVING kodesp <> 'bw'[;]
SELECT label,sum(\`value\`) \`value\` FROM (
SELECT kodesp label, sum(pokok) \`value\` FROM mpinjam GROUP BY kodesp
UNION ALL
SELECT m.kodesp label, sum(mags.pokok * -1) \`value\` FROM mags
LEFT JOIN mpinjam m ON mags.fkt = m.faktur GROUP BY label HAVING \`value\` <> 0
) a GROUP BY a.label
`, function(q){
let [simpanan, pinjaman] = q;
DonutBar1.setData(simpanan);
DonutBar.setData(pinjaman);
})
var colorDanger = "#FF1744";
var DonutBar = Morris.Donut({
element: 'donut-example',
resize: true,
colors: [
'#E0F7FA',
'#B2EBF2',
'#80DEEA',
'#4DD0E1',
'#26C6DA',
'#00BCD4',
'#00ACC1',
'#0097A7',
'#00838F',
'#006064'
],
data: [
{ label: "REG", value: 0 },
]
});
setTimeout(function () {
DonutBar1.resizeHandler();
DonutBar.resizeHandler();
}, 1000);
var setV = 0;