%
if request("seq") = "" then seq = 1 else seq = request("seq")
function yesno(entry)
if entry = "1" then
yesno = -1
else
yesno = 0
end if
end function
if request("action") = "Cancel" then
response.redirect "menu.asp"
elseif request("action") = "Remove From Order" then
sql = "DELETE FROM tbl_oline WHERE id=" & request("oline_id")
cnn.execute sql
sql = "DELETE FROM tbl_oline WHERE seq_id=" & request("oline_id")
cnn.execute sql
cnn.close
set cnn = nothing
response.redirect "menu.asp"
elseif request("action") = "Add to Order" or request("action") = "Save Changes" or request("action") = "Next Taco" then
if request("qty") = "" then
msg = "Please enter the Quantity before clicking add to order."
elseif request("label") = "" then
msg = "Please enter the Whose food is this? before clicking add to order."
elseif not isnumeric(request("qty")) then
msg = "Please enter a numeric Quantity before clicking add to order."
elseif request("cook_type") = "" then
msg = "Please choose Grilled or Steamed before clicking add to order."
elseif request("tortilla") = "" then
msg = "Please choose Corn or Flour before clicking add to order."
elseif request("beans_none")="" and request("beans_refried")="" and request("beans_black")="" and request("beans_whole")="" then
msg = "Please make a Beans selection before clicking add to order."
elseif request("beans_none") = "1" and _
(request("beans_refried") <> "" or request("beans_black") <> "" or request("beans_whole") <> "") then
msg = "You cannot select the None option for Beans if you have checked another beans item."
elseif request("id") = "13" and request("avocado") = "" then
msg = "Please choose Avocado or Guacamole before clicking add to order."
elseif (request("meat") = "C" or request("meat") = "B") and request("chicken") = "" then
msg = "Please choose the type of chicken you want before clicking add to order."
elseif request("sauce_none") = "" and request("sauce_bbq") = "" and request("sauce_mild") = "" and _
request("sauce_hot") = "" and request("sauce_death") = "" and request("sauce_habenero") = "" and _
request("sauce_lime") = "" then
msg = "Please choose your sauce before clicking add to order. If you don't want any " & _
"sauces please check the none option."
elseif request("sauce_none") <> "" and (request("sauce_bbq") <> "" or request("sauce_mild") <> "" or _
request("sauce_hot") <> "" or request("sauce_death") <> "" or request("sauce_habenero") <> "" or _
request("sauce_lime") <> "") then
msg = "Please be sure to not choose any other sauce if you have already chosen the 'none' option."
elseif request("e_none") = "" and request("e_scream") = "" and request("e_guac") = "" and _
request("e_cheese") = "" and request("e_rice") = "" and request("e_avo") = "" and _
request("e_tortilla") = "" and request("e_beans_black") = "" and request("e_queso") = "" and _
request("e_beans_refried") = "" and request("e_beans_whole") = "" and _
request("e_steak") = "" and request("e_wchick") = "" and request("e_dchick") = "" then
msg = "Please choose your extras before clicking add to order. If you don't want any " & _
"extras please check the none option."
elseif request("e_none") <> "" and (request("e_scream") <> "" or request("e_guac") <> "" or _
request("e_cheese") <> "" or request("e_rice") <> "" or request("e_avo") <> "" or _
request("e_tortilla") <> "" or request("e_beans_black") <> "" or request("e_queso") <> "" or _
request("e_beans_refried") <> "" or request("e_beans_whole") <> "" or _
request("e_meat") <> "" or request("e_wchick") <> "" or request("e_dchick") <> "") then
msg = "Please be sure not to choose any other extra if you have already chosen the 'none' option."
elseif request("f_none") = "" and request("white_onions") = "" and request("purple_onions") = "" and _
request("tomatoes") = "" and request("cilantro") = "" and request("pico") = "" and _
request("jalapenos") = "" and request("lettuce") = "" and request("e_po") = "" and _
request("salsa") = "" and request("rgarlic") = "" then
msg = "Please choose your freebies before clicking add to order. If you don't want any " & _
"freebies please check the none option."
elseif request("f_none") <> "" and (request("white_onions") <> "" or request("purple_onions") <> "" or _
request("tomatoes") <> "" or request("cilantro") <> "" or request("pico") <> "" or _
request("jalapenos") <> "" or request("lettuce") <> "" or request("e_po") <> "" or _
request("salsa") <> "" or request("rgarlic") <> "") then
msg = "Please be sure not to choose any other freebie if you have already chosen the 'none' option."
else
if request("chicken") & "" = "" then chicken = "B" else chicken = request("chicken")
price = request("price")
base_price = price
' always pay for these
if request("e_guac") = "1" then price = price + .75
if request("e_avo") = "1" then price = price + 1
if request("e_steak") = "1" or request("e_wchick") = "1" or request("e_dchick") = "1" then price = price + 1.75
if request("e_queso") = "1" then price = price + .75
if request("e_scream") = "1" then price = price + .75
if request("e_cheese") = "1" then price = price + .50
if request("e_rice") = "1" then price = price + .50
if request("e_beans_black") = "1" or request("e_beans_refried") = "1" or request("e_beans_whole") = "1" then
price = price + .50
end if
sql = "INSERT INTO tbl_oline (order_id, product_id, qty, price, label, rice, avocado, scream, " & _
"cheese, beans_black, beans_refried, beans_whole, chicken, sauce_bbq, sauce_mild, sauce_hot, sauce_death, " & _
"sauce_habenero, sauce_lime, e_scream, e_guac, e_avo, e_cheese, e_rice, e_beans_black, e_beans_refried, e_beans_whole, " & _
"e_steak, e_wchick, e_dchick, e_po, rgarlic, e_queso, salsa, white_onions, purple_onions, jalapenos, pico, tomatoes, cilantro, lettuce, " & _
"cook_type, tortilla, notes_basic, notes_sauce, notes_free, notes_extra) VALUES (" & _
session("order_id") & ", " & _
request("id") & ", " & _
request("qty") & ", " & _
price & ", " & _
"'" & replace(request("label"), "'", "''") & "', " & _
yesno(request("rice")) & ", " & _
"'" & request("avocado") & "', " & _
yesno(request("scream")) & ", " & _
request("cheese") & ", " & _
yesno(request("beans_black")) & ", " & _
yesno(request("beans_refried")) & ", " & _
yesno(request("beans_whole")) & ", " & _
"'" & chicken & "', " & _
yesno(request("sauce_bbq")) & ", " & _
yesno(request("sauce_mild")) & ", " & _
yesno(request("sauce_hot")) & ", " & _
yesno(request("sauce_death")) & ", " & _
yesno(request("sauce_habenero")) & ", " & _
yesno(request("sauce_lime")) & ", " & _
yesno(request("e_scream")) & ", " & _
yesno(request("e_guac")) & ", " & _
yesno(request("e_avo")) & ", " & _
yesno(request("e_cheese")) & ", " & _
yesno(request("e_rice")) & ", " & _
yesno(request("e_beans_black")) & ", " & _
yesno(request("e_beans_refried")) & ", " & _
yesno(request("e_beans_whole")) & ", " & _
yesno(request("e_steak")) & ", " & _
yesno(request("e_wchick")) & ", " & _
yesno(request("e_dchick")) & ", " & _
yesno(request("e_po")) & ", " & _
yesno(request("rgarlic")) & ", " & _
yesno(request("e_queso")) & ", " & _
yesno(request("salsa")) & ", " & _
yesno(request("white_onions")) & ", " & _
yesno(request("purple_onions")) & ", " & _
yesno(request("jalapenos")) & ", " & _
yesno(request("pico")) & ", " & _
yesno(request("tomatoes")) & ", " & _
yesno(request("cilantro")) & ", " & _
yesno(request("lettuce")) & ", " & _
"'" & request("cook_type") & "', " & _
"'" & request("tortilla") & "', " & _
"'" & replace(request("notes_basic"),"'","''") & "', " & _
"'" & replace(request("notes_sauce"),"'","''") & "', " & _
"'" & replace(request("notes_free"),"'","''") & "', " & _
"'" & replace(request("notes_extra"),"'","''") & "')"
cnn.execute sql
' get id number of new oline
set rs = server.createobject("adodb.recordset")
sql = "SELECT * FROM tbl_oline " & _
"WHERE order_id=" & session("order_id") & " " & _
"AND label='" & replace(request("label"), "'", "''") & "' " & _
"ORDER BY id DESC"
rs.open sql, cnn, 0, 1
id = rs("id")
rs.close
if request("action") = "Save Changes" and clng(seq)=1 then
sql = "SELECT tbl_oline.id " & _
"FROM tbl_oline " & _
"WHERE seq_id=" & request("oline_id")
rs.open sql, cnn, 0, 1
second_id = rs("id")
rs.close
sql = "SELECT * FROM tbl_oline WHERE id=" & second_id
rs.open sql, cnn, 0, 1
second_pid = rs("product_id")
rs.close
' put the right seq_id into the new record
sql = "UPDATE tbl_oline SET seq_id=" & id & " WHERE id=" & second_id
cnn.execute sql
' delete the old first taco record
sql = "DELETE FROM tbl_oline WHERE id=" & request("oline_id")
cnn.execute sql
elseif request("action") = "Save Changes" and clng(seq)=2 then
' get the seq_id from the original second taco
sql = "SELECT seq_id FROM tbl_oline WHERE id=" & request("oline_id")
rs.open sql, cnn, 0, 1
second_id = rs("seq_id")
rs.close
' put the right seq_id into the new record
sql = "UPDATE tbl_oline SET seq_id=" & second_id & " WHERE id=" & id
cnn.execute sql
' delete the old second taco record
sql = "DELETE FROM tbl_oline WHERE id=" & request("oline_id")
cnn.execute sql
end if
if seq = 2 then
' put the first order line id into the seq_id field of the second one
' and set the price on the second taco to 0
cnn.execute "UPDATE tbl_oline SET " & _
"seq_id=" & request("olid") & ", " & _
"price=0 WHERE id=" & id
' adjust the base price so to be the amount of the most expensive meat version
sql = "SELECT tbl_product.price, tbl_product2.price AS price2 " & _
"FROM tbl_oline " & _
"LEFT JOIN tbl_product ON tbl_oline.product_id = tbl_product.id " & _
"LEFT JOIN tbl_oline AS tbl_oline2 ON tbl_oline.id = tbl_oline2.seq_id " & _
"LEFT JOIN tbl_product AS tbl_product2 ON tbl_oline2.product_id = tbl_product2.id " & _
"WHERE tbl_oline.id=" & request("olid")
rs.open sql, cnn, 0, 1
price1 = rs("price")
price2 = rs("price2")
rs.close
if price1 > price2 then high_price = price1 else high_price = price2
' remove the base price from the price on the current record (leave extras only)
cnn.execute "UPDATE tbl_oline SET price=price-" & price1 & " WHERE id=" & request("olid")
' add extras from the second taco to the price for the first one
cnn.execute "UPDATE tbl_oline SET price=price+" & price-base_price & " WHERE id=" & request("olid")
' add the base price from the most expensive meat selection
cnn.execute "UPDATE tbl_oline SET price=price+" & high_price & " WHERE id=" & request("olid")
end if
set rs = nothing
cnn.close
set cnn = nothing
if request("action") = "Save Changes" and clng(seq)=1 then
response.redirect "taco.asp?id=" & second_pid & "&seq=2&olid=" & id & "&oline_id=" & second_id
elseif clng(seq)=1 then
'response.redirect "taco.asp?id=" & request("id") & "&seq=2&olid=" & id
response.redirect "tacotype.asp?seq=2&olid=" & id
else
response.redirect "menu.asp"
end if
end if
cook_type = request("cook_type")
tortilla = request("tortilla")
rice = request("rice")
cheese = request("cheese")
beans_black = request("beans_black")
beans_refried = request("beans_refried")
beans_whole = request("beans_whole")
beans_none = request("beans_none")
qty = request("qty")
label = request("label")
chicken = request("chicken")
scream = request("scream")
sauce_bbq = request("sauce_bbq")
sauce_mild = request("sauce_mild")
sauce_hot = request("sauce_hot")
sauce_habenero = request("sauce_habenero")
sauce_death = request("sauce_death")
sauce_lime = request("sauce_lime")
e_scream = request("e_scream")
e_guac = request("e_guac")
e_avo = request("e_avo")
e_cheese = request("e_cheese")
e_rice = request("e_rice")
e_beans_black = request("e_beans_black")
e_beans_refried = request("e_beans_refried")
e_beans_whole = request("e_beans_whole")
e_steak = request("e_steak")
e_wchick = request("e_wchick")
e_dchick = request("e_dchick")
e_po = request("e_po")
rgarlic = request("rgarlic")
e_queso = request("e_queso")
white_onions = request("white_onions")
purple_onions = request("purple_onions")
tomatoes = request("tomatoes")
pico = request("pico")
jalapenos = request("jalapenos")
cilantro = request("cilantro")
lettuce = request("lettuce")
salsa = request("salsa")
avocado = request("avocado")
notes_basic = request("notes_basic")
notes_sauce = request("notes_sauce")
notes_extra = request("notes_extra")
notes_free = request("notes_free")
sauce_none = request("sauce_none")
e_none = request("e_none")
f_none = request("f_none")
end if
pid = request("id")
if request("oline_id") <> "" then
sql = "SELECT * FROM tbl_oline WHERE id=" & request("oline_id")
set rs = server.createobject("adodb.recordset")
rs.open sql, cnn, 1, 3
if not rs.eof then
pid = rs("product_id")
cook_type = rs("cook_type")
tortilla = rs("tortilla")
rice = abs(rs("rice"))
cheese = abs(rs("cheese"))
beans_black = abs(rs("beans_black"))
beans_refried = abs(rs("beans_refried"))
beans_whole = abs(rs("beans_whole"))
if beans_black = 0 and beans_refried = 0 and beans_whole = 0 then
beans_none = 1
else
beans_none = 0
end if
qty = rs("qty")
label = rs("label")
chicken = rs("chicken")
scream = abs(rs("scream"))
sauce_bbq = abs(rs("sauce_bbq"))
sauce_mild = abs(rs("sauce_mild"))
sauce_hot = abs(rs("sauce_hot"))
sauce_habenero = abs(rs("sauce_habenero"))
sauce_death = abs(rs("sauce_death"))
sauce_lime = abs(rs("sauce_lime"))
e_scream = abs(rs("e_scream"))
e_guac = abs(rs("e_guac"))
e_avo = abs(rs("e_avo"))
e_cheese = abs(rs("e_cheese"))
e_rice = abs(rs("e_rice"))
e_beans_black = abs(rs("e_beans_black"))
e_beans_refried = abs(rs("e_beans_refried"))
e_beans_whole = abs(rs("e_beans_whole"))
e_steak = abs(rs("e_steak"))
e_wchick = abs(rs("e_wchick"))
e_dchick = abs(rs("e_dchick"))
e_po = abs(rs("e_po"))
rgarlic = abs(rs("rgarlic"))
e_queso = abs(rs("e_queso"))
white_onions = abs(rs("white_onions"))
purple_onions = abs(rs("purple_onions"))
tomatoes = abs(rs("tomatoes"))
pico = abs(rs("pico"))
jalapenos = abs(rs("jalapenos"))
cilantro = abs(rs("cilantro"))
lettuce = abs(rs("lettuce"))
salsa = abs(rs("salsa"))
notes_basic = rs("notes_basic")
notes_sauce = rs("notes_sauce")
notes_extra = rs("notes_extra")
notes_free = rs("notes_free")
if sauce_bbq=0 and sauce_mild=0 and sauce_hot=0 and sauce_habenero=0 _
and sauce_death=0 and sauce_lime=0 then
sauce_none = 1
end if
if e_scream=0 and e_guac=0 and e_avo=0 and e_cheese=0 and e_rice=0 _
and e_beans_black=0 and e_beans_refried=0 and e_beans_whole=0 _
and e_steak=0 and e_wchick=0 and e_dchick=0 and e_queso=0 then
e_none = 1
end if
if white_onions=0 and purple_onions=0 and tomatoes=0 and pico=0 _
and jalapenos=0 and cilantro=0 and lettuce=0 and salsa=0 then
f_none = 1
end if
end if
rs.close
set rs = nothing
end if
if clng(seq) = 2 then
set rs = server.createobject("adodb.recordset")
sql = "SELECT label FROM tbl_oline WHERE id=" & request("olid")
rs.open sql, cnn, 0, 1
label = rs("label")
rs.close
set rs = nothing
end if
%>
<%
if request("qty") <> "" then qty = request("qty") else qty = "1"
set rs = server.createobject("adodb.recordset")
sql = "SELECT * FROM tbl_product WHERE id=" & pid
rs.open sql, cnn, 1, 3
%>
All items selected on this page will come inside your <%=rs("type")%>. If you'd like
to have something on the side, please select it in the "Sides" menu page.
The 'notes' line is to designate 'light', 'extra', or 'on the side'
for any item in this section. If you indicate 'extra' for any item
(excluding meat), we will add 1/2 again the normal portion for free. If
you'd like a full extra portion of any item, please select that item in the
"Extras" section. If you would like to purchase additional Sides of any
item, you may select something from the "Sides" Menu Page.
<%if msg <> "" then response.write "" & msg & "
"%> <%if clng(seq)=1 then%> Your Taco order comes with two tacos. Please use this screen to build your FIRST TACO. <%else%> Your Taco order comes with two tacos. Please use this screen to build your SECOND TACO. <%end if%>
| Whose food is this? type="text" name="label" value="<%=label%>" size="15" maxlength="50"> | Qty: type="text" name="qty" value="<%=qty%>" size="3"> |
| Type: | >Grilled >Steamed | ||
| Tortilla | >Corn >Flour | ||
| Rice: | > | ||
| Cheese: | >None >Monterrey Jack >Cheddar/Jack Mix | ||
| Beans: | >None >Black >Refried >Whole (choose one or more) | ||
All combo orders come with Steak. Please select which type of Chicken you'd like. | |||
| Chicken: | >White Meat >Dark Meat >Both | ||
| Notes: | |||
| Sauces: |
|
||
| Notes: | |||
| Freebies: |
|
||
| Notes: | |||
| Extras: |
Extra Meat $1.75: >Steak >White Chicken >Dark Chicken <%end if%> |
||
| Notes: | |||