Exemplo n.º 1
0
 public function execute()
 {
     $request = $_REQUEST;
     $data = $request['data'];
     if (empty($data)) {
         throw new Exception('Missing Data');
     }
     if (empty($data['uid'])) {
         throw new Exception('Missing Uid');
     }
     if (empty($data['to_uid'])) {
         throw new Exception('Missing to user id');
     }
     if (empty($data['subject'])) {
         throw new Exception('Missing subject');
     }
     if (empty($data['message'])) {
         throw new Exception('Missing message');
     }
     $message_id = guid();
     $data['message_id'] = $message_id;
     $Models_Messages = new Models_Messages();
     $Models_Messages->add($data);
     $this->return = array('confirm' => 'Message sent successfully.', 'message_id' => $message_id);
 }
 public function execute()
 {
     if (empty($_GET['uid'])) {
         throw new Exception('Enter uid');
     }
     if (empty($_GET['message_id'])) {
         throw new Exception('Enter message id');
     }
     $uid = $_GET['uid'];
     $message_id = $_GET['message_id'];
     $Models_Messages = new Models_Messages();
     $return = $Models_Messages->message_details($message_id, $uid);
     $this->return = $return;
 }
Exemplo n.º 3
0
 public function execute()
 {
     if (empty($_GET['uid'])) {
         throw new Exception('Enter uid');
     }
     $nrows = 10;
     $offset = 0;
     if (empty($_GET['offset'])) {
         $offset = $_GET['offset'];
     }
     $uid = $_GET['uid'];
     $Models_Messages = new Models_Messages();
     $return = $Models_Messages->message_view($uid, $nrows, $offset);
     $this->return = $return;
 }