Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 'getJumlahBarangRusakBerat':{
- foreach ($_REQUEST as $key => $value) {
- $$key = $value;
- }
- $arrKondisi = array();
- // $arrKondisiS=array();
- // $concatSKPD = base64_decode($concatSKPD);
- // $explodeKodeSKPD = explode(".",$kodeSKPD);
- // if(sizeof($explodeKodeSKPD) == 3){
- // $arrKondisiS[] = " c1 = '".$explodeKodeSKPD[0]."' and c = '".$explodeKodeSKPD[1]."' and d = '".$explodeKodeSKPD[2]."'";
- // }elseif(sizeof($explodeKodeSKPD) == 4){
- // $arrKondisiS[] = " c1 = '".$explodeKodeSKPD[0]."' and c = '".$explodeKodeSKPD[1]."' and d = '".$explodeKodeSKPD[2]."' and e = '".$explodeKodeSKPD[3]."'";
- // }elseif(sizeof($explodeKodeSKPD) == 5){
- // $arrKondisiS[] = " c1 = '".$explodeKodeSKPD[0]."' and c = '".$explodeKodeSKPD[1]."' and d = '".$explodeKodeSKPD[2]."' and e = '".$explodeKodeSKPD[3]."' and e1 = '".$explodeKodeSKPD[4]."'";
- // }
- //
- // $arrKondisiS[] = "status_barang not in(3)";
- // $dtsetting = mysql_fetch_array(mysql_query("select * from setting_inventaris order by thn_sensus DESC, Id DESC limit 0,1 "));
- //
- //
- // $arrKondisiS[] = "staset = 3";
- //
- //
- // if (!empty($dtsetting['thn_perolehan1']) && !empty($dtsetting['thn_perolehan2']) ) {
- // $arrKondisiS[] = " thn_perolehan >= '".$dtsetting['thn_perolehan1']."' and thn_perolehan <= '".$dtsetting['thn_perolehan2']."' ";
- // }else if (!empty($dtsetting['thn_perolehan1']) && empty($dtsetting['thn_perolehan2']) ) {
- // $arrKondisiS[] = " thn_perolehan >= '".$dtsetting['thn_perolehan1']."' ";
- // }else if (empty($dtsetting['thn_perolehan1']) && !empty($dtsetting['thn_perolehan2']) ) {
- // $arrKondisiS[] = " thn_perolehan <= '".$dtsetting['thn_perolehan2']."' ";
- // }
- //
- // $tahun_sensus = $dtsetting['thn_sensus'];
- //
- // $KondisiSetting= join(' and ',$arrKondisiS);
- // $KondisiSetting = $KondisiSetting =='' ? '':' and '.$KondisiSetting;
- $getSettingTahunInventaris = mysql_fetch_array(mysql_query("select * from setting where Id='THN_INVENTARIS'"));
- $getSettingInventaris = $this->sqlArray($this->sqlQuery("select * from setting_inventaris where thn_sensus = '".$getSettingTahunInventaris['nilai']."'"));
- $arrKondisi = array();
- // $KondisiSetting = $this->getKondisiSetting();
- // for($i=0;$i<sizeof($KondisiSetting);$i++){
- // $arrKondisi[] = $KondisiSetting[$i];
- // }
- $getKondisiSettingInventaris = $this->sqlArray($this->sqlQuery("select * from setting where Id ='STATUS_ASET'"));
- // $arrKondisi[] = " staset in (".$getKondisiSettingInventaris['nilai'].") ";
- $arrayKINT = array(
- '3' => "01.01.00",
- '5' => "01.02.01",
- '6' => "01.02.02",
- '7' => "01.02.03",
- '8' => "01.02.04",
- '9' => "01.02.05",
- '11' => "01.02.06",
- '12' => "01.02.06",
- '13' => "01.02.06",
- '14' => "01.02.07",
- // '5,6,7,8,9,11,12,13,14' => "01.00.00",
- '10' => "02.00.00",
- );
- $arrayKondisiKINT = array();
- $explodeStatusAset = explode(',',$getKondisiSettingInventaris['nilai']);
- for ($i=0; $i < sizeof($explodeStatusAset) ; $i++) {
- if (array_key_exists($explodeStatusAset[$i], $arrayKINT)) {
- $explodeKINT = explode(".",$arrayKINT[$explodeStatusAset[$i]]);
- if($explodeKINT[2] == '00'){
- $arrayKondisiKINT[] = "( kint = '".$explodeKINT[0]."' and ka = '".$explodeKINT[1]."' )";
- }else{
- $arrayKondisiKINT[] = "( kint = '".$explodeKINT[0]."' and ka = '".$explodeKINT[1]."' and kb = '".$explodeKINT[2]."' )";
- }
- }
- }
- $arrKondisi[] = "( ".implode(" or ",$arrayKondisiKINT)." )";
- $KondisiSetting= join(' and ',$arrKondisi);
- $KondisiSetting = $KondisiSetting =='' ? '':' and '.$KondisiSetting;
- $getVolumeRusakBerat =mysql_query( "select
- aa.id as idRusakBerat
- from buku_induk aa inner join inventaris bb on aa.id=bb.idbi
- $Kondisi $KondisiSetting and bb.kondisi=3");
- while ($dataRusakBerat = mysql_fetch_array($getVolumeRusakBerat)) {
- $arrayIdRusakBerat[] = $dataRusakBerat['idRusakBerat'];
- $jumlahBarangRusakBerat += 1;
- }
- $cek = "select aa.id as idRusakBerat from buku_induk aa inner join inventaris bb on aa.id=bb.idbi $Kondisi $KondisiSetting and bb.kondisi=3";
- $content = array(
- 'jumlahData' => $this->numberFormat($jumlahBarangRusakBerat),
- 'arrayIdRusakBerat' => json_encode($arrayIdRusakBerat),
- );
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement