<?php echo $form->textField($model, 'net_cost', array('disabled' => 'disabled')); ?> <?php echo $form->error($model, 'net_cost'); ?> </td> </tr> <tr> <td> <?php echo $form->labelEx($model, 'suppliers_id'); ?> <?php $supplier_id = $model->suppliers_id; $supplierModel = Suppliers::model()->findByPk($supplier_id); if ($supplierModel) { echo $form->textField($supplierModel, 'name', array('disabled' => 'disabled')); } else { echo "supplier not found"; } ?> <?php //echo $form->textField($model,'supplier_name', array('disabled'=>'disabled')); ?> <?php echo $form->error($model, 'suppliers_id'); ?> </td> <td> <b><?php
<?php echo $form->error($model1, 'issue_date'); ?> </div> </div> <div class="row"> <?php echo $form->labelEx($model1, 'supplier_id'); ?> <?php $this->widget('bootstrap.widgets.select2.ESelect2', array('model' => $model1, 'attribute' => 'supplier_id', 'data' => CHtml::listData(Suppliers::model()->findAll(), 'id', 'supplierName'), 'htmlOptions' => array('class' => ''))); ?> <?php echo $form->error($model1, 'supplier_id'); ?> </div> <br> <div id="form-content" style="margin-right: 5%;"> <?php if ($mode === 'update') { foreach ($model2 as $indmodel) { $this->renderPartial('_form-purchases-info', array('form' => $form, 'model2' => $indmodel, 'sts' => $sts)); $sts++; } } else { $this->renderPartial('_form-purchases-info', array('form' => $form, 'model2' => $model2, 'sts' => 0));
<h2>Create MoneyReceived</h2> <div style="border: 1px inset gold;padding: 3%;"> <span><b>Supplier: </b><?php echo Suppliers::model()->findByPk(PurchasesInvoices::model()->findByPk($id)->supplier_id)->supplierName; ?> </span> <br> <br> <span><b>Purchase Invoice: </b><?php echo $id; ?> </span> <br> <br> <?php $this->renderPartial('_form', array('model' => $model, 'id' => $id)); ?> </div>
public function getSuppliersName() { //return array( return CHtml::listData(Suppliers::model()->findAll(), 'id', 'name'); }
/** * 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 = Suppliers::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }