} echo '</ul>'; } } } ?> </form> </div> <div class="col-xs-6 col-md-4"> <?php if (admin_byEmail($myemail)) { echo '<h2>Welcome Admin</h2>'; echo '<h3><a href="adminUsr.php">Manage User</a></h3>'; } $myuid = sql_get_uid_byEmail($myemail); display_profile($myuid); echo '<div>'; if (isset($_GET['module']) && $_GET['module'] == 'refer') { echo '<a style="width:100%;" class="btn btn-warning" href="postrefer.php">Post New Refer!</a> '; } else { echo '<a style="width:100%;" class="btn btn-warning" href="postjob.php">Post New Job!</a> '; } echo '</div>'; echo '</div>'; echo '</div>'; echo '</div>'; include_once "footer.php"; ?> </body> </html>
if (sql_is_verified($myemail, $_SESSION['type'])) { } else { echo "<h3>Please verify your email</h3>"; return; } echo '<div style="width:700px; margin:auto" class = "container">'; echo '<h1>Profile Page</h1>'; $myUid = sql_get_uid_byEmail($myemail); if (isset($_GET['uid'])) { display_profile($_GET['uid']); if ($_GET['uid'] == $myUid && !admin_byEmail($_SESSION['email'])) { ?> <p><a href='settings.php'>Edit your profile</a> <?php } } else { display_profile($myUid); if (!admin_byEmail($_SESSION['email'])) { ?> <p><a href='settings.php'>Edit your profile</a> <?php } } ?> </div> <?php include_once "footer.php"; ?> </body> </html>
$profile_data = array_filter($data, function ($val) use($id) { return $val['id'] == $id; }); // 2. Rank and dispay if (count($profile_data) < 1) { echo '<p> No data <p>'; } else { // Split the user name data foreach ($profile_data as $profile) { $chunks = explode(' ', $profile['name']); foreach ($chunks as $keyword) { //Rank the keyword. rank_keyword($keyword); } } display_profile($profile_data); } } function get_data($json) { $string = file_get_contents($json); $json_a = json_decode($string, true); return $json_a['result']; } function rank_keyword($keyword) { // 1. Select key from db $sql = "SELECT Keyword, Hits FROM KeyHits WHERE Keyword=:keyword"; $params = array(':keyword' => $keyword); $stmt = _execute($sql, $params); $results = $stmt->fetchAll();