public function actionIndex() { $model = Weekend::model()->findByPk(1); $a = explode(", ", $model->day); $count = count($a); if (isset($_POST['Weekend'])) { $model->attributes = $_POST['Weekend']; if ($model->save()) { $this->refresh(); } } $this->render('index', array('model' => $model, 'count' => $count, 'a' => $a)); }
public function actionOrder() { $weekend = Weekend::model()->findByPk(1); $str_weekend = $weekend->day; $c = explode(', ', $str_weekend); $count = count($c); for ($i = 0; $i < $count; $i++) { $c[$i] = '"' . $c[$i] . '"'; } $new_str_weekend = implode(', ', $c); $model = new Orders(); if (isset($_POST['Orders'])) { $order_id = $_POST['Orders']['quest_id']; $date_day = $_POST['Orders']['date_day']; $this->redirect(array('step2', 'id' => $order_id, 'day' => $date_day)); } $this->render('order', array('model' => $model, 'new_str_weekend' => $new_str_weekend)); }
public function updItem($data) { $this->weekend->save(); }