File: /home/asjudine/www/iuris/pages/call_center/php/CONSULTAS_CONSULTAR_TICKETS.php
<?php
include("conexion_inter.php");
if($_POST['cedula'] != '')
{
$control_tickets = mysql_query("SELECT cedula, ticket, nombre, contrato, estado,fecha_ejecucion FROM tickets WHERE cedula = '".$_POST['cedula']."' ORDER BY id ASC ");
if (!$control_tickets) {
die('Invalid query ticket: ' . mysql_error());
}
}
else{
$control_tickets = mysql_query("SELECT cedula, ticket, nombre, contrato, estado,fecha_ejecucion FROM tickets WHERE ticket = '".$_POST['ticket']."' ORDER BY id ASC ");
if (!$control_tickets) {
die('Invalid query ticket: ' . mysql_error());
}
}
if ((mysql_num_rows($control_tickets)!=0))
{
?>
<table class="table table-sm table-hover table-striped table-bordered caption-top bg-primary">
<caption>Tickets Creados</caption>
<tr style="text-align: center" class="text-white">
<th>#</th>
<th>TICKET</th>
<th>CEDULA</th>
<th>NOMBRE</th>
<th>CONTRATO</th>
<th>ESTADO</th>
</tr>
<?php
while(list($cedula, $ticket, $nombre, $contrato, $estado, $fecha_ejecucion) = mysql_fetch_row($control_tickets))
{
$HOY = date('Y-m-d');
$NUM++;
if($estado == '3')
{
$estado = 'EN CIERRE';
$COLOR_TD = "#F1C47F";
}
else if($estado == '6')
{
$estado = 'CERRADO';
$COLOR_TD = "#FE6D61";
}
else if($estado == '1')
{
if($fecha_ejecucion != '0000-00-00')
{
if($fecha_ejecucion <= $HOY)
{
$estado = 'PENDIENTE HISTOSER';
$COLOR_TD = "#C47CFC";
}
else
{
$estado = 'PENDIENTE';
$COLOR_TD = "#79A2FF";
}
}
else{
$estado = "ABIERTO";
$COLOR_TD = "#74FE61";
}
}
?>
<tr style="text-align: center;background-color: <?php echo $COLOR_TD;?>">
<td><b><?php echo $NUM;?></b></td>
<td><button class="BOTON" style="border-radius: 50px" onclick="window.open('php/consultar_ticket.php?ticket=<?php echo $ticket;?>','','top=30,left=50,toolbar=yes,scrollbars=yes,width=1100,height=620,status=yes')" ><b><?php echo $ticket;?></b></button></td>
<td><b><?php echo $cedula;?></b></td>
<td><b><?php echo $nombre;?></b></td>
<td><b><?php echo $contrato;?></b></td>
<td><b><?php echo $estado;?></b></td>
</tr>
<?php
}
?>
</table>
<hr style="height: 3px;border: solid 3px #000000">
<style>
.BOTON
{
background-color: burlywood;
}
</style>
<?php
}