/** * Manages all models. */ public function actionIndex() { $model = new Job('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Job'])) { $model->attributes = $_GET['Job']; } $this->render('index', array('model' => $model)); }
/** * Manages all models. */ public function actionAdmin() { unset(Yii::app()->request->cookies['from_date']); // first unset cookie for dates unset(Yii::app()->request->cookies['to_date']); $model = new Job('search'); $model->unsetAttributes(); // clear any default values if (!empty($_POST)) { Yii::app()->request->cookies['from_date'] = new CHttpCookie('from_date', $_POST['from_date']); // define cookie for from_date Yii::app()->request->cookies['to_date'] = new CHttpCookie('to_date', $_POST['to_date']); $model->from_date = $_POST['from_date']; $model->to_date = $_POST['to_date']; } if (isset($_GET['Job'])) { $model->attributes = $_GET['Job']; } $this->render('admin', array('model' => $model)); }
/** * Manages all models. */ public function actionAdmin() { $this->layout = '//layouts/blank'; $model = new Job('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Job'])) { $model->attributes = $_GET['Job']; } $this->render('admin', array('model' => $model)); }
public function actionUser($periodId = false) { $model = new Job('search'); $model->unsetAttributes(); if ($periodId) { $model->period_id = $periodId; } if (isset($_GET['Job'])) { $model->attributes = $_GET['Job']; } $this->render('user', array('model' => $model)); }