<?php 
require "../commonincludefiles.php";
if($_SESSION["cCompany_id"]!="" && isset($_SESSION["cCompany_id"]))
{
	$objDesignationMgmt = new DesignationMgmt();
	$limit=0;
	$start=0;
	$condition="";
	
	$sort    = isset($_REQUEST['sort'])   ? $_REQUEST['sort']   : 'designation_id';
	$dir     = isset($_REQUEST['dir'])    ? $_REQUEST['dir']    : 'ASC';
	
	$result = $objDesignationMgmt->getAllRecords(0,0,$condition,$sort,$dir);
	$total = dbRows($result);
	$i=0;
	$sectionData = array("count" => $total, "rowe" => array());
	if(dbRows($result) > 0){
		$temparray = array();
		while($row = dbArray($result)){
			$temparray["designation_id"]  = $row["designation_id"];
			$temparray["designation_name"]   = $row["designation_name"];
			$sectionData["rowe"][$i] = $temparray;   
			$i++;
		}										
	}				   		 
 	echo json_encode($sectionData);	
}
?>