Major Problem - Please phone Brad on 0405104934 As soon as possible.

Your order has not been processed Error: no_sms_no

"); } $filler = 0; $timestamp = time(); $stringtime = (text)$timestamp; $trans_date = strftime("%e-%b-%Y",$timestamp); $month = strftime("%b",$timestamp); $year = strftime("%Y",$timestamp); /*echo("");*/ $month_year = strftime("%b-%Y",$timestamp); $filename = (text)$timestamp + "-" + (text)$account_no + ".txt"; $pickup_array= split($pickup_time," "); $time_array= split($pickup_array[0],":"); $pu_time = ((int)$time_array[0] * 60) + (int)$time_array[1]; $line_movement = "d"; $cut_command = "m"; $num1=""; $bell_command = "p0 "; $citizen_bell_command = " 1022"; $num2=""; $num3=""; $num4=""; $num5=""; $num6=""; $num7=""; $num8=" "; $num9=""; $num10=" "; $num11=" "; $num12=" "; $num13=" "; $num14=" "; $num15=""; $num16=""; $num17=""; $num18=""; $num19=""; $num20=""; $num21=""; $num22=""; $num23=""; $num24=""; $num25=""; $num26=""; /*$num27=""; $num28=""; $num29=""; $num30="";*/ if($pickup_array[1] == "P.M.") { $pu_time = $pu_time + 720; } $ah_time = ((int)$ah_hour * 60) + (int)$ah_minute; if($ah_pickup_time_sign == "P.M.") { $ah_time = $ah_time + 720; } if($ah_time > $pu_time) { $pickup_time = $ah_hour + ":" + $ah_minute + " " + $ah_pickup_time_sign; } $pathname = "/usr/local/apache2.2/htdocs/take-away/orders/$year/$month/$filename"; $fd = open("$pathname", ">"); if($fd < 0) { system("echo 'Cannot create file $pathname $ERRMSG' | mail -s'Create Transaction Error' brad@austbiz.com.au"); } else { $sock = msqlConnect(); if ($sock < 0) { fatal("Error : $ERRMSG\n"); } if (msqlSelectDB($sock,"take-away") < 0) { fatal("Error : $ERRMSG\n"); } $counter= 0; $start_no = 5; fprintf($fd,"$phone_line"); fprintf($fd,"Alphabet: GSM\n\n"); fprintf($fd,"$last_name $phone_no\n"); if($account_no == "3173") { fprintf($fd," $bell_command "); } if($account_no == "13306") { fprintf($fd," $bell_command "); } if((int)$number > 5) { while((int)$start_no <= (int)$number) { $item_price[$counter] = sub($item_price[$counter],"$",""); fprintf($fd,"$no_ordered[$counter] $item_name[$counter] $m_extras[$counter] $item_price[$counter]\n\n"); $query = "select _seq from take_away_transactions"; if (msqlQuery($sock, $query) < 0) { fatal("Error : $ERRMSG\n"); } $res = msqlStoreResult(); $row = msqlFetchRow($res); $record_no = (int)$row[0]; msqlFreeResult($res); if(msqlQuery($sock,"insert into take_away_transactions values ($record_no,'$cust_id','$last_name',$account_no,$timestamp,'$trans_date','$month_year',$no_ordered[$counter],'$item_name[$counter]','$m_extras[$counter]',$item_price[$counter],'$pickup_time','0')") < 0) { fatal("Error : $ERRMSG\n"); } $start_no++; $counter++; } if(exists($payment_method)) { if($payment_method == "PayPal") { fprintf($fd,"Paid PayPal\n"); } else { echo("Major Problem Your Order Has not been processed - Please call Brad on 0405104934 A.S.A.P.

"); system("echo 'Payment method incorrect $payment_method' | mail -s'Payment method Error' brad@austbiz.com.au"); exit(1); } } else { fprintf($fd,"Due: $f_total\n"); } fprintf($fd,"$pickup_time\n"); if($h_delivery == "Y") { fprintf($fd,"Deliver to:\n"); fprintf($fd,"$stno_name\n"); fprintf($fd,"$city_suburb\n"); fprintf($fd,"$state \t $postcode\n"); } $filler = (int)$docket_length - (int)$number; if($filler <= 30 && $filler > 0) { if ($filler == 1) {$line_movement = $line_movement + $num1;} if ($filler == 2) {$line_movement = $line_movement + $num2;} if ($filler == 3) {$line_movement = $line_movement + $num3;} if ($filler == 4) {$line_movement = $line_movement + $num4;} if ($filler == 5) {$line_movement = $line_movement + $num5;} if ($filler == 6) {$line_movement = $line_movement + $num6;} if ($filler == 7) {$line_movement = $line_movement + $num7;} if ($filler == 8) {$line_movement = $line_movement + $num8;} if ($filler == 9) {$line_movement = $line_movement + $num9;} if ($filler == 10) {$line_movement = $line_movement + $num10;} if ($filler == 11) {$line_movement = $line_movement + $num11;} if ($filler == 12) {$line_movement = $line_movement + $num12;} if ($filler == 13) {$line_movement = $line_movement + $num13;} if ($filler == 14) {$line_movement = $line_movement + $num14;} if ($filler == 15) {$line_movement = $line_movement + $num15;} if ($filler == 16) {$line_movement = $line_movement + $num16;} if ($filler == 17) {$line_movement = $line_movement + $num17;} if ($filler == 18) {$line_movement = $line_movement + $num18;} if ($filler == 19) {$line_movement = $line_movement + $num19;} if ($filler == 20) {$line_movement = $line_movement + $num20;} if ($filler == 21) {$line_movement = $line_movement + $num21;} if ($filler == 22) {$line_movement = $line_movement + $num22;} if ($filler == 23) {$line_movement = $line_movement + $num23;} if ($filler == 24) {$line_movement = $line_movement + $num24;} if ($filler == 25) {$line_movement = $line_movement + $num25;} if ($filler == 26) {$line_movement = $line_movement + $num26;} if ($filler == 27) {$line_movement = $line_movement + $num27;} if ($filler == 28) {$line_movement = $line_movement + $num28;} if ($filler == 29) {$line_movement = $line_movement + $num29;} if ($filler == 30) {$line_movement = $line_movement + $num30;} fprintf($fd,$line_movement); fprintf($fd," "); } } else { $item_price = sub($item_price,"$",""); fprintf($fd,"$no_ordered $item_name $m_extras $item_price\n\n"); if(exists($payment_method)) { if($payment_method == "PayPal") { fprintf($fd,"Paid PayPal\n"); } else { echo("Major Problem Your Order Has not been processed - Please call Brad on 0405104934 A.S.A.P.

"); system("echo 'Payment method incorrect $payment_method' | mail -s'Payment method Error' brad@austbiz.com.au"); exit(1); } } else { fprintf($fd,"Due: $f_total\n"); } fprintf($fd,"$pickup_time\n"); if($h_delivery == "Y") { fprintf($fd,"Deliver to:\n"); fprintf($fd,"$stno_name\n"); fprintf($fd,"$city_suburb\n"); fprintf($fd,"$state \t $postcode\n"); } $filler = (int)$docket_length - (int)$number; if($filler <= 30 && $filler > 0) { if ($filler == 1) {$line_movement = $line_movement + $num1;} if ($filler == 2) {$line_movement = $line_movement + $num2;} if ($filler == 3) {$line_movement = $line_movement + $num3;} if ($filler == 4) {$line_movement = $line_movement + $num4;} if ($filler == 5) {$line_movement = $line_movement + $num5;} if ($filler == 6) {$line_movement = $line_movement + $num6;} if ($filler == 7) {$line_movement = $line_movement + $num7;} if ($filler == 8) {$line_movement = $line_movement + $num8;} if ($filler == 9) {$line_movement = $line_movement + $num9;} if ($filler == 10) {$line_movement = $line_movement + $num10;} if ($filler == 11) {$line_movement = $line_movement + $num11;} if ($filler == 12) {$line_movement = $line_movement + $num12;} if ($filler == 13) {$line_movement = $line_movement + $num13;} if ($filler == 14) {$line_movement = $line_movement + $num14;} if ($filler == 15) {$line_movement = $line_movement + $num15;} if ($filler == 16) {$line_movement = $line_movement + $num16;} if ($filler == 17) {$line_movement = $line_movement + $num17;} if ($filler == 18) {$line_movement = $line_movement + $num18;} if ($filler == 19) {$line_movement = $line_movement + $num19;} if ($filler == 20) {$line_movement = $line_movement + $num20;} if ($filler == 21) {$line_movement = $line_movement + $num21;} if ($filler == 22) {$line_movement = $line_movement + $num22;} if ($filler == 23) {$line_movement = $line_movement + $num23;} if ($filler == 24) {$line_movement = $line_movement + $num24;} if ($filler == 25) {$line_movement = $line_movement + $num25;} if ($filler == 26) {$line_movement = $line_movement + $num26;} if ($filler == 27) {$line_movement = $line_movement + $num27;} if ($filler == 28) {$line_movement = $line_movement + $num28;} if ($filler == 29) {$line_movement = $line_movement + $num29;} if ($filler == 30) {$line_movement = $line_movement + $num30;} fprintf($fd,$line_movement); fprintf($fd," "); } $query = "select _seq from take_away_transactions"; if (msqlQuery($sock, $query) < 0) { fatal("Error : $ERRMSG\n"); } $res = msqlStoreResult(); $row = msqlFetchRow($res); $record_no = (int)$row[0]; msqlFreeResult($res); if(msqlQuery($sock,"insert into take_away_transactions values ($record_no,'$cust_id','$last_name',$account_no,$timestamp,'$trans_date','$month_year',$no_ordered,'$item_name','$m_extras',$item_price,'$pickup_time','O')") < 0) { fatal("Error : $ERRMSG\n"); } } if((int)$account_no == 3173) { fprintf($fd," $bell_command "); } if((int)$account_no == 13306) { fprintf($fd," $citizen_bell_command "); fprintf($fd," $cut_command "); } } close($fd); $result = system("cp $pathname /usr/local/apache2.2/htdocs/take-away/orders"); if($result != 0) { echo("

Please phone Brad on 0405104934 As soon as possible.

Your order has not been processed Error: Problem sending message!

"); } else { /* echo("");*/ echo(""); } > msqlClose($sock);