Exemple #1
0
	
	<div class="row">
		<?php 
echo $form->label($model, 'ID_PENERBIT');
?>
		<?php 
echo $form->textField($model, 'ID_PENERBIT');
?>
	</div>
	-->
	<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">
Exemple #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 Penerbit the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Penerbit::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }