Example #1
0
    {
        return $this->status_description;
    }
    //Get message
    public function getMessage()
    {
        return $this->message;
    }
}
//Join status
$sql = "SELECT * FROM users\n\t\t\tINNER JOIN status \n\t\t\tON user_id = fk_user_id \n\t\t\tINNER JOIN descriptions \n\t\t\tON fk_description_id = description_id\n\t\t\tINNER JOIN messages\n\t\t\tON message_id = fk_message_id";
$member_list = array();
if ($query = mysqli_query($dbc, $sql)) {
    while ($row = mysqli_fetch_assoc($query)) {
        $member = new Member();
        $member->setId($row["user_id"]);
        $member->setName($row["user_name"]);
        $member->setImage($row["user_img"]);
        $member->setStatusId($row["fk_description_id"]);
        $member->setStatusDescription($row["description_text"]);
        $member->setMessage($row["message_text"]);
        array_push($member_list, $member);
    }
}
?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
Example #2
0
 public function profil()
 {
     $msg = "";
     $member = new Member();
     // LA PAGE N'EST ACCESSIBLE QUE SI UN MEMBRE OU ADMIN EST CONNECTE
     if ($member->sessionExists()) {
         $memberID = $_SESSION['user']['id_membre'];
         $member->setId($memberID);
         $connectedMember = $member->retrieveMember($memberID);
         $orders = $member->access_modelOrder_findOrdersById();
         $msg .= '<div class="panel panel-primary">';
         $msg .= '<div class="panel-heading">';
         if ($connectedMember['statut'] == 1) {
             $msg .= '<span class="profilTitle">Administrateur : </span>';
         } else {
             $msg .= '<span class="profilTitle">Membre : </span>';
         }
         $msg .= '<span class="profilTitle">' . $connectedMember['pseudo'] . '</span>';
         $msg .= '</div>';
         $msg .= '<div class="panel-body ficheProfil">';
         $msg .= '<p><label class="profilDetail">Pseudo: </label>' . $connectedMember['pseudo'] . '</p>';
         $msg .= '<p><label class="profilDetail">Nom: </label>' . $connectedMember['nom'] . '</p>';
         $msg .= '<p><label class="profilDetail">Prénom: </label>' . $connectedMember['prenom'] . '</p>';
         $msg .= '<p><label class="profilDetail">Adresse mail: </label>' . $connectedMember['email'] . '</p>';
         $msg .= '<p><label class="profilDetail">Adresse: </label>' . $connectedMember['adresse'] . '</p>';
         $msg .= '<p><label class="profilDetail">Code postal: </label>' . $connectedMember['cp'] . '</p>';
         $msg .= '<p><label class="profilDetail">Ville: </label>' . $connectedMember['ville'] . '</p>';
         $msg .= '<a class="btn btn-default pull-right" href="index.php?controller=members&action=modifyProfile&id=' . $memberID . '" title="Modifier mon profil">Mettre à jour mes informations</a>';
         $msg .= '<div class="clearfix"></div><br/>';
         if ($connectedMember['statut'] == 1) {
             $msg .= '<div class="panel panel-default">';
             $msg .= '<div class="panel-body">';
             $msg .= 'Vous êtes administrateur';
             $msg .= '</div>';
             $msg .= '</div>';
         }
         $msg .= '</div>';
         $msg .= '</div>';
         $msg .= '<div class="panel panel-primary">';
         $msg .= '<div class="panel-heading">';
         $msg .= 'Vos dernières commandes';
         $msg .= '</div>';
         $msg .= '<div class="panel-body">';
         $msg .= '<table class="table table-hover">';
         $msg .= '<tr>';
         $msg .= '<th>Numéro de suivi</th>';
         $msg .= '<th>Montant</th>';
         $msg .= '<th>Date</th>';
         $msg .= '</tr>';
         foreach ($orders as $lastorder) {
             $date = new DateTime($lastorder['date']);
             $lastorder['date'] = $date->format('d-m-Y');
             $msg .= '<tr>';
             $msg .= '<td>' . $lastorder['id_commande'] . '</td>';
             $msg .= '<td>' . $lastorder['montant'] . '</td>';
             $msg .= '<td>' . $lastorder['date'] . '</td>';
             $msg .= '</tr>';
         }
         $msg .= '</table>';
         $msg .= '</div>';
         $msg .= '</div>';
     } else {
         $msg .= 'Vous n\'avez pas le droit d\'accéder à cette page.<br/>Vous devez être connecté en tant que membre.';
     }
     include "views/members/profile.php";
 }
 public function executePublicHangoutReview(sfWebRequest $request)
 {
     if (!isset($_GET['id'])) {
         die('Sorry! page cannot be found.');
     }
     $profileId = $_GET['id'];
     $Member = new Member();
     $Member->setId($profileId);
     $memberId = $Member->getMemberInfo('id');
     $gender = $Member->getMemberInfo('gender');
     $profilePictureId = $Member->getMemberInfo('profile_picture_id');
     $Photo = new Photo();
     $this->path = $Photo->getPicturePath($profilePictureId);
     $this->photos = array();
     $this->photos = $Photo->getPhotos($memberId);
     if (empty($this->path)) {
         $pictureName = strtolower($gender) == 'f' ? 'female.jpg' : 'male.png';
         $this->path = "images/{$pictureName}";
     }
     $this->userId = $memberId;
 }
 public function executeSaveChanges(sfWebRequest $request)
 {
     try {
         $q = Postings::getPostingInfo($_REQUEST['posting_id']);
         $q->gender_type = $_REQUEST['gender_type'];
         $q->date_to_hangout = date("Y-m-d", strtotime($_REQUEST['startdt_hangout']));
         $q->num_ppl = $_REQUEST['num_ppl'];
         $q->posting_enddt = $this->calculatePostingEndDate($_REQUEST['posting_enddt'], $_REQUEST['starttime'], $_REQUEST['startdt_hangout']);
         $q->age_range_1 = $_REQUEST['age_range_1'];
         $q->age_range_2 = $_REQUEST['age_range_2'];
         $q->starttime = $_REQUEST['starttime'];
         $q->endtime = $_REQUEST['endtime'];
         $q->posting_title = $_REQUEST['posting_title'];
         $q->posting_desc = $_REQUEST['posting_desc'];
         $q->enddate_hangout = date("Y-m-d", strtotime($_REQUEST['enddt_hangout']));
         $q->save();
         $hotlistMembers = HotList::getHotListMembers($_REQUEST['posting_id'], $_SESSION['userId']);
         $Member = new Member();
         $Member->setId($_SESSION['userId']);
         $nick_name = $Member->getMemberInfo('nick_name');
         foreach ($hotlistMembers as $v) {
             $body = '
                 <div style="font-family:tahoma;font-size:12px;">
                     Hi <b>' . $v->getMember()->getNickName() . '</b>,
                     <br/><br/>
                     <p>
                         <b> ' . $nick_name . ' </b> has made some changes on a post with title "<b>' . $v->getPostings()->getPostingTitle() . '</b>".
                     </p>
                     <br/>
                     Thank you
                     <br/>                    
                 </div>';
             CustomHangout::email($v->getMember()->getEmail(), $body, 'HangOutToday', 'HangOutToday Notification');
         }
         die(true);
     } catch (Exception $e) {
         die(false);
     }
 }
 static function getMembersByObjectAndDimension($object_id, $dimension_id, $extra_conditions = "")
 {
     $sql = "\r\n  \t\t\t\tSELECT m.* \r\n  \t\t\t\tFROM " . TABLE_PREFIX . "object_members om \r\n  \t\t\t\tINNER JOIN " . TABLE_PREFIX . "members m ON om.member_id = m.id \r\n  \t\t\t\tWHERE \r\n  \t\t\t\t\tdimension_id = '{$dimension_id}' AND \r\n  \t\t\t\t\tom.object_id = '{$object_id}' \r\n  \t\t\t\t\t{$extra_conditions}\r\n  \t\t\t\tORDER BY m.name";
     $result = array();
     $rows = DB::executeAll($sql);
     if (!is_array($rows)) {
         return $result;
     }
     foreach ($rows as $row) {
         $member = new Member();
         $member->setFromAttributes($row);
         $member->setId($row['id']);
         $result[] = $member;
     }
     return $result;
 }
 		static function getMembersByObjectAndDimension($object_id, $dimension_id, $extra_conditions = "") {
 			$sql = "
 				SELECT m.* 
 				FROM ".TABLE_PREFIX."object_members om 
 				INNER JOIN ".TABLE_PREFIX."members m ON om.member_id = m.id 
 				WHERE 
 					dimension_id = '$dimension_id' AND 
 					om.object_id = '$object_id' 
 					$extra_conditions
 				ORDER BY m.name";
 			
 			$result = array();
 			$rows = DB::executeAll($sql);
 			if (!is_array($rows)) return $result;
 			
 			foreach ($rows as $row) {
 				$member = new Member();
 				$member->setFromAttributes($row);
 				$member->setId($row['id']);
 				$result[] = $member;
 			}
 			return $result;
 		}
Example #7
0
<?php

require_once './resource/models/member.php';
if ($_POST['member_id']) {
    $member = new Member();
    if ($_POST["member_id"] != "") {
        $member->setId($_POST["member_id"]);
        $result = $member->delete();
        if ($result) {
            $message = "<p class=\"message success\"><i class=\"material-icons\">done</i>Member deleted!</p>";
        } else {
            $message = "<p class=\"message error\"><i class=\"material-icons\">error</i>Error: Member was not deleted</p>";
        }
    } else {
        $message = "<p class=\"message error\"><i class=\"material-icons\">error</i>Error: Blank member ID specified in POST request</p>";
    }
} else {
    $message = "<p class=\"message error\"><i class=\"material-icons\">error</i>Error: No member ID specified in POST request</p>";
}
Example #8
0
<?php

require_once './resource/config/connectDB.php';
require_once './resource/models/member.php';
$member = new Member();
if (isset($member_id)) {
    $member->setId($member_id);
    $member->read();
} else {
    $member = $member->allPublicRecords();
}