<?php 
 //mail("josmijose.techintl@gmail.com","test mail","<pre>".print_r($_POST,true)."</pre>");

// print_r($_POST); exit;
	$name=stripslashes($_POST['contact_name']);
	$company=stripslashes($_POST['company']); 
	$address=stripslashes($_POST['address']); 
	$phone=stripslashes($_POST['phone']);
	$fax=stripslashes($_POST['fax']);
	$unitsize=stripslashes($_POST['size']);
	$ClimateControlledUnit=stripslashes($_POST['climate']);
	$DateSpaceRequired=stripslashes($_POST['space']);
	$TermLength=stripslashes($_POST['length']);
	// $TenantInsurance=stripslashes($_POST['TenantInsurance']);
	// $payment=stripslashes($_POST['payment']);
    $email=stripslashes($_POST['email']);
    
    $comments=stripslashes($_POST['comment']);
     // $id=$_POST['session_id']; 
       $other_fields = array('Fax'=>$fax,'Unit_size_required'=>$unitsize,'Climate_Controlled_Unit'=>$ClimateControlledUnit,'Date_Space_Required'=>$DateSpaceRequired,'Term_Length'=>$TermLength);
     //  if(isset($_POST['session_id']))
     //  	{ 
     //  		$other_fields['session_id'] = $id; 
     //  	}      


//--------------------------------------adluge code--------------------------------------
	require_once("clientcenter-api-library.php"); 
	$lead = new clientcenter();
	$lead->client_code="usicv1wnyaggkf8"; // Mandatory. Unique identification code.

	$lead->fname=$name; //post  Value of first name  
	$lead->lname=$lname; //post  Value of first name
	$lead->phone=$phone;//post Value of Phone Number 
	//$lead->session_id=$id;//post Value of Phone Number
	$lead->email=$email;//post  Value of Email addess  
	$lead->other_fields=json_encode($other_fields);//post Value of other_fields 
	$lead->company_name=$company;//post  Value of City 
	$lead->city=$city;//post  Value of City 
	$lead->address_1=$address;//post  Value of City
	$lead->postalcode=$postalcode;
	$lead->comments=$comments;//post Value of Comments 
	
	$lead->status=1; // No need to change this
	
	//No need to modify any of the below code
	$lead->useragent = $_SERVER['HTTP_USER_AGENT']; //browser properties
	$lead->remote_ip=$_SERVER['REMOTE_ADDR']; //ip address
	$lead->referrer=$_SERVER['HTTP_REFERER'];// page source
	$lead->contact_date=date("Y-m-d h:i:s");
	$lead->search_engine=$_COOKIE['adl_durl'];
	$lead->keyword=$_COOKIE['adl_key'];
	$lead->source=$_COOKIE['adl_camp'];
	$lead->randomnum=$_COOKIE['adl_rand'];
	$lead->adl_ref=$_COOKIE['adl_ref'];
		
	$lead->send_to_adluge=true; // Set to true If you are sending leads to adluge //default true
	$lead->send();
	//echo "thank-you";exit;
//--------------------------------------------------------------------------------------------------

?>