Esempio n. 1
0
        $_SESSION['selOutlet'][$key] = $value;
    }
}
// ** set configuration
include '../config/config.inc.php';
//prepare selected Date
list($sy, $sm, $sd) = explode("-", $_SESSION['selectedDate']);
// get outlet maximum capacity
$maxC = maxCapacity();
// get Pax by timeslot
$resbyTime = reservationsByTime('pax');
$tblbyTime = reservationsByTime('tbl');
$_SESSION['passbyTime'] = reservationsByTime('pass');
// get availability by timeslot
$availability = getAvailability($resbyTime, $general['timeintervall']);
$tbl_availability = getAvailability($tblbyTime, $general['timeintervall']);
// some constants
$outlet_name = querySQL('db_outlet');
// translate to selected language
$_SESSION['language'] = $language;
translateSite(substr($language, 0, 2), '../web/');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="<?php 
echo $language;
?>
">
<head>
function listenXML($runs = 1)
{
    global $CONFIG, $RESPONSE, $INTERNAL, $QCOUNT, $QLIST;
    processActions();
    if (!SERVERSETUP && !LOGIN && $INTERNAL[CALLER_SYSTEM_ID]->Status == USER_STATUS_OFFLINE) {
        return;
    }
    $start = time();
    /*while(time() < $start + getLongPollRuntime() || $runs == 1)
    	{
    		if($runs > 1)
    			getData(true,false,true,false);*/
    $RESPONSE->XML = "<listen disabled=\"" . base64_encode(getAvailability() ? "0" : "1") . "\" h=\"<!--gl_all-->\" " . (isset($_POST[POST_INTERN_XMLCLIP_HASH_EXECUTION_TIME]) ? "ex_time=\"<!--execution_time-->\"" : "") . ">\r\n";
    $RESPONSE->Typing = "";
    if ($RESPONSE->Login != null) {
        $RESPONSE->XML .= $RESPONSE->Login;
    }
    buildSystem();
    //if($runs++ == 1)
    processPosts();
    if (($hash = substr(md5($RESPONSE->Typing), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_TYPING] && strlen($RESPONSE->Typing) > 0) {
        $RESPONSE->XML .= "<gl_typ h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Typing . "</gl_typ>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Events), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_EVENTS]) {
        $RESPONSE->XML .= "<gl_ev h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Events . "</gl_ev>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Exceptions), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_ERRORS] && strlen($RESPONSE->Exceptions) > 0) {
        $RESPONSE->XML .= "<gl_e h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Exceptions . "</gl_e>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Internals), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_INTERN] && strlen($RESPONSE->Internals) > 0) {
        $RESPONSE->XML .= "<int_r h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Internals . "</int_r>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Groups), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_GROUPS] && strlen($RESPONSE->Groups) > 0) {
        $RESPONSE->XML .= "<int_d h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Groups . "</int_d>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Actions), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_ACTIONS]) {
        $RESPONSE->XML .= "<int_ac h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Actions . "</int_ac>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->InternalVcards), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_PROFILES]) {
        $RESPONSE->XML .= "<int_v h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->InternalVcards . "</int_v>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->InternalProfilePictures), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_PICTURES_PROFILE]) {
        $RESPONSE->XML .= "<int_pp h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->InternalProfilePictures . "</int_pp>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->InternalWebcamPictures), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_PICTURES_WEBCAM]) {
        $RESPONSE->XML .= "<int_wp h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->InternalWebcamPictures . "</int_wp>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Goals), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_GOALS]) {
        $RESPONSE->XML .= "<int_t h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Goals . "</int_t>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Filter), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_FILTERS]) {
        $RESPONSE->XML .= "<ext_b h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Filter . "</ext_b>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Tracking), 0, 5)) != @$_POST[POST_INTERN_XMLCLIP_HASH_TRACKING]) {
        $RESPONSE->XML .= "<ext_u h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Tracking . "</ext_u>\r\n";
    }
    if ($RESPONSE->Archive != null) {
        $RESPONSE->XML .= "<ext_c>\r\n" . $RESPONSE->Archive . "</ext_c>\r\n";
    }
    if ($RESPONSE->Resources != null) {
        $RESPONSE->XML .= "<ext_res>\r\n" . $RESPONSE->Resources . "</ext_res>\r\n";
    }
    if ($RESPONSE->Ratings != null) {
        $RESPONSE->XML .= "<ext_r>\r\n" . $RESPONSE->Ratings . "</ext_r>\r\n";
    }
    if ($RESPONSE->Messages != null) {
        $RESPONSE->XML .= "<ext_m>\r\n" . $RESPONSE->Messages . "</ext_m>\r\n";
    }
    if (strlen($RESPONSE->Authentications) > 0) {
        $RESPONSE->XML .= "<gl_auths>\r\n" . $RESPONSE->Authentications . "\r\n</gl_auths>\r\n";
    }
    if (strlen($RESPONSE->Posts) > 0) {
        $RESPONSE->XML .= "<usr_p>\r\n" . $RESPONSE->Posts . "</usr_p>\r\n";
    }
    if (isset($_POST[POST_INTERN_ACCESSTEST])) {
        $RESPONSE->XML .= "<permission>" . base64_encode(getFolderPermissions()) . "</permission>";
    }
    if (SERVERSETUP || LOGIN || $INTERNAL[CALLER_SYSTEM_ID]->LastActive <= @filemtime(FILE_CONFIG)) {
        $RESPONSE->XML .= getConfig();
    }
    $RESPONSE->XML .= "</listen>";
    /*
    	if(substr_count($RESPONSE->XML,"<") > 4 || $INTERNAL[CALLER_SYSTEM_ID]->Status == USER_STATUS_OFFLINE || isset($_POST[POST_GLOBAL_NO_LONG_POLL]))
    	{
    		break;
    	}
    	else
    	{
    		if(isset($_POST[POST_GLOBAL_SHOUT]))
    			break;
    		$wait = max($CONFIG["poll_frequency_clients"]-3,1);
    		if(time()+$wait <= $start + getLongPollRuntime())
    		{
    			sleep($wait);
    		}
    		else
    			break;
    	}
    }
    */
}
Esempio n. 3
0
     }
 }
 if (!empty($_GET["ovlc"]) && strlen(base64UrlDecode($_GET["ovlc"])) == 7) {
     require LIVEZILLA_PATH . "ovl.php";
     $TRACKINGSCRIPT .= @$OVLPAGE;
 }
 if (!empty($_GET["cboo"]) && !operatorsAvailable(0, $parameters["exclude"], $parameters["include_group"], $parameters["include_user"], false)) {
     $TRACKINGSCRIPT .= "lz_tracking_remove_buttons();";
 }
 $hidevisitor = empty($CONFIG["gl_vmac"]) || !empty($CONFIG["gl_hide_inactive"]) && !$EXTERNALUSER->IsActivity($BROWSER);
 if (!empty($_SERVER['HTTP_DNT']) && $CONFIG["gl_dnt"] && empty($_GET["ovlc"])) {
     $BROWSER->Destroy();
     $TRACKINGSCRIPT .= "lz_tracking_stop_tracking(10);";
 }
 if ($monitoringActive || !empty($ACTIVE_OVLC)) {
     if (!getAvailability()) {
         $BROWSER->Destroy();
         abortTracking(12);
     } else {
         if (IS_FLOOD) {
             $BROWSER->Destroy();
             abortTracking(14);
         }
     }
     if (isset($_GET[GET_TRACK_START]) && is_numeric($_GET[GET_TRACK_START])) {
         if (!empty($_GET["ovlc"])) {
             $TRACKINGSCRIPT .= "lz_tracking_callback(" . getMonitoringPollFrequency($EXTERNALUSER->IsInChat(true), $EXTERNALUSER->IsInChat(false)) . ");";
         } else {
             $TRACKINGSCRIPT .= "lz_tracking_callback(" . getMonitoringPollFrequency(false, false) . ");";
         }
     }
Esempio n. 4
0
function processBooking()
{
    // rather than recursively calling query, insert all rows with one query
    global $general;
    // database table to store reservations
    $table = 'reservations';
    // reservation date
    $reservation_date = $_SESSION['selectedDate'];
    // prepare POST data for storage in database:
    // $keys
    // $values
    if ($_POST['action'] == 'submit') {
        $keys = array();
        $values = array();
        $i = 1;
        // prepare arrays for database query
        foreach ($_POST as $key => $value) {
            if ($key != "action" && $key != "dbdate" && $key != "reservation_date" && $key != "recurring_dbdate" && $key != "captcha" && $key != "barrier" && $key != "reservation_author" && $key != "email_type" && $key != "captchaField1" && $key != "captchaField2" && $key != "captchaField3") {
                $keys[$i] = $key;
                $values[$i] = "'" . $value . "'";
            }
            // remember some values
            if ($key == "reservation_date") {
                $reservation_date = strtotime($value);
            } else {
                if ($key == 'reservation_booker_name') {
                    $_SESSION['author'] = $value;
                } else {
                    if ($key == 'reservation_time') {
                        $_SESSION['reservation_time'] = "'" . $value . "'";
                    } else {
                        if ($key == 'reservation_pax') {
                            $_SESSION['reservation_pax'] = "'" . $value . "'";
                        }
                    }
                }
            }
            if ($key == "reservation_date") {
                $keys[$i] = $key;
                $values[$i] = "'" . $_SESSION['selectedDate'] . "'";
            }
            $i++;
        }
        // END foreach $_POST
        // =-=-=-=Store in database =-=-=-=-=-=-=-=-=-=-=-=-=-=-=
        // clear old booking number
        $_SESSION['booking_number'] = '';
        // variables
        $res_pax = $_POST['reservation_pax'] ? (int) $_POST['reservation_pax'] : 0;
        // sanitize old booking numbers
        $clr = querySQL('sanitize_unique_id');
        // create and store booking number
        if (!$_POST['reservation_id'] || $_POST['reservation_id'] == '') {
            $_SESSION['booking_number'] = uniqueBookingnumber();
            //$_SESSION['messages'][] = _booknum.":&nbsp;&nbsp;' ".$_SESSION['booking_number']." '";
            $keys[] = 'reservation_bookingnumber';
            $values[] = "'" . $_SESSION['booking_number'] . "'";
        }
        // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
        // enter into database
        // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
        // build new reservation date
        $index = array_search('reservation_date', $keys);
        // build for availability calculation
        $index = array_search('reservation_wait', $keys);
        if ($index) {
            $values[$index] = '1';
            $waitlist = '1';
        }
        //Check Availability
        // =-=-=-=-=-=-=-=-=
        // get Pax by timeslot
        $resbyTime = reservationsByTime('pax');
        $tblbyTime = reservationsByTime('tbl');
        // get availability by timeslot
        $occupancy = getAvailability($resbyTime, $general['timeintervall']);
        $tbl_occupancy = getAvailability($tblbyTime, $general['timeintervall']);
        //cut both " ' " from reservation_pax
        $res_pax = substr($_SESSION['reservation_pax'], 0, -1);
        $res_pax = substr($_SESSION['reservation_pax'], 1);
        $startvalue = $_SESSION['reservation_time'];
        //cut both " ' " from reservation_time
        $startvalue = substr($startvalue, 0, -1);
        $startvalue = substr($startvalue, 1);
        $val_capacity = $_SESSION['outlet_max_capacity'] - $occupancy[$startvalue];
        $tbl_capacity = $_SESSION['outlet_max_tables'] - $tbl_occupancy[$startvalue];
        if ((int) $res_pax > $val_capacity || $tbl_capacity < 1) {
            //prevent double entry
            $index = array_search('reservation_wait', $keys);
            if ($index > 0) {
                $values[$index] = '1';
                // = waitlist
                $waitlist = '1';
            } else {
                // error on new entry
                $keys[] = 'reservation_wait';
                $values[] = '1';
                // = waitlist
                $waitlist = '1';
            }
        }
        // END Availability
        if ($waitlist != 1) {
            // number of database fields
            $max_keys = count($keys);
            // enter into database
            // -----
            $query = "INSERT INTO `{$table}` (" . implode(',', $keys) . ") VALUES (" . implode(',', $values) . ") ON DUPLICATE KEY UPDATE ";
            // Build 'on duplicate' query
            for ($i = 1; $i <= $max_keys; $i++) {
                if ($keys[$i] != '') {
                    $query .= $keys[$i] . "=" . $values[$i] . ",";
                } else {
                    $max_keys++;
                }
            }
            // run sql query
            $query = substr($query, 0, -1);
            $result = query($query);
            $_SESSION['result'] = $result;
            // Reservation ID
            $resID = mysql_insert_id();
            // *** send confirmation email
            if ($_POST['email_type'] != 'no') {
                include '../web/classes/email.class.php';
            }
            // store new reservation in history
            $result = query("INSERT INTO `res_history` (reservation_id,author) VALUES ('%d','%s')", $resID, $_SESSION['author']);
            // Reservation was done
            $waitlist = 2;
        }
        // reservation done, handle back waitlist status
        return $waitlist;
    }
}
function buildLoginErrorField($error = "", $addition = "")
{
    global $FILTERS, $LZLANG, $CONFIG;
    if (!getAvailability()) {
        return $LZLANG["client_error_deactivated"];
    }
    if (!DB_CONNECTION || !empty($CONFIG["gl_stmo"])) {
        return $LZLANG["client_error_unavailable"];
    }
    if (IS_FILTERED) {
        $error = $LZLANG["client_error_unavailable"];
        if (isset($FILTERS->Message) && strlen($FILTERS->Message) > 0) {
            $addition = "<br><br>" . $FILTERS->Message;
        }
    }
    return $error . $addition;
}
Esempio n. 6
0
require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_lib/objects.global.users.inc.php";
require LIVEZILLA_PATH . "_lib/objects.devices.inc.php";
defineURL(FILE_SERVER_FILE);
header("Connection: close");
processHeaderValues();
$DBA = 0;
$RESPONSE = new Response();
if (!isset($_POST[POST_INTERN_ADMINISTRATE]) && isset($_POST[POST_SERVER_REQUEST_TYPE]) && $_POST[POST_SERVER_REQUEST_TYPE] == CALLER_TYPE_INTERNAL) {
    header("Content-Type: text/xml; charset=UTF-8");
    if (getIdle()) {
        $RESPONSE->SetValidationError(LOGIN_REPLY_IDLE);
        exit($RESPONSE->GetXML());
    }
    if (!getAvailability() && $_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_LOGIN && !isset($_POST[POST_INTERN_ACCESSTEST])) {
        $RESPONSE->SetValidationError(LOGIN_REPLY_DEACTIVATED);
        exit($RESPONSE->GetXML());
    }
}
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
setDataProvider();
@set_time_limit($CONFIG["timeout_clients"]);
@ini_set('session.use_cookies', '0');
@set_error_handler("handleError");
if (isset($_POST[POST_SERVER_REQUEST_TYPE]) || isset($_GET[GET_SERVER_REQUEST_TYPE])) {
    if (STATS_ACTIVE) {
        initStatisticProvider();
    }
    if (DB_CONNECTION && (isset($_POST[POST_SERVER_REQUEST_TYPE]) && $_POST[POST_SERVER_REQUEST_TYPE] == CALLER_TYPE_TRACK || isset($_GET[GET_SERVER_REQUEST_TYPE]) && $_GET[GET_SERVER_REQUEST_TYPE] == CALLER_TYPE_TRACK)) {
        define("CALLER_TYPE", CALLER_TYPE_TRACK);
Esempio n. 7
0
<?
// initialize
$count_slots = 0;
$val_by_time = 0;

// get Pax by timeslot
$resbyTime = reservationsByTime('pax');

// get availability by timeslot
$availability = getAvailability($resbyTime,$general['timeintervall']);

// actual time rounded half hour  
$round_numerator = 60 * $general['timeintervall']; // 60 seconds per minute * 15 minutes equals 900 seconds
$rounded_time = ( round ( time() / $round_numerator ) * $round_numerator );

//timeline open/close time
//prevent 'division by zero error'
$open_time = ($_SESSION['selOutlet']['outlet_open_time']!="") ? $_SESSION['selOutlet']['outlet_open_time'] : "11:00:00";
$close_time = ($_SESSION['selOutlet']['outlet_close_time']!="") ? $_SESSION['selOutlet']['outlet_close_time'] : "22:00:00";

// calculate after midnight
$day    = date("d");
$endday = ($open_time < $close_time) ? date("d") : date("d")+1;

// build time values
list($h1,$m1)		= explode(":",$open_time);
list($h2,$m2)		= explode(":",$close_time);
$value  			= mktime($h1+0,$m1+0,0,date("m"),$day,date("Y"));
$endtime		 	= mktime($h2+0,$m2+0,0,date("m"),$endday,date("Y"));
$i 					= 1;
// build break times UNIX time
Esempio n. 8
0
 function IsDeactivated()
 {
     return !getAvailability();
 }
function listenXML()
{
    global $RESPONSE, $INTERNAL;
    processActions();
    if (!SERVERSETUP && !LOGIN && $INTERNAL[CALLER_SYSTEM_ID]->Status == USER_STATUS_OFFLINE) {
        return;
    }
    $RESPONSE->XML = "<listen disabled=\"" . base64_encode(getAvailability(false) ? "0" : "1") . "\" h=\"<!--gl_all-->\" " . (isset($_POST[POST_INTERN_XMLCLIP_HASH_EXECUTION_TIME]) ? "ex_time=\"<!--execution_time-->\"" : "") . ">\r\n";
    $RESPONSE->Typing = "";
    if ($RESPONSE->Login != null) {
        $RESPONSE->XML .= $RESPONSE->Login;
    }
    buildSystem();
    processPosts();
    if (($hash = substr(md5($RESPONSE->Typing), 0, 5)) != @$_POST["p_gl_t"] && strlen($RESPONSE->Typing) > 0) {
        $RESPONSE->XML .= "<gl_typ h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Typing . "</gl_typ>\r\n";
    }
    $RESPONSE->XML .= $RESPONSE->Events . "\r\n";
    if (($hash = substr(md5($RESPONSE->Exceptions), 0, 5)) != @$_POST["p_gl_e"] && strlen($RESPONSE->Exceptions) > 0) {
        $RESPONSE->XML .= "<gl_e h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Exceptions . "</gl_e>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Internals), 0, 5)) != @$_POST["p_int_r"] && strlen($RESPONSE->Internals) > 0) {
        $RESPONSE->XML .= "<int_r h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Internals . "</int_r>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Groups), 0, 5)) != @$_POST["p_int_d"] && strlen($RESPONSE->Groups) > 0) {
        $RESPONSE->XML .= "<int_d h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Groups . "</int_d>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Actions), 0, 5)) != @$_POST["p_int_ev"]) {
        $RESPONSE->XML .= "<int_ac h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Actions . "</int_ac>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->InternalVcards), 0, 5)) != @$_POST["p_int_v"]) {
        $RESPONSE->XML .= "<int_v h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->InternalVcards . "</int_v>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->InternalWebcamPictures), 0, 5)) != @$_POST["p_int_wp"]) {
        $RESPONSE->XML .= "<int_wp h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->InternalWebcamPictures . "</int_wp>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Goals), 0, 5)) != @$_POST["p_int_t"]) {
        $RESPONSE->XML .= "<int_t h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Goals . "</int_t>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Filter), 0, 5)) != @$_POST["p_ext_b"]) {
        $RESPONSE->XML .= "<ext_b h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Filter . "</ext_b>\r\n";
    }
    if (!empty($RESPONSE->Tracking) && ($hash = substr(md5($RESPONSE->Tracking), 0, 5)) != @$_POST["p_ext_u"]) {
        $RESPONSE->XML .= "<ext_u h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Tracking . "</ext_u>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->Forwards), 0, 5)) != @$_POST["p_ext_f"]) {
        $RESPONSE->XML .= "<ext_f h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->Forwards . "</ext_f>\r\n";
    }
    if (($hash = substr(md5($RESPONSE->ChatVouchers), 0, 5)) != @$_POST["p_ext_ct"]) {
        $RESPONSE->XML .= "<ext_ct h=\"" . base64_encode($hash) . "\">\r\n" . $RESPONSE->ChatVouchers . "</ext_ct>\r\n";
    }
    if ($RESPONSE->Archive != null) {
        $RESPONSE->XML .= "<ext_c>\r\n" . $RESPONSE->Archive . "</ext_c>\r\n";
    }
    if ($RESPONSE->Resources != null) {
        $RESPONSE->XML .= "<ext_res>\r\n" . $RESPONSE->Resources . "</ext_res>\r\n";
    }
    if ($RESPONSE->Ratings != null) {
        $RESPONSE->XML .= "<ext_r>\r\n" . $RESPONSE->Ratings . "</ext_r>\r\n";
    }
    $RESPONSE->XML .= $RESPONSE->Messages . "\r\n";
    if (strlen($RESPONSE->Authentications) > 0) {
        $RESPONSE->XML .= "<gl_auths>\r\n" . $RESPONSE->Authentications . "\r\n</gl_auths>\r\n";
    }
    if (strlen($RESPONSE->Posts) > 0) {
        $RESPONSE->XML .= "<usr_p>\r\n" . $RESPONSE->Posts . "</usr_p>\r\n";
    }
    if (isset($_POST[POST_INTERN_ACCESSTEST])) {
        $RESPONSE->XML .= "<permission>" . base64_encode(getFolderPermissions()) . "</permission>";
    }
    if (SERVERSETUP || LOGIN || $INTERNAL[CALLER_SYSTEM_ID]->LastActive <= @filemtime(FILE_CONFIG)) {
        $RESPONSE->XML .= getConfig();
    }
    $RESPONSE->XML .= "</listen>";
}
Esempio n. 10
0
            $TRACKINGSCRIPT .= "lz_tracking_add_floating_button(" . $_GET["fbpos"] . "," . $shadow . $margin . "," . $_GET["fbw"] . "," . $_GET["fbh"] . ");";
        }
    }
} else {
    $TRACKINGSCRIPT = "lz_tracking_set_sessid(\"" . htmlentities(CALLER_USER_ID) . "\",\"" . htmlentities(CALLER_BROWSER_ID) . "\");";
    if (isset($_GET[GET_TRACK_URL]) && strpos(base64UrlDecode($_GET[GET_TRACK_URL]), GET_INTERN_COBROWSE) !== false) {
        abortTracking(1);
    }
    $BROWSER = new VisitorBrowser(CALLER_BROWSER_ID, CALLER_USER_ID);
    if ($EXTERNALUSER->FirstCall && !$BROWSER->IsFirstCall()) {
        $EXTERNALUSER->FirstCall = false;
    }
    initData(false, false, false, true, true);
    define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), CALLER_USER_ID));
    define("IS_FLOOD", $BROWSER->IsFirstCall() && isFlood(getIP(), CALLER_USER_ID));
    if (!getAvailability() || IS_FILTERED || IS_FLOOD) {
        $BROWSER->Destroy();
        exit("lz_tracking_stop_tracking();");
    }
    $BROWSER->Customs = getCustomArray();
    if (isset($_GET[GET_EXTERN_USER_NAME]) && !empty($_GET[GET_EXTERN_USER_NAME])) {
        $BROWSER->Fullname = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_NAME]), 254);
    } else {
        $BROWSER->Fullname = getCookieValue("form_111");
    }
    if (isset($_GET[GET_EXTERN_USER_EMAIL]) && !empty($_GET[GET_EXTERN_USER_EMAIL])) {
        $BROWSER->Email = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL]), 254);
    } else {
        $BROWSER->Email = getCookieValue("form_112");
    }
    if (isset($_GET[GET_EXTERN_USER_COMPANY]) && !empty($_GET[GET_EXTERN_USER_COMPANY])) {
Esempio n. 11
0
            <li><a href="about.php">About</a></li>

          </ul>
        <div id="navbar" class="navbar-collapse collapse">
          <form class="navbar-form navbar-right" action="footer.php">
            <button type="button" class="btn btn-danger" onclick="loadMap()">Change Default Location</button>
            <button type="submit" class="btn btn-danger">Sign Out</button>
          </form>
          <!--form class="navbar-form navbar-right" action="CallFunction.php" method ="post" >
				<input type="hidden" name="driver_id" value="<?php 
echo $driver_id;
?>
" />
				<a><font color="white">Availability</font></a> 
				<input type="submit" class="btn btn-danger" value = "<?php 
echo getAvailability($GLOBALS["driver_id"]);
?>
"/>
          </form-->
          
        </div><!--/.navbar-collapse -->
      </div>
    </nav>
    
     <div id="wrapper">
		 
    <!-- Sidebar -->
        <div id="sidebar-wrapper">
            <ul class="sidebar-nav" style="padding-top:60px;">
				<li>
                    <a href="#"  onclick="loadMyHires()">My Hires</a>
Esempio n. 12
0
$dayoff = getDayoff();
// *** DATABASE queries ***
// check token
if ($api_token != '') {
    //check the user's API
    $request_count = validate_requests($api_token);
    // database request
    if ($status['code'] != 400 && $request_count < $max_requests) {
        //Check Availability
        // =-=-=-=-=-=-=-=-=
        // get Pax by timeslot
        $resbyTime = reservationsByTime('pax');
        $tblbyTime = reservationsByTime('tbl');
        // get availability by timeslot
        $occupancy = getAvailability($resbyTime, $general['timeintervall']);
        $tbl_occupancy = getAvailability($tblbyTime, $general['timeintervall']);
        $val_capacity = $_SESSION['outlet_max_capacity'] - $occupancy[$_SESSION['reservation_time']];
        $tbl_capacity = $_SESSION['outlet_max_tables'] - $tbl_occupancy[$_SESSION['reservation_time']];
        if ($dayoff == 0) {
            if ($res_pax > $val_capacity || $tbl_capacity < 1) {
                // NO more space available, reservation declined
                $data['code'] = 406;
                $data['status'] = getStatusCodeMessage($data['code']);
            } else {
                if ($res_pax <= $val_capacity || $tbl_capacity >= 1) {
                    // Free seats, reservation is ok
                    $data['code'] = 202;
                    $data['status'] = getStatusCodeMessage($data['code']);
                }
            }
        } else {
 function SetDynamicValues($_row)
 {
     global $CONFIG;
     $this->AppClient = !empty($_row["lapp"]);
     $this->AppBackgroundMode = !empty($_row["mobile_background"]);
     $this->AppDeviceId = @$_row["mobile_device_id"];
     $this->AppOS = @$_row["mobile_os"];
     $this->ClientWeb = !empty($_row["lweb"]);
     $this->LoginId = $_row["login_id"];
     $this->LastActiveDB = $this->LastActive = $_row["last_active"];
     $this->Deactivated = $_row["sign_off"] == 2;
     $this->SignOffRequest = !empty($_row["sign_off"]);
     if (!empty($_row["mobile_ex"])) {
         $this->MobileExtends = @unserialize($_row["mobile_ex"]);
     }
     $this->Typing = $_row["typing"];
     $this->VisitorFileSizes = @unserialize($_row["visitor_file_sizes"]);
     $this->Status = $_row["status"];
     $this->FirstActive = $_row["first_active"] < time() - $CONFIG["timeout_clients"] ? time() : $_row["first_active"];
     $this->LastChatAllocation = $_row["last_chat_allocation"];
     if ($_row["status"] != USER_STATUS_OFFLINE) {
         if (!empty($_row["mobile_device_id"]) && !empty($_row["mobile_os"]) && $_row["last_active"] > time() - 30 * 86400 && getAvailability()) {
             $this->LastActive = time();
         } else {
             if ($_row["last_active"] < time() - $CONFIG["timeout_clients"]) {
                 $this->Status = USER_STATUS_OFFLINE;
             }
         }
     }
     $this->Reposts = @unserialize(@$_row["reposts"]);
     $this->PasswordChange = $_row["password_change"];
     $this->PasswordChangeRequest = !empty($_row["password_change_request"]);
 }
Esempio n. 14
0
         $sql .= $post_localize_to["value"] . " = '" . $post_localize_to_lang_id["value"] . "' ";
         $sql .= "WHERE lang_id = " . $post_lang_id["value"] . ";";
         db_query($database_name, $sql, "no", "no");
     }
     break;
 case "show_first_availability":
     // ****************************************************************************
     $error_message = "";
     $get_object_id = checkVar("", $_GET["object_id"], "int", "", "", "", "Object ID", 1, 0);
     $get_start_date = checkVar("", $_GET["start_date"], "date", "", "", "", "Start date", 1, 0);
     $get_start_hour = checkVar("", $_GET["start_hour"], "hour", "", "", "", "Start hour", 1, 0);
     // 00:00
     $get_duration = checkVar("", $_GET["duration"], "int", "", "", "", "Duration", 1, 0);
     if ($get_object_id["ok"] && $get_start_date["ok"] && $get_start_hour["ok"] && $get_duration["ok"]) {
         $start_date = dateFormat($get_start_date, "", "Y-m-d") . " " . $get_start_hour . ":00";
         $first_availability = getAvailability($get_object_id, $start_date, $get_duration);
         $script = "parent.document.getElementById(\"info_display\").innerHTML = \"" . $first_availability . "\";\n";
     } else {
         // displays error to user
         $error_message .= !$get_object_id["ok"] ? $get_object_id["error"] . "<br>" : "";
         $error_message .= !$get_start_date["ok"] ? $get_start_date["error"] . "<br>" : "";
         $error_message .= !$get_start_hour["ok"] ? $get_start_hour["error"] . "<br>" : "";
         $error_message .= !$get_duration["ok"] ? $get_duration["error"] . "<br>" : "";
         $script = "parent.document.getElementById(\"info_display\").innerHTML = \"" . $error_message . "\";\n";
     }
     break;
 case "export_localization":
     // ****************************************************************************
     $absolute_csvfile_path = dirname($_SERVER["SCRIPT_FILENAME"]) . "/openbookings_localization.csv";
     $file_handle = fopen($absolute_csvfile_path, "w");
     fwrite($file_handle, "THIS IS AN OPENBOOKINGS.ORG " . param_extract("app_version") . " LOCALIZATION EXCHANGE FILE (see http://www.openbookings.org for informations).\n");