Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. case 'getJumlahBarangRusakBerat':{
  2. foreach ($_REQUEST as $key => $value) {
  3. $$key = $value;
  4. }
  5. $arrKondisi = array();
  6.  
  7. // $arrKondisiS=array();
  8. // $concatSKPD = base64_decode($concatSKPD);
  9. // $explodeKodeSKPD = explode(".",$kodeSKPD);
  10. // if(sizeof($explodeKodeSKPD) == 3){
  11. // $arrKondisiS[] = " c1 = '".$explodeKodeSKPD[0]."' and c = '".$explodeKodeSKPD[1]."' and d = '".$explodeKodeSKPD[2]."'";
  12. // }elseif(sizeof($explodeKodeSKPD) == 4){
  13. // $arrKondisiS[] = " c1 = '".$explodeKodeSKPD[0]."' and c = '".$explodeKodeSKPD[1]."' and d = '".$explodeKodeSKPD[2]."' and e = '".$explodeKodeSKPD[3]."'";
  14. // }elseif(sizeof($explodeKodeSKPD) == 5){
  15. // $arrKondisiS[] = " c1 = '".$explodeKodeSKPD[0]."' and c = '".$explodeKodeSKPD[1]."' and d = '".$explodeKodeSKPD[2]."' and e = '".$explodeKodeSKPD[3]."' and e1 = '".$explodeKodeSKPD[4]."'";
  16. // }
  17. //
  18. // $arrKondisiS[] = "status_barang not in(3)";
  19. // $dtsetting = mysql_fetch_array(mysql_query("select * from setting_inventaris order by thn_sensus DESC, Id DESC limit 0,1 "));
  20. //
  21. //
  22. // $arrKondisiS[] = "staset = 3";
  23. //
  24. //
  25. // if (!empty($dtsetting['thn_perolehan1']) && !empty($dtsetting['thn_perolehan2']) ) {
  26. // $arrKondisiS[] = " thn_perolehan >= '".$dtsetting['thn_perolehan1']."' and thn_perolehan <= '".$dtsetting['thn_perolehan2']."' ";
  27. // }else if (!empty($dtsetting['thn_perolehan1']) && empty($dtsetting['thn_perolehan2']) ) {
  28. // $arrKondisiS[] = " thn_perolehan >= '".$dtsetting['thn_perolehan1']."' ";
  29. // }else if (empty($dtsetting['thn_perolehan1']) && !empty($dtsetting['thn_perolehan2']) ) {
  30. // $arrKondisiS[] = " thn_perolehan <= '".$dtsetting['thn_perolehan2']."' ";
  31. // }
  32. //
  33. // $tahun_sensus = $dtsetting['thn_sensus'];
  34. //
  35. // $KondisiSetting= join(' and ',$arrKondisiS);
  36. // $KondisiSetting = $KondisiSetting =='' ? '':' and '.$KondisiSetting;
  37.  
  38. $getSettingTahunInventaris = mysql_fetch_array(mysql_query("select * from setting where Id='THN_INVENTARIS'"));
  39. $getSettingInventaris = $this->sqlArray($this->sqlQuery("select * from setting_inventaris where thn_sensus = '".$getSettingTahunInventaris['nilai']."'"));
  40. $arrKondisi = array();
  41. // $KondisiSetting = $this->getKondisiSetting();
  42. // for($i=0;$i<sizeof($KondisiSetting);$i++){
  43. // $arrKondisi[] = $KondisiSetting[$i];
  44. // }
  45. $getKondisiSettingInventaris = $this->sqlArray($this->sqlQuery("select * from setting where Id ='STATUS_ASET'"));
  46. // $arrKondisi[] = " staset in (".$getKondisiSettingInventaris['nilai'].") ";
  47. $arrayKINT = array(
  48. '3' => "01.01.00",
  49. '5' => "01.02.01",
  50. '6' => "01.02.02",
  51. '7' => "01.02.03",
  52. '8' => "01.02.04",
  53. '9' => "01.02.05",
  54. '11' => "01.02.06",
  55. '12' => "01.02.06",
  56. '13' => "01.02.06",
  57. '14' => "01.02.07",
  58. // '5,6,7,8,9,11,12,13,14' => "01.00.00",
  59. '10' => "02.00.00",
  60. );
  61.  
  62. $arrayKondisiKINT = array();
  63. $explodeStatusAset = explode(',',$getKondisiSettingInventaris['nilai']);
  64. for ($i=0; $i < sizeof($explodeStatusAset) ; $i++) {
  65. if (array_key_exists($explodeStatusAset[$i], $arrayKINT)) {
  66. $explodeKINT = explode(".",$arrayKINT[$explodeStatusAset[$i]]);
  67. if($explodeKINT[2] == '00'){
  68. $arrayKondisiKINT[] = "( kint = '".$explodeKINT[0]."' and ka = '".$explodeKINT[1]."' )";
  69. }else{
  70. $arrayKondisiKINT[] = "( kint = '".$explodeKINT[0]."' and ka = '".$explodeKINT[1]."' and kb = '".$explodeKINT[2]."' )";
  71. }
  72. }
  73. }
  74. $arrKondisi[] = "( ".implode(" or ",$arrayKondisiKINT)." )";
  75.  
  76. $KondisiSetting= join(' and ',$arrKondisi);
  77. $KondisiSetting = $KondisiSetting =='' ? '':' and '.$KondisiSetting;
  78.  
  79.  
  80. $getVolumeRusakBerat =mysql_query( "select
  81. aa.id as idRusakBerat
  82. from buku_induk aa inner join inventaris bb on aa.id=bb.idbi
  83. $Kondisi $KondisiSetting and bb.kondisi=3");
  84. while ($dataRusakBerat = mysql_fetch_array($getVolumeRusakBerat)) {
  85. $arrayIdRusakBerat[] = $dataRusakBerat['idRusakBerat'];
  86. $jumlahBarangRusakBerat += 1;
  87. }
  88.  
  89.  
  90. $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";
  91.  
  92. $content = array(
  93. 'jumlahData' => $this->numberFormat($jumlahBarangRusakBerat),
  94. 'arrayIdRusakBerat' => json_encode($arrayIdRusakBerat),
  95. );
  96.  
  97. break;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement