| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/hans_sites/yogurtlanddelivers.com/ |
Upload File : |
<?php
session_start();
if(empty($_SESSION['shopping_cart'])) {
$_SESSION['shopping_cart'] = array();
}
if(!empty($_GET['ay'])) {
//They are adding a yogurt
$current_size = $_SESSION['current_size'];
$current_flavors = $_SESSION['current_flavors'];
$current_toppings = $_SESSION['current_toppings'];
$current_size['name_on_cup'] = $_GET['name_on_cup'];
$unique_id = uniqid();
$yogurt_cup = array('id'=>$unique_id,'size'=>$current_size,'flavors'=>$current_flavors,'toppings'=>$current_toppings);
if(empty($_SESSION['shopping_cart'])) {
$_SESSION['shopping_cart'] = array();
}
$_SESSION['shopping_cart'][] = $yogurt_cup;
unset($_SESSION['current_size']);
unset($_SESSION['current_flavors']);
unset($_SESSION['current_toppings']);
require_once($_SERVER['DOCUMENT_ROOT'].'/php/mysql.php');
$db->query("INSERT INTO yogurtland_delivers.step_tracking
(
ip_address
,order_id
,step
,comments
,ts
) VALUES (
'".clean($_SERVER['REMOTE_ADDR'])."'
,'".clean((!empty($_SESSION['order_id'])) ? $_SESSION['order_id'] : '0')."'
,'Added to Shopping Cart'
,'".clean(print_r($_SESSION,true))."'
,NOW()
)");
header("Location: /checkout.php");
exit(0);
}
//echo '<pre>'.print_r($_SESSION,true).'</pre>';
ob_start();
?>
<script src="/js/jquery.formatter.min.js"></script>
<script src="/js/checkout.js?ts=<?= time();?>"></script>
<div id="real_content">
<div class="checkout_header">ORDER SUMMARY</div>
<?php foreach($_SESSION['shopping_cart'] as $num=>$order) {
$total_flavor_list = count($order['flavors']);
if($total_flavor_list < count($order['toppings'])) {
$total_flavor_list = count($order['toppings']);
}
?>
<div class="order_summary">
<div class="delete_cup" title="Remove Cup" onclick="delete_yogurt_cup(this,'<?= $order['id'];?>','<?= str_replace("'",'',$order['size']['name_on_cup']);?>');">−</div>
<img src="/images/checkout_yogurt.png" />
<div class="order_ounces"><?= $order['size']['name_on_cup'];?> - <?= $order['size']['ounces'];?> oz Cup</div>
<div class="order_price">$<?= number_format($order['size']['price'],2);?></div>
<table>
<tr>
<td class="order_summary_flavor_title">Flavors:</td>
<td class="order_summary_flavor_title">Toppings:</td>
</tr>
<?php for($i=0;$i<$total_flavor_list;$i++) { ?>
<tr>
<?php if(!empty($order['flavors'][$i])) { ?>
<td><?= $i+1;?>. <?= $order['flavors'][$i]['short_flavor'];?></td>
<?php } else { ?>
<td></td>
<?php } ?>
<?php if(!empty($order['toppings'][$i])) { ?>
<td><?= $i+1;?>. <?= $order['toppings'][$i]['short_flavor'];?></td>
<?php } else { ?>
<td></td>
<?php } ?>
</tr>
<?php } ?>
</table>
</div>
<?php } ?>
<div class="add_another_yogurt">
<a href="/choose_size.php">Add Another Cup</a>
</div>
<div style="clear:both;margin-bottom:10px;"></div>
<div class="checkout_header">ADD TIP</div>
<div class="tip_container">
<div class="tip_button" onclick="update_tip_button(this);">$2</div>
<div class="tip_button" onclick="update_tip_button(this);">$3</div>
<div class="tip_button" onclick="update_tip_button(this);">$4</div>
<div class="tip_button" onclick="update_tip_button(this);">$5</div>
<div><input type="number" min="0" step="0.01" id="update_tip_input" name="custom_tip" placeholder="Custom Tip" onkeyup="update_tip_input(this);" /></div>
<div class="real_tip">$0.00</div>
</div>
<div class="subtotal_area">
<div class="subtotal_left_side">
<input type="text" name="promo_code" id="promo_code" placeholder="Promo Code" onkeyup="check_promo_code();" />
</div>
<div class="subtotal_right_side">
<?php
$total = 0;
if(!empty($_SESSION['shopping_cart'])) {
foreach($_SESSION['shopping_cart'] as $k=>$v) {
$total += $v['size']['price'];
}
}
$subtotal_cost = round($total,2);
$delivery_amount = 3.00;
$total += $delivery_amount;
$over_10_total = $total;
if($_SESSION['extra_delivery_charge']=='1') {
$total += '2.00';
}
$tax = round($total * 0.075,2);
$real_total = round($total + $tax,2);
$over_10_total = round($over_10_total + $tax,2);
?>
<table class="subtotal">
<tr>
<td class="subtotal_label">Subtotal:</td>
<td class="subtotal_amount" id="subtotal_cost">$<?= number_format($subtotal_cost,2);?></td>
</tr>
<tr>
<td class="subtotal_label">Delivery:</td>
<td class="subtotal_amount" id="delivery_amount">$<?= number_format($delivery_amount,2);?></td>
</tr>
<?php if($_SESSION['extra_delivery_charge']=='1') { ?>
<tr>
<td class="subtotal_label">Extended Delivery:<br /><small>(over 5 miles)</small></td>
<td class="subtotal_amount" id="delivery_amount_extended">$<?= number_format($delivery_amount,2);?></td>
</tr>
<?php } ?>
<tr>
<td class="subtotal_label">Tax:</td>
<td class="subtotal_amount" id="tax_amount">$<?= number_format($tax,2);?></td>
</tr>
<tr>
<td class="subtotal_label">Driver's Tip:</td>
<td class="subtotal_amount" id="tip_amount">$0.00</td>
</tr>
<tr class="subtotal_promo" style="display:none;">
<td class="subtotal_label">Discount:</td>
<td class="subtotal_amount" id="discount_amount">$0.00</td>
</tr>
<tr class="subtotal_total">
<td class="subtotal_label">Total:</td>
<td class="subtotal_amount" id="total_amount">$<?= number_format($real_total,2);?></td>
</tr>
</table>
</div>
<?php if($_SESSION['extra_delivery_charge']=='1') { ?>
<div class="subtotal_label" id="minimum_needed" style="font-size:12px;<?= ($over_10_total>=10) ? 'display:none;' : '';?>">
Orders must be at least $10.00, not including tip and extended delivery.
<div class="add_another_yogurt add_button_mini">
<a href="/choose_size.php">Add Another Cup</a>
</div>
</div>
<?php } else { ?>
<div class="subtotal_label" id="minimum_needed" <?= ($over_10_total>=10) ? 'style="display:none;"' : '';?>>
Orders must be at least $10.00, not including tip.
<div class="add_another_yogurt add_button_mini">
<a href="/choose_size.php">Add Another Cup</a>
</div>
</div>
<?php } ?>
</div>
<div class="black_bar"></div>
<div class="delivery_container">
<table>
<tr>
<td class="delivery_address">
<div class="delivery_address_header">Delivery Address</div>
<div class="delivery_address_address">
<div><?= $_SESSION['address'];?></div>
<div><?= $_SESSION['city'];?>, <?= $_SESSION['state'];?> <?= $_SESSION['zip'];?></div>
</div>
</td>
<td class="delivery_time">
<div class="delivery_address_header">Delivery Time</div>
<div class="delivery_address_address">
<input type="hidden" name="delivery_time" id="delivery_time_select" value="" />
<div id="delivery_time_view" onclick="show_delivery_date_popup();"><span style="color:red;">Select Delivery Time</span></div>
</div>
</td>
</tr>
</table>
</div>
<div class="black_bar small_bar"></div>
<div class="credit_card_area">
<?php /*
<div class="credit_card_button" onclick="$('.credit_card_inputs').show(350);">
<img src="/images/credit_card.png" class="credit_card_button_image" />
<div class="credit_card_button_text">Credit Card</div>
</div> */?>
<div class="credit_card_inputs">
<input type="text" name="cc_first_name" placeholder="First Name" style="width:230px;" />
<input type="text" name="cc_last_name" placeholder="Last Name" style="width:230px;" />
<input type="tel" name="cc_cell_phone" placeholder="Cell Phone" style="width:120px;" />
<input type="text" name="cc_email" placeholder="Email" style="width:340px;" />
<input type="tel" name="cc_num" maxlength="16" placeholder="Credit Card" style="width:220px;" />
<input type="tel" name="cc_exp" placeholder="Expiration" style="width:120px;" />
<input type="tel" name="cc_cvv" placeholder="Sec. Code" style="width:93px;" />
<div onclick="charge_credit_card(); return false;" class="next_button">
<a href="#">Complete Order</a>
</div>
</div>
<?php /*
<div class="other_payment_methods_header">or Checkout with</div>
<div class="other_payment_methods">
<div class="apple_pay">
<img src="/images/apple_pay.png" />
</div>
<div class="amazon_pay">
<img src="/images/amazon_pay.png" />
</div>
<div class="google_pay">
<img src="/images/google_pay.png" />
</div>
</div>
*/ ?>
</div>
</div>
<div id="block_screen">
<table>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td id="blocked_message">
<img src="/images/checkout_yogurt.png" />
<div>Processing Your Order</div>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<div id="date_pick_container">
<table>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td id="date_pick_td">
<div id="date_picker_close" onclick="$('#date_pick_container').hide();">x</div>
<h2>Delivery Time</h2>
<div id="delivery_date_dates_container">
<?php
$delivery_dates = array();
$first_delivery_date = date('Y-m-d');
$today = date('Y-m-d');
if(date('w')!='0') {
$delivery_dates[] = $first_delivery_date;
}
while(count($delivery_dates)<5) {
$first_delivery_date = date('Y-m-d',strtotime('+1 day',strtotime($first_delivery_date)));
if(date('w',strtotime($first_delivery_date))=='0') {
//no delivery on sunday
} else {
$delivery_dates[] = $first_delivery_date;
}
}
foreach($delivery_dates as $delivery_date) {
if($delivery_date==$today) {
$date_label = 'Today';
} else {
$date_label = date('D',strtotime($delivery_date));
}
?>
<div class="delivery_date <?= ($delivery_date==$today) ? 'selected_date' : '';?>" onclick="select_delivery_date(this,'<?= $delivery_date;?>');">
<div class="delivery_date_label"><?= $date_label;?></div>
<div class="delivery_date_day"><?= date('j',strtotime($delivery_date));?></div>
</div>
<?php
}
?>
</div>
<div id="delivery_date_times_container">
</div>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<?php
$title = 'Yogurtland Delivers - Checkout';
$page = 'checkout';
$html = ob_get_clean();
include('layout.php');
?>