public function actionDocumentList() { $model = new DocumentsList('searchReport'); $model->unsetAttributes(); // clear any default values $this->render('documentsList', array('model' => $model)); }
/** * 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 DocumentsList the loaded model * @throws CHttpException */ public function loadModel($id) { $model = DocumentsList::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
//echo $form->labelEx($model,'document_impounded'); ?> <?php //echo $form->dropDownList($model,'document_impounded',CHtml::listData(DocumentsList::model()->findAll(array('order' => 'name ASC')), 'id', 'name'),array('span'=>5,'maxlength'=>45)); ?> </div> <div class="row1" style="margin-bottom:10px;margin-top:20px;width:700px !important;"> <div style="float:left;width:700px !important;height:auto;" > <span>Documents List</span> <span style="margin-left:237px">Documents Confiscated</span> <?php //echo $form->labelEx($model,'offence_ids'); ?> <?php echo $form->dropDownList($model, 'docs_conf[]', CHtml::encodeArray(CHtml::listData(DocumentsList::model()->findAll(array('order' => 'id ASC')), 'id', 'name')), array('options' => $model->user_docs_conf(), 'multiple' => 'multiple'), array('style' => 'width:700px !important;height:auto')); ?> <?php //echo "<pre>";print_r($model->user_challan_list()); //print_r(array('1'=>array('selected'=>true),'2'=>array('selected'=>true))); ?> <div style="clear:both;" > </div> </div> </div> <div style="float:left;width:200px;" > <?php //echo $form->labelEx($model,'vehicle_impounded'); ?> <div > </div>
function user_docs_confname($challan_id) { if (!empty($challan_id) && $challan_id != '') { $criteria = new CDbCriteria(); $criteria->condition = "id = " . $challan_id; $challan = Challan::model()->find()->findByPk($challan_id); $criteria = new CDbCriteria(); $criteria->condition = "id IN (" . $this->document_impounded . ")"; $list = CHtml::ListData(DocumentsList::model()->findAll($criteria), "id", "name"); return $list; } else { return array(); } }