示例#1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Encuesta();
     if (isset($_POST['Encuesta'])) {
         $model->attributes = $_POST['Encuesta'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionAdd()
 {
     $model = new Encuesta();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Encuesta'])) {
         $model->attributes = $_POST['Encuesta'];
         if ($model->save()) {
             $this->redirect(array('admin'));
         }
     }
     $this->render('add', array('model' => $model));
 }
示例#3
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Encuesta();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Encuesta'])) {
         $model->attributes = $_POST['Encuesta'];
         $model->fecha_f = date("Y-d-m H:i:s");
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }