}
    unset($res_loc);
    // unsets all the waiters' _SESSION vars
    unset($_SESSION['catprinted']);
    if (isset($_REQUEST['mgmt_db_number'])) {
        $_SESSION['common_db'] = $_REQUEST['mgmt_db_number'];
    } elseif (!isset($_SESSION['common_db'])) {
        $_SESSION['common_db'] = common_find_first_db();
    }
    /*
    we almost always use this command var, so we get it here
    to make it available to other functions whithout other hassle
    */
    if (isset($_REQUEST['command'])) {
        $command = $_REQUEST['command'];
    } else {
        $command = 'none';
    }
    if (isset($_REQUEST['data'])) {
        $start_data = $_REQUEST['data'];
    }
    header("Content-Language: " . $_SESSION['language']);
    header("Content-type: text/html; charset=" . phr('CHARSET'));
    $tpl = new template();
    $tmp = head_line('Management section');
    $tpl->assign("head", $tmp);
    $menu = new menu();
    $tmp = $menu->main();
    $tpl->append("scripts", $tmp);
    $header_printed = 2;
}
    $catprinted_total = $arr['catprinted'];
    $catprinted_total = explode(" ", $catprinted_total);
    for ($i = 1; $i <= 3; $i++) {
        if (in_array("{$i}", $catprinted_total)) {
            $_SESSION['catprinted'][$i] = true;
        } else {
            $_SESSION['catprinted'][$i] = false;
        }
    }
    unset($res);
    unset($arr);
    unset($catprinted_total);
}
header("Content-Language: " . $_SESSION['language']);
header("Content-type: text/html; charset=" . phr('CHARSET'));
$tmp = head_line('Waiters Section');
$tpl->assign("head", $tmp);
if (!isset($dont_redirect_to_menu)) {
    $time_refresh = 1000 * get_conf(__FILE__, __LINE__, 'refresh_automatic_to_menu');
    if ($time_refresh) {
        $tmp = redirect_timed('tables.php', $time_refresh);
        $tpl->append("scripts", $tmp);
    }
}
$scripts = '<script language="javascript" type="text/javascript">
				function loadDish ( pageUrl ) {
						$.ajax( {
							type: "POST",
							url: pageUrl,
							data : \'\',
							success: function ( html ) {
        return ERR_MYSQL;
    }
    $arr = mysql_fetch_array($res);
    $catprinted_total = $arr['catprinted'];
    $catprinted_total = explode(" ", $catprinted_total);
    for ($i = 1; $i <= 3; $i++) {
        if (in_array("{$i}", $catprinted_total)) {
            $_SESSION['catprinted'][$i] = true;
        } else {
            $_SESSION['catprinted'][$i] = false;
        }
    }
    unset($res);
    unset($arr);
    unset($catprinted_total);
}
header("Content-Language: " . $_SESSION['language']);
header("Content-type: text/html; charset=" . phr('CHARSET'));
$tmp = head_line('Waiters\' section');
$tpl->assign("head", $tmp);
if (!isset($dont_redirect_to_menu)) {
    $time_refresh = 1000 * get_conf(__FILE__, __LINE__, 'refresh_automatic_to_menu');
    if ($time_refresh) {
        $tmp = redirect_timed('tables.php', $time_refresh);
        $tpl->append("scripts", $tmp);
    }
}
if (isset($_SESSION['sourceid']) && $_SESSION['sourceid']) {
    $tmp = table_people_number_line($_SESSION['sourceid']);
}
$tpl->assign("people_number", $tmp);