?>
<? 
	if(isset($_POST['submit_bill'])) {
		//update the member information
		$_POST = sanitize($_POST);
		$client = $_POST;
		settype($client,'object');
		if($_POST['Id']=="") {
			Billing::addBilling($client);
		} else {
			Billing::updateBilling($client);
		}
		
		if (isset($_POST['chkShip'])) {
				if(Shipping::countShippingClient($client_id)==0) {
					$_POST = sanitize($_POST);
					$shipping = $_POST;
					settype($shipping,'object');
					$shipping = Shipping::addShipping($shipping); 
				} else {
					$shippings = Shipping::findShippingClient($client_id);
					$_POST = sanitize($_POST);
					$shipping = $_POST;
					settype($shipping,'object');
					$shipping->Id = $shippings->fldShippingID;
					$shipping = Shipping::updateShipping($shipping); 
				}
				if(isset($_SESSION['FreeShipping'])) {				
						$links = $ROOT_URL.'order-confirmation.html';
						header("Location: $links");