<?php 
if(!isset($_SESSION["logado"]) == 1) {
	exit('<div class="box_conteudo">Voc&ecirc; n&atilde;o pode acessar esta p&aacute;gina</div>');
}
else{
$cargo = mssql_fetch_row(mssql_query("select cargo from ct_equipe where login='".$_SESSION["login"]."'"));
if($cargo[0] < 2) {
	exit('<div class="box_conteudo">Voc&ecirc; n&atilde;o tem benef&iacute;cio para acessar esta p&aacute;gina</div>');
}
else{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<div class="about-team-page-top-wrap" style="padding-bottom: 0px; margin-top: -5px;">
    <div class="top-title" style="width: 100%;">
        <div class="w_note">.......Gerencie chamados de suporte.</div>
    </div>
</div>
<div class="match-list-wrap">
<br />
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td style="color: #fff"><div align="center"><strong>Ticket</strong></div></td>
    <td style="color: #CCC"><div align="center"><strong>Personagem</strong></div></td>
    <td style="color: #CCC"><div align="center"><strong>Assunto</strong></div></td>
    <td style="color: #CCC"><div align="center"><strong>Data</strong></div></td>
    <td style="color: #CCC"><div align="center"><strong>Status</strong></div></td>
  </tr>
  <?php 
  $ticket = mssql_query("select msg,personagem,data,status,id,assunto from ct_tickets order by id desc");
  for($i=0;$i<mssql_num_rows($ticket);$i++) {
  	$pega = mssql_fetch_row($ticket);
  	switch($pega[3]) {
			case 0: $status = "<div style=\"color:#6C0\"><font color=\"#6C0\">Aberto</font></div>"; break;
		case 1: $status = "<div style=\"color:'#F00\"><font color=\"red\">Fechado</font></div>"; break;
	}
	echo '<tr>
    <td style="color: #fff"><div align="center"><a href="javascript: void(0);" onclick="loading(\'?go=ticket&ver=true&id='.$pega[4].'\', \'escolha\');">'.substr($pega[0],0,20).'.....</a></div></td>
    <td style="color: #fff"><div align="center">'.$pega[1].'</div></td>
	<td style="color: #fff"><div align="center">'.$pega[5].'</div></td>
    <td style="color: #fff"><div align="center">'.$pega[2].'</div></td>
    <td><div align="center">'.$status.'</div></td>
  </tr>';
}
  ?>
</table><br />
<br />
</div>

</body>
</html>
<? }} ?>