| 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/froyo2me.com/ |
Upload File : |
<?php
session_start();
require_once($_SERVER['DOCUMENT_ROOT'].'/php/mysql.php');
$sizes = $db->get_results("SELECT * FROM yogurtland_delivers.sizes WHERE active='1' ORDER BY price ASC");
$yogurt_sizes = array();
foreach($sizes as $size) {
$yogurt_sizes['cups_'.$size->ounces.'_ounce'] = $size;
}
$errors = '';
if(!empty($_GET['redeem_code'])) {
$res = $db->get_results("SELECT * FROM gifted_orders WHERE unique_code='".$db->clean($_GET['redeem_code'])."'");
if(!empty($res)) {
if(!empty($res[0]->code_used)) {
$errors = 'This code has already been used';
} else {
$_SESSION = array();
$_SESSION['unique_code'] = $res[0]->unique_code;
$_SESSION['gifted_orders_id'] = $res[0]->id;
$_SESSION['added_orders_id'] = $res[0]->added_orders_id;
$_SESSION['make_anonymous'] = $res[0]->make_anonymous;
$_SESSION['sender_message'] = $res[0]->sender_message;
$_SESSION['sender_first_name'] = $res[0]->sender_first_name;
$_SESSION['sender_last_name'] = $res[0]->sender_last_name;
if($res[0]->make_anonymous) {
$_SESSION['sender_first_name'] = 'Anonymous';
$_SESSION['sender_last_name'] = '';
}
$_SESSION['recipient_first_name'] = $res[0]->recipient_first_name;
$_SESSION['recipient_last_name'] = $res[0]->recipient_last_name;
$_SESSION['recipient_cell_phone'] = $res[0]->recipient_cell_phone;
$_SESSION['recipient_email'] = $res[0]->recipient_email;
$_SESSION['gift_from'] = (empty($res[0]->make_anonymous)) ? $res[0]->sender_first_name.' '.$res[0]->sender_last_name : 'anonymous';
$_SESSION['total_cups'] = $res[0]->cups_7_ounce*1 + $res[0]->cups_14_ounce*1 + $res[0]->cups_21_ounce;
$_SESSION['cups_left']['cups_7_ounce'] = $res[0]->cups_7_ounce;
$_SESSION['cups_left']['cups_14_ounce'] = $res[0]->cups_14_ounce;
$_SESSION['cups_left']['cups_21_ounce'] = $res[0]->cups_21_ounce;
$_SESSION['cups_made'] = array();
$_SESSION['cups_made_total'] = 0;
}
} else {
$errors = 'This code is not valid';
}
} else {
if(empty($_SESSION['unique_code'])) {
$errors = 'This code is not valid';
}
}
ob_start();
?>
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDI7gLhFsyVVAnLKNkOrygt6hQ9ruYREmY"></script>
<script src="/js/gifted.js?ts=<?= time();?>"></script>
<style>
.yogurt_cup {
width:130px;
}
.description {
width:190px;
}
.size {
cursor:default;
}
.quote_from_client {
font-size:28px;
color:#804262;
font-weight:bold;
margin:10px 0px;
}
</style>
<div id="real_content">
<center style="padding:0px 20px;">
<?php if(!empty($errors)) { ?>
<div class="error"><?= $errors;?></div>
<?php } else { ?>
<?php } ?>
<div class="select_size_header_gift" style="height:90px;">
<img src="/images/gift_icon_bigger.png" style="vertical-align:bottom;width:90px;" /> <div style="display:inline-block;vertical-align:bottom;">Your Yogurt Gift</div>
</div>
<div class="quote_from_client"><i>"<?= $_SESSION['sender_message'];?></i>"<br /><div style="float:right;font-size:18px;color:black;">- <?= $_SESSION['sender_first_name'].' '.$_SESSION['sender_last_name'];?></div></div>
<div style="clear:both;"></div>
<div style="text-align:left;">
<p><?= $_SESSION['recipient_first_name'];?>, to receive your <?= $_SESSION['total_cups'];?> FREE Yogurts from <?= $_SESSION['gift_from'];?>, please follow these 3 Easy Steps:</p>
<ol>
<li>Click "Create" to select the flavors and toppings for each the yogurt cups below</li>
<li>Select your Delivery Method and Time</li>
<li>Click "Complete Order"</li>
</ol>
</div>
<div class="how_many_created_so_far"><?= $_SESSION['cups_made_total'];?> of <?= $_SESSION['total_cups'];?> yogurt cups created</div>
<div style="clear:both;"></div>
<?php if(!empty($_SESSION['cups_made'])) {
foreach($_SESSION['cups_made'] as $size=>$cups) {
foreach($cups as $order) {
$total_flavor_list = count($order['flavors']);
if($total_flavor_list < count($order['toppings'])) {
$total_flavor_list = count($order['toppings']);
}
?>
<div class="order_summary finished_yogurt">
<img src="/images/checkout_yogurt.png" />
<div class="order_ounces"><?= $order['size']['name_on_cup'];?> - <?= $order['size']['ounces'];?> oz Cup</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 }
}
}?>
<?php if(!empty($_SESSION['cups_left'])) {
foreach($_SESSION['cups_left'] as $size=>$cups) {
$really_left = $cups - ((empty($_SESSION['cups_made'][$size])) ? 0 : count($_SESSION['cups_made'][$size]));
if($really_left > 0) {
for($i=0;$i<$really_left;$i++) {
?>
<div class="size black2border slightly_bigger_size">
<div class="yogurt_cup">
<img src="/images/<?= $yogurt_sizes[$size]->image_url;?>" style="width:<?= $yogurt_sizes[$size]->image_width;?>px;" />
</div>
<div class="description">
<div class="total_weight"><?= $yogurt_sizes[$size]->ounces;?> oz Total Weight</div>
<div class="choose_up_to">Choose up to:</div>
<div class="num_flavors">
<?= $yogurt_sizes[$size]->flavors;?> Flavor<?= ($yogurt_sizes[$size]->flavors*1>1) ? 's' : '';?>,
<?= $yogurt_sizes[$size]->toppings;?> Topping<?= ($yogurt_sizes[$size]->toppings*1>1) ? 's' : '';?>
</div>
</div>
<div class="cup_amounts">
<a href="choose_flavors.php?new_size=<?= $yogurt_sizes[$size]->id;?>"><img src="/images/gifted_create_icon.png" /></a>
</div>
</div>
<?php
}
}
}
}
?>
<div class="select_size_header" style="font-size:27px;">
Delivery Method
</div>
<div>
<div class="gifted_delivery_method" onclick="update_delivery_method(this,'delivery'); return false;">
<img src="/images/yogurt_car.png" />
<div>Delivery</div>
</div>
<div class="gifted_delivery_method_or">Or</div>
<div class="gifted_delivery_method" onclick="update_delivery_method(this,'curbside'); return false;">
<img src="/images/curbside_big.png" />
<div>Curbside</div>
</div>
</div>
<div id="delivery_method_delivery_time" style="display:none;"></div>
<div id="address_form" style="display:none;">
<form onsubmit="false" autocomplete="false">
<input type="text" id="address_input" name="address" placeholder="Enter Address" autocomplete="off" />
</form>
<div>
<textarea id="apt_suite" name="apt_suite" placeholder="Apt number, or other info we need to know"></textarea>
</div>
<div class="address_comments_container" style="display:none;">
<div id="address_hidden" style="display:none;"></div>
<div id="address_geocoded" class="delivery_big_text ptb15"></div>
<textarea id="address_comments" name="address_comments" placeholder="Describe delivery location"></textarea>
</div>
<div id="map" style="display:none;"></div>
</div>
<div class="curbside_comments_container" style="display:none;">
<div><input type="text" id="car_color" name="car_color" placeholder="Car Color" /></div>
<div><input type="text" id="car_model" name="car_model" placeholder="Car Model" /></div>
</div>
<div class="select_size_header" style="font-size:27px;">
Your Information
</div>
<div class="credit_card_area bigger_text_inputs">
<div class="credit_card_inputs">
<input type="text" name="recipient_first_name" placeholder="First Name" id="recipient_first_name" value="<?= $_SESSION['recipient_first_name'];?>" onkeyup="update_text_from();" />
<input type="text" name="recipient_last_name" placeholder="Last Name" id="recipient_last_name" value="<?= $_SESSION['recipient_last_name'];?>" onkeyup="update_text_from();" />
<input type="tel" name="recipient_cell_phone" placeholder="Cell Phone" value="<?= $_SESSION['recipient_cell_phone'];?>" />
<input type="text" name="recipient_email" placeholder="Email" style="font-size:28px;" value="<?= $_SESSION['recipient_email'];?>" />
</div>
</div>
<br />
<?php if(empty($_SESSION['make_anonymous'])) { ?>
<div class="checkout_header">
<input type="checkbox" name="send_a_message_to_gifter" value="1" id="send_a_message_to_gifter" style="width:32px;height:32px;vertical-align:middle;" onclick="if($(this).is(':checked')) { $('#text_customer_parent').show(); } else { $('#text_customer_parent').hide(); }" /> Send a Thank You note to <span id="recipient_first_name_in_text"><?= $_SESSION['sender_first_name'].' '.$_SESSION['sender_last_name'];?></span>
</div>
<div class="credit_card_area" id="text_customer_parent" style="display:none;">
<div id="first_part_of_text">Yogurtland Thank You note from <?= $_SESSION['recipient_first_name'];?>: </div>
<div>
<textarea name="text_custom" id="text_custom" placeholder="Your custom message here" onkeyup="update_custom_part_of_text(this);"></textarea>
</div>
<div id="custom_text_remaining_characters">Remaining Characters: <?= 140 - strlen('Yogurtland Thank You note from '.$_SESSION['recipient_first_name'].': ');?></div>
</div>
<?php } ?>
<div onclick="redeem_gifted_yogurts(); return false;" class="next_button">
<a href="#">Complete Order</a>
</div>
</center>
</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_animated.gif" />
<div>Processing Your Order<br />Please do not hit the back button or refresh the page</div>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<?php
$title = 'Yogurtland Delivers - Gifted';
$page = 'gifted';
$html = ob_get_clean();
include('layout.php');
?>