/**
  * Lists all models.
  */
 public function actionIndex()
 {
     parent::actionIndex();
     $purchasingorg = new Purchasingorg('search');
     $purchasingorg->unsetAttributes();
     // clear any default values
     if (isset($_GET['Purchasingorg'])) {
         $purchasingorg->attributes = $_GET['Purchasingorg'];
     }
     $paymentmethod = new Paymentmethod('search');
     $paymentmethod->unsetAttributes();
     // clear any default values
     if (isset($_GET['Paymentmethod'])) {
         $paymentmethod->attributes = $_GET['Paymentmethod'];
     }
     $purchasinggroup = new Purchasinggroup('search');
     $purchasinggroup->unsetAttributes();
     // clear any default values
     if (isset($_GET['Purchasinggroup'])) {
         $purchasinggroup->attributes = $_GET['Purchasinggroup'];
     }
     $supplier = new Supplier('search');
     $supplier->unsetAttributes();
     // clear any default values
     if (isset($_GET['Supplier'])) {
         $supplier->attributes = $_GET['Supplier'];
     }
     $podetail = new Podetail('search');
     $podetail->unsetAttributes();
     // clear any default values
     if (isset($_GET['Podetail'])) {
         $podetail->attributes = $_GET['Podetail'];
     }
     $product = new Prmaterial('search');
     $product->unsetAttributes();
     // clear any default values
     if (isset($_GET['Prmaterial'])) {
         $product->attributes = $_GET['Prmaterial'];
     }
     $unitofmeasure = new Unitofmeasure('search');
     $unitofmeasure->unsetAttributes();
     // clear any default values
     if (isset($_GET['Unitofmeasure'])) {
         $unitofmeasure->attributes = $_GET['Unitofmeasure'];
     }
     $currency = new Currency('search');
     $currency->unsetAttributes();
     // clear any default values
     if (isset($_GET['Currency'])) {
         $currency->attributes = $_GET['Currency'];
     }
     $sloc = new Sloc('search');
     $sloc->unsetAttributes();
     // clear any default values
     if (isset($_GET['Sloc'])) {
         $sloc->attributes = $_GET['Sloc'];
     }
     $tax = new Tax('search');
     $tax->unsetAttributes();
     // clear any default values
     if (isset($_GET['Tax'])) {
         $tax->attributes = $_GET['Tax'];
     }
     $model = new Poheader('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Poheader'])) {
         $model->attributes = $_GET['Poheader'];
     }
     if (isset($_GET['pageSize'])) {
         Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);
         unset($_GET['pageSize']);
         // would interfere with pager and repetitive page size change
     }
     $this->render('index', array('model' => $model, 'purchasingorg' => $purchasingorg, 'purchasinggroup' => $purchasinggroup, 'paymentmethod' => $paymentmethod, 'supplier' => $supplier, 'podetail' => $podetail, 'product' => $product, 'unitofmeasure' => $unitofmeasure, 'currency' => $currency, 'sloc' => $sloc, 'tax' => $tax, 'podetail' => $podetail));
 }
 /**
  * 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 = Purchasinggroup::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
?>
		<?php 
echo $form->error($model, 'deliverytime');
?>
	</div>
        </td>
        <td>
          <div class="row">
		<?php 
echo $form->labelEx($model, 'purchasinggroupid');
?>
		<?php 
echo $form->hiddenField($model, 'purchasinggroupid');
?>
	  <input type="text" name="sched_name" id="purchasinggroupcode" title="Enter Schedule name" readonly value="<?php 
echo Purchasinggroup::model()->findByPk($model->purchasinggroupid) !== null ? Purchasinggroup::model()->findByPk($model->purchasinggroupid)->purchasinggroupcode : '';
?>
">
    <?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'purchasinggroupcode_dialog', 'options' => array('title' => Yii::t('app', 'Purchasing Group'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$this->widget('zii.widgets.grid.CGridView', array('id' => 'product-grid', 'dataProvider' => $purchasinggroup->Searchwstatus(), 'filter' => $purchasinggroup, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+",
          array("name" => "send_product",
          "id" => "send_product",
          "onClick" => "$(\\"#purchasinggroupcode_dialog\\").dialog(\\"close\\"); $(\\"#purchasinggroupcode\\").val(\\"$data->purchasinggroupcode\\"); $(\\"#Purchinforec_purchasinggroupid\\").val(\\"$data->purchasinggroupid\\");
		  "))'), array('name' => 'purchasinggroupid', 'visible' => false, 'value' => '$data->purchasinggroupid', 'htmlOptions' => array('width' => '1%')), 'purchasinggroupcode', 'description', array('class' => 'CCheckBoxColumn', 'name' => 'recordstatus', 'selectableRows' => '0', 'header' => 'Record Status', 'checked' => '$data->recordstatus'))));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$("#purchasinggroupcode_dialog").dialog("open"); return false;'));
?>
		<?php 
echo $form->error($model, 'purchasinggroupid');
?>
echo $form->error($model, 'docdate');
?>
	</div>
	  </td>
		<td>
		  <div class="row">
		<?php 
echo $form->labelEx($model, 'purchasinggroupid');
?>
		<?php 
echo $form->hiddenField($model, 'purchasinggroupid');
?>
	  <input type="text" name="product_name" id="purchasinggroupcode" readonly >
    <?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'purchasinggroup_dialog', 'options' => array('title' => Yii::t('app', 'Purchasing Group'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$purchasinggroup = new Purchasinggroup('search');
$purchasinggroup->unsetAttributes();
// clear any default values
if (isset($_GET['Purchasinggroup'])) {
    $purchasinggroup->attributes = $_GET['Purchasinggroup'];
}
$this->widget('zii.widgets.grid.CGridView', array('id' => 'purchasinggroup-grid', 'dataProvider' => $purchasinggroup->Searchwstatus(), 'filter' => $purchasinggroup, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+",
          array("name" => "send_absschedule",
          "id" => "send_absschedule",
          "onClick" => "$(\\"#purchasinggroup_dialog\\").dialog(\\"close\\"); $(\\"#purchasinggroupcode\\").val(\\"$data->purchasinggroupcode\\"); $(\\"#Poheader_purchasinggroupid\\").val(\\"$data->purchasinggroupid\\");
		  "))'), array('name' => 'purchasinggroupid', 'visible' => false, 'value' => '$data->purchasinggroupid'), array('name' => 'purchasingorgid', 'value' => '$data->purchasingorg->description'), 'purchasinggroupcode', 'description')));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$.fn.yiiGridView.update("purchasinggroup-grid");$("#purchasinggroup_dialog").dialog("open"); return false;'));
?>
		<?php 
echo $form->error($model, 'purchasinggroupid');
 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     parent::actionIndex();
     $supplier = new Supplier('searchwstatus');
     $supplier->unsetAttributes();
     // clear any default values
     if (isset($_GET['Supplier'])) {
         $supplier->attributes = $_GET['Supplier'];
     }
     $product = new Product('searchwstatus');
     $product->unsetAttributes();
     // clear any default values
     if (isset($_GET['Product'])) {
         $product->attributes = $_GET['Product'];
     }
     $purchasinggroup = new Purchasinggroup('searchwstatus');
     $purchasinggroup->unsetAttributes();
     // clear any default values
     if (isset($_GET['Purchasinggroup'])) {
         $purchasinggroup->attributes = $_GET['Purchasinggroup'];
     }
     $currency = new Currency('searchwstatus');
     $currency->unsetAttributes();
     // clear any default values
     if (isset($_GET['Currency'])) {
         $currency->attributes = $_GET['Currency'];
     }
     $model = new Purchinforec('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Purchinforec'])) {
         $model->attributes = $_GET['Purchinforec'];
     }
     if (isset($_GET['pageSize'])) {
         Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);
         unset($_GET['pageSize']);
         // would interfere with pager and repetitive page size change
     }
     $this->render('index', array('model' => $model, 'supplier' => $supplier, 'product' => $product, 'purchasinggroup' => $purchasinggroup, 'currency' => $currency));
 }