$QUERY_STRING

); $query = sub($QUERY_STRING, "%20"," "); $query = sub($query, "%7C", "_"); $query_array = split($query, "_"); $account_no = (int)$query_array[0]; $cust_id = $query_array[1]; $last_name = $query_array[2]; $last_name = tr($last_name,"a-z","A-Z"); $number = #$query_array; $total = sub($query_array[3],"total=",""); if(exists($account_no)) { $banner = (char)$account_no + ".jpg"; } else { echo(""); } echo("

"); echo("
"); echo("
"); echo("The current time is:
"); echo("

"); echo("Taking orders for pickup at:

"); echo("


"); echo("Order Total:
"); echo(""); echo("
"); echo("
"); $total = sub($total,"$",""); echo("
"); echo("
"); $sock = msqlConnect(); if ($sock < 0) { fatal("Error : $ERRMSG\n"); } if (msqlSelectDB($sock,"take-away") < 0) { fatal("Error : $ERRMSG\n"); } if (msqlQuery($sock,"select cust_id, first_name, last_name, stno_name, city_suburb, postcode, phone_no from take_away_customers where cust_id='$cust_id' and last_name='$last_name'") <0) { fatal("Error : $ERRMSG\n"); } $res = msqlStoreResult(); $num_rows = msqlNumRows($res); $row = msqlFetchRow($res); if ($num_rows < 1) { echo("

The customer i.d. $cust_id or Last Name $last_name you entered is not correct.

"); echo("

Click your browser's back button to go back and correct.

"); echo("

or

"); /* echo("

Click here to register.

");*/ echo("

Click here to register."); } else { $stno_name = $row[3]; $city_suburb = $row[4]; $postcode = $row[5]; $phone_no = $row[6]; /***********************************************************************************************************************************************************/ msqlFreeResult($res); if (msqlQuery($sock, "select sms_no, postcode, $day_open, $day_close, open_overide_flag, announcement, delay, deliver_flag, delivery_range_klms, docket_length, ccflag from take_away_account where account_no=$account_no") < 0) { fatal("Error : $ERRMSG\n"); } $res = msqlStoreResult(); $num_rows = msqlNumRows($res); if ($num_rows <> 1) { echo("

MAJOR PROBLEM! CONTACT TECHNICAL HELP ON 0405104934 A.S.A.P.
$query

"); } else { $row = msqlFetchRow($res); $f_sms_no = $row[0]; $f_postcode = $row[1]; $f_opentime = $row[2]; $f_closedtime = $row[3]; $f_deliver_flag = $row[7]; $f_delivery_range_klms = $row[8]; $docket_length = $row[9]; $ccflag = $row[10]; if($f_opentime == "no") { echo("

MAJOR PROBLEM! CONTACT TECHNICAL HELP ON 0405104934 A.S.A.P. Shop Closed

"); } else { $closed_array = split($f_closedtime,":"); $closed_minutes = ($closed_array[0] * 60) + ($closed_array[1]); echo(""); } } msqlFreeResult($res); $text_file = (text)$account_no + "_delay.txt"; if(test("f","/usr/local/apache2.2/htdocs/take-away/notifications/$text_file")==1) { $fd = open("/usr/local/apache2.2/htdocs/take-away/notifications/$text_file", "<"); if ($fd < 0) { echo("Error: $ERRMSG\n"); } else { $delay = readln($fd); close($fd); echo("$delay"); echo(""); } } else { echo(""); } /**********************************************************************************************************************************************************/ echo(""); echo(""); $len = 0; $array_flag = "N"; while($counter < $number) { $line_array = split($query_array[$counter], ":"); $no_of_fields = #$line_array -1; $field_counter = 0; while($field_counter <= $no_of_fields) { $m_extras = ""; if($field_counter == 0) { echo(""); } if($field_counter == 1) { echo(""); } if ($field_counter > 1 && $field_counter < $no_of_fields) { /* echo("
Qty.Item NameInstructionsPrice