
 
 <?php
 
 
	include("../pertial_page/function.php");
	include('../config/db_connect.php');
	
	$checked = 1;
 
 
 	$query1 = "";
	$query2 = "";
	$query3 = "";
	$page = "";
	
 
 	switch($_REQUEST['page_id'])
	{
		case 'client_list' :
 
			$query1 = " CALL usp_select_client_list( ".(($_REQUEST['page_no'] * $_REQUEST['recoud']) -  $_REQUEST['recoud']). " , " .$_REQUEST['recoud']. ", ";
	   		$query1 .= "'" .$_REQUEST['cmb_kva']. "',";
			$query1 .= "'" .$_REQUEST['txt_kva']. "', ";
			$query1 .= "'" .$_REQUEST['cmb_sector']. "', ";
			$query1 .= "'" .$_REQUEST['cmb_sold_year']. "',";
			$query1 .= "'" .$_REQUEST['cmb_group_by']. "' ) ";
 	
			
			$query2 = " CALL usp_select_client_list_counter( ";
	   		$query2 .= "'" .$_REQUEST['cmb_kva']. "',";
			$query2 .= "'" .$_REQUEST['txt_kva']. "', ";
			$query2 .= "'" .$_REQUEST['cmb_sector']. "', ";
			$query2 .= "'" .$_REQUEST['cmb_sold_year']. "')";
 
			 
			$result1 = $mysql->query($query1);
			include('../config/db_connect.php');
			$result2 = $mysql->query($query2);
		
			$counter = 0;
			if($row = mysqli_fetch_array($result2))
				$counter = $row[0];
	 
			$page = create_subpage($result1, $counter,$_REQUEST['page_id'],  $_REQUEST['sub_element_id'], $_REQUEST['page_no'],  $_REQUEST['recoud'], $checked, $_REQUEST['field'], $_REQUEST['menu_id'], $_REQUEST['access_id']);
	
																  
																		  
		break;
		
		case 'rating_list' :
			$query1 = " CALL usp_select_rating( '".$_REQUEST['cmb_engine']."','".$_REQUEST['cmb_alt']."')";
			$result1 = $mysql->query($query1);
			
			$page = "<select id='cmb_rating' name='D4'  class='common_commbo' ><option value='0'>--All--</option>";
			while($row = mysqli_fetch_array($result1))
			{
				$page .= "	<option value='$row[1]'>$row[1]</option>";
			}
            $page .= "</select>";
 
 		break;
		
		case 'product_list' :
 
			$query1 = " CALL usp_select_generator( ".(($_REQUEST['page_no'] * $_REQUEST['recoud']) -  $_REQUEST['recoud']). " , " .$_REQUEST['recoud']. ", ";
	   		$query1 .= "'" .$_REQUEST['cmb_engine']. "',";
			$query1 .= "'" .$_REQUEST['cmb_alt']. "', ";
			$query1 .= "'" .$_REQUEST['cmb_rating']. "') ";
 
 	
			$query2 = " CALL usp_select_generator_counter( ";
	   		$query2 .= "'" .$_REQUEST['cmb_engine']. "',";
			$query2 .= "'" .$_REQUEST['cmb_alt']. "', ";
			$query2 .= "'" .$_REQUEST['cmb_rating']. "') ";
			
				 
			$result1 = $mysql->query($query1);
			include('../config/db_connect.php');
			$result2 = $mysql->query($query2);
		
			$counter = 0;
			if($row = mysqli_fetch_array($result2))
				$counter = $row[0];
	 
			$page = create_subpage($result1, $counter,$_REQUEST['page_id'],  $_REQUEST['sub_element_id'], $_REQUEST['page_no'],  $_REQUEST['recoud'], $checked, $_REQUEST['field'], $_REQUEST['menu_id'], $_REQUEST['access_id']);

	 		
					  
			
			$page =  "<div  style='height:5px; background-color:#FFF'>&nbsp;</div>
                      <div style=' background-color:#FFF' align='center' >
        <img id='loder' style='visibility:hidden; ' align='middle'src='images/ajax-loader.gif' alt='Loder' />
        </div>
        <div  style='height:5px; background-color:#FFF'>&nbsp;</div> ".$page."<div style='height:10px;background-color:#FFF'></div>";
		break;
		
		case 'send_message' :
  			$to      = 'sales@cross-world.com';
 
			$subject = 'Customer Query';
			$message = "Name : ". $_REQUEST['fullname']. "\n" ;
			$message .= "Address : ". $_REQUEST['address']. "\n" ;
			$message .= "Email : ". $_REQUEST['email']. "\n" ;
			$message .= "Phone : ". $_REQUEST['tel']. "\n\n" ;
			$message .= "       ". $_REQUEST['content']. "\n\n" ;
			
			if (mail($to, $subject, $message, "Inquiry from cross-world.com" )) 
			{
   				$page = "Thank you for your inquiry. We will attend the quire and will contact you within next working day.";	
  			} 
			else 
			{
   				$page = "Message delivery failed...";
			}
 
 														  
		break;

		
	}
 
 
 
 
 		echo $page;
	
 
 
 
 ?>