/**
  * Lists all models.
  */
 public function actionIndex()
 {
     parent::actionIndex();
     $grdetail = new Grdetail('search');
     $grdetail->unsetAttributes();
     // clear any default values
     if (isset($_GET['Grdetail'])) {
         $grdetail->attributes = $_GET['Grdetail'];
     }
     $poheader = new Poheader('search');
     $poheader->unsetAttributes();
     // clear any default values
     if (isset($_GET['Poheader'])) {
         $poheader->attributes = $_GET['Poheader'];
     }
     $model = new Grheader('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Grheader'])) {
         $model->attributes = $_GET['Grheader'];
     }
     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, 'poheader' => $poheader, 'grdetail' => $grdetail));
 }
 /**
  * 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));
 }
Esempio n. 3
0
echo $form->error($model, 'grdate');
?>
        </div>
	  </td>
		<td>
		  <div class="row">
		<?php 
echo $form->labelEx($model, 'poheaderid');
?>
    <?php 
echo $form->hiddenField($model, 'poheaderid');
?>
    <input type="text" name="pono" id="pono" readonly >
    <?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'poheader_dialog', 'options' => array('title' => Yii::t('app', 'Purchase Order'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$poheader = new Poheader('searchwfqtystatus');
$poheader->unsetAttributes();
// clear any default values
if (isset($_GET['Poheader'])) {
    $poheader->attributes = $_GET['Poheader'];
}
$this->widget('zii.widgets.grid.CGridView', array('id' => 'poheader-grid', 'dataProvider' => $poheader->searchwfqtystatus(), 'filter' => $poheader, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+",
          array("name" => "send_absstatus",
          "id" => "send_absstatus",
          "onClick" => "$(\\"#poheader_dialog\\").dialog(\\"close\\");
          $(\\"#pono\\").val(\\"$data->pono\\");
          $(\\"#Grheader_poheaderid\\").val(\\"$data->poheaderid\\");
          $(\\"#Grheader_grdate\\").val(\\"$data->docdate\\");
          $(\\"#Grheader_headernote\\").val(\\"$data->headernote\\");
          generatedata1();"))'), array('name' => 'poheaderid', 'visible' => false, 'value' => '$data->poheaderid'), 'pono', array('name' => 'addressbookid', 'value' => '$data->supplier!==null?$data->supplier->fullname:""'), array('name' => 'docdate', 'type' => 'raw', 'value' => 'date(Yii::app()->params["dateviewfromdb"], strtotime($data->docdate))'), 'headernote')));
$this->endWidget('zii.widgets.jui.CJuiDialog');
 /**
  * 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 = Poheader::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }