Пример #1
0
<?php

include './admin/config.php';
include './admin/db_connection.php';

if (isset($_POST['user_id_clear']) && $_POST['user_id_clear'] != '') {
    $product_id         =       $_POST['product_id_clear'];
    $user_id            =       $_POST['user_id_clear'];
    $query = "DELETE FROM sohorepro_checkout WHERE user_id = '" . $user_id . "'";
    mysql_query($query);
    $checkout_product = checkOut($user_id);
    echo 'Removed the all products successfully~';
}
?>
<table width="740" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="right" valign="middle" height="55" ><input type="button" onclick="return continue_shopping('<?php echo $user_id; ?>');" class="btn_shopping" value="Contiune Shopping"></td>
  </tr>
  <tr>
  <td align="left" valign="top">
  <table width="740" border="0" cellspacing="0" cellpadding="0" class="product_table" >
  <tr bgcolor="#ff7e00" class="h1">
    <td width="48" align="center" valign="middle" class="brdr_2" >S.NO</td>
    <td width="46" align="center" valign="middle" class="brdr_2" >SKU Id</td>
    <td width="115" align="left" valign="middle" class="brdr_2">Product Name</td>
    <td width="66" align="center" valign="middle" class="brdr_2">Unit Price</td>
    <td width="44" align="center" valign="middle" class="brdr_2">Qty</td>
    <td width="64" align="center" valign="middle" class="brdr_2">Line Price</td>
    <td width="243" align="left" valign="middle" class="brdr_2">Shipping Address</td>
    <td width="97" align="center" valign="middle" class="brdr_2">Option</td>
  </tr>
Пример #2
0
function updateResultTable($athlete, $event, $startHeight)
{
    global $glb_connection, $glb_connection_server;
    global $glb_results_skip;
    global $glb_high_attempt_passed, $glb_high_attempt_failed, $glb_high_attempt_waived;
    try {
        $settings = getHighSettings($event);
        $sql_ath = "SELECT xSerienstart AS ath_id\r\n                        , xSerie\r\n                        , IF((SELECT COUNT(*) FROM resultat WHERE xSerienstart = serienstart.xSerienstart AND Leistung IN (" . implode(',', $glb_results_skip) . ")), 1, 0) AS skip\r\n                        , Starthoehe AS ath_start\r\n                        , Position AS ath_pos\r\n                    FROM serienstart\r\n                    WHERE xSerienstart = :serienstart;";
        $query_ath = $glb_connection_server->prepare($sql_ath);
        $query_ath->bindValue(':serienstart', $athlete);
        $query_ath->execute();
        $ath = $query_ath->fetch(PDO::FETCH_ASSOC);
        $xSerienstart = $ath['ath_id'];
        $position = $ath['ath_pos'];
        $xSerie = $ath['xSerie'];
        $skip = $ath['skip'];
        $sql_res = "SELECT \r\n                        xSerienstart\r\n                        , Leistung AS result_max\r\n                        , Info AS result_info\r\n                    FROM\r\n                        resultat \r\n                        LEFT JOIN serienstart USING (xSerienstart) \r\n                    WHERE xSerienstart = :serienstart \r\n                        AND Info LIKE '%" . $glb_high_attempt_passed . "%'\r\n                    ORDER BY Leistung DESC\r\n                    LIMIT 1;";
        $query_res = $glb_connection_server->prepare($sql_res);
        $query_res->bindValue(':serienstart', $xSerienstart);
        $query_res->execute();
        $result = $query_res->fetch(PDO::FETCH_ASSOC);
        $result_res = $result['result_max'] ? $result['result_max'] : 0;
        $res_attempts = substr_count($result['result_info'], $glb_high_attempt_failed) + 1;
        $sql_miss = "SELECT \r\n                        xSerienstart\r\n                        , Leistung AS result\r\n                        , Info AS result_info\r\n                    FROM\r\n                        resultat \r\n                        LEFT JOIN serienstart USING (xSerienstart) \r\n                    WHERE xSerienstart = :serienstart \r\n                        AND Info LIKE '%" . $glb_high_attempt_failed . "%';";
        $query_miss = $glb_connection_server->prepare($sql_miss);
        $query_miss->bindValue(':serienstart', $xSerienstart);
        $query_miss->execute();
        $results_miss = $query_miss->fetchAll(PDO::FETCH_ASSOC);
        $miss = 0;
        foreach ($results_miss as $result_miss) {
            $miss = $miss + substr_count($result_miss['result_info'], $glb_high_attempt_failed);
        }
        $sql_heights = "SELECT serie\r\n                            , height\r\n                            FROM t_heights\r\n                            WHERE serie = :serie\r\n                            ORDER BY height ASC;";
        $query_heights = $glb_connection->prepare($sql_heights);
        $query_heights->bindValue(':serie', $event);
        $query_heights->execute();
        $heights = $query_heights->fetchAll(PDO::FETCH_ASSOC);
        $sql_maxHeight = "SELECT MAX(height) as max_height\r\n                                FROM t_heights\r\n                                WHERE serie = :serie\r\n                                ORDER BY height ASC;";
        $query_maxHeight = $glb_connection->prepare($sql_maxHeight);
        $query_maxHeight->bindValue(':serie', $event);
        $query_maxHeight->execute();
        $maxHeight = $query_maxHeight->fetch(PDO::FETCH_ASSOC);
        $maxHeight = $maxHeight['max_height'];
        $diff = $maxHeight < $settings['diff_1_until'] ? $settings['diff_1_value'] : $settings['diff_2_value'];
        $curr_height = $maxHeight + $diff;
        $curr_miss = 0;
        $out = checkOut($athlete);
        if ($out) {
            $curr_height = 0;
            $curr_miss = 0;
        } else {
            foreach ($heights as $height) {
                if ($height['height'] >= $startHeight) {
                    $sql_check = "SELECT Info\r\n                                    FROM resultat\r\n                                    WHERE Leistung = :height\r\n                                        AND xSerienstart = :serienstart;";
                    $query_check = $glb_connection_server->prepare($sql_check);
                    $query_check->bindValue(':height', $height['height']);
                    $query_check->bindValue(':serienstart', $athlete);
                    $query_check->execute();
                    if ($query_check->rowCount() == 0) {
                        $curr_height = $height['height'];
                        $curr_miss = 0;
                        break;
                    } else {
                        $check = $query_check->fetch(PDO::FETCH_ASSOC);
                        $check_miss = substr_count($check['Info'], $glb_high_attempt_failed);
                        $check_skip = substr_count($check['Info'], $glb_high_attempt_passed) + substr_count($check['Info'], $glb_high_attempt_waived);
                        if ($check_miss > 0 && $check_skip == 0) {
                            $curr_height = $height['height'];
                            $curr_miss = $check_miss;
                            break;
                        }
                    }
                }
            }
        }
        $sql_insert = "UPDATE tempresult SET\r\n                                            skip = :skip\r\n                                            , result = :result\r\n                                            , result_attempts = :res_attempts\r\n                                            , miss = :miss\r\n                                            , ath_out = :out\r\n                                            , curr_height = :curr_height\r\n                                            , curr_miss = :curr_miss\r\n                                            WHERE xSerienstart = :serienstart;";
        $query_insert = $glb_connection->prepare($sql_insert);
        $query_insert->bindValue(':serienstart', $athlete);
        $query_insert->bindValue(':skip', $skip);
        $query_insert->bindValue(':result', $result_res);
        $query_insert->bindValue(':res_attempts', $res_attempts);
        $query_insert->bindValue(':miss', $miss);
        $query_insert->bindValue(':out', $out);
        $query_insert->bindValue(':curr_height', $curr_height);
        $query_insert->bindValue(':curr_miss', $curr_miss);
        $query_insert->execute();
    } catch (PDOException $e) {
        trigger_error($e->getMessage());
    }
}
Пример #3
0
    $seats['SC'] = $_POST['SC'];
    $seats['FA'] = $_POST['FA'];
    $seats['FC'] = $_POST['FC'];
    $seats['B1'] = $_POST['B1'];
    $seats['B2'] = $_POST['B2'];
    $seats['B3'] = $_POST['B3'];
    $price = calculatePrice($seats, $date);
    foreach ($seats as $k => $v) {
        if ($v == 0) {
            unset($seats[$k]);
        }
    }
    addToCart($movie, $date, $price, $sessiontime, $seats);
}
if (isset($_POST['firstname'])) {
    checkOut($_POST['firstname'], $_POST['lastname'], $_POST['phone'], $_POST['emailaddress']);
    unset($_POST['firstname']);
}
function addToCart($movie, $date, $price, $sessiontime, $seats)
{
    $_SESSION['cart'][$movie]['date'] = $date;
    $_SESSION['cart'][$movie]['sessiontime'] = $sessiontime;
    $_SESSION['cart'][$movie]['price'] = $price;
    $_SESSION['cart'][$movie]['seats'] = $seats;
}
function removeFromCart($movie)
{
    unset($_SESSION['cart'][$movie]);
}
function checkOut($firstname, $lastname, $phone, $email)
{
Пример #4
0
$Order_number           = $object['order_number'];
$order_comm             = $object['order_comment'];
//$current_time           = date("Y-m-d h:i:s");
$current_time = $object['created_date'];
$datew = new DateTime($current_time, new DateTimeZone('America/New_York'));
date_default_timezone_set('America/New_York');
$temp_times =  date("Y-m-d h:iA", $datew->format('U'));
//$Date = date("m/d/Y", strtotime($object['created_date'])). ' ' .date("h:iA",strtotime("-0 minutes",strtotime($temp_times)));
$Date                   = date('Y-m-d h:i A', time());              
$view_orders            = viewOrders($id);
$pick_up                = $view_orders[0]['shipping_add_id'];

$returnValue            = html_entity_decode('Your Soho Repro graphics order has been received and will be processed promptly.', ENT_COMPAT, 'ISO-8859-1');

//Add Favorites
$select_pro_fav = checkOut($user_id);


       
foreach ($select_pro_fav as $fav_prod){
    $fav_comp_id = $fav_prod['company_id'];
    $fav_prod_id = $fav_prod['product_id'];
    $check_fav = CHECKFAVEXIXT($fav_comp_id, $fav_prod_id);
    if(count($check_fav) == '0'){
        
        $sql_sort_id        = mysql_query("SELECT sort_id FROM sohorepro_favorites WHERE comp_id = '".$comp_id."' ORDER BY sort_id DESC LIMIT 1");
        $object_order_sort  = mysql_fetch_assoc($sql_sort_id);

        if (count($object_order_sort['sort_id']) > 0) {
            $order_sort_id = ($object_order_sort['sort_id'] + 1);
        } 
Пример #5
0
        if (count($object_order['order_number']) > 0) {
            $order_id = ($object_order['order_number'] + 1);
        } 
        else{
            $order_id = '101';
        }
    
   
        
$user_id          =       $_POST['user_cart_id'];
$company_id       =       $_POST['company_id'];
$referece         =       $_POST['reference']  ;
$sql = "INSERT INTO sohorepro_order_master SET order_number = '".$order_id."', order_id     = '" . $referece . "', customer_company = '".$company_id."', customer_name = '".$user_id."', created_date = now()";
mysql_query($sql);
$order_id_pro = mysql_insert_id();
$product = checkOut($user_id);

if($order_id_pro != ''){
foreach ($product as $pro)
    {
    $product_id       = $pro['product_id'];
    $product_price    = $pro['unit_price'];
    $product_quantity = $pro['quantity'];
    $shipping_id      = $pro['shipping_add_id'];
    $product_name     = mysql_real_escape_string(getProName($product_id));
    $query = "INSERT INTO sohorepro_product_master SET product_id     = '" . $product_id . "', product_price = '" . $product_price . "', product_quantity = '" . $product_quantity . "', product_name = '".$product_name."', order_id = '" .$order_id_pro. "', shipping_add_id ='" .$shipping_id. "' ";
    mysql_query($query);
    } 
}

            </table></center>

        <br><br>
        
    </form>

    <?php 
$con = mysql_connect("localhost", "root", "");
if ($con) {
    mysql_select_db("library");
} else {
    echo 'could not connect' . "<br/>";
}
if ($_POST) {
    if (isset($_POST['checkout'])) {
        checkOut();
    } elseif (isset($_POST['checkin'])) {
        checkIn();
    }
}
function checkOut()
{
    $bookid = $_POST['bookid'];
    $branchid = $_POST['branchid'];
    $card = $_POST['card'];
    $queryno = " select count(*) as 'no_of_books_taken' from book_loans " . " where card_no='{$card}' and isnull(date_in) ";
    $no_taken = mysql_query($queryno);
    if ($no_taken === FALSE) {
        echo mysql_error();
    } else {
        while ($no = mysql_fetch_assoc($no_taken)) {
Пример #7
0
require_once ROOT_PATH . 'lib/inc.init.php';
require_once ROOT_PATH . 'lib/cls.result_high.php';
$athletes = getAthleteDetails(0, true, "ath_rank, ath_res DESC");
?>
<table>
    <colgroup>
        <col width="50">
        <col width="50">
        <col width="200">
        <col width="50">
        <col width="250">
        <col>
    </colgroup>
<?php 
foreach ($athletes as $athlete) {
    $out = checkOut($athlete['ath_id']);
    if ($out == 1 || $athlete['ath_res'] < 0) {
        $class = "resultlist_inactive";
    } else {
        $class = "resultlist";
    }
    ?>
    <tr class="<?php 
    echo $class;
    ?>
">
        <td><?php 
    echo $athlete['ath_rank_out'];
    ?>
</td>
        <td><?php 
Пример #8
0
    public function actionView()
    {
        global $urlRequestRoot, $sourceFolder, $templateFolder, $cmsFolder, $moduleFolder;
        $moduleComponentId = $this->moduleComponentId;
        $scriptsFolder = "{$urlRequestRoot}/{$cmsFolder}/{$templateFolder}/common/scripts";
        $imagesFolder = "{$urlRequestRoot}/{$cmsFolder}/{$templateFolder}/common/images";
        require_once "{$sourceFolder}/{$moduleFolder}/prhospi/prhospi_common.php";
        require_once "{$sourceFolder}/{$moduleFolder}/prhospi/accommodation.php";
        if (isset($_POST['subaction']) && $_POST['subaction'] == 'accoRegUser') {
            echo ajaxSuggestions($moduleComponentId, 0, $this->userId);
            exit;
        }
        if (isset($_POST['subaction']) && $_POST['subaction'] == 'accoRegUserUpdate') {
            echo ajaxSuggestions($moduleComponentId, 1);
            exit;
        }
        if (isset($_GET['subaction']) && $_GET['subaction'] == 'getsuggestions' && isset($_GET['forwhat'])) {
            echo getSuggestionsForIdOrEmail(escape($_GET['forwhat']));
            exit;
        }
        if (isset($_POST['printthis']) && isset($_POST['printHiddenId'])) {
            if ($_POST['printHiddenId'] != "") {
                $pos = strpos($_POST['printHiddenId'], "printHostelAllotmentBill");
                if ($pos == 0) {
                    return printDisclaimer($moduleComponentId, substr(escape($_POST['printHiddenId']), 24), "hospihead");
                }
            }
        }
        if (isset($_GET['subaction'])) {
            if ($_GET['subaction'] == 'AddRoom') {
                if (isset($_POST['addHostels'])) {
                    $displayActions = addHostels($_POST, $moduleComponentId);
                }
                return $displayActions = displayAddNewRooms("view", $moduleComponentId);
            }
        }
        $displayTags = <<<TAG
      <script type="text/javascript" src="{$urlRequestRoot}/{$cmsFolder}/{$moduleFolder}/prhospi/accoregister.js"></script> 
       <h2> Accommodation </h2>
\t<table>
         <tr>
           <td><a href="./+view&subaction=viewRegisteredUser"> <div>View Registrants</div></a></td>
           <td><a href="./+view"><div>Add User</div></a></td>
         </tr>
        </table>
                                    
TAG;
        if (isset($_GET['subaction']) && $_GET['subaction'] == 'viewRegisteredUser') {
            $excel = "<a href='./+view&subaction=viewRegisteredUser&saveAsExcel'>Save as Excel</a>";
            if (isset($_GET['saveAsExcel'])) {
                require_once "{$sourceFolder}/{$moduleFolder}/qaos1/excel.php";
                displayExcelForTable(displayUsersRegisteredToAcco($moduleComponentId));
            }
            return $displayTags . $excel . displayUsersRegisteredToAcco($moduleComponentId);
        }
        $inputUser = <<<USER
      
    <h2> CHECK IN FORM </h2>
      <form method="POST" action="./+view">
      Enter UserId or Email:<input type="text" name="txtFormUserId" id="txtFormUserId"  autocomplete="off" style="width: 256px" />
      <div id="suggestionsBox" style="background-color: white; width: 260px; border: 1px solid black; position: absolute; overflow-y: scroll; max-height: 180px; display: none"></div>
      <input type="submit" Value="Find User"/>
  <!--    <script type="text/javascript" language="javascript" src="{$scriptsFolder}/ajaxsuggestionbox.js">
      </script>
      <script language="javascript">
      
      var userBox = new SuggestionBox(document.getElementById('txtFormUserId'), document.getElementById('suggestionsBox'), "./+view&subaction=getsuggestions&forwhat=%pattern%");
    userBox.loadingImageUrl = '{$imagesFolder}/ajaxloading.gif';
    </script>
  --> </form>


USER;
        $userDetails = "";
        $displayActions = "";
        if (isset($_POST['txtFormUserId']) && $_POST['txtFormUserId'] != '') {
            //      $detailsGiven=explode("- ",escape($_POST['txtFormUserId']));
            //      $userDetails.=getUserDetailsForHospi($detailsGiven[1],$moduleComponentId);
            $userDetails .= getUserDetailsForHospi(escape($_POST['txtFormUserId']), $moduleComponentId);
        }
        if (isset($_POST['txtFormUserId1']) && $_POST['txtFormUserId1'] != '') {
            if (!isset($_POST['refundAmt'])) {
                displayerror("Refund Amount Not Defined");
            } else {
                if (!is_numeric($_POST['refundAmt'])) {
                    displayerror("Refund Amount is not a Valid Number");
                } else {
                    //        $detailsGiven=explode("- ",escape($_POST['txtFormUserId1']));
                    //        checkOut($detailsGiven[1],escape($_POST['refundAmt']),$moduleComponentId);
                    checkOut(escape($_POST['txtFormUserId1']), escape($_POST['refundAmt']), $moduleComponentId);
                }
            }
        }
        if (isset($_GET['subaction']) && $_GET['subaction'] == 'accommodation' && isset($_GET['userId']) && is_numeric($_GET['userId'])) {
            $userDetails .= displayAccommodationForm(escape($_GET['userId']), $moduleComponentId, $this->userId);
        }
        $amtToCollect = getAmount("hospihead", $moduleComponentId);
        $checkOutFORM = <<<checkOut
   <hr/>
   <h2> CHECK OUT FORM </h2>
    <form method="POST" action="./+view">
    <table border="1">
      <tr>
       <td>Enter UserId or Email:</td>
       <td><input type="text" name="txtFormUserId1" id="txtFormUserId1"  autocomplete="off" style="width: 256px" />
        <div id="suggestionsBox1" style="background-color: white; width: 260px; border: 1px solid black; position: absolute; overflow-y: scroll; max-height: 180px; display: none"></div><br/>
        </td>
      </tr>
      <tr>
        <td>Refund Amount:</td>
        <td><input type="text" name="refundAmt" value="{$amtToCollect}"/></td>
      </tr>
      <tr>  
        <td colspan="2"><input type="submit" Value="Find User"/></td>
      </tr>
      </table>
<!--      <script type="text/javascript" language="javascript" src="{$scriptsFolder}/ajaxsuggestionbox.js">
      </script>
      <script language="javascript">
      var userBox = new SuggestionBox(document.getElementById('txtFormUserId1'), document.getElementById('suggestionsBox1'), "./+view&subaction=getsuggestions&forwhat=%pattern%");
    userBox.loadingImageUrl = '{$imagesFolder}/ajaxloading.gif';
    </script> -->
   </form>


checkOut;
        return $displayTags . $inputUser . $userDetails . $checkOutFORM;
    }
Пример #9
0
 } else {
     $message = strtolower($currentCall->initialText);
 }
 switch ($message) {
     // User is checking in.
     case 'check in':
         if (checkIn($callerID, $channel, $network)) {
             say('You have been checked in to Cloud knock.');
         } else {
             say('Could not check you in. Do you need to check out?');
         }
         break;
         // User is checking out.
     // User is checking out.
     case 'check out':
         if (checkOut($callerID)) {
             say('You have been checked out of Cloud knock.');
         } else {
             say('Could not check you out. Do you need to check in?');
         }
         break;
         // Somebody's knocking on the door, somebody's rining the bell...
     // Somebody's knocking on the door, somebody's rining the bell...
     case 'knock knock':
         if (knockKnock($userName, $callerID)) {
             say('OK. knocks sent.');
         } else {
             say('No one checked in. :-(');
         }
         break;
     default:
Пример #10
0
    }
}
if (isset($_POST["form_submit_out"]) && $_POST["form_submit_out"] == "true" && $_POST["form_submit_out"] != "") {
    $userid = trim($_POST['userid']);
    $data['attd_out_time'] = trim($_POST['attd_out_time']);
    $data['attd_date'] = trim($_POST['attd_date']);
    $data['attd_comment'] = trim($_POST['attd_comment']);
    if (!checkOutCheckIn($userid, $data, $db)) {
        // check today check in data is exist or not
        $rfc = "<script>alert('Please, check in first, thank you.')</script>";
    } else {
        if (checkOutCheckedIn($userid, $data, $db)) {
            // check today checked in data is already exist or not
            $rfc = "<script>alert('You already checked out for today, thank you.')</script>";
        } else {
            if (checkOut($userid, $data, $db)) {
                // checking out
                $rfc = "<script>alert('Successfully checked out, thank you.')</script>";
            } else {
                $rfc = "<script>alert('Sorry for inconvenience, try again.')</script>";
            }
        }
    }
}
if (isset($_POST['filter']) && $_POST['filter'] == "true" && $_POST["filter"] != "") {
    $my[0] = trim($_POST['year']);
    $my[1] = trim($_POST['month']);
    $my[2] = trim($todaydate[2]);
    // only allow to view history
    $show = true;
    if ($my[0] > $todaydate[0]) {