Query("SELECT SUM(Rupiah) Pagu FROM mus_usulan_desa WHERE Tahun='".$_SESSION['__WEB_APP']['RENC_THN']."' AND KecID IN (".$_SESSION['__WEB_USER']['AK_KEC'].")"); if ($db->Next()) $tot_pagu = $db->Row("Pagu"); $db->Query("SELECT L.K_Lokasi K_Kec,L.N_Lokasi N_Kec,U.Pagu FROM (SELECT KelID,SUM(Rupiah) Pagu FROM mus_usulan_desa WHERE Tahun='".$_SESSION['__WEB_APP']['RENC_THN']."' AND KecID IN (".$_SESSION['__WEB_USER']['AK_KEC'].") GROUP BY KelID) U LEFT JOIN para_lokasi L ON (L.LokasiID=U.KelID) ORDER BY L.K_Lokasi"); } else { $tot_pagu = 0; $db->Query("SELECT SUM(Rupiah) Pagu FROM mus_usulan_desa WHERE Tahun='".$_SESSION['__WEB_APP']['RENC_THN']."'"); if ($db->Next()) $tot_pagu = $db->Row("Pagu"); $db->Query("SELECT L.K_Lokasi K_Kec,L.N_Lokasi N_Kec,U.Pagu FROM (SELECT KecID,SUM(Rupiah) Pagu FROM mus_usulan_desa WHERE Tahun='".$_SESSION['__WEB_APP']['RENC_THN']."' GROUP BY KecID) U LEFT JOIN para_lokasi L ON (L.LokasiID=U.KecID) ORDER BY L.K_Lokasi"); } } if ( $data == "pagu-info" ) { $pagu_info = '

Rekapitulasi Usulan Musrenbang '.$_SESSION['__WEB_APP']['RENC_THN'].'

'; $pagu_info .= ''; $pagu_info .= ''; while ($db->Next()){ $pagu_info .= sprintf('', $db->Row("N_Kec"), rupiah2($db->Row("Pagu"))); } $pagu_info .= '
'.($_SESSION['__WEB_USER']['Level']==7?"Indikator":($_SESSION['__WEB_USER']['Level']==2?"Kelurahan / Desa":"Kecamatan")).'Total Anggaran
%s%s
'; $ajson['html'] = $pagu_info; } else if ( $data == "pagu-chart" ) { $ajson['datasets'] = array(); $ajson['labels'] = array(); $atmp = array(); $acol = array(); $atmp[] = 100; $col_r = mt_rand( 0, 255 ); $col_g = mt_rand( 0, 255 ); $col_b = mt_rand( 0, 255 ); $acol[] = "rgb(".$col_r.",".$col_g.",".$col_b.")"; $ajson['labels'][] = "Belum Ada Usulan"; if ($db->RecordCount()>0) { $atmp = array(); $acol = array(); $ajson['labels'] = array(); } while ($db->Next()){ $atmp[] = round($db->Row("Pagu") / $tot_pagu * 100, 2); $col_r = mt_rand( 0, 255 ); $col_g = mt_rand( 0, 255 ); $col_b = mt_rand( 0, 255 ); $acol[] = "rgb(".$col_r.",".$col_g.",".$col_b.")"; $ajson['labels'][] = $db->Row("N_Kec"); } $ajson['datasets'][] = array('data'=>$atmp, 'backgroundColor'=>$acol); } else if ( $data == "default" ) { $aapp = $_SESSION['__WEB_APP']; $ajson['content'] = '

'.$aapp['REG_ADDRESS'].'
'.$aapp['REG_CITY'].' '.$aapp['REG_POSTCODE'].'

Register ID : '.Register::reg_id().'

'.$aapp['APP_NAMES'].'
'.$aapp['APP_NAME'].' Ver. '.$aapp['APP_VER'].'
Updated : '.$aapp['APP_UPDATED'].'

'; } send_json($ajson); ?>