Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Tnegpelabuhan::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(['like', 'idpel', $this->idpel])->andFilterWhere(['like', 'negarapelabuhan', $this->negarapelabuhan]);
     return $dataProvider;
 }
Exemplo n.º 2
0
   <?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']);
?>
          
  
             <?php 
echo $form->field($model, 'tglpeltujuan')->widget(DatePicker::className(), ['inline' => false, 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
    <?php 
echo $form->field($model, 'jenisdokumen')->dropDownList(['PIB' => 'PIB', 'PEB' => 'PEB', 'BC11' => 'BC11', 'BC12' => 'BC12', 'BC13' => 'BC13'], ['prompt' => '']);
?>

    <?php 
echo $form->field($model, 'jenisbarang')->textInput(['maxlength' => 100]);
?>

    <?php 
Exemplo n.º 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdpeltujuan0()
 {
     return $this->hasOne(Tnegpelabuhan::className(), ['idpel' => 'idpeltujuan']);
 }
Exemplo n.º 4
0
 /**
  * Finds the Tnegpelabuhan model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Tnegpelabuhan the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Tnegpelabuhan::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
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;
 }