Esempio n. 1
0
 public function send($to, $subject, $message)
 {
     $db = new Database();
     $db->connect();
     $from = $this->userid;
     $today = date('Y-m-d H:i:s');
     $query = "insert into message \n\t\t(`id`, `senderid`, `receiverid`, `messagestatusid`, `subject`, `text`, `timestamp`) \n\t\tVALUES \n\t\t(NULL, '" . $from . "','" . $to . "','1','" . $subject . "','" . $message . "','" . $today . "')";
     $db->query($query);
     $body = "<font face=arial size=2>" . $this->getname('user', $from) . " has sent you a new message!<br><br>Please login at <a href='http://www.harvardconnection.co'>http://www.harvardconnection.co</a> to view the message.<br><br>Thanks,<br>The Harvardconnection Team";
     email::sendinfo($this->getemail($to), 'New Message', $body);
     return;
 }
Esempio n. 2
0
 public function confirm($uid, $rid)
 {
     $db = new Database();
     $db->connect();
     $query = "\n\t\t\t\tupdate relationship\n\t\t\t\tset `confirmed`='1'\n\t\t\t\twhere (`senderid`='" . $uid . "' and `receiverid`='" . $rid . "')\n\t\t\t\tor (`senderid`='" . $rid . "' and `receiverid`='" . $uid . "') limit 1";
     //echo $query;
     $db->query($query);
     $body = "<font face=arial size=2>" . $this->getname('user', $uid) . " confirmed your request.<br><br>Please login at <a href='http://www.harvardconnection.co'>http://www.harvardconnection.co</a> to view their profile.<br><br>Thanks,<br>The Harvardconnection Team";
     email::sendinfo(Relationship::getemail($rid), 'Request Confirmed', $body);
     return 1;
 }