<?
include($DOCUMENT_ROOT.'/helpdesk/include/database.php');
include($DOCUMENT_ROOT.'/helpdesk/include/new_user.php');
session_start();
if ($valid != "yes") {
header("Location: /helpdesk/login.php");
exit;
}
$head = "View User";
$bttm_menu = " <a class=bttm_menu href='/helpdesk/scripts/main_adminmenu.php'>Main Menu</a> |
<a class=bttm_menu href='/helpdesk/scripts/admin/admin_viewuser.php'>View Users</a> |
<a class=bttm_menu href='/helpdesk/scripts/admin/admin_adduser.php'>Add a User</a> |
<a class=bttm_menu href='/helpdesk/scripts/admin/admin_moduserview.php'>Modify a User</a> |
<a class=bttm_menu href='/helpdesk/scripts/admin/admin_remuser.php'>Remove a User</a> |
<a class=bttm_menu href='/helpdesk/logout.php'>Log Out</a> |
";
//Get the user info
$sql = "SELECT * FROM help_users WHERE user_id = '$select_userid'";
$result = mysql_query($sql,$conn);
while ($row = mysql_fetch_array($result)) {
$user_id_dis = $row['user_id'];
$f_name = $row['f_name'];
$m_name = $row['m_name'];
$l_name = $row['l_name'];
$email = $row['email'];
$work_num = $row['work_num'];
$mobile_num = $row['mobile_num'];
$fax = $row['fax'];
$username_temp = $row['username'];
$job_title = $row['job_title'];
$get_per_id = $row['per_id'];
$get_dept_id = $row['dept_id'];
$get_build_id = $row['build_id'];
$get_site_id = $row['site_id'];
$comments = $row['comments'];
}
$users_name = "$f_name $m_name $l_name";
$sql = "SELECT * FROM permissions";
$result = mysql_query($sql,$conn);
while ($row = mysql_fetch_array($result)) {
$getper_id = $row['per_id'];
$getper_name = $row['per_name'];
if (($getper_id == '1') && ($get_per_id == '1')) { $per_name = $getper_name; }
if (($getper_id == '2') && ($get_per_id == '2')) { $per_name = $getper_name; }
if (($getper_id == '3') && ($get_per_id == '3')) { $per_name = $getper_name; }
if (($getper_id == '4') && ($get_per_id == '4')) { $per_name = $getper_name; }
if (($getper_id == '5') && ($get_per_id == '5')) { $per_name = $getper_name; }
}
$bottom = "
<h1>View User</h1>
<table>
<th class=table_header colspan=3>Name and Contact Information</th>
<tr><td>
<tr><td class=user width=100>Name:<td> <td width=200>$users_name
<td class=user width=130>Work No:<td> <td width=100>$work_num
<tr><td class=user width=100>E-Mail:<td> <td width=200>$email
<td class=user width=130>Mobile No:<td> <td width=100>$mobile_num
<tr><td class=user width=100><td> <td width=200>
<td class=user width=130>Fax No:<td> <td width=100>$fax
</table>
<br>
<table>
<th class=table_header>Login Details</th>
<tr><td>
<tr><td class=pass width=100>Username:<td> <td width=200>$username_temp
<td class=pass width=130>Access Level:<td> <td width=200>$per_name
</table>
<br>
<table border=0>
<th class=table_header colspan=2>Further Details</th>
<tr><td>
<tr><td class=other width=100 nowrap>Job Title:<td> <td width=200>$job_title
<td class=other width=130 nowrap>Building:<td> <td width=200>$get_build_id
<tr><td class=other width=100 nowrap>Department:<td> <td width=200>$get_dept_id
<td class=other width=130 nowrap>Site:<td> <td width=200>$get_site_id
<tr><td class=other width=100 nowrap>Comments:<td> <td width=200>$comments
</table>
";
include($DOCUMENT_ROOT.'/helpdesk/include/template.inc.php');
?>