PABX da Simples IP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

162 lines
6.0 KiB

<?php
include_once("bd.php");
?>
<?php
function HtmlHead() { /* imprime um cabecalio html */ ?>
<html>
<head>
<title>Relat&oacute;rio de Pausas do Discador</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
#prodAgente{ width: 180mm; height: 252mm; top:15mm; left:20mm; font:Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
.relHead { height: 20mm; border: 1px solid #000; font-size:3mm;}
.titSefaz { font:Arial, Helvetica, sans-serif; font-size:4mm; font-weight:bold;}
.headTitle { height: 5mm; font:Arial, Helvetica, sans-serif; font-size: 4mm; font-weight:bold;}
.headColun { height: 4mm; font:Arial, Helvetica, sans-serif; font-size:3mm; font-weight:bold; border-top: 1px solid #000; border-bottom: 1px solid #000;}
.headData { /*border: 1px solid #CCCCCC;*/ font-size:3mm; height: 3mm;}
.legenda { height: 5mm; font:Arial, Helvetica, sans-serif; font-size:9px; border: 1px solid #000000;}
-->
</style>
</head>
<body onLoad="javaScript:print();">
<?php
}
/* fim HeadHtml */
?>
<?php
function Head() { /* imprime o cabecalio do relatório */ ?>
<table id="prodAgente" border="0" cellspacing="0" cellpadding="3">
<tr>
<td colspan="9" style="height:20mm" align="center" valign="top">
<table width="100%" class="relHead" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="100" rowspan="4" align="center" valign="middle"><img src="<?php echo GetLogoRel(); ?>" width="90" height="84"></td>
<td rowspan="2" style="border: vertical-align:bottom" valign="bottom"><span class="titSefaz"><?php echo GetHeadRel(REL_HEAD_NIVEL1) ?></span> </td>
<td>&nbsp;</td>
</tr>
<tr>
<td nowrap><span class="titSefaz">Relat&oacute;rio de Pausas do Discador</span></td>
</tr>
<tr>
<td rowspan="2"><strong><?php echo GetHeadRel(REL_HEAD_NIVEL2) ?><?php echo "<br />" . GetHeadRel(REL_HEAD_NIVEL3) ?></strong></td>
<td>Per&iacute;odo: <?php echo $_SESSION["dataIni"] ? $_SESSION["dataIni"] : "-"; ?> de at&eacute; <?php echo $_SESSION["dataFim"] ? $_SESSION["dataFim"] : "-"; ?></td>
</tr>
<tr>
<td>Dac: <?php echo $_SESSION["dac"]; ?></td>
</tr>
</table>
</td>
</tr>
<tr >
<td colspan="9" valign="top">
<table width="100%" cellpadding="1" cellspacing="0">
<tr >
<td colspan="5" class="headTitle" align="center"><span class="titSefaz">Relat&oacute;rio de Pausas do Discador/Agente</span></td>
</tr>
<tr align="center">
<td align="center" nowrap class="headColun">In&iacute;cio</td>
<td align="center" nowrap class="headColun">Fim</td>
<td align="center" nowrap class="headColun">Motivo</td>
<td align="center" nowrap class="headColun"> Tempo </td>
</tr>
<?php
}
/* fim head */
?>
<?php
function Foot($numTotal, $pag) { /* rodape do relatorio */ ?>
</table>
</td><tr>
<td colspan="9" style="height:5mm">
<table width="100%" class="legenda" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left">Emitido Por: <?php echo $_SESSION["SSlogin"]; ?> Em: <?php echo date('d/m/Y H:i:s'); ?> </td>
<td align="left">Total de Registros: <?php echo $numTotal; ?></td>
<td align="right">p<EFBFBD>g. <?php echo $pag; ?> </td></td>
</tr>
</table></td>
</tr>
</table>
<?php
}
/* fim Foot() */
?>
<?php
function HtmlFoot() { ?>
</body>
</html>
<?php } ?>
<?php
/*
* Emissão do relatório de producao/agente
*/
$maxLinhas = 54;
$pag = 0;
$linhas = "";
$dados = $_SESSION["SSlinhasPausasDiscador"];
$linhaAgrupado = $_SESSION["SSlinhasPausasDiscadorAgp"];
$numTotal = count($dados);
$toalPag = $numTotal / $maxLinhas;
if (($numTotal > $maxLinhas) && ($numTotal % $maxLinhas) > 0)
$toalPag++;
$contaLinha = 0;
HtmlHead();
Head();
$data = array('', '', '');
for ($i = 0; $i < $numTotal; $i++) {
echo $dados[$i];
if (++$contaLinha == $maxLinhas) {
Foot($numTotal, ++$pag);
echo htmlBreak();
Head();
$contaLinha = 0;
}
}
echo '
<table class="grid" border="1" cellpadding="2" cellspacing="0">
<tr align="center" bgcolor="#FFFFFF">
<th align="center" colspan="3">Agrupado</th>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<th align="center">Motivo</th>
<th align="center">Qtde</th>
<th align="center">Tempo</th>
</tr>' .
$linhaAgrupado .
'</table>';
//finaliza html
Foot($numTotal, ++$pag);
HtmlFoot();
?>