<style type="text/css">

.tg  {border-collapse:collapse;border-spacing:0;border-color:#aabcfe;}

.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aabcfe;color:#669;background-color:#e8edff;}

.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aabcfe;color:#039;background-color:#b9c9fe;}

.tg .tg-baqh{text-align:center;vertical-align:top}

.tg .tg-43nb{font-weight:bold;text-decoration:underline;text-align:center}

.tg .tg-hgcj{font-weight:bold;text-align:center}

.tg .tg-yw4l{vertical-align:top}

@media screen and (max-width: 767px) {.tg {width: auto !important;}.tg col {width: auto !important;}.tg-wrap {overflow-x: auto;-webkit-overflow-scrolling: touch;}}</style>

<div class="tg-wrap"><table class="tg" width="100%" >

  <tr>

    <th class="tg-hgcj" colspan="6">Chamados</th>

    <!-- botao abrir chamado inicio -->  

	<th class="tg-baqh" colspan="2" width="10%">

     <form action="index.php" method="POST" >

	<input type="hidden" name="acao" value="novo" />

	<input type="hidden" name="tabela" value="chamado" />

	<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />

	<input type = "submit" value ="Abrir Chamado" name="botao" />

	</form>

	</th>

    <!-- botao abrir chamado fim -->

  </tr>

  <tr>

    <td class="tg-hgcj">

   <form action="index.php" method="POST" >

	<input type="hidden" name="acao" value="lista" />

	<input type="hidden" name="tabela" value="chamado" />

	<input type="hidden" name="ordemtab" value="codigo" />

	<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />

	<input type = "submit" value ="Codigo" name="botao" />

	</form>

	</td>

    <td class="tg-hgcj">

	<form action="index.php" method="POST" >

	<input type="hidden" name="tabela" value="chamado" />

	<input type="hidden" name="acao" value="lista" />

	<input type="hidden" name="ordemtab" value="chamado_de_nome" />

	<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />

	<input type = "submit" value ="De" name="botao"     />

	</form>

    </td>

	<td class="tg-hgcj">

	<form action="index.php" method="POST" >

	<input type="hidden" name="tabela" value="chamado" />

	<input type="hidden" name="acao" value="lista" />

	<input type="hidden" name="ordemtab" value="chamado_tomador" />

	<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />

	<input type = "submit" value ="TOMADOR" name="botao"     />

	</form>

    </td>

    <td class="tg-hgcj">

	<form action="index.php" method="POST" >

	<input type="hidden" name="tabela" value="chamado" />

	<input type="hidden" name="acao" value="lista" />

	<input type="hidden" name="ordemtab" value="chamado_descricao_capa" />

	<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />

	<input type = "submit" value ="Descrição capa" name="botao"     />

	</form>

	</td>

    <td class="tg-hgcj">

	<form action="index.php" method="POST" >

	<input type="hidden" name="tabela" value="chamado" />

	<input type="hidden" name="acao" value="lista" />

	<input type="hidden" name="ordemtab" value="chamado_data_inicio" />

	<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />

	<input type = "submit" value ="DATA ABERT." name="botao"     />

	</form>

	</td>

    <td class="tg-hgcj" >

	<form action="index.php" method="POST" >

	<input type="hidden" name="tabela" value="chamado" />

	<input type="hidden" name="acao" value="lista" />

	<input type="hidden" name="ordemtab" value="chamado_data_ult_mov" />

	<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />

	<input type = "submit" value ="DATA U.MOV." name="botao"     />

	</form>

	</td>

    <td class="tg-baqh" colspan="2">

	<form action="index.php" method="POST" >

	<input type="hidden" name="acao" value="lista_todos" />

	<input type="hidden" name="tabela" value="chamado" />

	<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />

	<input type = "submit" value ="Pesquisar" name="botao" width="100%"/>

	</form>

	</td>

  </tr>

   <!-- abre while resultado do comando listar -->

    <?php while ($oquefazer->registros = $oquefazer->resultado->FetchNextObject()){?>

    <tr>

    <td class="tg-yw4l"width="5%"><?php echo TRIM($oquefazer->registros->CODIGO)?></td>

	

	

    <td class="tg-yw4l"width="15%"><?php
	//if($oquefazer->registros->_DE<>$_SESSION['user_id']){echo $oquefazer->registros->DE_NOME;
	if($oquefazer->registros->CHAMADO_DE<>$_REQUEST['cod_user_s']){echo $oquefazer->registros->CHAMADO_DE_NOME;
	} else{echo $oquefazer->registros->CHAMADO_PARA_NOME;}?><br></th>

</td>

    <td class="tg-yw4l"width="15%"><?php 
	//if($oquefazer->registros->TOMADOR<>$_SESSION['user_id']){echo $oquefazer->registros->TOMADOR_NOME;
	if($oquefazer->registros->CHAMADO_TOMADOR<>$_REQUEST['cod_user_s']){echo $oquefazer->registros->CHAMADO_TOMADOR_NOME;
	} else{echo $oquefazer->registros->CHAMADO_PARA_NOME;}?><br></th>

</td>

    <td class="tg-yw4l"><?php echo TRIM($oquefazer->registros->CHAMADO_DESCRICAO_CAPA)?></td>

    <td class="tg-yw4l" width="5%"><?php echo TRIM($oquefazer->registros->CHAMADO_DATA_INICIO)?></td>

    <td class="tg-yw4l" width="5	%"><?php echo TRIM($oquefazer->registros->CHAMADO_DATA_ULT_MOV)?></td>

    <!-- botao responder chamado inicio --> 

	<td class="tg-baqh">

	<form action="index.php" method="POST" >

	<input type="hidden" name="codigo" value=<?php echo TRIM($oquefazer->registros->CODIGO)?> />

	<input type="hidden" name="acao" value="ler" />

		<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />

	<input type="hidden" name="tabela" value="chamado" />

	<input type="hidden" name="emailvaipara" value=<?php 
	//if($oquefazer->registros->_DE==$_SESSION['user_id']){echo $oquefazer->registros->PARA;
	if($oquefazer->registros->CHAMADO_DE==$_REQUEST['cod_user_s']){echo $oquefazer->registros->CHAMADO_PARA;} else{echo $oquefazer->registros->CHAMADO_DE;}?>	/>

	<input type = "submit" value ="Ler" name="botao" />

		</form>

	

	

	</td>

    <!-- botao responder chamado fim --> 

	

	<!-- botao encerrar chamado inicio --> 

	<td class="tg-baqh">

		<?php if ($oquefazer->registros->CHAMADO_DE==$_REQUEST['cod_user_s']) {?>

     <form action="index.php" method="POST" >

	<input type="hidden" name="codigo" value=<?php echo TRIM($oquefazer->registros->CODIGO)?> />

	<input type="hidden" name="acao" value="encerrar" />

	<input type="hidden" name="tabela" value="chamado" />

	<input type = "submit" value ="Encerrar" name="botao" />



	<input type="hidden" name="cod_user_s" value="<?php echo $_REQUEST['cod_user_s']; ?>" />



	</form>

		<?php }?>

	</td>

	<!-- botao encerrar chamado fim --> 



    </tr>

	<?php } ?>

	<!-- fecha while resultado do comando listar -->

  <tr>

    <td class="tg-43nb" colspan="8">Última Linha da Pesquisa<br></td>

  </tr>

</table></div>



