Exemple #1
0
function event_connect($header, $data)
{
    $connect_info['protocol_name'] = decodeString($data);
    $offset = strlen($connect_info['protocol_name']) + 2;
    $connect_info['version'] = ord(substr($data, $offset, 1));
    $offset += 1;
    $byte = ord($data[$offset]);
    $connect_info['willRetain'] = $byte & 0x20 == 0x20;
    $connect_info['willQos'] = $byte & 0x18 >> 3;
    $connect_info['willFlag'] = $byte & 0x4 == 0x4;
    $connect_info['cleanStart'] = $byte & 0x2 == 0x2;
    $offset += 1;
    $connect_info['keepalive'] = decodeValue(substr($data, $offset, 2));
    $offset += 2;
    $connect_info['clientId'] = decodeString(substr($data, $offset));
    return $connect_info;
}
function sendMail($email)
{
    if (hasNotSensitiveCharacters($email)) {
        $userLoginDetails = getLoginDetails($email);
        if (isset($userLoginDetails)) {
            $usernameToSent = $userLoginDetails['username'];
            $pwToSent = $userLoginDetails['password'];
            $pwToSent = decodeString($pwToSent);
            $subject = "Your Login Details";
            $message = "Here are your login details <br><br> Username : "******"<br> Password :"******"<br>";
            $from = "*****@*****.**";
            $headers = "From: {$from}";
            // P.S php.ini file should be modified according to use mail function -
            // More reference on configuring the php,ini file - http://www.w3schools.com/php/php_ref_mail.asp
            mail($email, $subject, $message, $headers);
            $_SESSION['forgotPW'] = "An email has sent. <br>Check your email inbox";
            redirect_to("home");
            return "<font color=green>An email has sent.Redirecting to home page....</font>";
        }
    } else {
        return "<font color=red>Email has Invalid characters</font>";
    }
}
     $nav_btn_disable = array('nav_first' => 0, 'nav_prev' => 0, 'nav_next' => 0, 'nav_last' => 0);
 } elseif ($targetPage == 1) {
     $nav_btn_disable = array('nav_first' => 0, 'nav_prev' => 0, 'nav_next' => 1, 'nav_last' => 1);
 } elseif ($targetPage == $totalPages) {
     $nav_btn_disable = array('nav_first' => 1, 'nav_prev' => 1, 'nav_next' => 0, 'nav_last' => 0);
 } else {
     $nav_btn_disable = array('nav_first' => 1, 'nav_prev' => 1, 'nav_next' => 1, 'nav_last' => 1);
 }
 $startIndex = ($targetPage - 1) * $rowsPerPage;
 $reservationListString = '';
 $i = $startIndex + 1;
 //AND ( paymentmethod='신용카드' OR paymentmethod='계좌이체' )
 if (isset($_SESSION['adminid'])) {
     $reservation_qry = exec_query_utf8("SELECT * FROM tblbooking  {$sql_condition}  AND visible =1   ORDER BY bookingDate DESC LIMIT " . $startIndex . ",{$rowsPerPage}");
 } elseif (isset($_SESSION['userid'])) {
     $Use_id = decodeString($_SESSION['userid'], $encryptKey);
     $reservation_qry = exec_query_utf8("SELECT * FROM tblbooking  {$sql_condition}  AND visible =1  AND roomNumberid IN (SELECT id FROM tblcampingeachroom WHERE roomid IN (SELECT id FROM tblcampingroom WHERE campingid IN (SELECT id FROM tblcamping WHERE userid={$Use_id}))) ORDER BY bookingDate DESC LIMIT " . $startIndex . ",{$rowsPerPage}");
 }
 //  $navRow_qry = exec_query_utf8("SELECT * FROM tblbooking $sql_condition ORDER BY bookingDate DESC");
 //work with total page
 while ($booking_row = mysqli_fetch_assoc($reservation_qry)) {
     $bookingid = $booking_row['id'];
     $promotion_discount = $booking_row['promotion_discount'];
     $promotion_explode = explode(',', $booking_row['promotion_discount']);
     // start condition change background color of each row
     $style = 'background:rgba(63,188,62,0.74); color:#fff;';
     $style_tem = 'background:rgba(63,188,62,0.74); color:#fff;';
     $date_delaypayment = $booking_row['delaypaymentdate'];
     $cancel_delaypayment_date = strtotime($date_delaypayment) + $long_time_sec;
     $date_booking = $booking_row['bookingDate'];
     // need to be formatted as "YYYY-MM-DD HH:II:SS"
Exemple #4
0
function decode_real_escape_string($str)
{
    return mysql_real_escape_string(decodeString($str));
}
Exemple #5
0
        header("Content-type: " . $ContentType, true);
        header("Filename: " . $Filename, true);
    }
    if (ENABLE_CACHE) {
        $o = gzopen($f, GZ_WRITE_MODE);
        @gzwrite($o, "[");
        @gzwrite($o, $output);
        @gzwrite($o, "]");
        @gzwrite($o, "(");
        @gzwrite($o, $jsonData);
        @gzwrite($o, ")");
        @gzclose($o);
    }
    echo $out;
}
$reqa = decodeString($rawRequest);
$req = base64_decode($reqa);
$fn = CACHING_DICTIONARY . "/" . md5($req) . ".b64";
if ($reqmode == "loader") {
    echo '<script src="base64.js"></script>' . "\n";
    echo '<script src="browser.js"></script>' . "\n";
    echo '<script>';
    echo "var f = '" . $h . "';" . "\n";
    echo 'var host = Base64.decode(reverseString("' . $rawRequest . '"));' . "\n";
    echo 'window.fetcherUrl = f;window.hostUrl = host;';
    echo "fetch(host);" . "\n";
    echo "</script>";
} else {
    if ($reqmode == "p2get_p") {
        if (strstr($req, "?")) {
            $query = "";