public function save()
 {
     if ($this->perm->can_create == 'y') {
         $data = new Contents();
         $data->from_array($_POST);
         $data->save();
         save_logs($this->menu_id, 'Update', $data->id, ' Update Footage Contact  ');
     }
     redirect($_SERVER['HTTP_REFERER']);
 }
Beispiel #2
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $this->addToolbar();
     $model = new Contents();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Contents'])) {
         $model->attributes = $_POST['Contents'];
         if ($model->save()) {
             $this->redirect(array('index'));
         }
     }
     $this->render('form', array('model' => $model));
 }
 public function save()
 {
     if ($this->perm->can_create == 'y') {
         $data = new Contents();
         if ($_POST['id'] == '') {
             $_POST['created_by'] = $this->current_user->id;
         } else {
             $_POST['updated_by'] = $this->current_user->id;
         }
         $data->from_array($_POST);
         $data->save();
         save_logs($this->menu_id, 'Update', $this->session->userdata("id"), ' Update ASEAN Declaration ');
     }
     redirect($_SERVER['HTTP_REFERER']);
 }