<?php
	session_start();
include "../class/class.MySQL.php";
require '../class/resizeImage.php';
$db=new MySQL();

$from_date1='';
$to_date1='';

if(!empty($_REQUEST['from_date'])){
$from_date=$_REQUEST['from_date'];
$from_date1 = date('Y-m-d', strtotime($from_date));
}

if(!empty($_REQUEST['to_date'])){
$to_date=$_REQUEST['to_date'];
$to_date1 = date('Y-m-d', strtotime($to_date));
}

$query = "SELECT recruitment.*,designation.desig_name,department.depart_name,recruitment_resumes.rect_resumeup	as resume FROM  `recruitment` JOIN department ON department.depart_id=recruitment.rect_dept 
JOIN designation ON designation.desig_id=recruitment.rect_desg LEFT JOIN recruitment_resumes ON recruitment_resumes.rect_id	=recruitment.rect_id where 1 ";

if($from_date1!="" && $to_date1!=""){
$query.=" and rect_date between '$from_date1' and '$to_date1'";
}
include "pagingserch.php";

$query.=" GROUP BY recruitment.rect_id LIMIT $start, $limit";
//echo $query;
if(isset($_REQUEST['page'])){
$page=$_REQUEST['page'];
}else{
$page=15;
}

$pagecnt=$start;
$getrecruitment = $db->fetchQuery($query);
	
	//echo $count = count($getrecruitment);
	
	//echo $getrecruitment[] = $pagination;
	
	$count = count($getrecruitment);
	$getrecruitment[$count-1]['totalrows'] = $total_pages;
	//$getrecruitment[$count-1]['items_per_page'] = $page;
	
	echo '{"getrecruitment":'.json_encode($getrecruitment).'}';

?>

	
    
    
