/web/htdocs/www.euroroma.net/home/admin/spallaaltre/cerca.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<? session_start();

if(!
array_key_exists('user'$_SESSION))
{
    
header("Location: index.php");
    exit;
}
?>

<html>
<head>

<link rel="stylesheet" href="../style.css" type="text/css" media="screen" />

<title></title>

</head>
<body>
<div id="container">
    
    
    
    
    <div id="content">
    <TABLE width="100%" border="0">
        <TR>
            <TD valign="top">
                <TABLE>
                <TR>
                    <td height="50"><H1>
                        <? 
                            
if($_POST['nomecat']){
                                
$nomecat=$_POST['nomecat'];
                                echo 
str_replace("_"" "$_POST['nomecat']);
                            }else{
                                echo 
str_replace("_"" "$_GET['nomecat']);
                                
$nomecat=$_GET['nomecat'];
                            }
                        
?>
                    </H1></td>
                </TR>
                </TABLE>
            </TD>
        </TR>
        </TABLE>
                            
            <?
    
                
include("../setConn.php");
                include(
"../class_utility.php");
                
$special = new class_utility();
                
                
                if(
$_POST['ID']){
                    
$ID $_POST['ID'];
                }
                if(
$_GET['ID']){
                    
$ID $_GET['ID'];
                }
                
                
                
                if(
$_POST['rubrica']){
                    
$_SESSION['rubrica'] = htmlentities($_POST['rubrica']);
                    
$_SESSION['cat'] = htmlentities($_POST['rubrica']);
                }else{
                    
$_SESSION['rubrica'] = htmlentities($_GET['rubrica']);
                    
$_SESSION['cat'] = htmlentities($_GET['rubrica']);
                }
                
                echo 
$_SESSION['cat'];
                
                
$namedb "Sql603025_1";
                
//PAGINE
                
$result mysql_db_query($namedb$sql$db);
                if(
$_SESSION['rubrica']=="TUTTI"){
                    
$count mysql_query("SELECT COUNT(ID) FROM risultati");
                }else{
                    
$count mysql_query("SELECT COUNT(ID) FROM risultati WHERE Rubrica='".$_SESSION['rubrica']."'");
                }
                
$res_count mysql_fetch_row($count);
                
$tot_records $res_count[0];
                
$per_page 20;
                
$tot_pages ceil($tot_records $per_page);
                
$current_page = (!$_GET['page']) ? : (int)$_GET['page'];
                
$primo = ($current_page 1) * $per_page;
                
//FINE PAGINE
                
if ($db == FALSE)
                    die (
"Errore nella connessione.");
                if(
$_SESSION['rubrica']=="TUTTI"){
                    
$sql "SELECT * FROM risultati ORDER BY Data_e_ora DESC, ID DESC LIMIT $primo$per_page";
                }else{
                    
$sql "SELECT * FROM risultati WHERE Rubrica='".$_SESSION['rubrica']."' ORDER BY Data_e_ora DESC, ID DESC LIMIT $primo$per_page";
                }
                
$result mysql_db_query($namedb$sql$db);
                
$i=0;
                while(
$results mysql_fetch_array($result)){
                        
$sfondo="fotobianca"
                    if ( 
$i == ) { 
                        
$sfondo="fotoblu"
                    }
                    echo 
"<DIV class=".$sfondo.">";
                    echo 
"<TABLE width='98%' cellpadding='0' cellspacing='0'><TR><TD>";
                    echo 
"<p class='data'>".$results["Data_e_ora"]."</p>";
                    echo 
"<DIV align='justify'><B>".$special->specialChars($results["Rubrica"])."</B></DIV>";
                    if(
$results["URLimg"]){
                                echo 
"<DIV align='justify'><IMG SRC='".$results["URLimg"]."' width='100'></DIV>";
                            }
                            
                    
                    
                    echo 
"<DIV align='justify'>".$special->specialChars($results["Titolo"])."</DIV>";
                    echo 
"<DIV align='justify'>".$special->specialChars($results["Sottotitolo"])."</DIV>";
                    echo 
"<DIV><A HREF='save.php?ID=".$ID."&IDarticolo=".$results['ID']."&nomecat=ALTRE_NOTIZIE_DI_SPALLA'>SELEZIONA PER LA PUBBLICAZIONE</A>";
                    echo 
"<br><br>";
                    echo 
"</DIV>";
                    echo 
"</TD></TR></TABLE>";
                    echo 
"</DIV>";
                    echo 
"<!-- RIGA -->";
                    echo 
"<hr>";
                    echo 
"<!-- Fine Notizia 1 -->";
                    
$i++;
                }
                include(
"../paginazionealtre.php");
                
// in questa cella inseriamo la paginazione
                
print "<table width='100%' height='20' border='0' cellpadding='0' cellspacing='0' class='articoli'>";
                print 
" <tr>\n <td height=\"30\" valign=\"center\" align=\"center\" class=\"pagine\">$paginazione</td>\n";
                print 
" </tr>\n</table>";
                
mysql_close($db);
            
?>

    </div>
</div>
</body>
</html>