<?php if ($db_conn) { /* default query function pointer set here */ $queryFunctionPtr = 'query_getSuccessfulMatches'; if ($_SESSION['matchOrderBy']) { $queryFunctionPtr = $_SESSION['matchOrderBy']; } /* Handle POSTs */ if (array_key_exists('insert_sendMessage', $_POST)) { insert_sendMessage($user_userid, $_POST['insert_sendMessage'], $_POST['messageStr']); /* Commit to save changes... */ OCICommit($db_conn); } else { if (array_key_exists('block', $_POST)) { insert_match($user_userid, $_POST['block'], 'f'); /* Commit to save changes... */ OCICommit($db_conn); } else { if (array_key_exists('orderByMessageCount', $_POST)) { $queryFunctionPtr = 'query_getSuccessfulMatchesOrderByMessageCount'; } else { if (array_key_exists('orderByCommonInterests', $_POST)) { $queryFunctionPtr = 'query_getSuccessfulMatchesOrderByCommonInterests'; } else { if (array_key_exists('defaultOrder', $_POST)) { $queryFunctionPtr = 'query_getSuccessfulMatches'; } else { if (array_key_exists('filterOnlyPerfectMatches', $_POST)) { $queryFunctionPtr = 'query_getPerfectMatches'; }
<body> <?php include 'menu.php'; ?> <div class="maincontent"> <h1>Tinder++ Premium</h1> <p> Premium matches share all of your interests </p> <?php include 'session.php'; if ($db_conn) { /* 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>";