Exemplo n.º 1
0
            <?php 
echo $form->textFieldControlGroup($model, 'issue_date', array('span' => 5, 'data-provide' => 'datepicker'));
?>
            <?php 
echo $form->radioButtonListControlGroup($model, 'type', array('1' => 'Challaning Officer', '2' => 'Police Station'));
?>

            <?php 
//echo $form->textFieldControlGroup($model,'belt_no',array('span'=>5,'maxlength'=>45));
?>
            <span id="ps" style="display:none;margin-top:10px;">
            <?php 
//echo $form->textFieldControlGroup($model,'police_station',array('span'=>5,'maxlength'=>45));
?>
            <?php 
echo $form->dropDownListControlGroup($model, 'police_station', CHtml::listData(PoliceStations::model()->findAll(array('order' => 'id ASC')), 'id', 'name'), array('span' => 5));
?>
            </span>
            <span id="co" style="display:none;margin-top:10px;">
            <?php 
echo $form->dropDownListControlGroup($model, 'challaning_officer_id', CHtml::listData(ChallaningOfficer::model()->findAll(array('order' => 'name ASC')), 'id', 'name'), array('span' => 5, 'maxlength' => 45));
?>
            </span>
            <?php 
echo $form->textFieldControlGroup($model, 'starting_page_no', array('span' => 5, 'maxlength' => 45));
?>

            

            <?php 
//echo $form->textFieldControlGroup($model,'missing_pages',array('span'=>5,'maxlength'=>145));
Exemplo n.º 2
0
    <p class="help-block">Fields with <span class="required">*</span> are required.</p>

    <?php 
echo $form->errorSummary($model);
?>
            <?php 
$all_roles = new RAuthItemDataProvider('roles', array('type' => 2));
$data = $all_roles->fetchData();
// print_r($data);
?>
                
            <span id="ps" style="display:none;">
                <label>Police Staion</label>                    
                <?php 
echo $form->dropDownList($model, 'police_stations_id', CHtml::listData(PoliceStations::model()->findAll(array('order' => 'id ASC')), 'id', 'name'), array('span' => 5, 'empty' => '--Select Police Station--', 'style' => 'display:;'));
?>
    
            </span>
            
                    
            <?php 
echo $form->dropDownListControlGroup($model, 'role', array('Court Staff' => 'Court Staff', 'Judicial Officer' => 'Judicial Officer', 'Police Official' => 'Police Official'), array('span' => 5));
?>
      
            <div id="select_state" style="display:none;">
            <label>Select State</label>
            <?php 
echo $form->dropDownList($model, 'state_id', CHtml::listData(States::model()->findAll(array('order' => 'name ASC')), 'id', 'name'), array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('states/dynamicdistrict3'), 'update' => '#User_district_id', 'data' => array('role' => 'js:document.getElementById("User_role").value', 'state' => 'js:this.value')), 'empty' => 'Select State'), array('span' => 5));
?>
      
 /**
  * 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 PoliceStations the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = PoliceStations::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }