-
Notifications
You must be signed in to change notification settings - Fork 6
/
menu.php
executable file
·453 lines (375 loc) · 16.1 KB
/
menu.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
<?php
include_once('jcart/jcart.php');
require("admin/bootstrap.php");
include( dirname(__FILE__) . SYSPATH_LANG );
defined('SYSPATH_ADMIN') or die('No direct script access.');
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=TITLE_INDEX;?></title>
<meta name="description" content="">
<meta name="keywords" content="">
<script type="text/javascript" src="jcart/js/jquery-1.4.4.min.js"></script>
<!-- <script type="text/javascript" src="scripts/jQueryEasyUI/jquery-1.8.0.min.js"></script> Strang not work ;( -->
<script type="text/javascript" src="scripts/jquery.curvycorners.min.js"></script>
<link href="stylesheet/stylesheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/jquery-ui-1.8.4.custom.min.js"></script>
<link href="scripts/jqueryui/css/redmond/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/thickbox.js"></script>
<link href="scripts/thickbox.css" rel="stylesheet" type="text/css" />
<link rel="SHORTCUT ICON" href="favicon2.ico" />
<!-- script for open dialog box with product description -->
<link rel="stylesheet" type="text/css" href="scripts/jQueryEasyUI/themes/gray/easyui.css">
<link rel="stylesheet" type="text/css" href="scripts/jQueryEasyUI/themes/icon.css">
<script type="text/javascript" src="scripts/jQueryEasyUI/jquery.easyui.min.js"></script>
<!-- script for open dialog box with product description -->
<!-- script for cart -->
<script type="text/javascript">
// cart
$(window).scroll(function(){
$("#preview").css("top",Math.max(10,360-$(this).scrollTop()));
});
// cart
</script>
<link rel="stylesheet" type="text/css" media="screen, projection" href="jcart/css/jcart.css" />
<!-- end script for cart -->
</head>
<!-- header -->
<?php require("_header.inc.php"); ?>
<!-- header -->
<!-- top menu category -->
<?php require("_top-menu-category.php"); ?>
<!-- top menu category -->
<body>
<table width="999" border="0" cellpadding="0" cellspacing="0" align="center" id="table990" class="table bg">
<tr>
<td> </td>
<td valign="top">
<?php $_SESSION['category_id'] = Url::urlDec( $_SESSION['category_id'] ); // Decode Category ID (URL) ?>
<?php if ( isset( $_SESSION['category_id'] ) and empty( $_SESSION['category_id'] )) { ?>
<?php if ( !isset( $_SESSION['category_color'] ) and empty( $_SESSION['category_color'] )) $_SESSION['category_color'] = "D9D4C6"; ?>
<div class="round_bar" style="background-color:#<?=$_SESSION['category_color'];?>; font-size:18px; font-weight:bold;">
<?=$_SESSION['category_name'];?>
<a href="javascript:void(0);" onclick="window.location.href='menu-print.php';" style="float:right; font-size:14px; color:#666;"> <?=LBL_DOWNLOAD_MENU;?> </a> <br />
</div>
<?php } else { ?>
<div class="round_bar" style="background-color:#<?=$_SESSION['category_color'];?>; font-size:18px; font-weight:bold; color:#<?=$_SESSION['category_font_color'];?>;">
<?=$_SESSION['category_name'];?>
<a href="javascript:void(0);" onclick="window.open('menu-print', '_blank');" style="float:right; font-size:14px; color:#<?=$_SESSION['category_font_color'];?>;"> <?=LBL_DOWNLOAD_MENU;?> </a>
</div>
<?php } ?>
<!-- food container - products listed here -->
<table width="100%" cellpadding="3" cellspacing="0" style="border:solid 1px #f0f0e7; font-size:13px;">
<?php
if ( isset( $_SESSION['category_id'] ) and empty( $_SESSION['category_id'] ))
{
echo "<br><br><br><br><br>";
echo "<center><img src='images/Mascote.png' /></center>";
echo WARNING_CHOOSE_MENU;
echo "<br><br><br><br><br><br><br>";
}
else
{ ?>
<tr style="background-color:#f0f0e7; visibility:show;">
<td width="100"> </td>
<td width="30"><b><?=TABLE_TR_CODE;?></b></td>
<td width="150"><b><?=TABLE_TR_NAME;?></b></td>
<td width="125"><b><?=TABLE_TR_SIZE;?></b></td>
<td width="80"><b><?=TABLE_TR_QUANTITY;?></b></td>
</tr>
<?php
$array_total_products = GenericSql::getNumberOfProductsByCategory($database, $_SESSION['category_id']);
$total = $array_total_products;
if ( $total >= 1 )
{
$array_products = GenericSql::getProductsByCategory($database, $_SESSION['category_id']);
for ($i=0; $i<$total; $i++)
{
$product_id = $array_products[$i]['id'];
$product_code = $array_products[$i]['product_code'];
$product_image = $array_products[$i]['image'];
$product_name = $array_products[$i]['name'];
$product_description = $array_products[$i]['description'];
if ($alternate == "1")
{
$color = "#ffffff"; // #F5F3F3
$alternate = "2";
}
else
{
$color = "#F5F3F3";
$alternate = "1";
}
?>
<!-- custom products -->
<tr style="background-color:<?=$color;?>;" >
<form method="post" action="" class="jcart">
<input type="hidden" name="jcartToken" value="<?php echo $_SESSION['jcartToken'];?>" />
<input type="hidden" name="my-item-url" value="" />
<td valign="top" style="padding-left:10px;">
<img src="admin/uploads/<?php echo $product_image;?>" style="padding:2px; border:1px solid #CCC;" width="100" onmouseover="showPicture(event, 'admin/uploads/<?=$product_image;?>');" onmouseout="document.getElementById('div_box').style.display='none'; document.getElementById('div_box2').style.display='none'; document.getElementById('div_box').innerHTML='';" />
</td>
<td valign="top" style="line-height:16px; padding-top:6px;">
<?php echo $product_code;?>
<!-- item-id was here -->
</td>
<td valign="top" style="line-height:16px; padding-top:6px;">
<input type="hidden" name="my-item-name" value="<?=$product_name;?>" />
<a href="javascript:void(0)" class="easyui-link" onclick="$('#<?=$product_code;?>').dialog('open')">
<?=$product_name;?>
</a> <br />
<div id="<?=$product_code;?>" class="easyui-dialog" title="<?=$product_code;?> - <?=$product_name;?>" closed="true" style="width:400px;height:250px; padding:10px" data-options="resizable:true,modal:true">
<?=$product_description;?>
</div>
<table border='0' cellspacing='0' cellpadding='0' width='100%' onmouseover='this.style.cursor="default"'>
<tr>
<?php
$array_total_atributes = GenericSql::getNumberOfProductsAtributes($database, $product_id);
$total_atributes = $array_total_atributes[0]['total'];
for ($m=0;$m<$total_atributes;$m++)
{
$groupby=1;
$array_products_atributes = GenericSql::getProductsByAtributes($database, $product_id, $groupby);
var_dump($array_products_atributes);
$atributes = $array_products_atributes[$m]['atributes'];
$recommended = $array_products_atributes[$m]['recommended'];
?>
<td align="left">
<?php
for($h=0;$h<$atributes;$h++)
{
echo $chilly = '<img src="images/chili.png" >';
}
?>
</td>
<td align="right">
<?php
if ( $recommended == 1 )
{
echo $chef = '<img src="images/chef_hat.jpg" align="absmiddle" title="'.LBL_CHEF_RECOMMENDATION.'" />';
}
?>
</td>
<? } ?>
</tr>
</table>
<div style="height:5px; overflow:hidden;"></div>
</td>
<td valign="top" align="right" style="padding-top:6px;">
<table border='0' cellspacing='0' cellpadding='0' width='100%' onmouseover='this.style.cursor="default"'>
<?php
$array_total_atributes = GenericSql::getNumberOfProductsAtributes($database, $product_id);
for ($j=0; $j<$array_total_atributes; $j++)
{
$groupby = 0;
$array_products_atributes = GenericSql::getProductsByAtributes($database, $product_id, $groupby);
$atributes_id = $array_products_atributes[$j]['id'];
$atributes = $array_products_atributes[$j]['atributes'];
$recommended = $array_products_atributes[$j]['recommended'];
$product_size = $array_products_atributes[$j]['product_size'];
$price = $array_products_atributes[$j]['price'];
# Naming sizes here
switch ($product_size)
{
case 1:
$product_size_name = LBL_PRODUCT_SIZE_SMALL;
break;
case 2:
$product_size_name = LBL_PRODUCT_SIZE_MEDIUM;
break;
case 3:
$product_size_name = LBL_PRODUCT_SIZE_BIG;
break;
}
?>
<tr>
<td align="left">
<input type="hidden" name="my-item-id" value="<?php echo $atributes_id;?>" />
<input type="radio" value="<?php echo $price;?>" name="my-item-price" id="item_details_<?php echo $product_id;?>_<?php echo $j+1;?>" class="details_98" />
<span onclick="check_option('<?php echo $product_id;?>', '<?php echo $j+1;?>')"> <?php echo $product_size_name;?> </span>
</td>
<td align="right" onclick="check_option('<?php echo $product_id;?>', '<?php echo $j+1;?>')"> <?php echo LBL_CURRENCY;?> <?php echo $price;?></td>
</tr>
<? } ?>
</table>
</td>
<td valign="top" style="padding-top:6px;">
<input type="text" name="my-item-qty" value="1" size="1" maxlength="3" />
<!-- <input type="submit" name="my-add-button" value="Add" class="button" /> -->
<sub><input type="image" name="my-add-button" src="images/icons/button-plus.gif" value="Add" /></sub>
</td>
</form>
</tr>
<!-- customizado -->
<? }
} //empty Category
else
{
echo "<br><br><br><br><br>";
echo "<center><img src='images/Mascote.png' /></center>";
echo "<center>" . WARNING_NO_PRODUCTS_BY_CATEGORY . "</center>";
echo "<br><br><br><br><br><br><br><br><br><br><br><br><br>";
}
} ?>
</table>
<!-- food container - products listed here -->
<script>
function check_option(item_id, option_id)
{
$(".details_"+item_id).attr("checked", false);
$("#item_details_"+item_id+"_"+option_id).attr("checked", true);
$("#item_option_"+item_id).val(option_id);
}
</script>
<!-- subtitles -->
<div style="height:15px; overflow:hidden;"></div>
<img src="images/chili.png" align="absmiddle" title="<?=LBL_SPICY1;?>" /> =
<span style="color:#ff0000; font-weight:bold;"><?=LBL_SPICY1;?></span>
<img src="images/chili.png" align="absmiddle" title="<?=LBL_SPICY2;?>" />
<img src="images/chili.png" align="absmiddle" title="<?=LBL_SPICY2;?>" /> =
<span style="color:#ff0000; font-weight:bold;"><?=LBL_SPICY2;?></span>
<img src="images/chili.png" align="absmiddle" title="<?=LBL_SPICY3;?>" />
<img src="images/chili.png" align="absmiddle" title="<?=LBL_SPICY3;?>" />
<img src="images/chili.png" align="absmiddle" title="<?=LBL_SPICY3;?>" /> =
<span style="color:#ff0000; font-weight:bold;"><?=LBL_SPICY3;?></span>
<div style="height:8px; overflow:hidden;"></div>
<img src="images/chef_hat.jpg" align="absmiddle" title="<?=LBL_CHEF_RECOMMENDATION;?>" /> =
<span style="color:#993399; font-weight:bold;"><?=LBL_CHEF_RECOMMENDATION;?></span>
<!-- subtitles -->
</td>
<td width="20"> </td>
<td valign="top" width="300" style="padding-right:4px;">
<!-- cart -->
<!-- <div id="preview" name="preview"> -->
<div id="preview" name="preview" style="position:fixed;top:360px;width:inherit;">
<div id="jcart"><?php $jcart->display_cart(); ?></div>
<!-- validate AGENDAMENTO -->
<h2><img src='images/icons/check-alt.png' /> <?php echo LBL_SCHEDULING; ?> </h2>
<iframe src="scheduler.php" width="325" height="250" scrolling="no" frameborder=0 style="position:relative;right:15px;"></iframe>
<!-- validate AGENDAMENTO -->
<!-- validate ZIPCODE -->
<h2><img src='images/icons/check-alt.png' /> <?php echo LBL_ZIPCODE; ?> </h2>
<div id="cart"></div>
<script>
function cart_update() {
$.post("cart-zipcode.php", {}, function(data) {
$("#cart").html(data);
});
}
function cart_delete(id, item_pos) {
if (typeof(item_pos) == 'undefined') item_post = 0;
$.post("cart-zipcode.php", {'delete_id': id, 'item_pos': item_pos}, function(data) {
$("#cart").html(data);
});
}
function cart_add(id, qty, option_id) {
if (typeof(option_id) == 'undefined') option_id = 0;
$.post("cart-zipcode.php", {'item_id': id, 'qty': qty, 'option_id': option_id}, function(data) {
$("#cart").html(data);
});
}
$(function() {
cart_update();
});
</script>
<!-- validate ZIPCODE -->
</div>
<!-- end cart -->
<script>
/* radius for TITLE_SUBMENU */
$(function() {
settings = {
tl: { radius: 10 },
tr: { radius: 10 },
bl: { radius: 10 },
br: { radius: 10 },
antiAlias: true,
autoPad: true
}
$(".round_bar")
.css("padding-top", "10px")
.css("padding-bottom", "10px")
.css("padding-left", "15px")
.css("padding-right", "10px")
.corner(settings);
});
/* radius for TITLE_SUBMENU */
/* border image overlay */
function showPictureBorder(mx, my) {
if (document.getElementById('div_box').innerHTML!='') {
if (document.getElementById('div_box').offsetWidth<50)
setTimeout('showPictureBorder('+mx+', '+my+');', 20);
else {
document.getElementById('div_box2').style.cssText='z-index:1; padding:5px; position:absolute; left:'+(mx+25)+'px; top:'+(my-25)+'px; display:block; background-color:#333333; filter: alpha(opacity=50); -moz-opacity: .5; align:center; valign:center; width: '+document.getElementById('div_box').offsetWidth+'px; height: '+document.getElementById('div_box').offsetHeight+'px;';
}
}
else {
document.getElementById('div_box2').style.cssText='display:none;';
}
}
/* border image overlay */
/* show image on mouse over event */
function showPicture(evt, filename) {
var div_box=document.getElementById('div_box');
div_box.innerHTML='<div style="padding:3px; background-color:#FFFFFF;"><img src="'+filename+'" width="450" height="450" /></div>';
var mx = mouseX(evt);
var my = mouseY(evt);
document.getElementById('div_box').style.cssText='position:absolute; left:'+(mx+30)+'px; top:'+(my-20)+'px; display:block; align:center; valign:center; z-index:2;';
if (document.getElementById('div_box').offsetWidth>50) {
showPictureBorder(mx, my);
}
else {
setTimeout('showPictureBorder('+mx+', '+my+');', 20);
}
}
function mouseX(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX)
return evt.clientX + (document.documentElement.scrollLeft ?
document.documentElement.scrollLeft :
document.body.scrollLeft);
else return null;
}
function mouseY(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
return evt.clientY + (document.documentElement.scrollTop ?
document.documentElement.scrollTop :
document.body.scrollTop);
else return null;
}
function objPos(obj){
objlft=obj.offsetLeft;
objtop=obj.offsetTop;
while(obj.offsetParent!=null){
obj2=obj.offsetParent;
objlft+=obj2.offsetLeft;
objtop+=obj2.offsetTop;
obj=obj2;
}
return [objlft,objtop];
}
/* show image on mouse over event */
</script>
<!-- cart -->
<script type="text/javascript" src="jcart/js/jcart.min.js"></script>
<!-- cart -->
</td>
</tr>
<tr><td colspan=6> </td></tr>
<tr>
<td colspan=6>
<div style="background-color:#dcdcdc; height:1px; overflow:hidden; width:997px; margin-top:20px; margin-bottom:10px;" class="table bg"></div>
</td>
</tr>
<tr><td colspan=6> </td></tr>
</table>
</td>
</tr>
</table>
<!-- footer -->
<?php require("_footer.inc.php"); ?>
<!-- footer -->
</body>
</html>