garbage_manager(TRUE);
if (($user = &$bri->get_user($sess, &$idx)) != FALSE) {
if ($user->stat == "table") {
header ("Location: table.php");
unlock_data($sem);
exit;
}
$ACTION = "room";
}
}
if ($ACTION == "login" && isset($name)) {
$bri->garbage_manager(TRUE);
/* try login */
if (($user = &$bri->add_user(&$sess, &$idx, $name)) != FALSE) {
$ACTION = "room";
// setcookie ("sess", "", time() + 180);
$bri->standup_update(&$user);
if (save_data(&$bri) == FALSE) {
echo "ERRORE SALVATAGGIO\n";
exit;
}
}
else {
/* Login Rendering */
if ($idx == -2)
$body .= '
Il nickname deve contenere almeno una lettera o una cifra.
';
else if ($idx == -1)
$body .= 'Spiacenti, non ci sono più posti liberi. Riprova più tardi.
';
else
$body .= 'Il tuo nickname è già in uso.
';
}
}
unlock_data($sem);
}
/* Rendering. */
if ($BRISK_DEBUG == "debugtable") {
$ACTION = "room";
}
else if ($BRISK_DEBUG == "debuglogin") {
$ACTION = "login";
}
if ($ACTION == "room") {
$tables .= '';
for ($i = 0 ; $i < TABLES_N ; $i++) {
if ($i % 4 == 0)
$tables .= '';
$tables .= 'Tavolo '.$i.'';
$tables .= sprintf(' ', $i);
$tables .= sprintf(' ', $i);
$tables .= ' | '."\n";
if ($i % 4 == 3)
$tables .= '
';
}
$tables .= '';
$tables .= '';
$tables .= ' Giocatori in piedi';
$tables .= sprintf(' ');
$tables .= ' ';
$tables .= ' |
';
$tables .= '
';
}
$altout_propag = array( array ( 'url' => 'http://www.alternativeoutput.it',
'content' => '' ),
array ( 'url' => 'http://virtualsky.alternativeoutput.it',
'content' => '' )
);
// seed with microseconds since last "whole" second
srand ((double) microtime() * 1000000);
$randval = rand(0,count($altout_propag)-1);
$altout_carousel = sprintf('%s',
$altout_propag[$randval]['url'],
$altout_propag[$randval]['content']);
$brisk_header_form = '
';
/* Templates. */
if ($ACTION == 'login') {
?>
Brisk
Digita il tuo nickname per accedere ai tavoli della briscola.
Brisk
');
?>
sess"; ?>">