Пример #1
0
 /**
  * /admin/contact/save/ [POST]
  */
 public function save($parameters)
 {
     if ($parameters || !$_POST) {
         $this->loadView('404');
     }
     $data = $_POST;
     $page = new Page($this->db, $this->business_id, 'contact');
     $page->setData($data);
     $page->save();
     $_SESSION['message'] = array('message' => 'Page saved.', 'status' => 'success');
     header('Location: /admin/contact/');
     exit;
 }
Пример #2
0
 /**
  * /admin/catering/save/ [POST]
  */
 public function save($parameters)
 {
     if ($parameters || !$_POST || !$_FILES) {
         $this->loadView('404');
     }
     $data = $_POST;
     $page = new Page($this->db, $this->business_id, 'catering');
     $images = $page->processImages($_FILES);
     if (!$images['status']) {
         $_SESSION['message'] = array('message' => $images['message'], 'status' => 'error');
         header('Location: /admin/catering/');
         exit;
     }
     unset($images['status']);
     $data = array_merge($data, $images);
     $page->setData($data);
     $page->save();
     $_SESSION['message'] = array('message' => 'Page saved.', 'status' => 'success');
     header('Location: /admin/catering/');
     exit;
 }