if(isset($_SESSION['client_id'])) {
		$client_id = $_SESSION['client_id'];
		$billing = Billing::findBillingClient($client_id);
	} else {
		header("Location: index.php");
	}
		
?>
<? 
	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');