Example #1
0
<?php

return array('title' => 'Enter a check', 'showErrorSummary' => true, 'elements' => array('check' => array('type' => 'form', 'title' => 'Check Details', 'showErrorSummary' => true, 'elements' => array('amount' => array('type' => 'text', 'maxlength' => 20), 'check_num' => array('type' => 'text', 'maxlength' => 10), 'check_date' => array('type' => 'zii.widgets.jui.CJuiDatePicker', 'attribute' => 'check_date', 'model' => 'check', 'options' => array('showAnim' => 'fold', 'showButtonPanel' => true, 'autoSize' => true, 'dateFormat' => 'yy-mm-dd')), 'payee_id' => array('items' => CHtml::listData(Company::model()->findAll(), 'id', 'name'), 'type' => 'dropdownlist'), 'payer' => array('type' => 'text', 'maxlength' => 128), 'deposit_id' => array('items' => CHtml::listData(DepositDetails::model()->findAll(), 'id', 'deposited_date'), 'type' => 'dropdownlist'))), 'income' => array('type' => 'form', 'title' => 'Apply Payment', 'showErrorSummary' => true, 'elements' => array('student_id' => array('maxlength' => 10, 'prompt' => "Choose student...", 'items' => CHtml::listData(Student::model()->findAll(), 'id', 'full_name'), 'type' => 'dropdownlist'), 'class_id' => array('maxlength' => 10, 'prompt' => "Choose class...", 'items' => CHtml::listData(ClassInfo::model()->findAll(), 'id', 'class_name'), 'type' => 'dropdownlist'), 'amount' => array('type' => 'text', 'maxlength' => 10)))), 'buttons' => array('entry_form' => array('type' => 'submit', 'label' => 'Save')));
Example #2
0
?>

		<?php 
echo $form->error($model, 'payee_id');
?>
	</div>






	<div id="deposit_row" class="row">
		<?php 
echo $form->labelEx($model, 'deposit_id');
echo $form->dropDownList($model, 'deposit_id', CHtml::listData(DepositDetails::model()->findAll(), 'id', 'deposited_date'), array('empty' => "None"));
?>
		<?php 
echo $form->error($model, 'deposit_id');
?>
	</div>

	<div id="delivered_row" class="row">
		<?php 
echo $form->labelEx($model, 'delivered');
?>

<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'delivered', 'value' => $model->delivered, 'options' => array('showAnim' => 'fold', 'showButtonPanel' => true, 'autoSize' => true, 'dateFormat' => 'yy-mm-dd', 'defaultDate' => $model->delivered)));
?>
		<?php 
 /**
  * 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.
  */
 public function loadModel()
 {
     if ($this->_model === null) {
         if (isset($_GET['id'])) {
             $this->_model = DepositDetails::model()->findbyPk($_GET['id']);
         }
         if ($this->_model === null) {
             throw new CHttpException(404, 'The requested page does not exist.');
         }
     }
     return $this->_model;
 }