<? 
 if($_SESSION['page'] == '2' and $_SESSION['section'] == '1') 
 	{ 
		if ($_GET['stat'] == 'addnew' )
		   {
						$date_now   		  = date("Y").'-'.date("m").'-'.date("d"); 
						$uid				  = $_SESSION['Login_user_id'];
						$CPR 	   			  = $_POST['CPR'];
						$CR  	   			  = $_POST['CR'];
						$cus_name   		  = $_POST['cus_name'];
						$cus_mobile  		  = $_POST['cus_mobile'];
						$cus_address 		  = $_POST['cus_address'];
						$cus_fax			  = $_POST['cus_fax'];
						$Created_Date		  = $date_now ;
						
						//821002325
						
						
						$query = mysql_query("SELECT * FROM ".$dcm_table_start."customer where CPR = '".$CPR."' and CR = '".$CR."'"); 	
							if (mysql_num_rows($query) <> 0 and ( $CPR  <> "" or $CR <> "" ) )
								{
									header("Location: index.php?stat=Error201"); 
								}else{
									mysql_query("INSERT INTO ".$dcm_table_start."customer ( uid , CPR, CR, cus_name, cus_mobile, cus_address, cus_fax ,created_date) VALUES ($uid,'$CPR','$CR','$cus_name','$cus_mobile','$cus_address','$cus_fax','$Created_Date')");
									header("Location: index.php?section=2"); 
								}	
				
			}
	}
?>