| 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();
//If you change this page, be sure to also change the /flavors page and the /postmates/choose_flavors.php pages
require_once($_SERVER['DOCUMENT_ROOT'].'/php/mysql.php');
if(empty($_SESSION['unique_code'])) {
if(empty($_SESSION['full_address'])) {
header("Location: /"); //They shouldn't be here
}
if(empty($_SESSION['current_size'])) {
header("Location: /"); //They shouldn't be here
}
} else {
if($_GET['new_size']) {
$sizes = $db->query("SELECT * FROM yogurtland_delivers.sizes WHERE id='".clean($_GET['new_size'])."'");
if(!empty($sizes)) {
$_SESSION['current_size'] = $sizes[0];
header("Location: /choose_flavors.php");
}
}
}
$broken_stuff = $db->query("SELECT COUNT(*) as c
FROM ylreports_inventory.products
WHERE real_product_image_path='' AND type='yogurt'");
if($broken_stuff[0]['c']>0) {
$db->query("UPDATE ylreports_inventory.products
SET real_product_image_path=CONCAT('/images/flavors/',product_image)
WHERE real_product_image_path='' AND type='yogurt'");
}
$res = $db->query("SELECT MAX(ts) as ts FROM ylreports_HansKirchhausen.waste_log WHERE store_id=1");
$date = $res[0]['ts'];
$currentYogurts = $db->query("SELECT
f.id as product,
f.no_sugar_added,
f.gluten_free,
f.dairy_free,
f.fat_free,
f.low_fat,
w.machine,
w.flavor,
CONCAT('images/flavors/',f.picture) as real_product_image_path
FROM ylreports_HansKirchhausen.waste_log w
LEFT JOIN ylreports.flavors f ON w.flavor=f.flavor
WHERE
w.ts='".clean($date)."'
GROUP BY w.machine
ORDER BY flavor ASC
");
/*$currentYogurts = $db->query("SELECT
p.product_name as flavor,
p.product,
p.real_product_image_path,
m.machine_id,
m.side
FROM ylreports_inventory.machines m
LEFT JOIN ylreports_inventory.products p ON m.flavor=p.flavor
WHERE
m.store_id = '1'
GROUP BY machine_id,side
ORDER BY flavor ASC
");
*/
//check if the machine is up
$is_there = array();
foreach($currentYogurts as $k=>$yogurt) {
if(empty($yogurt['product'])) {
unset($currentYogurts[$k]);
continue;
}
if($yogurt['flavor']=='None') {
unset($currentYogurts[$k]);
continue;
}
if(!empty($is_there[$yogurt['product']])) {
unset($currentYogurts[$k]);
continue;
}
$is_there[$yogurt['product']] = '1';
$currentYogurts[$k]['short_flavor'] = $yogurt['flavor'];
if(strlen($yogurt['flavor'])>30) {
$currentYogurts[$k]['short_flavor'] = substr($yogurt['flavor'],0,30).'...';
}
//$machine = 'machine_'.$yogurt['machine_id'].'_'.$yogurt['side'].'_side';
$machine = $currentYogurts[$k]['machine'];
$res = $db->query("SELECT status
FROM ylreports_HansKirchhausen.hopper_temp
WHERE item='".clean($machine)."'
ORDER BY ts DESC LIMIT 1");
if($res[0]['status']=='down') {
unset($currentYogurts[$k]);
}
}
ob_start();
?>
<script src="/js/choose_flavors.js?ts=<?= time();?>"></script>
<?php if(!empty($_SESSION['current_flavors'])) { ?>
<script>
$('document').ready(function() {
var fls = <?= json_encode($_SESSION['current_flavors']);?>;
update_chosen_flavors(fls);
});
</script>
<?php } ?>
<div id="real_content">
<center>
<div class="floating_summary">
<table>
<tr>
<td class="your_cup">
<img src="/images/<?= $_SESSION['current_size']['image_url'];?>" class="yogurt_cup_mini" />
<div><?= $_SESSION['current_size']['ounces'];?> oz Cup</div>
</td>
<td class="your_flavors">
<div class="floating_summary_header">Flavors <a href="/choose_flavors.php"><img src="/images/pencil.png" /></a></div>
<?php for($i=0;$i<$_SESSION['current_size']['flavors'];$i++) { ?>
<div id="flavor_mini_<?= $i;?>" class="flavor_mini"><?= $i+1;?>. <span class="real_flavor_mini"><?= $_SESSION['current_flavors'][$i]['short_flavor'];?></span></div>
<?php } ?>
</td>
<td class="your_toppings">
<div class="floating_summary_header">Toppings <a href="/choose_toppings.php"><img src="/images/pencil.png" /></a></div>
<?php for($i=0;$i<$_SESSION['current_size']['toppings'];$i++) { ?>
<div id="topping_mini_<?= $i;?>" class="topping_mini"><?= $i+1;?>. <span class="real_topping_mini"><?= $_SESSION['current_toppings'][$i]['short_flavor'];?></span></div>
<?php } ?>
</td>
<td>
<a class="next_cup_link <?= (empty($_SESSION['current_flavors'])) ? 'link_disabled' : '';?>">
<img src="/images/next_cup.png" />
</a>
</td>
</tr>
</table>
</div>
<div class="select_size_header">
<div class="big_number_1">
<div class="center_number_1">2</div>
</div>
Yogurt Flavors
<div class="yogurt_flavors_picker_subtitle">Choose up to <?= $_SESSION['current_size']['flavors'];?></div>
</div>
<div class="yogurt_flavors_picker" style="display:none;">
<div class="yogurt_flavors_picker_title">Yogurt Flavors</div>
<table>
<tr>
<?php for($i=0;$i<$_SESSION['current_size']['flavors'];$i++) { ?>
<td>
<div class="yogurt_flavor_picked yogurt_flavors_picker_<?= $i;?>">
<?php if(!empty($_SESSION['current_flavors'][$i]['flavor'])) { ?>
<img src="https://ylreports.com/<?= $_SESSION['current_flavors'][$i]['real_product_image_path'];?>" class="yogurt_small_pic" />
<div class="yogurt_small_text_flavor"><?= $_SESSION['current_flavors'][$i]['short_flavor'];?></div>
<?php } else { ?>
<div class="yogurt_small_text">
Choose
<div class="choose_plus_sign"><img src="/images/plus_sign.png" /></div>
Flavor
</div>
<?php } ?>
</div>
</td>
<?php } ?>
</tr>
</table>
<div class="yogurt_flavors_picker_subtitle">Your yogurt will be split evenly between the flavors you choose.</div>
</div>
<div class="all_yogurts">
<?php foreach($currentYogurts as $yogurt) { ?>
<div class="big_yogurt" id="big_yogurt_id_<?= $yogurt['product'];?>" onclick="choose_flavor(this,'<?= $yogurt['product'];?>');">
<img src="http://ylreports.com/<?= $yogurt['real_product_image_path'];?>" class="yogurt_big_pic" />
<?php
$special_types = array();
if(!empty($yogurt['no_sugar_added'])) {
$special_types[] = 'no_sugar_added';
}
if(!empty($yogurt['dairy_free'])) {
$special_types[] = 'dairy_free';
}
if(!empty($yogurt['gluten_free'])) {
$special_types[] = 'gluten_free';
}
if(!empty($yogurt['fat_free'])) {
$special_types[] = 'fat_free';
}
if(!empty($yogurt['low_fat'])) {
$special_types[] = 'low_fat';
}
if(count($special_types)>0) {
?><img src="/images/<?= $special_types[0];?>.png" class="special_yogurt_type_1" /><?php
}
if(count($special_types)>1) {
?><img src="/images/<?= $special_types[1];?>.png" class="special_yogurt_type_2" /><?php
}
if(count($special_types)>2) {
?><img src="/images/<?= $special_types[2];?>.png" class="special_yogurt_type_3" /><?php
}
if(count($special_types)>3) {
?><img src="/images/<?= $special_types[3];?>.png" class="special_yogurt_type_4" /><?php
}
?>
<div class="yogurt_big_text"><?= $yogurt['short_flavor'];?></div>
</div>
<?php } ?>
</div>
</center>
</div>
<?php
$title = 'Yogurtland Delivers - Choose Flavors';
$page = 'choose_flavors';
$html = ob_get_clean();
include('layout.php');
?>