<?php
include("postget.php");
include_once("common.php");
$pagetitle = ucfirst(_TICKETS)." > ".ucfirst(_DEPARTMENTS);

checklevel(4,$_REQUEST['clientid']);

include("head_template.php");
echo '
<div class="container">
	<div class="row">
';

echo '<table id="table-1" class="table table-striped">';
print("<thead>
	<tr id='0' class='nodrop nodrag'>
	<th>&nbsp;</th> 
	<th>".ucfirst(_NAME)."</th> 
	<th>".ucfirst(_DESCRIPTION)."</th> 
	<th>".ucfirst(_EMAIL)."</th> 
	<th>".ucfirst(_ONLY_CLIENTS)."</th> 
	<th>POP3 - ".ucfirst(_SERVER)."</th> 
	<th>POP3 - ".ucfirst(_PORT)."</th> 
	<th>POP3 - ".ucfirst(_USER)."</th> 
	<th>".ucfirst(_OPTIONS)."</th>
	</tr></thead><tbody>");

$data = query("SELECT * FROM hd_tickets_dep ORDER by orderby",0);

$_SESSION['ordenar'] = "[hd_tickets_dep]{orderby}(depid)<>";


while($row=mysql_fetch_array($data)) {

	print("<tr><td class='dragHandle'>&nbsp;</td>");

	print("<td>".ucfirst($row[name])."</td>");
	print("<td>".ucfirst($row[description])."&nbsp;</td>");
	print("<td>".$row[email]."</td>");
	print("<td align='center'>"); if ($row[onlyclients]==1) {print("<img class='sprites green_status' src='images/transparent.gif' border='0'>");} print("&nbsp;</td>");
	print("<td align='center'>".$row[server]."&nbsp;</td>");
	print("<td align='center'>".$row[port]."&nbsp;</td>");
	print("<td align='center'>".$row[user]."&nbsp;</td>");
	print("<td align='center'>
	<a href='".$serverurl."/departments2.php?id=$row[depid]'><img class='sprites edit' src='images/transparent.gif' border='0' title='"._EDIT."'></a>
	<a href='".$serverurl."/departments3.php?id=$row[depid]&text=$row[name]'><img class='sprites del' src='images/transparent.gif' border='0' title='"._DELETE."'></a>
	</td>
	</tr></tbody>");
}
print("</table>");

graybutton("departments2.php",_ADD_DEPARTMENT);


echo '
</div>
</div>
';

include("foot_template.php");
?>
	
