Esempio n. 1
0
 public function homeAction()
 {
     $form = new Form\RegisterEstimote($_POST, array('db' => $this->db));
     if ($this->method == 'POST' && $form->isValid()) {
         $estimote = new Model\Estimote($form->getValues());
         $estimote['created'] = date("Y-m-d");
         $estimote['user_id'] = $this->session->getUser()->getPk();
         $estimote->save();
         $this->redirect('backoffice');
     }
     $val = $this->session->getUser()->getPk();
     $stmt = $this->db->query("SELECT * FROM `esti_beacon` WHERE `user_id` =  {$val}");
     $lama = $stmt->fetchAll();
     return array('form' => $form, 'query' => $lama);
 }