<?php
$t = $site->pageTitle($s['shop_page']);
$seo_pageTitle = seo_str($t);
//if is suburb is set, save it for the order and redirect to checkout
if(isset($_POST['suburb']))
{
$sub = $form->clean_fields($_POST['suburb']);
$mysql->update("town", $sub, "fs_shop_orderdata", "owner = '{$_SESSION['owner']}' AND temp = 'y' LIMIT 1");
$_SESSION['form']['town'] = $_POST['suburb'];
header('Location: /'.$s['shop_page'].'/'.$seo_pageTitle.'/Payment/');
exit;
}
//
$mainhtml .= '<h1>Shipping error</h1><p>We are having difficulties calculating shipping cost for the address you have supplied.</p>';
//show list of subs to choose if order is within AU
$order = $mysql->get_array($mysql->query("postcode,state,country", "fs_shop_orderdata", "owner = '{$_SESSION['owner']}' AND temp = 'y' LIMIT 1"));
$subs = file_get_contents('https://www.freesites.com.au/fastway/suburbList.php?action=fields&postcode='.$order['postcode']);
if($order['country'] == 'AU' && $order['postcode'] > 0 && $subs != 'error')
{
$mainhtml .= '<form id="subsForm" name="subsForm" method="post" action=""><h1>Select Suburb</h1>';
$mainhtml .= '<p>Most of the time this is due to not spelling your suburb correctly, please try picking it from the list below to try again.</p>';
$mainhtml .= $subs;
$mainhtml .= '<input type="submit" value="Submit" style="margin-top:5px;width:auto;" /></form></p>';
}
//
$mainhtml .= '<p>If you are sure your address is correct and this issue persists, please try using an alternative delivery address if you have one, or please contact us so that we can help with your order.</p>';
?>