-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_contatti.php
56 lines (41 loc) · 1.4 KB
/
admin_contatti.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
<?php
session_start();
require "include/template2.inc.php";
require "include/dbms.inc.php";
global $conn;
$main = new Template("skins/admin/dtml/index.html");
$body = new Template("skins/admin/dtml/contatti.html");
$main->setContent('nome', $_SESSION['auth']['utente']['nome']);
$main->setContent('cognome', $_SESSION['auth']['utente']['cognome']);
$main->setContent('contatti', 'active');
$pagine = $conn->query("SELECT nome as nome_pagina FROM pagina");
if ($pagine) {
if ($pagine->num_rows > 0) {
while ($row = $pagine->fetch_assoc()) {
foreach ($row as $key => $value) {
$main->setContent($key, $value);
}
}
}
}
$main->setContent('numero', $pagine->num_rows);
$noleggi = $conn->query("SELECT COUNT(*) as numero_noleggi FROM noleggio WHERE stato <> 'Terminato'");
if($noleggi){
if ($noleggi->num_rows > 0) {
$row = $noleggi->fetch_assoc();
$main->setContent('numero_noleggi', $row['numero_noleggi']);
}
}
$contatti = $conn->query("SELECT id as id_contatto,tipo, contenuto, collegamento from contatto ");
if ($contatti) {
if ($contatti->num_rows > 0) {
while ($row = $contatti->fetch_assoc()) {
foreach ($row as $key => $value) {
$body->setContent($key, $value);
}
}
}
}
$main->setContent('content', $body->get());
$main->close();
?>