Exemple #1
0
 public function getAttenderCount($eid)
 {
     $query = "select uid from userEvent where eid = " . $eid . " group by uid";
     $queryResult = parent::query($query);
     $attenderCount = 0;
     if (parent::rowExist($queryResult)) {
         $attenderCount = parent::numRows($queryResult);
     }
     return $attenderCount;
 }
Exemple #2
0
 public function getEventName($eid)
 {
     $query = "select name from event where eid = " . $eid;
     $queryResult = parent::query($query);
     $eventName = NULL;
     if (parent::rowExist($queryResult)) {
         $eventName = parent::queryResult($queryResult, 'name');
     }
     return $eventName;
 }
Exemple #3
0
 public function getExplanation($type)
 {
     $query = "select explanation from explanation where type = '" . $type . "'";
     $queryResult = parent::query($query);
     $explanation = NULL;
     if (parent::rowExist($queryResult)) {
         $explanation = parent::queryResult($queryResult, 'explanation');
     }
     return $explanation;
 }
Exemple #4
0
 public function checkHashExist($hash)
 {
     $query = "select uid from activationHash where hash = '" . $hash . "'";
     $queryResult = parent::query($query);
     if (parent::rowExist($queryResult)) {
         return parent::queryResult($queryResult, 'uid');
     } else {
         return false;
     }
 }
Exemple #5
0
 public function checkUserActivation($uid)
 {
     $query = "select activation from users where uid = " . $uid;
     $queryResult = parent::query($query);
     if (parent::rowExist($queryResult)) {
         $activation = parent::queryResult($queryResult, 'activation');
         if ($activation == '1') {
             return true;
         } else {
             //return false -> if activation is needed
             return true;
         }
     }
 }
Exemple #6
0
 public function checkRegisterData($input)
 {
     $query = "select uid from users where email = '" . $input['email'] . "'";
     $queryResult = parent::query($query);
     return parent::rowExist($queryResult);
 }
Exemple #7
0
 public function checkEmailExist($email)
 {
     $query = "select uid from users where email = '" . $email . "'";
     $queryResult = parent::query($query);
     return parent::rowExist($queryResult);
 }
Exemple #8
0
 public function checkUserExist($uid)
 {
     $query = "select uid from users where uid = " . $uid;
     $queryResult = self::query($query);
     return parent::rowExist($queryResult);
 }
Exemple #9
0
 public function getEmailCommentUser($cid, $uid)
 {
     $query = "select u.email, u.uid, u.firstname from users as u, commentSub as cs, notificationSetting as ns where u.uid = cs.wid and u.uid = ns.uid and ns.commentSub = 1 and cs.wid != " . $uid . " and cs.cid = " . $cid . " group by u.uid";
     $queryResult = parent::query($query);
     $sendEmailToArray = array();
     while ($result = parent::fetchArray($queryResult)) {
         $sendEmailToArray[] = array('uid' => $result['uid'], 'firstname' => $result['firstname'], 'email' => $result['email']);
     }
     $query = "select u.email, u.uid, u.firstname from users as u, comments as c, notificationSetting as ns where u.uid = c.wid and c.wid != " . $uid . " and u.uid = ns.uid and ns.commentSub = 1 and c.cid = " . $cid;
     $queryResult = parent::query($query);
     if (parent::rowExist($queryResult)) {
         $sendEmailToArray[] = array('uid' => parent::queryResult($queryResult, 'uid'), 'firstname' => parent::queryResult($queryResult, 'firstname'), 'email' => parent::queryResult($queryResult, 'email'));
     }
     return $sendEmailToArray;
 }
Exemple #10
0
 public function getSendEmailUser($uid)
 {
     $query = "select u.email, u.firstname, ns.eventInvite from users as u, notificationSetting as ns where u.uid = ns.uid and u.uid = " . $uid;
     $queryResult = parent::query($query);
     $user = array();
     if (parent::rowExist($queryResult)) {
         $user = array('eventInvite' => parent::queryResult($queryResult, 'eventInvite'), 'email' => parent::queryResult($queryResult, 'email'), 'firstname' => parent::queryResult($queryResult, 'firstname'));
     }
     return $user;
 }