public function actionAdmin() { $model = new VoucherType('search'); $model->unsetAttributes(); if (isset($_GET['VoucherType'])) { $model->setAttributes($_GET['VoucherType']); } $this->render('admin', array('model' => $model)); }
<?php echo $form->labelEx($model, 'subdistribution_id'); ?> <?php echo $form->dropDownList($model, 'subdistribution_id', GxHtml::listDataEx(Subdistribution::model()->findAllAttributes(null, true))); ?> <?php echo $form->error($model, 'subdistribution_id'); ?> </div><!-- row --> <div class="row"> <?php echo $form->labelEx($model, 'type_id'); ?> <?php echo $form->dropDownList($model, 'type_id', GxHtml::listDataEx(VoucherType::model()->findAllAttributes(null, true))); ?> <?php echo $form->error($model, 'type_id'); ?> </div><!-- row --> <div class="row"> <?php echo $form->labelEx($model, 'expiration_date'); ?> <?php echo $form->textField($model, 'expiration_date'); ?> <?php echo $form->error($model, 'expiration_date'); ?>
<?php $this->breadcrumbs = array(VoucherType::label(2), Yii::t('app', 'Index')); $this->menu = array(array('label' => Yii::t('app', 'Create') . ' ' . VoucherType::label(), 'url' => array('create')), array('label' => Yii::t('app', 'Manage') . ' ' . VoucherType::label(2), 'url' => array('admin'))); ?> <h1><?php echo GxHtml::encode(VoucherType::label(2)); ?> </h1> <?php $this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
echo $form->error($model, 'deleted_at'); ?> </div><!-- row --> <label><?php echo GxHtml::encode($model->getRelationLabel('distributions')); ?> </label> <?php echo $form->checkBoxList($model, 'distributions', GxHtml::encodeEx(GxHtml::listDataEx(Distribution::model()->findAllAttributes(null, true)), false, true)); ?> <label><?php echo GxHtml::encode($model->getRelationLabel('vendorTypes')); ?> </label> <?php echo $form->checkBoxList($model, 'vendorTypes', GxHtml::encodeEx(GxHtml::listDataEx(VendorType::model()->findAllAttributes(null, true)), false, true)); ?> <label><?php echo GxHtml::encode($model->getRelationLabel('voucherTypes')); ?> </label> <?php echo $form->checkBoxList($model, 'voucherTypes', GxHtml::encodeEx(GxHtml::listDataEx(VoucherType::model()->findAllAttributes(null, true)), false, true)); ?> <?php echo GxHtml::submitButton(Yii::t('app', 'Save')); $this->endWidget(); ?> </div><!-- form -->
<?php $this->breadcrumbs = array($model->label(2) => array('index'), Yii::t('app', 'Manage')); $this->menu = array(array('label' => Yii::t('app', 'List') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create'))); Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('distribution-voucher-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1><?php echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2)); ?> </h1> <p> You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done. </p> <?php echo GxHtml::link(Yii::t('app', 'Advanced Search'), '#', array('class' => 'search-button')); ?> <div class="search-form"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'distribution-voucher-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', array('name' => 'subdistribution_id', 'value' => 'GxHtml::valueEx($data->subdistribution)', 'filter' => GxHtml::listDataEx(Subdistribution::model()->findAllAttributes(null, true))), array('name' => 'type_id', 'value' => 'GxHtml::valueEx($data->type)', 'filter' => GxHtml::listDataEx(VoucherType::model()->findAllAttributes(null, true))), 'expiration_date', 'create_date', 'deleted_at', array('class' => 'CButtonColumn'))));
<div class="row"> <?php echo $form->label($model, 'subdistribution_id'); ?> <?php echo $form->dropDownList($model, 'subdistribution_id', GxHtml::listDataEx(Subdistribution::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All'))); ?> </div> <div class="row"> <?php echo $form->label($model, 'type_id'); ?> <?php echo $form->dropDownList($model, 'type_id', GxHtml::listDataEx(VoucherType::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All'))); ?> </div> <div class="row"> <?php echo $form->label($model, 'expiration_date'); ?> <?php echo $form->textField($model, 'expiration_date'); ?> </div> <div class="row"> <?php echo $form->label($model, 'create_date');