<?php

	require_once("../include/config.php");	
	require_once("../include/startup.php");

$obj  = new Client();

if($_POST['SUBMIT'])
{ 

	 	$NewProduct['MemberName']					= sanitize($_POST['txtclientname'],SQL);
	 	$NewProduct['MemberSurName']				= sanitize($_POST['txtclientsurname'],SQL);
	 	
	 	//Address
	 	$NewProduct['Addline1'] 					= sanitize($_POST['Addline1'],SQL);
	 	$NewProduct['Addline2'] 					= sanitize($_POST['txtAddline1'],SQL);
	 	$NewProduct['head_CityName'] 				= sanitize($_POST['txthead_CityName1'],SQL);
	 	$state 											= explode("-",sanitize($_POST['txtstate'],SQL));
	 	$NewProduct['head_Stateid'] 				= $state[0];
	 	$NewProduct['head_StateName'] 			= $state[1];
	 	$Country											= explode("-",sanitize($_POST['txtcountry'],SQL));
	 	$NewProduct['Country'] 						= $Country[1];
		$NewProduct['head_Pin'] 					= sanitize($_POST['txtpincode1'],SQL);
		
	
		//Personal Information
	 	$NewProduct['dateofbirth']					= date("Y-m-d",strtotime($_POST['txtDOB']));
	 	$NewProduct['gender']						= $_POST['txtgender'];
	 	
	   //Contact Information
	 	$NewProduct['head_TelNo'] 	      		= sanitize($_POST['txthead_TelNo'],SQL);
		$NewProduct['mobileforsms'] 	     		= sanitize($_POST['head_mobNo'],SQL);
		$NewProduct['head_Email'] 	      		= sanitize($_POST['head_Email'],SQL);
		$NewProduct['memberapprovalstatus'] 	= sanitize($_POST['txtstatus'],SQL);
	 
		$addresult     = $obj -> AddClient($NewProduct);
		
		require_once("register_success.php");
		   	
}
?>