Exemplo n.º 1
0
//});
//$('.search-form form').submit(function(){
//	$.fn.yiiGridView.update('sale-order-grid', {
//		data: $(this).serialize()
//	});
//	return false;
//});
//");
?>

<h1>Manage Sale Orders</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php 
//echo CHtml::link('Advanced Search','#',array('class'=>'search-button btn'));
?>
<div class="search-form" style="display:none">
<?php 
//$this->renderPartial('_search',array(
//'model'=>$model,
//));
?>
</div><!-- search-form -->

<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'sale-order-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('sale_id', 'po_number', array('header' => 'Consumer', 'name' => "comp_name", 'value' => '$data->comp->name'), array('name' => 'payment_term_id', 'value' => '$data->paymentTerm->description', 'filter' => PaymentTerms::model()->getPaymentTerms(), 'htmlOptions' => array('width' => '110px')), array('name' => 'is_open', 'value' => '$data->is_open ? "Open" : "Closed"', 'filter' => array(1 => 'Open', 0 => 'Closed'), 'htmlOptions' => array('width' => '100px')), array('class' => 'bootstrap.widgets.TbButtonColumn'))));
 public function getPaymentTerms()
 {
     return CHtml::listData(PaymentTerms::model()->findAll(), 'term_id', 'description');
 }
Exemplo n.º 3
0
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'purchase-order-form', 'enableAjaxValidation' => false));
?>

	<p class="help-block">Fields with <span class="required">*</span> are required.</p>

	<?php 
echo $form->errorSummary($model);
?>

	<?php 
echo $form->datepickerRow($model, 'maturity_date', array('options' => array('format' => 'yyyy/mm/dd', 'language' => 'en')));
?>

	<?php 
echo $form->dropDownListRow($model, 'payment_term_id', PaymentTerms::model()->getPaymentTerms(), array('prompt' => 'Select Term'));
?>
        
        <?php 
echo $form->dropDownListRow($model, 'comp_id', Company::model()->getPurchaseOrderComp(), array('prompt' => 'Select Company'));
?>

	<?php 
echo $form->dropDownListRow($model, 'is_open', array(1 => 'Open', 0 => 'Closed'));
?>

	<?php 
echo $form->textFieldRow($model, 'contact', array('class' => 'span5', 'maxlength' => 150));
?>

	<?php 
 /**
  * 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 = PaymentTerms::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 5
0
?>
        
        <?php 
echo $form->datepickerRow($model, 'maturity_date', array('options' => array('format' => 'yyyy/mm/dd', 'language' => 'en')));
?>
        
        <?php 
echo $form->dropDownListRow($model, 'comp_id', Company::model()->getSaleOrderComp(), array('prompt' => 'Select Company', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('address/dynamicaddress'), 'update' => '#SaleOrder_address_id', 'data' => array('comp_id' => 'js:this.value'))));
?>
        
        <?php 
echo $form->dropDownListRow($model, 'address_id', $model->isNewRecord ? array() : Address::model()->getAddress($model->comp_id), array('prompt' => 'Select Company'));
?>
        
        <?php 
echo $form->dropDownListRow($model, 'payment_term_id', PaymentTerms::model()->getPaymentTerms());
?>
        
        <?php 
echo $form->dropDownListRow($model, 'is_open', array(1 => 'Open', 0 => 'Closed'));
?>

	<?php 
echo $form->textFieldRow($model, 'contact', array('class' => 'span5', 'maxlength' => 150));
?>

	<?php 
echo $form->textFieldRow($model, 'contact_telephone', array('class' => 'span5', 'maxlength' => 15));
?>
        
        <?php