コード例 #1
0
 public function read($id = null)
 {
     if ($id != null) {
         $message = new privateMessageModel();
         $message->markRead($id);
         header("location: " . $this->_link(array("index")) . "");
     } else {
         header("location: " . $this->_link(array("index")) . "");
     }
 }
コード例 #2
0
 public function archive()
 {
     $privateMessages = new privateMessageModel();
     $this->view->privateMessages = $privateMessages->loadExpired();
 }
コード例 #3
0
 private function loadSupervisorMessages()
 {
     $user = new userModel();
     $userId = $user->getId();
     $date = new DateTime();
     $date->setTime(0, 0, 0);
     $sql = "SELECT id FROM privateMessages WHERE supervisorId = '" . $userId . "' AND expireDate >= '" . $date->format('U') . "' ORDER BY postDate ASC";
     $query = $this->db->query($sql);
     $data = array();
     while ($result = $query->fetch_assoc()) {
         $message = new privateMessageModel();
         $data[] = $message->supervisorLoad($result['id']);
     }
     return $data;
 }