codice:
<?php require_once('../Connections/clubcanoa.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/templateBO.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>BackOffice</title>
<!-- InstanceEndEditable -->
<link href="../css/BO_style.css" rel="stylesheet" type="text/css" />
<!-- InstanceBeginEditable name="head" -->
<link href="../css/BO_style.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
</head>
<body>
<div id="container">
<div id="testata"><br />
<h1>Back Office</h1>
Club Canoa Capodimonte
<div style=" background-color:#666; padding:5px 0px 5px 15px; float:right; vertical-align:bottom; margin-top:30px; width:150px; font-size:14px;">
Benvenuto <?php echo $_SESSION['MM_Username'];?><br />
<a style="color:#F00; font-weight:bold;" href="Logout.php">Logout</a>
</div>
</div>
<div id="menu">
<ul>
<li style="list-style-image:url(../img/b_home.png);"><a href="../index.php">Index</a></li>
<li><a href="Backoffice.php">BackOffice</a></li>
<li><a href="Accesso.php">Accesso</a></li>
<li>Gallery
<ul>
<li><a href="AddFoto.php">Aggiungi foto</a></li>
<li><a href="GestioneFoto.php">Gestisci foto</a></li>
<li><a href="AddAlbum.php">Crea Album</a></li>
<li><a href="GestioneAlbum.php">Gestisci album</a></li>
</ul>
</li>
<li>Eventi
<ul>
<li><a href="AddEventi.php">Crea Evento</a></li>
<li><a href="GestioneEventi.php">Gestisci Eventi</a></li>
</ul>
</li>
</ul>
</div>
<div id="corpo">
<!-- InstanceBeginEditable name="corpo" -->
<table class="BOtabella" border="1" bordercolor="#666" width="400px">
<tr>
<td colspan="2">Autorizzati</td>
</tr>
<tr>
<td width="130px">N. autorizzati</td>
<td><?php $risultato = mysql_query("SELECT * FROM admin") or die(mysql_error());
$num_righe = mysql_num_rows($risultato);
echo $num_righe;
?></td>
</tr>
</table>
<table class="BOtabella" border="1" bordercolor="#666" width="400px">
<tr>
<td colspan="2">Gallery</td>
</tr>
<tr>
<td width="130px">N. Foto</td>
<td><?php $risultato = mysql_query("SELECT * FROM photo") or die(mysql_error());
$num_righe = mysql_num_rows($risultato);
echo $num_righe;
?></td>
</tr>
<tr>
<td width="130px">N. Album</td>
<td><?php $risultato = mysql_query("SELECT * FROM album") or die(mysql_error());
$num_righe = mysql_num_rows($risultato);
echo $num_righe;
?></td>
</tr>
</table>
<table class="BOtabella" border="1" bordercolor="#666" width="400px">
<tr>
<td colspan="2">Eventi</td>
</tr>
<tr>
<td width="130px">N. Eventi</td>
<td><?php $risultato = mysql_query("SELECT * FROM event") or die(mysql_error());
$num_righe = mysql_num_rows($risultato);
echo $num_righe;
?></td>
</tr>
</table>
<!-- InstanceEndEditable -->
</div>
</div>
</body>
<!-- InstanceEnd --></html>