function Pretest() { global $qcount; global $uid; //chk onlne if (!is_online()) { echo ': APPLICATION OFFLINE'; } //TestEnd(); $loggedInUser = $_SESSION["userCakeUser"]; $_SESSION['mode'] = 'train'; $uid = $loggedInUser->user_id; $_SESSION['uid'] = $uid; GetUserInfo(); GetMyBattingside(); ChkStarted(); ChkConnect(); if (!isset($_SESSION['curquest'])) { $_SESSION['curquest'] = 1; } echo '<a href="op/views/index.html" class="btn btn-primary"> START</a>'; }
public function LoadATest() { global $mysqli; ChkConnect(); $sql = "SELECT * FROM st_tests"; $result = mysqli_query($mysqli, $sql); if (mysqli_num_rows($result) > 0) { $row_cnt = mysqli_num_rows($result); // output data of each row while ($row = mysqli_fetch_object($result)) { echo $title = $row->test_title; $description = $row->test_description; $team = $row->test_team; $focus = $row->test_focus; $active = $row->test_active; $author = $row->test_author; $created = $row->test_created; } } else { echo "0 results"; } //mysqli_close($mysqli); }