<?php

  require_once("../config.php");
require_once("../startup.php");
	require_once(GLOBAL_INCLUDE_PATH."opt_js/json/jQuery.php");

	$company_obj = new Company();    
	$validation = new Validation();
	$obj = new AllTables();


		
		/*if(count($checkemail) > 0){
		
		
				$errorarray = array('emailerror' => 'Email ID Already Exists !');
				echo json_encode($errorarray);
		}else{*/ $operation_company = $_POST['operation_company'];
					$memberid 									= $_POST['txtmemberid'];
					  $edit_membercompanyid = $_POST['txtmembercompanyid'];
	 			$NewProduct['memberid']					= $memberid;
				//$NewProduct['memberid']	    				= $_POST['txtmemberid'];
				$NewProduct['membercompanyid']	    		= $edit_membercompanyid;
					
				$NewProduct['user_companyname']	    				= $_POST['txturcompany_name'];
				$NewProduct['MemberName']	    				= $_POST['txtcustomerName'];
				$NewProduct['MemberSurName']	    				= $_POST['txtcustomerlastName'];
				$NewProduct['user_password']		 				= $_POST['txtpassword'];

				$NewProduct['head_Email']			    			= $_POST['head_Email'];
				$NewProduct['head_Mob_no']		 				= $_POST['head_mobNo'];
				
				$NewProduct['entry_date']		 		= date("Y-m-d");
				
				$NewProduct['dateofbirth']		    		= $_POST['txtDOB'];
				$NewProduct['Addline1']		    		= $_POST['Addline1'];
				$NewProduct['Addline2']		    		= $_POST['txtAddline1'];
							
				
				$NewProduct['head_Pin']		    		= $_POST['txtpincode1'];
				$city 		= explode("-", $_POST['txthead_CityName1']);
				$state 		= explode("-", $_POST['txtstate']);
				$country 	= explode("-", $_POST['txtcountry']);
				
				$NewProduct['head_CityName']			 	= $city[1];
				$NewProduct['head_Stateid']		 			= $state[0];
				$NewProduct['head_StateName']		 		= $state[1];
			
				$NewProduct['Country']		 			= $country[1];	
				
				//print_r($NewProduct);
				//echo $NewProduct;
				//$productadd = $obj-> AddInfo($NewProduct,"trnuser_company");



			
	 //Information
	 	
 if($operation_company == "edit_company") 
		{
			
 
			$wherecondition = "membercompanyid = ".$edit_membercompanyid;
			$edit = $company_obj -> EditInfo($NewProduct,$wherecondition,"trnuser_company");				
				
	//		jQuery("form#company_reg_form_".$edit_membercompanyid)->html($returndata);	
		}			
		
			$returndata			= ManageUserCompanyDetailsDisplay($edit_membercompanyid);	
								
			jQuery("div#exists_company")->html($returndata);		
				
				
	jQuery::getResponse();   
	
		
	
	

?>