Vários erros nas aspas
Bom, estou querendo enviar um e-mail pelo mail() do php, mas estou com alguns problemas nas aspas, alguma aspa fora do canto, ou coisa assim, já revisei todo o código, mas não consigo ver onde tem um erro.
Quando arrumo uma aspa, recebo Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/gestor/suporte/relatorio_novo_diario_events.php on line 389, outras vezes só T_STRING, enfim...
Alguém que tenha um conhecimento (e um olho melhor que eu o meu) puder encontrar o erro.. aqui está o código:
$mensagem = "
<!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=utf-8' />
<title>Relatório diário</title>
<style type='text/css'><!--
.fonte-textos-pequena {
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
}
.fonte-tabelas-normal {
font-family: Verdana, Geneva, sans-serif;
font-size: 12px;
}
.topo-tabela-negrito {
font-family: Verdana, Geneva, sans-serif;
font-size: 16px;
text-align: center;
}
.noix {
text-align: center;
font-size: 12px;
}
.negao {
font-family: Verdana, Geneva, sans-serif;
font-size: 18px;
font-weight: bold;
text-align: center;
}
.fonte-tabelas-centralizado {
text-align: center;
font-family: Verdana, Geneva, sans-serif;
font-size: 12px;
}
.texto-central {
font-family: Verdana, Geneva, sans-serif;
text-align: center;
font-size: 12px;
}
.negao2 {
font-weight: bold;
text-align: center;
}-->
</style>
<body>
<p><img src='/imagens/Fortal_15anos.jpg' width='146' height='58' alt='' /><br />
<span class='fonte-textos-pequena'>Relatório do dia <b>$dia</b><br />
Turno: <b>$hora</b><br />
Enviado por <b>$login</b></span></p>
<p class='negao'>Informações gerais</span></p>
<table align='center' width='701' height='82' border='1' class='fonte-tabelas-normal'>
<tr>
<td width='115'>Técnicos do turno:</td>
<td width='570'>$tecnico1 ; $tecnico2 ; $tecnico3</td>
</tr>
<tr>
<td>Sobre-avisos:</td>
<td><strong>CPD:</strong> $sobreaviso_cpd - <strong>SETIP:</strong> $sobreaviso_setip</td>
</tr>
<tr>
<td>Servidores:</td>
<td><font size='2' face='Verdana'>$status_servidores</font></td>
</tr>
<tr>
<td>Salas:</td>
<td><b>Recepção</b>: <font size='2' face='Verdana'>$sala_recepcao</font><b> Suporte</b>: $sala_suporte <b>CPD</b>: $sala_cpd <b><br />
SETIP</b>: $sala_setip <b>ADM/Financeiro</b>: $sala_adm <b>Comercial</b>: $sala_financeiro</td>
</tr>
</table>
<p class='negao'>Ocorrências do dia</span><br />
<p class='fonte-tabelas-centralizado'>
<script language='JavaScript'>
function abrir(URL) {
var width = 500;
var height = 300;
var left = 99;
var top = 99;
window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
</script><?
mysql_connect('localhost','root','qwe!@#$') or die(mysql_error());
mysql_select_db('bancosuporte') or die(mysql_error());
function tableConstructorSimple($tabela,$campos,$cores,$extra,$to){//monta sql
$sql='SELECT $campos FROM $tabela $extra';
//fim montagem sql
// montagem da tabela
$q=mysql_query($sql);
$table='<fieldset><table width='100%' border='0'><tr>';//monta título
$acampos=explode(',',$campos);
while(list($k,$f)=each($acampos)){
$table.='<td align='center'<strong>'.strtoupper($f).'</strong></td>';
}//fim while campos
$table.='</tr>';
//monta linhas do resultado
$bcampos=explode(',',$campos);
$num=2;while($result=mysql_fetch_array($q)){
$index=$num % 2;
$num++;
$cor=$cores[$index];
$table.='<tr bgcolor="'.$cor.'">';while(list($k,$g)=each($bcampos)){
$dado=$result[$g];
$table.='<td onClick='javascript:abrir(\''.$to.'?'.$g.'='.$dado.'\'.$dado.'</td>';}//fim while colunas
reset($bcampos);
$table.='</tr>';}//fim while linhas
$table.='</table></fieldset>';
echo $table;//fim tabela
}//fim função
?>
<?
//tableConstructor('nome da tabela','campos que vão aparecer na consulta, separados por vírgula',array('cor1','cor2'),'opções extras da consulta (ex.: where group by, etc','página de destino para manipular uma linha escolhida');
tableConstructorSimple('relatorios','Hora,LinkNome,Problema,Solucao,data',array('#CCCCCC','#FFFFFF'),' WHERE data = '2010-01-15' ','teste.php');
<br />
<br /></p>
<p class='negao'>Detalhamento das ocorrências</span></p>
</p>
<table align='center' width='560' border='1'>
<tr class='topo-tabela-negrito'>
<td>Status </td>
<td>Nome do link</td>
<td>Detalhamento</td>
</tr>
<tr bgcolor='#FF0000' class='noix' style='font-family: Verdana, Geneva, sans-serif'>
<td class='noix'>Não resolvidos</td>
<td>//Configurações do servidor
$host = 'localhost';
$pw = 'qwe!@#$';
$login = 'root';
$db = 'bancosuporte';
$connect = mysql_connect($host, $login, $pw) or die(mysql_error());
mysql_select_db($db, $connect) or die('Erro ao tentar a conexão com o banco de dados. Contate o CPD!');
// $a pra gerar o loop dos registros
$a = 0;
// aqui define o nome do array
$linknome = array();
// query em si (:
$queryLINKNOME = mysql_query('SELECT * FROM relatorios WHERE data = '2010-01-15'');
while ($resultado = mysql_fetch_array($queryLINKNOME)) {
$resolvido[$a] = $resultado['status'];
$linknome[$a] = $resultado['LinkNome'];
if ($resolvido[$a] == 'n') {
echo '<br><b>'.$linknome[$a].'</b>';
}
if ($resolvido[$a] != 'n'){
echo '';
}
$a = $a + 1;
}
mysql_close($connect);
</td>
<td>
//Configurações do servidor
$host = 'localhost';
$pw = 'qwe!@#$';
$login = 'root';
$db = 'bancosuporte';
$connect = mysql_connect($host, $login, $pw) or die(mysql_error());
mysql_select_db($db, $connect) or die('Erro ao tentar a conexão com o banco de dados. Contate o CPD!');
// $a pra gerar o loop dos registros
$a = 0;
// aqui define o nome do array
$linkdetalhamento = array();
// query em si (:
$queryDETALHAMENTO = mysql_query('SELECT * FROM relatorios WHERE data = '2010-01-15'');
while ($resultado = mysql_fetch_array($queryDETALHAMENTO)) {
$resolvido[$a] = $resultado['status'];
$linkdetalhamento[$a] = $resultado['detalhes'];
if ($resolvido[$a] == 'n') {
echo '<br><b>'.$linkdetalhamento[$a].'</b>';
}
if ($resolvido[$a] != 'n'){
echo '';
}
$a = $a + 1;
}
mysql_close($connect);
</td>
</tr>
<tr bgcolor='#009900' class='noix' style='font-family: Verdana, Geneva, sans-serif'>
<td class='noix'>Resolvidos</td>
<td>
//Configurações do servidor
$host = 'localhost';
$pw = 'qwe!@#$';
$login = 'root';
$db = 'bancosuporte';
$connect = mysql_connect($host, $login, $pw) or die(mysql_error());
mysql_select_db($db, $connect) or die('Erro ao tentar a conexão com o banco de dados. Contate o CPD!');
// $a pra gerar o loop dos registros
$a = 0;
// aqui define o nome do array
$linknome = array();
// query em si (:
$queryLINKNOME = mysql_query('SELECT * FROM relatorios WHERE data = '2010-01-15'');
while ($resultado = mysql_fetch_array($queryLINKNOME)) {
$resolvido[$a] = $resultado['status'];
$linknome[$a] = $resultado['LinkNome'];
if ($resolvido[$a] == 's') {
echo '<br><b>'.$linknome[$a].'</b>';
}
if ($resolvido[$a] != 's'){
echo '';
}
$a = $a + 1;
}
mysql_close($connect);
</td>
<td>
//Configurações do servidor
$host = 'localhost';
$pw = 'qwe!@#$';
$login = 'root';
$db = 'bancosuporte';
$connect = mysql_connect($host, $login, $pw) or die(mysql_error());
mysql_select_db($db, $connect) or die('Erro ao tentar a conexão com o banco de dados. Contate o CPD!');
// $a pra gerar o loop dos registros
$a = 0;
// aqui define o nome do array
$linkdetalhamento = array();
// query em si (:
$queryDETALHAMENTO = mysql_query('SELECT * FROM relatorios WHERE data = '2010-01-15'');
while ($resultado = mysql_fetch_array($queryDETALHAMENTO)) {
$resolvido[$a] = $resultado['status'];
$linkdetalhamento[$a] = $resultado['detalhes'];
if ($resolvido[$a] == 's') {
echo '<br><b>'.$linkdetalhamento[$a].'</b>';
}
if ($resolvido[$a] != 's'){
echo '';
}
$a = $a + 1;
}
mysql_close($connect);
;</td>
</tr>
<tr bgcolor='#FFFF00' class='noix' style='font-family: Verdana, Geneva, sans-serif'>
<td class='noix'>Sem resposta</td>
<td><?
//Configurações do servidor
$host = 'localhost';
$pw = 'qwe!@#$';
$login = 'root';
$db = 'bancosuporte';
$connect = mysql_connect($host, $login, $pw) or die(mysql_error());
mysql_select_db($db, $connect) or die('Erro ao tentar a conexão com o banco de dados. Contate o CPD!');
// $a pra gerar o loop dos registros
$a = 0;
// aqui define o nome do array
$linknome = array();
// query em si (:
$queryLINKNOME = mysql_query('SELECT * FROM relatorios WHERE data = '2010-01-15'');
while ($resultado = mysql_fetch_array($queryLINKNOME)) {
$resolvido[$a] = $resultado['status'];
$linknome[$a] = $resultado['LinkNome'];
if ($resolvido[$a] == 'sr') {
echo '<br><b>'.$linknome[$a].'</b>';
}
if ($resolvido[$a] != 'sr'){
echo '';
}
$a = $a + 1;
}
mysql_close($connect);
</td>
<td>
//Configurações do servidor
$host = 'localhost';
$pw = 'qwe!@#$';
$login = 'root';
$db = 'bancosuporte';
$connect = mysql_connect($host, $login, $pw) or die(mysql_error());
mysql_select_db($db, $connect) or die('Erro ao tentar a conexão com o banco de dados. Contate o CPD!');
// $a pra gerar o loop dos registros
$a = 0;
// aqui define o nome do array
$linkdetalhamento = array();
// query em si (:
$queryDETALHAMENTO = mysql_query('SELECT * FROM relatorios WHERE data = '2010-01-15'');
while ($resultado = mysql_fetch_array($queryDETALHAMENTO)) {
$resolvido[$a] = $resultado['status'];
$linkdetalhamento[$a] = $resultado['detalhes'];
if ($resolvido[$a] == 'sr') {
echo '<br><b>'.$linkdetalhamento[$a].'</b>';
}
if ($resolvido[$a] != 'sr'){
echo '';
}
$a = $a + 1;
}
mysql_close($connect);
</td>
</tr>
</table>
<p class='negao'>Imagens</p>
<p class='negao2'>Links no final do turno<br />
$linkimg1<br />
$linkimg2<br />
$linkimg3<br />
$linkimg4
<br />
<br />
Rastreamento dos carros<br />
$imgcarros
</p>
<p class='negao'>Informações adicionais<br />
<br />
<p class='texto-central'>$adicionais</p>
</p>
</p>
</body>
</html>";Discussão (14)
Carregando comentários...