hello, i receive the error :Parse error: syntax error, unexpected $end in C:xamppxampphtdocshelpdeskusers.php on line 372 i looked allover the code but i can't find the curly bracket missing or what is generating the error Code: <?php define('_VALID_','1'); $timestart = microtime(1);
$db = new database(); $link = $db->get_link_id(); $user = new userAccess($link);
$page = 'View Users'; $id = $user->get_property('ID'); $user_details = $db->query_first("SELECT fname, lname, email, type, receive, created FROM ".DB_TABLE."users WHERE ID={$id}");
if ( $_GET['logout'] == 1 ) $user->logout('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); if ( !$user->is_loaded() ) { //Login stuff: if ( isset($_POST['login']) && isset($_POST['pwd'])){ if ( !$user->login($_POST['login'],$_POST['pwd'],$_POST['remember'] )){ $error = true; }else{ //user is now loaded header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); } } load_login($error); } elseif (!check_credentails($page,$user_details['type'])) { echo 'You have insufficient privileges.'; } else { if ($user_details['type'] == 3) { $deps = $db->fetch_all_array("SELECT DEPARTMENT_ID as dep FROM ".DB_TABLE."user_department WHERE USER_ID='{$id}'");;
if ($deps) { $num = count($deps); $i = 0; $addon = " AND ("; foreach ($deps as $dep) { $addon .= " DEPARTMENT_ID='{$dep['dep']}'".($num != ++$i ? ' OR': ''); } $addon .= ")"; } else { // Has been assigned no departments, so they can't see any tickets $addon = " AND (DEPARTMENT_ID='-1')"; } } $tickets = $db->query_first("SELECT COUNT(*) as num FROM ".DB_TABLE."tickets WHERE `parent`='0' AND `status` != 'Resolved'".($user_details['type'] == 0 ? " AND `by`='{$id}'": '').$addon.";");
if (isset($_GET['id'])) { $user_id = (int) $_GET['id']; if (isset($_POST['submit'])) { $name = explode(" ",$_POST['name'],2); $data = Array ( 'fname' => $name['0'], 'lname' => $name['1'], 'email' => $_POST['email'], 'receive' => $_POST['receive'] ); if (isset($_POST['type'])) $data['type'] = $_POST['type']; if (trim($_POST['pass'] != '')) $data['pass'] = md5($_POST['pass']); $update = $db->query_update("users",$data,"ID='{$user_id}'"); $db->query("DELETE FROM ".DB_TABLE."user_department WHERE USER_ID='{$user_id}';");
if (isset($_POST['submit']) && $update) echo '<div id="message" class="success"><p><img id="close_message" style="float:right;cursor:pointer" src="img/cancel.png" /><big>Success!</big><br />User has been successfully updated!</p></div>'; elseif (isset($_POST['submit'])) echo '<div id="message" class="error"><p><img id="close_message" style="float:right;cursor:pointer" src="img/cancel.png" /><big>Error!</big><br />User has not been successfully updated! We apologize for the inconvenience. Try again, and if the problem persists, please send us an email at <a href="mailto:'.ADMIN_EMAIL.'">'.ADMIN_EMAIL.'</a> or contact Tommy (The Developer) at <a href="mailto:quicktick@sirestudios.com">quicktick@sirestudios.com</a>.</p></div>';
<?php if ($user_details['type'] <= 2) echo '<label>Password <span>Enter a new password for user</span></label><input type="password" name="pass" class="text" />'; ?>