/**
  * 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 = Soheader::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
echo $form->error($model, 'deliveryadviceid');
?>
	</div>
		</td>
				         <td>
		  <div class="row">
		<?php 
echo $form->labelEx($model, 'soheaderid');
?>
    <?php 
echo $form->hiddenField($model, 'soheaderid');
?>
    <input type="text" name="stat_name" id="sono" readonly >
    <?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'so_dialog', 'options' => array('title' => Yii::t('app', 'Sales Order'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$soheader = new Soheader('searchwstatus');
$soheader->unsetAttributes();
// clear any default values
if (isset($_GET['Soheader'])) {
    $soheader->attributes = $_GET['Soheader'];
}
$this->widget('zii.widgets.grid.CGridView', array('id' => 'so-grid', 'dataProvider' => $soheader->searchwfqtystatus(), 'filter' => $soheader, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+",
          array("name" => "send_absstatus",
          "id" => "send_absstatus",
          "onClick" => "$(\\"#so_dialog\\").dialog(\\"close\\"); $(\\"#sono\\").val(\\"$data->sono\\");
          $(\\"#Giheader_soheaderid\\").val(\\"$data->soheaderid\\");
          $(\\"#Giheader_gidate\\").val(\\"$data->sodate\\");
          generatedataso();
                "))'), array('name' => 'soheaderid', 'visible' => false, 'value' => '$data->soheaderid:""'), 'sono', array('name' => 'addressbookid', 'value' => '($data->customer!==null)?$data->customer->fullname:""'), 'headernote', array('name' => 'sodate', 'type' => 'raw', 'value' => 'date(Yii::app()->params["dateviewfromdb"], strtotime($data->sodate))'))));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$.fn.yiiGridView.update("so-grid");$("#so_dialog").dialog("open"); return false;'));