예제 #1
0
파일: create2.php 프로젝트: aunorafiq/jks

<?php 
Yii::app()->clientScript->registerScript('search', "\r\n\$('.search-button').click(function(){\r\n\t\$('.search-form').toggle();\r\n\treturn false;\r\n});\r\n\$('.search-form form').submit(function(){\r\n\t\$('#material-grid').yiiGridView('update', {\r\n\t\tdata: \$(this).serialize()\r\n\t});\r\n\treturn false;\r\n});\r\n");
?>
<h1>Buat PO Perjalanan Baru - Step 2 : Pilih Tujuan / Ongkos Perjalanan - <?php 
echo $model->iDKENDARAAN->NOPOL;
?>
</h1>


<!-- </div>form -->
<?php 
$this->renderPartial('/ongkos/create', array('model' => Ongkos::model(), "id" => $model->ID_PERJALANAN));
?>

<?php 
$this->renderPartial('/relasi_po/view', array('model' => RelasiPo::model(), "id" => $model->ID_PERJALANAN));
$isi = Yii::app()->db->createCommand()->select('COUNT(*)')->from('relasi_po')->where('ID_PERJALANAN=:ID_PERJALANAN', array(':ID_PERJALANAN' => "{$model->ID_PERJALANAN}"))->queryScalar();
if ($isi != 0) {
    echo "Sudah selesai?";
    echo "\r\n";
    echo TbHtml::submitButton('LANJUT', array('submit' => array("lanjut", "id" => $model->ID_PERJALANAN), 'color' => TbHtml::BUTTON_COLOR_PRIMARY));
}
?>
<p>
<?php 
echo TbHtml::submitButton('Kembali', array('submit' => array("create1", "id" => $model->ID_PERJALANAN), 'color' => TbHtml::BUTTON_COLOR_PRIMARY));
?>
</p>
예제 #2
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Ongkos the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Ongkos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }