Example #1
0
 /**
  * Show the homepage
  * @throws \Exception
  */
 public function home()
 {
     $logs = new Log();
     $logs->fetchAll();
     $this->to_tpl['logs'] = $logs;
     $this->template = "home";
     return;
 }
Example #2
0
 /**
  * Save the log
  * @throws \Exception
  */
 public function add_log()
 {
     $logName = $_POST['logText'];
     settype($logName, "string");
     $date = $_POST['date'];
     settype($date, "string");
     $log = new Log();
     $log->name = $logName;
     $log->date_added = new \DateTime($date);
     if ($id = $log->saveToDb()) {
         $this->print_ajax($id);
     } else {
         $this->print_ajax("false");
     }
 }