<?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 src="ckeditor/ckeditor.js"></script>
<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 news inserite</b></div>
</td>
</tr>
</table>
</div>
<?php
switch($status){
case AUTH_LOGGED:
include("menu.php");
echo "<div id=\"main\"><div id=\"news\">";
setlocale(LC_ALL, 'it_IT');
$query = "SELECT COUNT(*) as num FROM news";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages['num'];
$limit = 50; //how many items to show per page
$adjacents = 1;
$page=1;
if (isset($_GET['page']))
$page=$_GET['page'];
if (isset($page) )
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
echo "<form name=\"ml_news\" method=\"post\" action=\"view_code.php\" TARGET=\"_blank\" enctype=\"multipart/form-data\">";
echo '<p><h2>Inserimento testo personalizzato</h2></p><textarea id="testo" name="testo" rows="10" cols="40"></textarea><p><h2>Seleziona news</h2></p>';
$query = "SELECT * FROM news ORDER BY date DESC LIMIT $start , $limit";
$risultato = mysql_query($query) or die("Query 1 failed");
while ($array = mysql_fetch_array($risultato, MYSQL_BOTH)) {
echo "<div style=\"height:50px;\"><div style=\"float:left; \"><span class='titolini'><b>".$array['titolo']."</b>";
if ($array['acsi'] == 1) {
echo " <strong>[ACSI]</strong> ";
} if ($array['aes'] == 1) {
echo " <strong>[AES]</strong> ";
} if ($array['rivs'] == 1) {
echo " <strong>[RIVS]</strong></span> ";
}
echo "<br/>";
echo "<span class=\"dataml\">";
echo strtoupper(strftime("(%d %b %Y)",strtotime($array['date']))); echo "</span></div>";
echo "<div style=\"float:right; \"><input type='checkbox' name='sendML[".$array['id']."]' value='send'></div>";
echo "<div style=\"clear:both; \"><hr></div>";
echo "</div>";
}
echo "<div class=\"alert\"><b>Pagina $page - $total_pages news in totale</b></div>";
echo "<div style=\"clear:both;align:center;\"><input type=\"submit\" name=\"e-postmain\" value=\"Crea codice RIVS\"><input type=\"submit\" name=\"e-postmain\" value=\"Crea codice ACSI\"></div>";
echo "</form>";
echo "<script>
// Replace the <textarea id=\"editor1\"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'testo', {
//appena inserisci i valori \"filebrowser...\" compaiono automaticamente i vari tasti \"Carica\"
filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
});
</script>";
include ('include/paginazione.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>