Path: C:\
<?php
$if['TE']='Tempo de Espera';
date_default_timezone_set('America/Sao_Paulo');
function abrevia($texto){
$split_name = explode(" ",$texto);
if(count($split_name) > 2){
for($i=1;(count($split_name) - 1) > $i; $i++){
if(strlen($split_name[$i]) > 3){
$split_name[$i] = substr($split_name[$i],0,1).".";
}
}
}
return implode(" ",$split_name);
}
$base1 = date("d-m-Y");
$json = file_get_contents('arquivos/pernoite.json');
$reg = json_decode($json, true);
$lin=count($reg);
$body='
<table width="600"align="left" cellpadding="1" cellspacing="1" border="1">
<tr height="30" style="size=3; font-weight:bold; color:BLACK;" >
<td align="center"colspan="3"><strong>MOTORISTAS EM TEMPO DE ESPERA</strong></td>
</tr>
<tr style="size=3; font-weight:bold; color:white; background:#ff0000;">
<td align="center" width="210"><strong>NOME</strong></td>
<td align="center" width="210"><strong>CELULAR</strong></td>
<td align="center" width="210"><strong>EVENTO</strong></td>
</tr>
';
foreach ($reg as $value => $x)
{ $moto=abrevia($x['nome']);
$cel=$x['cel'];
foreach ($x['mov'] as $val => $y)
{ $body .='
<tr height="30" style="size=3; color:black; background:#ffffff;">
<td align="center">'.utf8_encode($moto).'</td>
<td align="center">'.$cel.'</td>
<td align="center">'.$if[$x['mov'][$val]['evento']].'</td>
</tr>
';
include('zap03a.php');
}
}
$body .='</table>';
echo 'AVISOS DE PERNOITE AS 17:50 de '.$base1.'<br>';
echo $body.'';
?>