<?php 
require "../commonincludefiles.php";
if($_SESSION["VedantnrCollegeId"]!="" && isset($_SESSION["VedantnrCollegeId"]))
{
	
	$objDesignationMgmt = new DesignationMgmt();
	$limit=0;
	$start=0;
	$condition="";
	
	$sort    = isset($_REQUEST['sort'])   ? $_REQUEST['sort']   : 'designation_id';
	$dir     = isset($_REQUEST['dir'])    ? $_REQUEST['dir']    : 'ASC';
	
	//$order_field="designation_id";
	//$order_type="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_nameeng"]   = $row["designation_nameeng"];
					$temparray["designation_nameguj"]   = $row["designation_nameguj"];
					$temparray["designation_type"]   = $row["dept_type"];
					$temparray["designation_priority"]   = $row["designation_priority"];
					$sectionData["rowe"][$i] = $temparray;   
				$i++;
			}										
	}				   		 
 	echo json_encode($sectionData);	
}
?>