/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = SimpelKeg::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id_kegiatan' => $this->id_kegiatan, 'tgl_mulai' => $this->tgl_mulai, 'tgl_selesai' => $this->tgl_selesai, 'unit_id' => $this->unit_id, 'user_id' => $this->user_id, 'penandatangan' => $this->penandatangan, 'jml_dl' => $this->jml_dl, 'status' => $this->status, 'status_edit' => $this->status_edit, 'negara' => $this->negara, 'detail_id' => $this->detail_id, 'tgl_penugasan' => $this->tgl_penugasan, 'random' => $this->random]); $query->andFilterWhere(['like', 'mak', $this->mak])->andFilterWhere(['like', 'nama_keg', $this->nama_keg])->andFilterWhere(['like', 'tujuan', $this->tujuan])->andFilterWhere(['like', 'nip_ppk', $this->nip_ppk])->andFilterWhere(['like', 'no_sp', $this->no_sp])->andFilterWhere(['like', 'no_spd', $this->no_spd])->andFilterWhere(['like', 'angkutan', $this->angkutan])->andFilterWhere(['like', 'berangkat_asal', $this->berangkat_asal])->andFilterWhere(['like', 'nip_bpp', $this->nip_bpp]); return $dataProvider; }
public function actionSearchDinas($search) { $sumber = SimpelKeg::find()->andWhere('(mak like \'%' . $search . '%\' or nama_keg like \'%' . $search . '%\' or tgl_mulai like \'%' . $search . '%\' or tgl_selesai like \'%' . $search . '%\' or tujuan like \'%' . $search . '%\')'); //$sumber = SimpelKeg::find()->where('id_kegiatan='.$search); $dataDinas = new ActiveDataProvider(['query' => $sumber, 'pagination' => ['pageSize' => 10]]); return $this->renderAjax('@backend/views/simpel-keg/s_dinas', ['dataDinas' => $dataDinas]); }
public function actionLuar($id) { $model = $this->findModel($id); $model2 = \backend\models\SimpelKeg::find()->where('id_kegiatan=' . $model->id_kegiatan)->one(); if ($_POST) { // print_r($_POST); // die(); $model->pegawai_id = $_POST['SimpelPersonil']['pegawai_id']; $model->tingkat_id = $_POST['SimpelPersonil']['tingkat_id']; $model->tgl_penugasan = $_POST['SimpelPersonil']['tgl_penugasan']; $model->tgl_berangkat = $_POST['SimpelPersonil']['tgl_berangkat']; $model->tgl_kembali = $_POST['SimpelPersonil']['tgl_kembali']; $model->no_sp = $_POST['SimpelPersonil']['no_sp']; $model->pejabat = $_POST['SimpelPersonil']['pejabat']; $model->uang_makan = $_POST['SimpelPersonil']['uang_makan']; $model->angkutan = $_POST['SimpelPersonil']['angkutan']; if ($model->save()) { $data = count($_POST['rows']); for ($i = 1; $i <= $data; $i++) { $model3 = SimpelRincianBiaya::findOne($_POST['id_rincian_biaya' . $i]); $model3->id_kegiatan = $model2->id_kegiatan; $model3->kat_biaya_id = $model3->kat_biaya_id; $model3->harga_satuan = $_POST['satuan' . $i]; $model3->bukti_kwitansi = $_POST['bukti_kwitansi' . $i]; $model3->volume = $_POST['volume' . $i]; $model3->jml = $_POST['jml' . $i]; $model3->uraian_rincian = $_POST['uraian_rincian' . $i]; $model3->save(); } // die(); } return $this->redirect(['/simpel-keg/create', 'id' => $model->id_kegiatan]); } else { switch ($model2->negara) { case "1": return $this->renderAjax('input', ['model' => $model, 'model2' => $model2]); case "2": return $this->renderAjax('input_luar', ['model' => $model, 'model2' => $model2]); break; } } }
/** * Finds the SimpelKeg model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return SimpelKeg the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = SimpelKeg::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
echo "<div id='modalContent'></div>"; Modal::end(); Modal::begin(['header' => 'Data Personil', 'options' => ['tabindex' => false], 'id' => 'modall', 'size' => 'bigModal']); echo "<div id='modalContentt'></div>"; Modal::end(); ?> <div class="block"> <div class="block-title"> </div> <div class="wp-posts-index"> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['mak', 'nama_keg', ['label' => 'Kwitansi', 'value' => $model->no_reg], ['label' => 'Tujuan Keberangkatan', 'value' => \backend\models\SimpelKeg::Tujuan($model->negara)], 'no_spd']]); ?> <?php switch ($model->negara) { case 1: echo $this->renderAjax('detail_dalam_negri', ['model' => $model, 'model2' => $model2]); break; case 2: echo $this->renderAjax('detail_luar_negri', ['model' => $model, 'model2' => $model2]); break; } ?>
} .noborder td { border:none; } .noborder tr td { border:none; } </style> <?php $no = 1; $hitung = count($model2); foreach ($model2 as $mode) { $cetak = \backend\models\SimpelKeg::find()->where('id_kegiatan=' . $model->id_kegiatan . ' and mak like \'%' . '524111' . '%\'')->one(); ?> <h5 style="font-weight: bold;" align="left"><b> <i>BADAN PENGAWAS TENAGA NUKLIR</i> <br/> </h5> <p style="padding-top:-10px; margin-left:50"> Jl. Gajah Mada No. 8 Jakarta Pusat</b></p> <p style="padding-top:-20px; margin-left:80"> Ministry / Institution</p> <table cellspacing="0" cellpadding="0" style="margin-top:-1000px;"> <tr> <td width="450"></td>
public function getKeg() { return $this->hasOne(\backend\models\SimpelKeg::className(), ['id_kegiatan' => 'id_kegiatan']); }