echo json_encode($echo_stat); } else { $echo_stat['error'] = "Error"; $echo_stat['status'] = "There have been some problem. please try again later"; echo json_encode($echo_stat); } } } if ($_POST['action'] == 'updatecat') { echo getCatList($db, $_SESSION['UA_DETAILS']['randid'], $_SESSION['UA_DETAILS']['level']); } if ($_POST['action'] == 'updatesubcat') { echo getSubCatList($db, $_POST['category'], $_SESSION['UA_DETAILS']['randid'], $_SESSION['UA_DETAILS']['level']); } if ($_GET['action'] == 'uuonline' && !empty($_POST['key'])) { updateUserOnline($db, $_POST['key']); } if ($_GET['subaction'] == 'addqstn') { if (empty($_POST['quiz_category']) || empty($_POST['quiz_sub_category']) || empty($_POST['pq_qstn']) || empty($_POST['opt_count']) || empty($_POST['opt_ans']) || checkOpt($_POST['opt_count'])) { if (empty($_GET['submitType'])) { $_SESSION['ERROR']['type'] = 'Error'; $_SESSION['ERROR']['reason'] = "Please check One of the Fields is left empty"; } else { $errorAjax['type'] = 'Error'; $errorAjax['reason'] = "Please check One of the Fields is left empty"; echo json_encode($errorAjax); } } else { if (getSettings($db, 'umngqstn') || $_SESSION['UA_DETAILS']['level'] == 'admin') { if ($pq->pqAddQuestion($db, $_POST, $_SESSION['UA_DETAILS'], $_GET['type'])) { if (empty($_GET['submitType'])) {
function _loadUserData() { $data = $_SESSION['sessionuserdata']; #check session UserData if ($data) { $return = getUserByID($data['id'], $data['password']); if ($return) { $this->userdata = $return; updateUserOnline($this->userdata['uid']); #load login/logout box, useronlinebox refreshUserOnline(); $this->box['userbox']['title'] = 'Benutzerinfo'; $this->box['userbox']['username'] = $this->userdata['nick']; $this->box['userbox']['gala'] = $this->userdata['gala']; $this->box['userbox']['pos'] = $this->userdata['pos']; $this->box['userbox']['userid'] = $this->userdata['uid']; $this->box['userbox']['template'] = 'box_userdata_content.html'; $this->box['useronline']['title'] = 'User Online'; $list = listUserOnline(); for ($i = 0; $i < count($list); $i++) { $len = 11 - strlen($list[$i]['gala']) - strlen($list[$i]['pos']); if (strlen($list[$i]['nick']) > $len) { $list[$i]['name'] = substr($list[$i]['nick'], 0, $len) . ".."; } else { $list[$i]['name'] = $list[$i]['nick']; } } $this->box['useronline']['list'] = $list; $this->box['useronline']['template'] = 'box_useronline_content.html'; } else { deleteUserOnline($this->userdata['uid']); unset($_SESSION['sessionuserdata']); unset($data); } } }