Current Path : /web/htdocs/www.entinoprofit.org/home/database/new_aff/
Upload File :
Current File : /web/htdocs/www.entinoprofit.org/home/database/new_aff/club.php

<?php
session_start();
include_once("../include/config.php");
include_once("../include/auth.lib.php");

list($status, $user) = auth_get_status();

if($status == AUTH_LOGGED & auth_get_option("TRANSICTION METHOD") == AUTH_USE_LINK){
	$link = "?uid=".$_GET['uid'];
}else	$link = '';




?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
	<meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Rinnovo Affiliazione ACSI Padova</title>
	<script src="js/jquery-1.7.2.min.js"></script> 
	<script src="js/tab.js"></script> 
    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="css/bootstrapValidator.css"/>
    <!-- Custom styles for this template -->
    <link href="css/jumbotron-narrow.css" rel="stylesheet">
	<script type="text/javascript" src="js/bootstrapValidator.js"></script>
    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="js/ie-emulation-modes-warning.js"></script>

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="js/ie10-viewport-bug-workaround.js"></script>
 <link href="css/signin.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="container">
      <div class="header">
	  <?php if($status == AUTH_LOGGED) { ?>
        <ul class="nav nav-pills pull-right">
          <li><a href="logout.php">Logout</a></li>
        </ul>
		<?php } ?>
        <h3 class="text-muted">ACSI PADOVA</strong></h3>
      </div>

<?php 
switch($status){
case AUTH_LOGGED:
	
if($user['admin'] == 1) {
?>

<h3>ACCESSI DATABASE CLUB</h3>
<p class="text-justify">Visualizzazione ultimi accessi sul database e aggiornamento dati.<br>
Il controllo della data sull'aggiornamento dei dati ha effetto a partire dal 26/08/2014.
</p>

<?php
echo '<table class="table"><thead><tr><th>CLUB</th><th>ACCESSO</th><th>AGGIORNAMENTO</th></tr></thead><tbody>';

$selectID = "SELECT MAX(creation_date) AS creation_date,user_id FROM sessioni GROUP BY user_id ORDER by creation_date DESC";
$resultID = mysql_query($selectID);
while($arrayID = mysql_fetch_array($resultID,MYSQL_BOTH)) {

	$query = "SELECT name,lastUpdate FROM utenti WHERE id = '".$arrayID['user_id']."'";
	$result = mysql_query($query) or die(mysql_error());
	while($array = mysql_fetch_array($result,MYSQL_BOTH)) {
	
		$lastUpdate = ($array['lastUpdate'] != '0') ? date('d-m-Y H:i:s',$array['lastUpdate']) : 'N.P.';
		
		echo '<tr><td>'.$array['name'].'</td><td>'.date('d-m-Y H:i:s',$arrayID['creation_date']).'</td><td>'.$lastUpdate.'</td></tr>';
	
	}

}

echo '</tbody></table>';


}

break; 

case AUTH_NOT_LOGGED:

header("Refresh: 0;URL=index.php");
break;

} 
?>

<div class="footer">
  <p>&copy; ACSI Padova</p>
</div>

</div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
  </body>
</html>