?> <?php echo $form->error($model, 'unitofmeasureid'); ?> </div> </td> </tr> <tr> <td> <div class="row"> <?php echo $form->labelEx($model, 'requestedbyid'); echo $form->hiddenField($model, 'requestedbyid'); ?> <input type="text" name="reqbyname" id="reqbyname" title="Account name" readonly value="<?php echo Requestedby::model()->findByPk($model->requestedbyid) !== null ? Requestedby::model()->findByPk($model->requestedbyid)->requestedbycode : ''; ?> "> <?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'req_dialog', 'options' => array('title' => Yii::t('app', 'Requested By'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true))); $requestedby = new Requestedby('searchwfstatus'); $requestedby->unsetAttributes(); // clear any default values if (isset($_GET['Requestedby'])) { $requestedby->attributes = $_GET['Requestedby']; } $this->widget('zii.widgets.grid.CGridView', array('id' => 'req-grid', 'dataProvider' => $requestedby->Searchwstatus(), 'filter' => $requestedby, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+", array("name" => "send_absschedule", "id" => "send_absschedule", "onClick" => "$(\\"#req_dialog\\").dialog(\\"close\\"); $(\\"#reqbyname\\").val(\\"$data->description\\"); $(\\"#Deliveryadvicedetail_requestedbyid\\").val(\\"$data->requestedbyid\\"); "))'), array('name' => 'requestedbyid', 'visible' => false, 'value' => '$data->requestedbyid', 'htmlOptions' => array('width' => '1%')), 'requestedbycode', 'description')));
/** * 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 the ID of the model to be loaded */ public function loadModel($id) { $model = Requestedby::model()->findByPk((int) $id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }