Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Tagen::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'npwp', $this->npwp])->andFilterWhere(['like', 'namaagen', $this->namaagen])->andFilterWhere(['like', 'pic', $this->pic])->andFilterWhere(['like', 'alamat1', $this->alamat1])->andFilterWhere(['like', 'alamat2', $this->alamat2])->andFilterWhere(['like', 'telpon', $this->telpon])->andFilterWhere(['like', 'fax', $this->fax])->andFilterWhere(['like', 'status', $this->status]);
     return $dataProvider;
 }
Exemplo n.º 2
0
  
  <?php 
echo $form->field($model, 'tgllhpsp')->widget(DatePicker::className(), ['inline' => false, 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
  <?php 
echo $form->field($model, 'idkapal')->widget(Select2::classname(), ['data' => ArrayHelper::map(Kapal::find()->all(), 'kapal_id', 'kapal_nama'), 'language' => 'en', 'options' => ['placeholder' => 'Pilih Kapal ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
           
   
    <?php 
echo $form->field($model, 'voy')->textInput(['maxlength' => 20]);
?>


   <?php 
echo $form->field($model, 'idagen')->dropDownList(ArrayHelper::map(Tagen::find()->all(), 'id', 'namaagen'), ['prompt' => 'pilih negara pelabuhan asal']);
?>
 
  
      <?php 
echo $form->field($model, 'idpelasal')->dropDownList(ArrayHelper::map(Tnegpelabuhan::find()->all(), 'idpel', 'negarapelabuhan'), ['prompt' => 'pilih negara pelabuhan asal']);
?>
            
  
    <?php 
echo $form->field($model, 'tglpeldatang')->widget(DatePicker::className(), ['inline' => false, 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
    
         <?php 
echo $form->field($model, 'idpeltujuan')->dropDownList(ArrayHelper::map(Tnegpelabuhan::find()->all(), 'idpel', 'negarapelabuhan'), ['prompt' => 'pilih negara pelabuhan tujuan']);
?>
Exemplo n.º 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdagen0()
 {
     return $this->hasOne(Tagen::className(), ['id' => 'idagen']);
 }
Exemplo n.º 4
0
 public function actionCetakWord($id)
 {
     $tmaster = Tmaster::findOne($id);
     $kapal = Kapal::find()->where(['kapal_id' => $tmaster->idkapal])->all();
     $agen = Tagen::find()->where(['id' => $tmaster->idagen])->all();
     /*
             $query = new Query;
             $query	->select([
     		'kapal.kapal_nama AS kapal_nama', 
           'kapal.kapal_neg AS kapal_neg', 
           'tagen.namaagen AS namaagen']
     		
     		)  
     	->from('tmaster')
     	->join('INNER JOIN', 'kapal',
     				'kapal.kapal_id =tmaster.idkapal')		
     	->join('INNER JOIN', 'tagen', 
     				'tagen.id =tmaster.idagen')
     	->LIMIT(2)	; 
     		
             $command = $query->createCommand();
             $datatabel = $command->queryAll();
     */
     // Initalize the TBS instance
     $OpenTBS = new \hscstudio\export\OpenTBS();
     // new instance of TBS
     // Change with Your template kaka
     $template = Yii::getAlias('@hscstudio/export') . '/templates/opentbs/lhpspword1.docx';
     $OpenTBS->LoadTemplate($template);
     // Also merge some [onload] automatic fields (depends of the type of document).
     $OpenTBS->VarRef['xnolhpsp'] = $tmaster->nolphsp;
     $OpenTBS->VarRef['xtgllhpsp'] = $tmaster->tgllhpsp;
     $OpenTBS->VarRef['xvoy'] = $tmaster->voy;
     $OpenTBS->VarRef['xtglpeldatang'] = $tmaster->tglpeldatang;
     $OpenTBS->VarRef['xjumlahkemasan'] = $tmaster->jumlahkemasan;
     $OpenTBS->VarRef['xsatuan'] = $tmaster->satuan;
     $OpenTBS->VarRef['xvolume'] = $tmaster->volume;
     $OpenTBS->VarRef['xberat'] = $tmaster->berat;
     $OpenTBS->VarRef['xbc11'] = $tmaster->bc11;
     $OpenTBS->VarRef['xtglbc11'] = $tmaster->tglbc11;
     $data = [];
     foreach ($kapal as $kapals) {
         $data[] = ['kapal_nama' => $kapals->kapal_nama, 'kapal_neg' => $kapals->kapal_neg];
     }
     /*
            $data = [];
     foreach($datatabel as $datatabels){
         $data[] = [
             'kapal_nama'=> $datatabels->kapal_nama,
             'kapal_neg'=>$datatabels->kapal_neg,
             'namaagen'=>$datatabels->namaagen
                 ];
     }
     */
     $OpenTBS->MergeBlock('data', $data);
     $data1 = [];
     foreach ($agen as $agens) {
         $data1[] = ['namaagen' => $agens->namaagen];
     }
     $OpenTBS->MergeBlock('data1', $data1);
     // Output the result as a file on the server. You can change output file
     $OpenTBS->Show(OPENTBS_DOWNLOAD, 'export.docx');
     // Also merges all [onshow] automatic fields.
     exit;
 }
Exemplo n.º 5
0
 public function actionCetakWord($id)
 {
     $tmaster = Tmaster::findOne($id);
     $kapal = Kapal::find()->where(['kapal_id' => $tmaster->idkapal])->all();
     $agen = Tagen::find()->where(['id' => $tmaster->idagen])->all();
     $negpelabuhan = Tnegpelabuhan::find()->where(['idpel' => $tmaster->idpelasal])->all();
     $nippemeriksa = Pegawai::find()->where(['nip' => $tmaster->nippemeriksa])->all();
     $nipatasan1 = Pegawai::find()->where(['nip' => $tmaster->nipatasan1])->all();
     $nipatasan2 = Pegawai::find()->where(['nip' => $tmaster->nipatasan2])->all();
     // Initalize the TBS instance
     $OpenTBS = new \hscstudio\export\OpenTBS();
     // new instance of TBS
     // Change with Your template kaka
     $template = Yii::getAlias('@hscstudio/export') . '/templates/opentbs/lhpspword1.docx';
     $OpenTBS->LoadTemplate($template);
     // Also merge some [onload] automatic fields (depends of the type of document).
     $OpenTBS->VarRef['xnolhpsp'] = $tmaster->nolphsp;
     $OpenTBS->VarRef['xtgllhpsp'] = $tmaster->tgllhpsp;
     $OpenTBS->VarRef['xvoy'] = $tmaster->voy;
     $OpenTBS->VarRef['xtglpeldatang'] = $tmaster->tglpeldatang;
     $OpenTBS->VarRef['xjumlahkemasan'] = $tmaster->jumlahkemasan;
     $OpenTBS->VarRef['xsatuan'] = $tmaster->satuan;
     $OpenTBS->VarRef['xvolume'] = $tmaster->volume;
     $OpenTBS->VarRef['xberat'] = $tmaster->berat;
     $OpenTBS->VarRef['xbc11'] = $tmaster->bc11;
     $OpenTBS->VarRef['xtglbc11'] = $tmaster->tglbc11;
     $OpenTBS->VarRef['xbc12'] = $tmaster->bc12;
     $OpenTBS->VarRef['xtglbc12'] = $tmaster->tglbc12;
     $OpenTBS->VarRef['xbc13'] = $tmaster->bc13;
     $OpenTBS->VarRef['xtglbc13'] = $tmaster->tglbc13;
     $OpenTBS->VarRef['xlhpsp'] = $tmaster->lhpsp;
     $data = [];
     foreach ($kapal as $kapals) {
         $data[] = ['kapal_nama' => $kapals->kapal_nama, 'kapal_neg' => $kapals->kapal_neg];
     }
     $OpenTBS->MergeBlock('data', $data);
     $b1 = [];
     foreach ($agen as $agens) {
         $b1[] = ['namaagen' => $agens->namaagen];
     }
     $OpenTBS->MergeBlock('b1', $b1);
     $b2 = [];
     foreach ($negpelabuhan as $negpelabuhans) {
         $b2[] = ['negarapelabuhan' => $negpelabuhans->negarapelabuhan];
     }
     $OpenTBS->MergeBlock('b2', $b2);
     $b5 = [];
     foreach ($nippemeriksa as $nippemeriksas) {
         $b5[] = ['nip' => $nippemeriksas->nip, 'nama' => $nippemeriksas->nama];
     }
     $OpenTBS->MergeBlock('b3', $b5);
     $b5 = [];
     foreach ($nipatasan1 as $nipatasan1s) {
         $b5[] = ['nip' => $nipatasan1s->nip, 'nama' => $nipatasan1s->nama];
     }
     $OpenTBS->MergeBlock('b4', $b5);
     $b5 = [];
     foreach ($nipatasan2 as $nipatasan2s) {
         $b5[] = ['nip' => $nipatasan2s->nip, 'nama' => $nipatasan2s->nama];
     }
     $OpenTBS->MergeBlock('b5', $b5);
     // Output the result as a file on the server. You can change output file
     $OpenTBS->Show(OPENTBS_DOWNLOAD, 'export.docx');
     // Also merges all [onshow] automatic fields.
     exit;
 }
Exemplo n.º 6
0
 /**
  * Finds the Tagen model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Tagen the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Tagen::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }