<?php
include_once("include/config.php");
include_once("include/auth.lib.php");
list($status, $user) = auth_get_status();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Inserimento news Entinoprofit.org - Rivs.it - Aesnazionale.it</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="style.css" rel="stylesheet" type="text/css">
<script type='text/javascript'>
function confirmDelete(delUrl) {
if (confirm("Sei sicuro di voler cancellare?")) {
document.location = delUrl;
}
}
</script>
</head>
<body>
<div id="testata">
<table width="760" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td height="105" colspan="2" valign="top"><img src="images/testata.jpg" width="760" height="105" border="0"></td>
</tr>
<tr><td height="37" colspan="2" valign="center" background="images/navbar.gif">
<div align="center" class="titolo"><b>Visualizzazione SMS Ricevuti </b></div>
</td>
</tr>
</table>
</div>
<?php
switch($status){
case AUTH_LOGGED:
include("menu.php");
?>
<div id="main">
<div id="news">
<?php
if($_GET['delete']) {
$delId = $_GET['delete'];
$delmail = "DELETE FROM sms WHERE id='$delId'";
$delres = mysql_query($delmail) or die(mysql_error());
if ($delres) echo "<div class=\"fbinfobox\">SMS cancellato correttamente.</div>";
}
?>
<div class="alert">Per ricevere gli SMS comunicare ai CLUB il numero SMS: <font color="red">320 2041040</font> e il codice <font color="red">441</font>. <br>
Esempio invio SMS: 441 Questa sera confermato il cinema!</div>
<?php
echo "<table class=\"cusco\" width=\"100%\">";
echo '<thead><tr><th class="cusco">ID</th><th class="cusco">SMS</th><th class="cusco">DATA</th><th class="cusco"> </th></tr></thead><tbody>';
$query = "SELECT s.id AS idSms, sender,message,date,readed,r.nome FROM sms AS s LEFT JOIN rubrica AS r ON r.numero = s.sender ORDER BY date DESC";
$risultato = mysql_query($query) or die(mysql_error());
$num_row = mysql_num_rows($risultato);
if($num_row >= 1) {
$i = 0;
while ($array = mysql_fetch_array($risultato, MYSQL_BOTH)) {
if(is_int($i/2)) {
echo '<tr class="odd">';
} else {
echo '<tr>';
}
echo "<td width=\"5%\" class=\"cusco\">".$array['idSms']."</td><td width=\"83%\"><b>".$array['sender']."<i> ".$array['nome']."</i></b><br/>".$array['message']."</td><td width=\"10%\">
".strtoupper(strftime("%d %b %y <br> %H:%M:%S",strtotime($array['date'])))."</td>";
echo '<td class="cusco" width="2%"><a href="javascript:confirmDelete(\'view_sms.php?delete='.$array['idSms'].'\');"><img align="right" src="images/icon_delete.gif" alt="Cancella questo SMS"></a></td>';
echo "</tr>";
$i++;
if($array['readed'] == 0) mysql_query("UPDATE sms SET readed = '1' WHERE id = ".$array['idSms']."");
}
} else {
echo "<tr class=\"odd\"><td colspan=\"4\">Nessun SMS presente in archivio</td></tr>";
}
echo "</tbody></table>";
?>
<?php
break;
case AUTH_NOT_LOGGED:
?>
<table width="760" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td >Login Club </td>
</tr>
<tr>
<td >
<form action="login.php<?=$link?>" method="post">
<table cellspacing="2">
<!--DWLayoutTable-->
<tr>
<td >Username :</td>
<td ><input name="uname" type="text" size="10"></td>
</tr>
<tr>
<td class="text1">Password :</td>
<td><input name="passw" type="password" size="10"></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="action" value="entra">
</td>
</tr>
<tr><td height="21" colspan="2" valign="top" ><!--DWLayoutEmptyCell--> </td>
</tr>
</table>
</form>
</table>
<?php
break; }
?>
</div></div>
</body>
</html>