';
print_r($_SESSION);
echo '';
*/
if (!isset($_SESSION['zalogowany']))
{
header('Location: index.php');
exit();
}
require_once "dbconnect.php";
$polaczenie = mysqli_connect($host, $db_user, $db_password);
mysqli_query($polaczenie, "SET CHARSET utf8");
mysqli_query($polaczenie, "SET NAMES 'utf8' COLLATE 'utf8_polish_ci'");
mysqli_select_db($polaczenie, $db_name);
$zapytanietxt = "SELECT * FROM events";
$rezultat = mysqli_query($polaczenie, $zapytanietxt);
$ile = mysqli_num_rows($rezultat);
echo "Witaj ".$_SESSION['login']; echo " [".$_SESSION['perm'].']! [ Wyloguj się! ';echo "] [";
echo ' Archiwalne]';
if(isset($_SESSION['blad_perm'])){
echo "".$_SESSION['blad_perm']."";unset($_SESSION['blad_perm']);
}
elseif(isset($_SESSION['id_log'])){
echo "".$_SESSION['id_log']."";unset($_SESSION['id_log']);
}
elseif(isset($_SESSION['slots_log'])){
echo "".$_SESSION['slots_log']."";unset($_SESSION['slots_log']);
}
if ($ile>=1)
{
if($_SESSION['perm']=='modder' || $_SESSION['perm']=='admin'){
echo '';
}
else{
echo '
';
}
echo<<
END;
}
$akt_date = date("Y-m-d");
for ($i = 1; $i <= $ile; $i++)
{
$row = mysqli_fetch_assoc($rezultat);
$a4 = $row['date_stop'];
if($a4 >= $akt_date){
$a1 = $row['title'];
$a2 = $row['description'];
$a3 = $row['date_start'];
$a5 = $row['time_start'];
$a6 = $row['time_stop'];
$a7 = $row['location'];
$a8 = $row['id_events'];
$a9 = $a6 - $a5;
$a5 = substr($a5,0,strlen($a5)-3);
$a6 = substr($a6,0,strlen($a6)-3);
echo<<
$a8 |
$a1 |
$a3 |
$a5 |
$a9 |
$a7 |
END;
}
}
echo "
";
?>