Пример #1
0
    we assume that having not authenticated is good in some cases
    eg when the waiter has not authenticated yet (index.php)
    or in other cases when it is not required to be authenticated
    
    to activate this flag, just write the following line BEFORE the require line:
    // ---- example begin ----
    $useridnotsetisok=1;			//has to be before start.php requirement!!!
    require("./start.php");
    // ---- example end ----
    */
    /*
    We stop execution, because the waiter has to authenticate first
    so we suggest him/her to authenticate on index.php page
    */
    $error_msg = common_header('Waiter not connected');
    $error_msg .= redirect_waiter('index.php');
    $error_msg .= phr('MSG_WAITER_NOT_CONNECTED_ERROR') . '<br>
	<a href="index.php">' . ucfirst(phr('CONNECT')) . '</a>';
    $error_msg .= common_bottom();
    die($error_msg);
}
unset($res);
unset($arr);
/*
The next if contains a primitive access control
to avoid that 2 waiters simultaneously work on the same table

this is done by updating a timestamp field in the sources table
and by checking (if the waiter changed)
if the elapsed time from the last update is > than the config lock_time
*/
Пример #2
0
 function disconnect_waiter()
 {
     global $tpl;
     $tpl->set_waiter_template_file('disconnect');
     // has to be before session_unset, because of common_db session var need
     $redirect = redirect_waiter('index.php');
     $err = $this->disconnect();
     status_report('DISCONNECTION', $err);
     if ($err) {
         return $err;
     }
     $tpl->append('scripts', $redirect);
     $tmp = '<a href="index.php">' . ucfirst(phr('CONNECT')) . '</a>';
     $tpl->assign('logout', $tmp);
     return 0;
 }
Пример #3
0
		</h4>
		' . ucfirst(phr('WHO_ARE_YOU')) . '<br/>
' . $user->html_select(SHOW_WAITER_ONLY) . '
		</center>
	</td></tr>
	<tr><td>
		<center>
		<INPUT TYPE="SUBMIT" value="' . ucfirst(phr('SUBMIT')) . '">
		</center>
	</td></tr>
</table>
</form>
';
    $tpl->assign('waiter_selection', $tmp);
} else {
    $tmp = redirect_waiter('tables.php');
    $tpl->append('scripts', $tmp);
    $tmp = '<font color="green">' . ucfirst(phr('ALREADY_CONNECTED')) . '<br/><a href="tables.php">' . ucfirst(phr('GO_ON')) . '</a></font>' . "\n";
    $tpl->append('messages', $tmp);
}
// prints page generation time
$tmp = generating_time($inizio);
$tpl->assign('generating_time', $tmp);
if ($err = $tpl->parse()) {
    return $err;
}
$tpl->clean();
$output = $tpl->getOutput();
// prints everything to screen
echo $output;
if (CONF_DEBUG_PRINT_PAGE_SIZE) {
Пример #4
0
function table_cleared_interface_pos()
{
    global $tpl;
    $tpl->set_waiter_template_file('question');
    $tmp = navbar_menu_pos();
    $tpl->assign('navbar', $tmp);
    $tmp = '
	' . ucfirst(phr('TABLE_HAS_BEEN_CLEARED'));
    $tpl->assign('question', $tmp);
    $redirect = redirect_waiter('tables.php');
    $tpl->append('scripts', $redirect);
    return 0;
}