connect(); // Dummy customer var $dbcustomer = array('firstName' => '', 'lastName' => '', 'email' => '', 'address1' => '', 'address2' => '', 'city' => '', 'state' => '', 'postcode' => '', 'country' => 'Australia', 'phone' => '', 'password' => ''); // Output vars $PAGE_CONTENT = ''; $PAGE_HEADING = ''; if ($cart->isEmpty()) { $PAGE_CONTENT = "You do not have any items in your shopping cart!"; finish(); } // This needs to be a secure page // securePage(); $EXTRA_SCRIPTING = "var requiredFields = Array('text,firstName','text,lastName','email,email','text,address1','text,city','text,state','text,postcode','text,country','checkbox,policies'); function togglePass() { var c,p1,p2; // Determine objects depending on browser c=getObj('store_info'); p1=getObj('password1'); p2=getObj('password2'); if (c.checked==true) { p1.disabled=false; p2.disabled=false; } else { p1.disabled=true; p2.disabled=true; } } function validate() { // Validitiy flag var valid=true; var field=null,fieldname,fieldtype,val='',img=null; var msgSpan = getObj('valid_msg'); var rxEmail = new RegExp('[a-zA-z0-9\.]+@[a-zA-z0-9]+\.[a-zA-Z]+.*'); // Cycle required fields for (i=0;iset('customers',$dbcustomer,'customerID='.$customer['customerID']); //$dbcustomer = $customer['customerID']; $dbcustomer['customerID'] = $customer['customerID']; //$customer = $dbcustomer; //$customer['customerID'] = $cid; @debug(print_r($customer,true)); } else if (!$customer || empty($customer)) { if ($store_info) { // Check to see if the email address already exists $email_count = $db->count('customers','email="'.$dbcustomer['email'].'"'); if ($email_count > 0) { $PAGE_CONTENT = '
An account with that email address already exists!
'; $valid = false; } else { // Perform query $dbcustomer['customerID'] = $db->insert('customers',$dbcustomer); // Store customer information in session //$_SESSION[_SESS_CUSTOMER] = $dbcustomer; $customer = $dbcustomer; } } else { $dbcustomer['customerID'] = $db->insert('customers',$dbcustomer); } } else { $dbcustomer['customerID'] = $customer['customerID']; } //@debug(print_r($dbcustomer,true)); if ($valid) { // Shipping info is determined, on to the secure payment page $_SESSION['shipping'] = $shipping; // Store customer information in session $_SESSION[_SESS_CUSTOMER] = $dbcustomer; redirect(_SITE_SECURE.'transfer.php'); } } if ($customer) $dbcustomer = $customer; $shipint = ''; if (strtolower($dbcustomer['country']) != 'australia') $shipint = 'checked'; //else if ($shipping != 'international') //$shipint = ''; // Output form if (rq('js') == 'false') $PAGE_CONTENT .= '
This site requires you have a javascript-enabled browser!
'; $PAGE_CONTENT .= <<
FORM; // If this is a new customer // we need to give them the opportunity // to save their shipping information if (!$customer) { $PAGE_CONTENT .= << FORM; } else { $PAGE_CONTENT .= << FORM; } // Get purchase policy $purchase_policy = get_page_content('purchase',$purchase_policy_title); $PAGE_CONTENT .= <<

Shipping and Contact Info  This is a required field Required fields

This is a required field First Name
This is a required field Last Name
This is a required field Email
This is a required field Address
 
This is a required field City
This is a required field State
This is a required field Postcode
This is a required field Country
Phone
     

Delivery Method

This is a required field Standard
International
  All deliveries are sent via Australia Post
     
Store this information for future purchases
If you would like to store your shipping/contact info for future purchases, enter a password below so you can login next time you wish to make a purchase. (Password must be at least 6 characters)
  Password
  Re-type Password
Save any changes
Select the checkbox if you would like to save any changes made to the details above.
     

Purchase Policies

{$purchase_policy}
This is a required field
FORM; // Disconnect from mysql server $db->shutdown(); // Assign template vars $t->assign_vars(array('PAGE_HEADING' => $PAGE_HEADING, 'PAGE_CONTENT' => $PAGE_CONTENT, 'EXTRA_SCRIPTING' => $EXTRA_SCRIPTING)); // Parse template $t->pparse('main'); ?>