public function actionIndex() { $this->pageTitle = 'Вывод средств'; $model = new Zakaz('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Zakaz'])) { $model->attributes = $_GET['Zakaz']; } $this->render('index', array('model' => $model)); }
/** * Lists all models. */ public function actionIndex($all = 0) { $model = new Zakaz('search'); $model->unsetAttributes(); if ($all == 1) { $model->setAttribute('status', -1); } if (Yii::app()->request->isAjaxRequest) { array_walk($_POST['Zakaz'], function (&$v, $k) { if (substr($k, 0, 2)) { if (strlen($v) > 10) { $v = substr($v, 0, 10); } } }); $params = Yii::app()->request->getParam('Zakaz'); $model->setAttributes($params); Yii::app()->user->setState('ZakazFilterState', $params); $this->renderPartial('index', array('model' => $model), false, true); } else { $params = Yii::app()->user->getState('ZakazFilterState'); if (isset($params)) { $model->setAttributes($params); } $this->render('index', array('model' => $model)); } }
/** * Manages all models. */ public function actionAdmin() { $model = new Zakaz('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Zakaz'])) { $model->attributes = $_GET['Zakaz']; } $this->render('admin', array('model' => $model)); }
public function actionList($status = 0) { $model = new Zakaz('search'); $model->unsetAttributes(); if (User::model()->isAuthor()) { $model->executor = 0; $model->status = 3; $user = User::model()->findByPk(Yii::app()->user->id); $fields = $model->getFields(); foreach ($fields as $field) { if ($field->field_type == 'LIST') { $tmp = $field->varname; $model->{$tmp} = $user->profile->{$tmp}; } } } $this->render('list', array('model' => $model)); }