Esempio n. 1
0
 $admin = new Admin();
 //if($objForm->getPost("dafcabang")!='cashflow'){
 //    $nmcabang = $objCabang->getNama($objForm->getPost("dafcabang"))?$objCabang->getNama($objForm->getPost("dafcabang")):"Semua Cabang";
 //}
 switch ($objForm->getPost('form')) {
     case 'penjualan':
         //Penjualan
         //$tglAwal = Helper::dateToMySqlSystem($objForm->getPost('tglawaljual'));
         //$tglAkhir = Helper::dateToMySqlSystem($objForm->getPost('tglakhirjual'));
         $group = $objForm->getPost("group_by");
         //$dir=$objForm->getPost("direction");
         $direction = $objForm->getPost("direction") ?: "DESC";
         $objPenjualan->_cabang = $objForm->getPost('dafcabang');
         $objPenjualan->_startDate = Helper::dateToMySqlSystem($objForm->getPost("tglawaljual"));
         $objPenjualan->_endDate = Helper::dateToMySqlSystem($objForm->getPost("tglakhirjual"));
         $listPenjualan = $objPenjualan->getDataByGroup($group, $direction);
         $nmcabang = $objCabang->getNama($objForm->getPost("dafcabang"));
         break;
     case 'pembelian':
         //Pembelian
         $group = $objForm->getPost("group_by");
         $dir = $objForm->getPost("direction");
         $direction = isset($_POST['direction']) ? $dir : "DESC";
         $objPembelian->_cabang = $objForm->getPost('dafcabang');
         $objPembelian->_startDate = Helper::dateToMySqlSystem($objForm->getPost("tglawalbeli"));
         $objPembelian->_endDate = Helper::dateToMySqlSystem($objForm->getPost("tglakhirbeli"));
         $listPembelian = $objPembelian->getDataByGroup($group, $direction);
         $nmcabang = $objCabang->getNama($objForm->getPost("dafcabang"));
         break;
     case 'labarugi':
         $tglAwal = Helper::dateToMySqlSystem($objForm->getPost('tglawaljual'));