2 header ("Pragma: no-cache"); // sempre carregar página (não vai ser armazenada no cache http 1,0
3 header("Cache-Control: no-cache, must-revalidate"); // idem http 1,1
5 require_once("Globals.php");
6 //verifica se o administrador está logado
8 // realiza conexão com o banco de dados
11 if(isset($_GET['all']))
13 $sql = "SELECT mensagem.id, getName(id_from) AS de, getName(id_to) AS para, DATE_FORMAT(data, '%Y/%m/%d - %H:%i') AS data, texto, lido
15 WHERE id_to IS NOT NULL
16 ORDER BY data DESC, de";
17 $title = "Mensagens entre Usuários";
26 mysql_query("UPDATE mensagem SET lido = 1 WHERE id_to IS NULL");
27 $sql = "SELECT mensagem.id, getName(id_from) AS de, DATE_FORMAT(data, '%Y/%m/%d - %H:%i') AS data, texto
30 ORDER BY data DESC, de";
31 $title = "Mensagens para Administrador";
38 <title
><?php
echo $title; ?
> - Logador PET
</title
>
39 <link rel
="stylesheet" type
="text/css" href
="estilo.css">
42 <center
><h2
><?php
echo $title; ?
></h2
></center
>
45 $result = mysql_query($sql);
47 if ($mensagem = mysql_fetch_array($result))
50 <table border
="2" class='bordasimples' align
="center">
57 <?php
echo $destinatario; ?
>
80 <form action
="deleta_mensagem.php" method
="POST">
82 <td style
="padding-right:20px;"><?php
echo $mensagem['de']; ?
></td
>
84 if(strlen($destinatario)>0)
85 echo "<td style=\"padding-right:20px;\">". $mensagem['para'] ."</td>";
87 <td style
="padding-right:0 10px;"><?php
echo $mensagem['data']; ?
></td
>
88 <td
><?php
echo $mensagem['texto']; ?
></td
>
89 <td
><input type
="submit" name
="apagar" value
="Deletar"></td
>
90 <input type
="hidden" name
="id" value
="<?php echo $mensagem['id'];?>" />
98 } while ($mensagem = mysql_fetch_array($result));
106 echo "<center style='color: #ff0000;'>Sem mensagens!!!</center>";
112 <a href
="admin.php"><< Administrador
</a
><br
>
113 <a href
="index.php"><< Logador
</a
>