Пример #1
0
	<div class="row">
		<?php 
echo $form->label($model, 'NAMA PENERBIT');
?>
		<?php 
$data = CHtml::listData(Penerbit::model()->findAll(), 'ID_PENERBIT', 'NAMA_PENERBIT');
echo $form->dropDownList($model, 'ID_PENERBIT', $data, array('empty' => '- Pilih Nama Penerbit -'));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'NOPOL');
?>
		<?php 
$data = CHtml::listData(Kendaraan::model()->findAll(), 'ID_KENDARAAN', 'NOPOL');
echo $form->dropDownList($model, 'ID_KENDARAAN', $data, array('empty' => '- Pilih Nopol Kendaraan -'));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'Tanggal Perjalanan');
?>
		<?php 
echo CHtml::activeTextField($model, 'from_date', array("id" => "from_date"), 'required');
?>
		&nbsp; s/d &nbsp;
		<?php 
echo CHtml::activeTextField($model, 'to_date', array("id" => "to_date"));
?>
Пример #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 Kendaraan the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Kendaraan::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }