SELECT #arguments.columnList# FROM #arguments.tableName# WHERE 1 = 1 AND #arguments.whereClauseColumn# = ORDER BY #arguments.orderBy# SELECT sd.*, s.shop_name FROM shop_dives sd, shop s WHERE dive_start >= "#dateformat(now(), 'yyyy-mm-dd')#" and sd.dive_shop_id = s.shop_id ORDER BY #arguments.orderBy# SELECT event_type, event_start, event_end, event_name, event_id FROM events WHERE event_start >= "#dateformat(now(), 'yyyy-mm-dd')#" and event_locked <> 1 AND event_type <> ORDER BY #arguments.orderBy# select event_type, event_start, event_end, event_name, event_id FROM events where event_start >= "#dateformat(now(), 'yyyy-mm-dd')#" and event_locked <> 1 and event_type = and event_multi = 0 select event_type, event_start, event_end, event_name, event_id, event_dive_time FROM events where event_start >= "#dateformat(now(), 'yyyy-mm-dd')#" and event_locked <> 1 and event_type = and event_multi = 1 group by event_dive_time select * from myNewQuery order by event_start SELECT event_type, event_start, event_end, event_name, event_id FROM events WHERE event_start >= "#dateformat(now(), 'yyyy-mm-dd')#" and event_end >= "#dateformat(now(), 'yyyy-mm-dd')#" and event_locked <> 1 and event_active = 1 and event_lock_date > "#dateformat(now(), 'yyyy-mm-dd')#" AND event_type <> ORDER BY #arguments.orderBy# SELECT event_type, event_start, event_end, event_name, event_id FROM events WHERE event_start >= "#dateformat(now(), 'yyyy-mm-dd')#" and event_end >= "#dateformat(now(), 'yyyy-mm-dd')#" and event_locked <> 1 and event_active = 1 and (event_dive_time = 0 or event_dive_time is null) and event_lock_date > "#dateformat(now(), 'yyyy-mm-dd')#" AND event_type = ORDER BY #arguments.orderBy# select super_start, super_end, super_id, super_name FROM super_events where super_start >= "#dateformat(now(), 'yyyy-mm-dd')#" and super_end >= "#dateformat(now(), 'yyyy-mm-dd')#" select * from myNewQuery order by event_start insert into reservations (reservation_event_id, reservation_create, reservation_update, reservation_locked, reservation_complete, reservation_cart_id, diver_number,reservation_parent_id,reservation_user_id,user_id,createdBy_userId,referring_shop,reservation_shop_id, online_book) values (, , , , , , ,,,,, , ,) SELECT @@IDENTITY AS NewID; update reservations set reservation_address = , reservation_city = , reservation_state = , reservation_zip = , reservation_email = , reservation_phone = ,---> reservation_cc_num = , reservation_cc_month = , reservation_cc_year = , reservation_cc_cvv = , reservation_create = , reservation_update = , reservation_complete = , reservation_user_id = where reservation_cart_id = and reservation_parent_id = 0 update reservations set reservation_create = , reservation_update = , reservation_complete = where reservation_cart_id = and reservation_parent_id <> 0 insert into reservations_divers (diver_reserve_id, diver_name, diver_level, diver_cert, diver_number) values (, , , , ) SELECT @@IDENTITY AS NewID; insert into reservations_divers_equipment (reservation_id, equipment_option_id) values (, ) delete from reservations_divers_equipment where reservation_id = insert into reservations_other (other_reserve_id, other_sbusername, other_name, other_number) values (, , , ) SELECT reservations.* FROM reservations,shop_dives WHERE reservation_complete = 1 AND #arguments.whereClauseColumn# = and reservations.reservation_event_id = shop_dives.dive_id and shop_dives.dive_shop_id = ORDER BY #arguments.orderBy# insert into reservations_divers (diver_reserve_id) values () insert FROM reservations WHERE reservation_complete = 1 AND #arguments.whereClauseColumn# = ORDER BY #arguments.orderBy# SELECT * FROM events WHERE event_start = "#dateformat(arguments.date, 'yyyy-mm-dd')#" and event_dive_time = '#arguments.time#' and event_type = 1 and event_multi = 1 SELECT * FROM users WHERE user_sbusername = '#arguments.username#' and user_password = '#arguments.pass#' SELECT * FROM events WHERE event_dive_time = #arguments.masterid# and event_type = 1 and event_multi = 1 order by event_start var taxtotal = 0; var ordertotal = 0; var marinaemails = ''; var rezs = structnew(); var stTaxes = structnew(); select s.shop_sales_tax, s.shop_deposit, s.shop_email, m.* from shop s left outer join shop_dive_marina m on s.shop_id = m.shop_id where s.shop_id = #session.referrer_shop# SELECT r.reservation_id,r.reservation_event_id,r.reservation_parent_id, r.reservation_user_id, r.dove_past_year, r.reservation_activity_id, user_fname, u.user_lname, u.user_diver_level, u.user_diver_cert, d.dive_name, d.dive_start, d.dive_marina_id, d.dive_image, o.option_id,o.label, ifnull(q.ans_price,0) as price, q.ans_name, q.ans_order, q.ans_taxable, co.* , a.activity_id, a.shop_id, a.activity_description, a.activity_order, ifnull(a.activity_price,sds.dive_site_price) as activity_price, activity_taxable FROM reservations r left OUTER join reservation_options o ON r.reservation_id = o.reservation_id LEFT OUTER JOIN shop_custom_questions q ON q.id = o.option_id LEFT OUTER JOIN shop_custom_options co on co.option_id = q.option_id LEFT OUTER JOIN shop_activities a ON r.reservation_activity_id = a.activity_id, dp_user u , shop_dives d, shop_dive_site sds where r.reservation_user_id = u.user_id AND r.reservation_event_id = d.dive_id AND d.dive_site_id = sds.dive_site_id and r.reservation_cart_id = and ( r.reservation_id = OR r.reservation_parent_id = ) and reservation_complete = 1 and reservation_cancelled <> 1 AND r.reservation_event_id = order by r.reservation_event_id,r.reservation_parent_id, r.reservation_id stTaxes[session.referrer_shop] = structnew(); stTaxes[session.referrer_shop].tax = qryTaxRates.shop_sales_tax; stTaxes[session.referrer_shop].email = qryTaxRates.shop_email; for ( i=1; i lte qryTaxRates.recordcount; i++ ) { if (isnumeric(qryTaxRates.sales_tax[i]) AND qryTaxRates.sales_tax[i] neq 0) { stTaxes[qryTaxRates.marina_id[i]] = structnew(); stTaxes[qryTaxRates.marina_id[i]].tax = qryTaxRates.sales_tax[i]; stTaxes[qryTaxRates.marina_id[i]].email = qryTaxRates.email[i]; } }
  if ( dive_marina_id eq '0' ) { event_tax_rate = stTaxes[session.referrer_shop].tax; } else { event_tax_rate = stTaxes[dive_marina_id].tax; if ( not listfind(marinaemails,stTaxes[dive_marina_id].email) ) { marinaemails = listappend(marinaemails,stTaxes[dive_marina_id].email); } } opts = application.CustomCFC.getCartOptionsSwim(reservation_id,qcart,arguments.showcheckout,reservation_event_id,event_tax_rate); ordertotal = ordertotal+ opts.reztotal; for ( key in opts.divers ) { taxtotal = taxtotal + opts.divers[key].taxtotal; } rezs[reservation_id] = structnew(); rezs[reservation_id].total = opts.reztotal; rezs[reservation_id].taxtotal = numberformat(opts.reztotal+(opts.taxable_amount*event_tax_rate/100), '.99'); rezs[reservation_id].count = opts.divercount; rezs[reservation_id].opts = opts;
Date Description
#dateFormat(dive_start, "mm/dd/yyyy")# #dive_name#
 
#opts.html#
Reservation Total: $#numberformat(opts.reztotal, '.99')#
Cart Summary
Date Description Swimmers Price  
#dateFormat(dive_start, "mm/dd/yyyy")# NA #dive_name# (#rezs[reservation_id].count#)  

Subtotal: $#numberformat(ordertotal, '.99')#
Tax: $#numberformat(taxtotal, '.99')#0.00

Total: $#numberformat(ordertotal+taxtotal, '.99')#0.00

Amount Paid: $#numberformat(arguments.showbalance.amtToPost, '.99')#

Balance Due: $#numberformat(( (ordertotal+taxtotal) - arguments.showbalance.amtToPost ), '.99')#
Transaction Information:
Transaction Type: #arguments.showbalance.ptype#
Transaction ID: #arguments.showbalance.rtransid#
st = structnew(); st.html = html; st.js = js; st.ordertotal = ordertotal; st.ordertotalwithtax = numberformat(ordertotal+taxtotal, '.99'); st.taxtotal = taxtotal; st.deposit = qryTaxRates.shop_deposit; st.taxes = stTaxes; st.reservationids = valuelist(qcart.reservation_id); st.rez = rezs;
var taxtotal = 0; var ordertotal = 0; var marinaemails = ''; var rezs = structnew(); var stTaxes = structnew(); select s.shop_sales_tax, s.shop_deposit, s.shop_email, s.shop_tip, m.* from shop s left outer join shop_dive_marina m on s.shop_id = m.shop_id where s.shop_id = #session.referrer_shop# SELECT r.reservation_id,r.reservation_event_id,r.reservation_parent_id, r.reservation_user_id, r.dove_past_year,r.reservation_activity_id, u.user_fname, u.user_lname, u.user_diver_level, u.user_diver_cert, d.dive_name, d.dive_start, d.dive_marina_id,d.dive_image, o.option_id,o.label, ifnull(q.ans_price,0) as price, q.ans_name, q.ans_order, q.ans_taxable, co.*, a.activity_id, a.shop_id, a.activity_description, a.activity_order, ifnull(a.activity_price,sds.dive_site_price) as activity_price, activity_taxable FROM reservations r left OUTER join reservation_options o ON r.reservation_id = o.reservation_id LEFT OUTER JOIN shop_custom_questions q ON q.id = o.option_id LEFT OUTER JOIN shop_custom_options co on co.option_id = q.option_id LEFT OUTER JOIN shop_activities a ON r.reservation_activity_id = a.activity_id, dp_user u , shop_dives d, shop_dive_site sds where r.reservation_user_id = u.user_id AND r.reservation_event_id = d.dive_id AND d.dive_site_id = sds.dive_site_id and r.reservation_cart_id = and ( r.reservation_id = OR r.reservation_parent_id = ) and reservation_complete = 1 and reservation_cancelled <> 1 AND r.reservation_event_id = order by r.reservation_event_id,r.reservation_parent_id, r.reservation_id SELECT r.reservation_id,r.reservation_event_id,r.reservation_parent_id, r.reservation_user_id, r.dove_past_year,r.reservation_activity_id, 'Guest First Name' as user_fname, 'Guest Last Name' as user_lname, '' as user_diver_level, '' as user_diver_cert, d.dive_name, d.dive_start, d.dive_marina_id,d.dive_image, o.option_id,o.label, ifnull(q.ans_price,0) as price, q.ans_name, q.ans_order, q.ans_taxable, co.*, a.activity_id, a.shop_id, a.activity_description, a.activity_order, ifnull(a.activity_price,sds.dive_site_price) as activity_price, activity_taxable FROM reservations r left OUTER join reservation_options o ON r.reservation_id = o.reservation_id LEFT OUTER JOIN shop_custom_questions q ON q.id = o.option_id LEFT OUTER JOIN shop_custom_options co on co.option_id = q.option_id LEFT OUTER JOIN shop_activities a ON r.reservation_activity_id = a.activity_id, shop_dives d, shop_dive_site sds where r.reservation_event_id = d.dive_id AND d.dive_site_id = sds.dive_site_id and r.reservation_cart_id = and ( r.reservation_id = OR r.reservation_parent_id = ) and reservation_complete = 1 and reservation_cancelled <> 1 AND r.reservation_event_id = order by r.reservation_event_id,r.reservation_parent_id, r.reservation_id SELECT * from reservation_trans where reservation_id = (select reservation_id from reservations where reservation_cart_id = limit 0,1) SELECT * from reservation_trans where reservation_id = stTaxes[session.referrer_shop] = structnew(); stTaxes[session.referrer_shop].tax = qryTaxRates.shop_sales_tax; stTaxes[session.referrer_shop].email = qryTaxRates.shop_email; for ( i=1; i lte qryTaxRates.recordcount; i++ ) { if (isnumeric(qryTaxRates.sales_tax[i])) { stTaxes[qryTaxRates.marina_id[i]] = structnew(); stTaxes[qryTaxRates.marina_id[i]].tax = qryTaxRates.sales_tax[i]; stTaxes[qryTaxRates.marina_id[i]].email = qryTaxRates.email[i]; } }
  if ( dive_marina_id eq '0' ) { event_tax_rate = stTaxes[session.referrer_shop].tax; } else { event_tax_rate = stTaxes[dive_marina_id].tax; if ( not listfind(marinaemails,stTaxes[dive_marina_id].email) ) { marinaemails = listappend(marinaemails,stTaxes[dive_marina_id].email); } } opts = application.CustomCFC.getCartOptions(reservation_id,qcart,arguments.showcheckout,reservation_event_id,event_tax_rate); ordertotal = ordertotal+ opts.reztotal; for ( key in opts.divers ) { taxtotal = taxtotal + opts.divers[key].taxtotal; } rezs[reservation_id] = structnew(); rezs[reservation_id].total = opts.reztotal; rezs[reservation_id].taxtotal = numberformat(opts.reztotal+(opts.taxable_amount*event_tax_rate/100), '.99'); rezs[reservation_id].count = opts.divercount; rezs[reservation_id].opts = opts;
Cart Detail
#dateFormat(dive_start, "mm/dd/yyyy")# Item #dive_name#
 
#opts.html#
Reservation Total: $#numberformat(opts.reztotal, '.99')#
Item Total: $#numberformat(opts.reztotal, '.99')#
Cart Summary
Date Desc. Qty Price  
#dateFormat(dive_start, "mm/dd/yyyy")# N/A #dive_name# #rezs[reservation_id].count# $#numberformat(rezs[reservation_id].total, '.99')#  
Subtotal: $#numberformat(ordertotal, '.99')#
Tax: $#numberformat(taxtotal, '.99')#0.00
Tip: $
Total: $#numberformat(ordertotal+taxtotal, '.99')# 0.00

Total Paid: $#numberformat(transaction_totals, '.99')#
Total Due: $#numberformat(ordertotal+taxtotal-transaction_totals, '.99')#0.00

Amount Paid: $#numberformat(arguments.showbalance.amtToPost, '.99')#

Balance Due: $#numberformat(( (ordertotal+taxtotal) - arguments.showbalance.amtToPost ), '.99')#
Transaction Information:
#arguments.showbalance.Brand# #arguments.showbalance.Account#
Auth Code: #arguments.showbalance.rtransid#
#dateformat(now(), 'mm/dd/yyyy')# #timeformat(now(), 'h:mm')##lcase(timeformat(now(), 'tt'))#


st = structnew(); st.html = html; st.js = js; st.ordertotal = ordertotal; st.ordertotalwithtax = numberformat(ordertotal+taxtotal, '.99'); st.taxtotal = taxtotal; st.deposit = qryTaxRates.shop_deposit; st.taxes = stTaxes; st.reservationids = valuelist(qcart.reservation_id); st.rez = rezs;
var taxtotal = 0; var ordertotal = 0; var marinaemails = ''; var rezs = structnew(); var stTaxes = structnew(); select s.shop_sales_tax, s.shop_deposit, s.shop_email, s.shop_tip, m.* from shop s left outer join shop_dive_marina m on s.shop_id = m.shop_id where s.shop_id = #session.referrer_shop# SELECT r.reservation_id,r.reservation_event_id,r.reservation_parent_id, r.reservation_user_id, r.dove_past_year,r.reservation_activity_id, u.user_fname, u.user_lname, u.user_diver_level, u.user_diver_cert, d.dive_name, d.dive_start, d.dive_marina_id, o.option_id,o.label, ifnull(q.ans_price,0) as price, q.ans_name, q.ans_order, q.ans_taxable, co.*, a.activity_id, a.shop_id, a.activity_description, a.activity_order, ifnull(a.activity_price,sds.dive_site_price) as activity_price, activity_taxable FROM reservations r left OUTER join reservation_options o ON r.reservation_id = o.reservation_id LEFT OUTER JOIN shop_custom_questions q ON q.id = o.option_id LEFT OUTER JOIN shop_custom_options co on co.option_id = q.option_id LEFT OUTER JOIN shop_activities a ON r.reservation_activity_id = a.activity_id, dp_user u , shop_dives d, shop_dive_site sds where r.reservation_user_id = u.user_id AND r.reservation_event_id = d.dive_id AND d.dive_site_id = sds.dive_site_id and r.reservation_cart_id = and ( r.reservation_id = OR r.reservation_parent_id = ) and reservation_complete = 1 and reservation_cancelled <> 1 AND r.reservation_event_id = order by r.reservation_event_id,r.reservation_parent_id, r.reservation_id SELECT r.reservation_id,r.reservation_event_id,r.reservation_parent_id, r.reservation_user_id, r.dove_past_year,r.reservation_activity_id, 'Guest First Name' as user_fname, 'Guest Last Name' as user_lname, '' as user_diver_level, '' as user_diver_cert, d.dive_name, d.dive_start, d.dive_marina_id, o.option_id,o.label, ifnull(q.ans_price,0) as price, q.ans_name, q.ans_order, q.ans_taxable, co.*, a.activity_id, a.shop_id, a.activity_description, a.activity_order, ifnull(a.activity_price,sds.dive_site_price) as activity_price, activity_taxable FROM reservations r left OUTER join reservation_options o ON r.reservation_id = o.reservation_id LEFT OUTER JOIN shop_custom_questions q ON q.id = o.option_id LEFT OUTER JOIN shop_custom_options co on co.option_id = q.option_id LEFT OUTER JOIN shop_activities a ON r.reservation_activity_id = a.activity_id, shop_dives d, shop_dive_site sds where r.reservation_event_id = d.dive_id AND d.dive_site_id = sds.dive_site_id and r.reservation_cart_id = and ( r.reservation_id = OR r.reservation_parent_id = ) and reservation_complete = 1 and reservation_cancelled <> 1 AND r.reservation_event_id = order by r.reservation_event_id,r.reservation_parent_id, r.reservation_id SELECT * from reservation_trans where reservation_id = (select reservation_id from reservations where reservation_cart_id = limit 0,1) SELECT * from reservation_trans where reservation_id = stTaxes[session.referrer_shop] = structnew(); stTaxes[session.referrer_shop].tax = qryTaxRates.shop_sales_tax; stTaxes[session.referrer_shop].email = qryTaxRates.shop_email; for ( i=1; i lte qryTaxRates.recordcount; i++ ) { if (isnumeric(qryTaxRates.sales_tax[i])) { stTaxes[qryTaxRates.marina_id[i]] = structnew(); stTaxes[qryTaxRates.marina_id[i]].tax = qryTaxRates.sales_tax[i]; stTaxes[qryTaxRates.marina_id[i]].email = qryTaxRates.email[i]; } }
  if ( dive_marina_id eq '0' ) { event_tax_rate = stTaxes[session.referrer_shop].tax; } else { event_tax_rate = stTaxes[dive_marina_id].tax; if ( not listfind(marinaemails,stTaxes[dive_marina_id].email) ) { marinaemails = listappend(marinaemails,stTaxes[dive_marina_id].email); } } opts = application.CustomCFC.getCartOptions(reservation_id,qcart,arguments.showcheckout,reservation_event_id,event_tax_rate); ordertotal = ordertotal+ opts.reztotal; for ( key in opts.divers ) { taxtotal = taxtotal + opts.divers[key].taxtotal; } rezs[reservation_id] = structnew(); rezs[reservation_id].total = opts.reztotal; rezs[reservation_id].taxtotal = numberformat(opts.reztotal+(opts.taxable_amount*event_tax_rate/100), '.99'); rezs[reservation_id].count = opts.divercount; rezs[reservation_id].opts = opts;
Cart Detail
Date Description
#dateFormat(dive_start, "mm/dd/yyyy")# ccc #dive_name#
 
#opts.html#
Reservation Total: $#numberformat(opts.reztotal, '.99')#

Cart Summary
Date Description Qty Price  
#dateFormat(dive_start, "mm/dd/yyyy")# ddd #dive_name# #rezs[reservation_id].count# $#numberformat(rezs[reservation_id].total, '.99')#  

Subtotal: $#numberformat(ordertotal, '.99')#
Tax: $#numberformat(taxtotal, '.99')#0.00
Tip: $ #numberformat(session.tip, '9.99')#
Total: $#numberformat(ordertotal+taxtotal+session.tip, '.99')# 0.00

Total Paid: $#numberformat(transaction_totals, '.99')#
Total Due: $#numberformat(ordertotal+taxtotal-transaction_totals+session.tip, '.99')#0.00

Amount Paid: $#numberformat(arguments.showbalance.amtToPost, '.99')#

Balance Due: $#numberformat(( (ordertotal+taxtotal+session.tip) - arguments.showbalance.amtToPost ), '.99')#
Transaction Information:
#arguments.showbalance.Brand# #arguments.showbalance.Account#
Auth Code: #arguments.showbalance.rtransid#
#dateformat(now(), 'mm/dd/yyyy')# #timeformat(now(), 'h:mm')##lcase(timeformat(now(), 'tt'))#


st = structnew(); st.html = html; st.js = js; st.ordertotal = ordertotal; st.ordertotalwithtax = numberformat(ordertotal+taxtotal, '.99'); st.taxtotal = taxtotal; st.deposit = qryTaxRates.shop_deposit; st.taxes = stTaxes; st.reservationids = valuelist(qcart.reservation_id); st.rez = rezs;
SELECT r.*, e.*, ds.dive_site_price FROM reservations r, shop_dives e, shop_dive_site ds WHERE r.reservation_event_id = e.dive_id and ds.dive_site_id = e.dive_site_id and r.reservation_cart_id = and r.reservation_parent_id = 0
select * from reservations_divers_equipment de, equipment e, equipment_options eo, shop_equip_opt so where de.reservation_id = and de.equipment_option_id = eo.option_id and eo.option_equipment_id = e.equipment_id and so.equipment_option_id = eo.option_id and so.shop_id = #qGetShopInfo.shop_id# and so.marina_id = #qGetDive.dive_marina_id# select * from reservations_divers_equipment de, equipment e, equipment_options eo, shop_equip_opt so where de.reservation_id = and de.equipment_option_id = eo.option_id and eo.option_equipment_id = e.equipment_id and so.equipment_option_id = eo.option_id and so.shop_id = #qGetShopInfo.shop_id# and so.marina_id = #qGetDive.dive_marina_id#
Event NameDatePriceNumber
of
Guests
colspan="2">TotalRemove
#dive_name# #dateOutput(dive_start)# #dollarformat(dive_site_price)# #divercount# colspan="2"> #dollarformat(evaluate(dive_site_price * divercount))#
  
Equipment:colspan="2">#dollarformat(equimenttotalvar)#
Subtotal:colspan="2">#dollarformat(carttotalvar)#
Tax:colspan="2">#dollarformat(taxamountvar)#
Order Total:colspan="2">#dollarformat(evaluate(carttotalvar + taxamountvar))#
Deposit to Hold Reservation:colspan="2">#dollarformat(evaluate(depositvar))#

You cart is empty.
delete FROM reservations WHERE reservation_id = and reservation_cart_id = select order_id from orders where order_id = insert into orders (order_id, order_date) values (, ) update orders set order_user_id = , order_complete = where order_id = update reservations set reservation_cancelled = , reservation_cancel_date = where reservation_id = update reservations set reservation_event_id = where reservation_id = select events.* from events, super_events, master_dives where events.event_dive_time = master_dives.dive_id and super_events.super_id = master_dives.super_event_id and super_events.super_id = SELECT * FROM dp_user WHERE user_email = and user_shop_id = #arguments.shop_id# SELECT * FROM dp_user WHERE user_email = AND user_id != #arguments.user_id# and user_shop_id = #arguments.shop_id# SELECT * FROM dp_user WHERE user_id = SELECT * FROM dp_user WHERE 1=1 AND user_fname LIKE AND user_lname LIKE AND user_shop_id = LIMIT 50 SELECT equipment_options.option_name, equipment.equipment_name FROM equipment_options, equipment WHERE equipment_options.option_id = and equipment_options.option_equipment_id = equipment.equipment_id SELECT #arguments.columns#, s.shop_name FROM shop_dives sd, shop s WHERE sd.dive_start = "#dateformat(arguments.divemonth, 'yyyy-mm-dd')#" and sd.dive_shop_id = s.shop_id and sd.dive_shop_id = and (dive_time_id = 0 or dive_time_id = #i# ) and sd.dive_marina_id = and sd.dive_start > "#dateformat(dateadd('d','-1', now()), 'yyyy-mm-dd')#" and sd.dive_active = 1 ORDER BY dive_start asc SELECT #arguments.columns#, s.shop_name , COUNT(r.reservation_id) AS reservationCount, log.log_seas,log.log_visibility,log.log_current,log.log_wind,log.log_site,log.log_temp,log.log_comments, COUNT(comment_id) AS commentCount, COUNT(photo_id) AS photoCount FROM shop_dives sd INNER JOIN shop s ON sd.dive_shop_id = s.shop_id LEFT JOIN reservations r ON sd.dive_id = r.reservation_event_id LEFT JOIN shop_captain_log log ON sd.dive_id = log.log_dive_id LEFT JOIN dive_comments dc ON sd.dive_id = dc.comment_dive_id LEFT JOIN shop_log_photos lp ON sd.dive_id = lp.dive_id WHERE sd.dive_start >= AND sd.dive_start <= AND (reservation_complete = 1 OR reservation_complete IS NULL) AND (reservation_cancelled <> 1 OR reservation_cancelled IS NULL) AND (dc.comment_approved = 1 OR dc.comment_approved IS NULL) AND (lp.approved = 1 OR lp.approved IS NULL) and sd.dive_shop_id = and (dive_time_id = 0 or dive_time_id = #i# ) and sd.dive_marina_id = and sd.dive_start > "#dateformat(dateadd('d','-1', now()), 'yyyy-mm-dd')#" and sd.dive_active = 1 GROUP BY #arguments.columns#, s.shop_name ORDER BY dive_start asc SELECT sd.*, s.shop_name FROM shop_dives sd, shop s, shop_dive_marina dm WHERE sd.dive_start = "#dateformat(arguments.divemonth, 'yyyy-mm-dd')#" and sd.dive_shop_id = s.shop_id and sd.dive_shop_id = and (dive_time_id = 0 or dive_time_id = #i# ) and sd.dive_marina_id = and s.shop_id = dm.shop_id and dm.marina_id = and sd.dive_start > "#dateformat(dateadd('d','-1', now()), 'yyyy-mm-dd')#" ORDER BY dive_start asc SELECT shop.shop_email FROM shop, reservations, shop_dives WHERE reservations.reservation_id = and shop_dives.dive_id = reservations.reservation_event_id and shop_dives.dive_shop_id = shop.shop_id update reservations set conf_email = where reservation_cart_id = SELECT reservations.reservation_id,reservations.reservation_event_id FROM reservations WHERE reservations.reservation_cart_id = and reservation_parent_id = SELECT comment_desc,comment_date FROM dive_comments WHERE comment_dive_id = and comment_approved = insert dive_comments (comment_user_id, comment_desc, comment_dive_id, comment_reservation_id) values (,,,) update dp_user set user_password = WHERE user_email = SELECT shop_id,shop_alias FROM shop WHERE shop_alias = SELECT photo_name,photo_id FROM shop_log_photos WHERE dive_id = and approved = SELECT photo_name FROM shop_log_photos WHERE dive_id = and user_id = and reservation_id = and approved = insert shop_log_photos (user_id, photo_name, dive_id, reservation_id,approved) values (,,,,) SELECT reservation_id,reservation_user_id,reservation_event_id FROM reservations WHERE reservation_event_id = and reservation_user_id = SELECT #arguments.myFields#* FROM #arguments.target_table# WHERE #preserveSingleQuotes(arguments.myWhere)# ORDER BY #arguments.myOrder# LIMIT #arguments.myLimit# SELECT #arguments.myFields#* FROM #arguments.target_table# WHERE #preserveSingleQuotes(arguments.myWhere)# ORDER BY #arguments.myOrder# LIMIT #arguments.myLimit# SELECT count(reservation_id) as countvar FROM reservations WHERE reservation_parent_id = and reservation_complete = 1 and reservation_cancelled <> 1 and reservation_event_id = SELECT #arguments.columns# from reservations r where reservation_event_id in (#arguments.event_id#) and reservation_complete = 1 and reservation_cancelled <> 1 and reservation_processed = 0 and r.reservation_parent_id = 0 order by r.reservation_id desc SELECT * FROM DivesSummary WHERE diveMonth = AND diveYear = AND dive_shop_id = SELECT * FROM DivesSummary WHERE diveMonth = AND diveYear = AND dive_shop_id = AND reservation_cancelled = 1