$searchString = '%' . $searchString; } if ($searchOper == 'cn' || $searchOper == 'nc' || $searchOper == 'in' || $searchOper == 'ni') { $searchString = '%' . $searchString . '%'; } $where = "{$searchField} {$ops} '{$searchString}'"; if ($session->user_group_id == 0) { $scores = Score::get_by_sql("SELECT * FROM " . T_SCORES . " WHERE " . $where . " ORDER BY {$sidx} {$sord} LIMIT {$start} , {$limit}"); } else { $scores = Score::get_by_sql("SELECT * FROM " . T_SCORES . " WHERE " . C_SCORE_USER_ID . " IN (SELECT " . C_USER_UNIQUE_ID . " FROM " . T_USERS . " WHERE " . C_USER_GROUP_ID . " = " . $session->user_group_id . ") AND " . $where . " ORDER BY {$sidx} {$sord} LIMIT {$start} , {$limit}"); } } else { if ($session->user_group_id == 0) { $scores = Score::get_by_sql("SELECT * FROM " . T_SCORES . " ORDER BY {$sidx} {$sord} LIMIT {$start} , {$limit}"); } else { $scores = Score::get_by_sql("SELECT * FROM " . T_SCORES . " WHERE " . C_SCORE_USER_ID . " IN (SELECT " . C_USER_UNIQUE_ID . " FROM " . T_USERS . " WHERE " . C_USER_GROUP_ID . " = " . $session->user_group_id . ") ORDER BY {$sidx} {$sord} LIMIT {$start} , {$limit}"); } } header("Content-type: text/xml;charset=utf-8"); $s = "<?xml version='1.0' encoding='utf-8'?>"; $s .= "<rows>"; $s .= "<page>" . $page . "</page>"; $s .= "<total>" . $total_pages . "</total>"; $s .= "<records>" . $count . "</records>"; foreach ($scores as $score) { $s .= "<row id='" . $score->id . "'>"; $s .= "<cell></cell>"; $s .= "<cell>" . $score->score . "</cell>"; $s .= "<cell>" . $score->user_id . "</cell>"; $s .= "<cell>" . $score->time_elapsed . "</cell>"; $s .= "<cell>" . $score->correct_answers . "</cell>";
<?php require_once "../../includes/initialize.php"; global $session; if (!$session->is_logged_in()) { redirect_to("login.php"); } $user = User::get_by_id($session->user_id); $scores = Score::get_by_sql("SELECT * FROM " . T_SCORES . " WHERE " . C_SCORE_USER_ID . "=" . $user->id . " ORDER BY " . C_SCORE_DATE); $highest_score = Score::get_highest_score($user->id); $recent_score = Score::get_recent_score($user->id); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title> </title> <link rel="stylesheet" href="../css/jquery.mobile-1.1.1.min.css" /> <link rel="stylesheet" href="my.css" /> <style> </style> <script src="../js/jquery-1.8.2.js"></script> <script src="../js/jquery.mobile-1.1.1.min.js"></script> <script src="my.js"></script> </script> </head> <body> <!-- Home -->