Exemplo n.º 1
0
 $matchIds = $queryFunctionPtr($id);
 /* Display the users */
 $i = 0;
 foreach ($matchIds as $matchId) {
     if ($i % 3 == 0) {
         if ($i != 0) {
             echo "</div>";
         }
         echo "<div class='container jumbotron'>";
     }
     echo "<div class='col-xs-4'>";
     /* Display the match's name */
     $receiverUser = query_getNameFromId($matchId);
     echo "<h2>{$receiverUser}</h2>";
     /* Display the user's location */
     $locationResult = query_userInformationWithUserID($matchId);
     $location = $locationResult['location'];
     echo "<h4>{$location}</h4>";
     /* Display the match's first photo */
     $images = query_images($matchId);
     if ($images[0]) {
         echo "<p><img src=\"" . $images[0] . "\" width=75></img></p>";
     }
     /* Display the common interests between two users */
     $commonInterestResult = query_getCommonInterests($id, $matchId);
     $commonInterests = $commonInterestResult['commonInterests'];
     if (!isset($commonInterests)) {
         echo "<h4>Find something in common through messaging!</h4></br>";
     } else {
         echo "<h4>Common Interests: </h4><br>";
         foreach ($commonInterests as $commonInterest) {
Exemplo n.º 2
0
 /* Deal with POST requests */
 if (array_key_exists('hot', $_POST)) {
     insert_match($user_userid, $_POST['matchwith'], 't');
 } else {
     if (array_key_exists('not', $_POST)) {
         insert_match($user_userid, $_POST['matchwith'], 'f');
     }
 }
 /* Get all users this user has yet to try matching with */
 $result = query_getPremiumUnmatchedusers($user_userid);
 /* Grab the first one */
 $unmatchedUser = $result['unmatchedUsers'][0];
 if ($unmatchedUser) {
     /* If unmatchedUser exists, display their profile */
     /* Get their profile information */
     $result = query_userInformationWithUserID($unmatchedUser);
     $name = $result['name'];
     $age = $result['age'];
     /* Get this user's images */
     $result = query_images($unmatchedUser);
     echo "<h1>{$name} </h1>";
     echo "<p>Age: {$age} <b></b></p>";
     /* Display the images */
     foreach ($result as $img) {
         echo "<p><img src=\"" . $img . "\" width=150></img></p>";
     }
     /* Get common interests */
     $result = query_getCommonInterests($user_userid, $unmatchedUser);
     /* Display the interests */
     echo "<b>Common Interests</b><br>";
     foreach ($result['commonInterests'] as $commonint) {