/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { if (!Yii::app()->user->id) { $this->redirect(array('site/login')); } $user = User::model()->findByPk(Yii::app()->user->uid); $status = CHtml::listData(Status::getStatus(), 'status', 'image'); if ($user->role_id == 2) { Yii::app()->user->setState('role', 2); } if (Yii::app()->user->isUser()) { $model = new Customer('search'); $model->franchise(); $model->desc(); $model->unsetAttributes(); if (isset($_GET['Customer'])) { $model->attributes = $_GET['Customer']; } $this->render('//customer/admin1', array('model' => $model, 'statuses' => json_encode($status))); } else { $criteria = new CDbCriteria(); $criteria->order = 'id desc'; if (Yii::app()->user->isFranchiseAdmin()) { $criteria->compare('franchise', Yii::app()->user->franchise); } $dataProvider = new CActiveDataProvider('Customer', array('criteria' => $criteria, 'pagination' => array('pageSize' => 10))); $this->render('welcome', array('dataProvider' => $dataProvider)); } }
public function actionAdmin() { $model = new Customer('search'); $model->unsetAttributes(); if (isset($_GET['Customer'])) { $model->setAttributes($_GET['Customer']); } $this->render('admin', array('model' => $model)); }
/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { $this->pageTitle = "List of Customer"; $model = new Customer('search'); $model->unsetAttributes(); if (isset($_GET['Customer'])) { $model->attributes = $_GET['Customer']; } $this->render($this->view . 'index', array('model' => $model)); }
/** * Manages all models. */ public function actionAdmin() { IsAuth::Admin(); $model = new Customer('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Customer'])) { $model->attributes = $_GET['Customer']; } $this->render('admin', array('model' => $model)); }
?> </div> </td> <td> <div class="row"> <?php echo $form->labelEx($model, 'addressbookid'); ?> <?php echo $form->hiddenField($model, 'addressbookid'); ?> <input type="text" name="product_name" id="fullname" readonly > <?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'addressbook_dialog', 'options' => array('title' => Yii::t('app', 'Customer'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true))); $customer = new Customer('search'); $customer->unsetAttributes(); // clear any default values if (isset($_GET['Customer'])) { $customer->attributes = $_GET['Customer']; } $this->widget('zii.widgets.grid.CGridView', array('id' => 'addressbook-grid', 'dataProvider' => $customer->Searchwstatus(), 'filter' => $customer, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+", array("name" => "send_absschedule", "id" => "send_absschedule", "onClick" => "$(\\"#addressbook_dialog\\").dialog(\\"close\\"); $(\\"#fullname\\").val(\\"$data->fullname\\"); $(\\"#Soheader_addressbookid\\").val(\\"$data->addressbookid\\"); "))'), array('name' => 'addressbookid', 'visible' => false, 'value' => '$data->addressbookid'), 'fullname'))); $this->endWidget('zii.widgets.jui.CJuiDialog'); echo CHtml::Button('...', array('onclick' => '$.fn.yiiGridView.update("addressbook-grid");$("#addressbook_dialog").dialog("open"); return false;')); ?> <?php echo $form->error($model, 'addressbookid'); ?>
/** * Lists all models. */ public function actionIndex() { parent::actionIndex(); $this->lookupdata(); $model = new Customer('searchwstatus'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Customer'])) { $model->attributes = $_GET['Customer']; } 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, 'customeraddress' => $this->customeraddress, 'customercontact' => $this->customercontact, 'acchutang' => $this->acchutang)); }
/** * Manages all models. */ public function actionAdmin() { $model = new Customer('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Customer'])) { $model->attributes = $_GET['Customer']; } if (isset($_GET['pageSize'])) { Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']); unset($_GET['pageSize']); } $this->render('admin', array('model' => $model)); }
public function actionCustomers() { $model = new Customer('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Customer'])) { $model->attributes = $_GET['Customer']; } $this->render('cus_index', array('customer' => $model, 'hasType' => false)); }