<?php require_once('Connections/config.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$data=date('Y-m-d');

//$data='2021-04-28';



mysql_select_db($database_config, $config);
$query_clientes1 = "SELECT  * FROM acom_suporte WHERE fechamento LIKE '$data%' AND assunto LIKE 'INSTALACAO%' AND status='ENCERRADO' ORDER BY nome ASC";
$clientes1 = mysql_query($query_clientes1, $config) or die(mysql_error());
$row_clientes1 = mysql_fetch_assoc($clientes1);
$totalRows_clientes1 = mysql_num_rows($clientes1);


mysql_select_db($database_config, $config);
$query_clientes11 = "SELECT  * FROM acom_suporte WHERE fechamento LIKE '$data%' AND assunto LIKE 'TRANSFEREN%' AND status='ENCERRADO' ORDER BY nome ASC";
$clientes11 = mysql_query($query_clientes11, $config) or die(mysql_error());
$row_clientes11 = mysql_fetch_assoc($clientes11);
$totalRows_clientes11 = mysql_num_rows($clientes11);


mysql_select_db($database_config, $config);
$query_clientes12 = "SELECT  * FROM acom_suporte WHERE fechamento LIKE '$data%' AND assunto LIKE 'SUPORTE%' AND status='ENCERRADO' ORDER BY nome ASC";
$clientes12 = mysql_query($query_clientes12, $config) or die(mysql_error());
$row_clientes12 = mysql_fetch_assoc($clientes12);
$totalRows_clientes12 = mysql_num_rows($clientes12);





?>

<!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="refresh" content="5">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="tables.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
	font-size: 14px;
	font-weight: bold;
}
.style2 {
	font-size: 12px;
	font-weight: bold;
}
-->
</style>
</head>
<body>

<table width="90%" border="0" cellspacing="0" cellpadding="0">
  <tr class="odd">
    <td><span class="style1">INSTALAÇÕES REALIZADAS DIA<?php echo date('d/m/Y', strtotime($data)); ?> || TOTAL INSTALAÇÕES <?php echo $totalRows_clientes1; ?> || TOTAL DE SERVIÇOS <?php echo $totalRows_clientes11+$totalRows_clientes12+$totalRows_clientes1; ?></span></td>
  </tr>
</table>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr width='90%' class="odd">
      <td><strong>DATA</td>
      <td><strong>LOGIN</td>
      <td><strong>CHAMADO</td>

      <td><strong>INSTALADOR</td>
</tr>
   <?php do { ?>
<tr>
      <td><strong><?php echo $row_clientes1['fechamento']; ?></td>
      <td><?php echo $row_clientes1['login']; ?></td>
      <td><?php echo $row_clientes1['chamado']; ?></td>
      <td><?php echo $row_clientes1['nome']; ?></td>
</tr>
    <?php } while ($row_clientes1 = mysql_fetch_assoc($clientes1)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($clientes1);

?>

<!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=iso-8859-1" />
<title>Untitled Document</title>
<link href="tables.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
	font-size: 14px;
	font-weight: bold;
}
.style2 {
	font-size: 12px;
	font-weight: bold;
}
-->
</style>
</head>
<body>

<table width="90%" border="0" cellspacing="0" cellpadding="0">
  <tr class="odd">
    <td><span class="style1">TRANSFERENCIAS REALIZADAS DIA <?php echo date('d/m/Y', strtotime($data)); ?> || TOTAL TRANSFERENCIAS <?php echo $totalRows_clientes11; ?> ||</span></td>
  </tr>
</table>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr width='90%' class="odd">
      <td><strong>DATA</td>
      <td><strong>LOGIN</td>
      <td><strong>CHAMADO</td>

      <td><strong>TECNICO</td>
</tr>
   <?php do { ?>
<tr>
      <td><strong><?php echo $row_clientes11['fechamento']; ?></td>
      <td><?php echo $row_clientes11['login']; ?></td>
      <td><?php echo $row_clientes11['chamado']; ?></td>
      <td><?php echo $row_clientes11['nome']; ?></td>
</tr>
    <?php } while ($row_clientes11 = mysql_fetch_assoc($clientes11)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($clientes11);
?>


<!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=iso-8859-1" />
<title>Untitled Document</title>
<link href="tables.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
	font-size: 14px;
	font-weight: bold;
}
.style2 {
	font-size: 12px;
	font-weight: bold;
}
-->
</style>
</head>
<body>

<table width="90%" border="0" cellspacing="0" cellpadding="0">
  <tr class="odd">
    <td><span class="style1">SUPORTE REALIZADOS DIA <?php echo date('d/m/Y', strtotime($data)); ?> || TOTAL SUPORTE <?php echo $totalRows_clientes12; ?> ||</span></td>
  </tr>
</table>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr width='90%' class="odd">
      <td><strong>DATA</td>
      <td><strong>LOGIN</td>
      <td><strong>CHAMADO</td>

      <td><strong>TECNICO</td>
</tr>
   <?php do { ?>
<tr>
      <td><strong><?php echo $row_clientes12['fechamento']; ?></td>
      <td><?php echo $row_clientes12['login']; ?></td>
      <td><?php echo $row_clientes12['chamado']; ?></td>
      <td><?php echo $row_clientes12['nome']; ?></td>
</tr>
    <?php } while ($row_clientes12 = mysql_fetch_assoc($clientes12)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($clientes12);
?>


