예제 #1
0
 public function actionIndex()
 {
     $modelForm = new CetakLabelRakForm();
     $profil = new Profil('search');
     $profil->unsetAttributes();
     // clear any default values
     if (isset($_GET['Profil'])) {
         $profil->attributes = $_GET['Profil'];
     }
     $rak = new RakBarang('search');
     $rak->unsetAttributes();
     if (isset($_GET['RakBarang'])) {
         $rak->attributes = $_GET['RakBarang'];
     }
     $labelCetak = new LabelRakCetak('search');
     $labelCetak->unsetAttributes();
     if (isset($_GET['LabelRakCetak'])) {
         $labelCetak->attributes = $_GET['LabelRakCetak'];
         /* simpan ke sesi untuk digunakan cetak label */
         Yii::app()->user->setState('labelKategoriId', $_GET['LabelRakCetak']['kategoriId']);
     }
     $layoutForm = new CetakLabelRakLayoutForm();
     if (isset($_GET['CetakLabelRakLayoutForm'])) {
         $layoutForm->attributes = $_GET['CetakLabelRakLayoutForm'];
         $this->labelRakPdf($layoutForm);
     }
     $this->render('index', array('modelForm' => $modelForm, 'profil' => $profil, 'rak' => $rak, 'labelCetak' => $labelCetak, 'layoutForm' => $layoutForm));
 }
예제 #2
0
 /**
  * Manages all models.
  */
 public function actionIndex()
 {
     $model = new Profil('search');
     $model->unsetAttributes();
     // clear any default values
     $model->profileTipeId = Profil::TIPE_SUPPLIER;
     if (isset($_GET['Profil'])) {
         $model->attributes = $_GET['Profil'];
     }
     $this->render('index', array('model' => $model));
 }
예제 #3
0
 /**
  * Updates a particular model.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUbah($id)
 {
     $model = $this->loadModel($id);
     // Jika pengeluaran sudah disimpan (status bukan draft) maka tidak bisa diubah lagi
     if ($model->status != Pengeluaran::STATUS_DRAFT) {
         $this->redirect(array('view', 'id' => $id));
     }
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Pengeluaran'])) {
         $model->attributes = $_POST['Pengeluaran'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $id));
         }
     }
     $profil = new Profil('search');
     $profil->unsetAttributes();
     // clear any default values
     if (isset($_GET['Profil'])) {
         $profil->attributes = $_GET['Profil'];
     }
     $itemKeuangan = new ItemKeuangan('search');
     $itemKeuangan->unsetAttributes();
     $itemKeuangan->scenario = 'hanyaDetail';
     if (isset($_GET['ItemKeuangan'])) {
         $itemKeuangan->attributes = $_GET['ItemKeuangan'];
         //print_r($_GET['ItemKeuangan']);
     }
     $itemKeuangan->id = '>=' . ItemKeuangan::ITEM_TRX_SAJA;
     $hutangPiutang = new HutangPiutang('search');
     $hutangPiutang->unsetAttributes();
     if (isset($_GET['HutangPiutang'])) {
         $hutangPiutang->attributes = $_GET['HutangPiutang'];
     }
     $hutangPiutang->scenario = 'pilihDokumen';
     $pengeluaranDetail = new PengeluaranDetail();
     $detail = new PengeluaranDetail('search');
     $detail->unsetAttributes();
     if (isset($_GET['PengeluaranDetail'])) {
         $detail->attributes = $_GET['PengeluaranDetail'];
     }
     $detail->pengeluaran_id = '=' . $id;
     //$test = HutangPiutang::model()->findByPk(10);
     //echo $test->getNamaProfil();
     $this->render('ubah', array('model' => $model, 'profil' => $profil, 'itemKeuangan' => $itemKeuangan, 'hutangPiutang' => $hutangPiutang, 'pengeluaranDetail' => $pengeluaranDetail, 'detail' => $detail, 'listNamaAsalHutangPiutang' => HutangPiutang::model()->listNamaAsal(), 'listNamaTipe' => HutangPiutang::model()->listNamaTipe()));
 }
예제 #4
0
 public function actionPls()
 {
     $model = new ReportPlsForm();
     $report = null;
     if (isset($_POST['ReportPlsForm'])) {
         $model->attributes = $_POST['ReportPlsForm'];
         if ($model->validate()) {
             $report = $model->reportPls();
         }
     }
     $profil = new Profil('search');
     $profil->unsetAttributes();
     // clear any default values
     if (isset($_GET['Profil'])) {
         $profil->attributes = $_GET['Profil'];
     }
     $tipePrinterAvailable = [Device::TIPE_PDF_PRINTER];
     $printers = Device::model()->listDevices($tipePrinterAvailable);
     $kertasUntukPdf = ReportPlsForm::listKertas();
     $this->render('pls', ['model' => $model, 'profil' => $profil, 'report' => $report, 'printers' => $printers, 'kertasPdf' => $kertasUntukPdf]);
 }