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);
require 'inc/database.class.php';
require 'inc/users.class.php';
require 'inc/functions.inc.php';
$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 ($_POST['type'] == 3 && !empty($_POST['department'])) {
            foreach ($_POST['department'] as $department)
               $db->query_first("INSERT INTO ".DB_TABLE."user_department (`USER_ID`,`DEPARTMENT_ID`) VALUES ('$user_id','$department')");
          }
       }
        $row = $db->query_first("SELECT fname, lname, email, type, receive, created FROM ".DB_TABLE."users WHERE ID={$user_id}");
        $deps = $db->fetch_all_array("SELECT ".DB_TABLE."departments.ID FROM ".DB_TABLE."departments, ".DB_TABLE."user_department WHERE ".DB_TABLE."departments.ID=".DB_TABLE."user_department.DEPARTMENT_ID AND ".DB_TABLE."user_department.USER_ID='{$user_id}'");
     }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>Users</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link href="css/styles.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" language="javascript"></script>
  <script type="text/javascript" src="js/jquery.tablesorter.min.js"></script> 
  <script type="text/javascript" src="js/jquery.tablesorter.pager.js"></script>
  <script src="js/jquery.livesearch.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
      $(document).ready(function () {
         $('table#client_list tbody tr').quicksearch({
            attached: "table#client_list",
            position: "before",
            labelText: null,
            inputText: 'Search users'
         });
         $('.qs_input').ready
      });
  </script>
  <script type="text/javascript">
  $(document).ready(function(){
     $('#close_message').click(function(){
      $('#message').slideUp();
   });
    $('#mover').hide();
    $('#type').change(function() {
       if($('#type').val() === "0" || $('#type').val() === "1" || $('#type').val() === "2" )
          $('#mover').slideUp('normal');
       else
          $('#mover').slideDown('normal');
    });
    <?php
    
    if ($row['type'] == 3)
       echo "$('#mover').slideDown('normal');";
    
    ?>
   $("#nav li ul").hide();   
   $("#nav li a.active").parent().find("ul").slideToggle("normal");
   
    $("#nav li a.top-item").click(
       function () {
          $(this).parent().siblings().find("ul").slideUp("normal");
          $(this).next().slideToggle("normal");
          return false;
       }
   );
   $("#nav li a.no-sub").click(
       function () {
          window.location.href=(this.href);
          return false;
       }
   ); 
   $("#nav li .top-item").hover(
       function () {
          $(this).stop().animate({ paddingRight: "25px" }, 200);
       }, 
       function () {
          $(this).stop().animate({ paddingRight: "16px" });
       }
   );
  });
  </script>
 </head>
 <body>
 
  <div id="wrapper">
   <div id="sidebar">
    <div id="header">
     <h1 id="logo">QuickTick<small><?php echo VERSION ?></small></h1>
     <div id="greeting">Welcome, <?php echo $user_details['fname'].' '.$user_details['lname'] ?> | <a href="<?php echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?logout=1'; ?>">Logout?</a></div>
    </div>
<?php load_menu($user_details['type'], $page, $tickets['num']); ?>
     
    </div>
  
   <div id="content">
    <?php
     if (isset($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>';
        if ($row) {
         echo '
         <div style="float:left;width:90px;height:90px;">
         '.get_gravatar($message['email'],'http://'.$_SERVER['HTTP_HOST'].WEBSITE_PATH.'/img/gravatar.jpg',80).'
         </div>
         <div style="float:left;"><h1 style="margin: 20px 0 0 0;">'.$row['fname'].' '.$row['lname'].'</big></h1>
           <span style="color:#999;">Created '.relative_date($row['created']).'</span>
         </div>
         <br class="clr" /><br />';
         ?>
         
         <div class="col">
<form action="" method="post" class="form">
<input type="hidden" name="created" value="<?php echo date("Y-m-d H:i:s") ?>" />
<label>First and Last Name</label>
<?php
if ($user_details['type'] <= 2)
   echo '<input type="text" name="name" class="text" value="'.$row['fname'].' '.$row['lname'].'" />';
else
   echo '<big>'.$row['fname'].' '.$row['lname'].'</big>';
?>
<label>Email</label>
<?php
if ($user_details['type'] <= 2)
   echo '<input type="text" name="email" class="text" value="'.$row['email'].'" />';
else
   echo '<big><a href="mailto:'.$row['email'].'">'.$row['email'].'</a></big>';
?>
<?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" />';
?>
<label>Account Type</label>
<?php
if ($user_details['type'] <= 2) {
   if ($row['type'] != 1) {
   echo '<select name="type" class="dropdown" id="type">';
   if ($user_details['type'] == 1)
      echo '<option value="1"'.($row['type']==1 ? ' selected="selected"' : '').'>Administrator</option>';
   if ($user_details['type'] < 2)
      echo '<option value="2"'.($row['type']==2 ? ' selected="selected"' : '').'>Manager</option>';
   if ($user_details['type'] < 3)
      echo '<option value="3"'.($row['type']==3 ? ' selected="selected"' : '').'>Staff</option>';
   echo '<option value="0"'.($row['type']==0 ? ' selected="selected"' : '').'>User</option>';
   } elseif ($user_details['type'] == 1 && $row['type'] == 1) {
   echo '<select name="type" class="dropdown" id="type">';
   echo '<option value="1"'.($row['type']==1 ? ' selected="selected"' : '').'>Administrator</option>';
   echo '<option value="2">Manager</option>';
   echo '<option value="3">Staff</option>';
   echo '<option value="0">User</option>';
   } else
   echo '<big>'.get_type($row['type']).'</big>';
} elseif ($user_details)
   echo '<big>'.get_type($row['type']).'</big>';
if ($user_details['type'] <= 2)
   echo '</select>';
?>
</select>
<div id="mover">
<?php
$array = $db->fetch_all_array("SELECT name, value FROM ".DB_TABLE."settings;");
foreach($array as $val){
      $settings[$val['name']] = $val['value'];
}
$rows = $db->fetch_all_array("SELECT ID, name FROM ".DB_TABLE."departments");
foreach ($deps as $dep) {
   $user_deps[] = $dep['ID'];
}
if ($user_details['type'] <= 2) {
echo '<label>Department <span>Hold SHIFT to select multiple departments</span></label>
<select name="department[]" class="dropdown" multiple="multiple" size="'.$db->affected_rows().'">';
foreach ($rows as $each) {
   echo '<option value="'.$each['ID'].
How to login with SAPCPIC userid
I have changed the Password for SAPCPIC in Development Server for 000,001 and 100 client.
Aris, Netweaver BPM, Visual composer and X'app
Dear Experts,
send message to the java application
Oracle 10g with Windows platform.
cURL Sending File as Post
This is a bit complicated, I'm just hoping someone else has run into this and knows how to do it a different way or make it work.When sending a file as part of form information included in a cURL
asking for direction
I have 2 tables in my data, which are "post" and "event"I won't make a summary page for showing the condition of these two tables.so what I am thinking is SELECT the fields inside
Read from a text file after a specific word
Hi all. I have a text file that looks like the one below. I know how to open the text file but I need to get the php pointer to take a value suck as $username. Once it finds $username, i need it to
my code does not work.
I have a code problem.Quote"<a href=index.php?gogo=ureticidetay&'?l={$letter}'>{$ letter}</a>" this is not working. but need link like this
Logic question
im wondering what's the best method to do the above list:it is for alliance @ MMORPG game -the administrator of alliance have 10 slots for creating ranks ... each rank have it's own permissions (in
Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will be multi-user. I've got the multi-deck shoe and dealing table done and other parts rough coded. What
Contents of variable not echoing
Hey guys, hopefully this is an easy one...In this line, the variables are not echoing out. The script runs without error though.Code: [Select]echo "Name: $name | E-mail: $email | Comments: