<?php
require "commonincludefiles.php";

$out = "";
$xaction = "";
$data = "";

$start =0;
$limit = 30;

$where = '';
$qs = '';

$order_field = "";
$order_type  = "";

$sort    = isset($_REQUEST['sort'])   ? $_REQUEST['sort']   : '';
$dir     = isset($_REQUEST['dir'])    ? $_REQUEST['dir']    : 'ASC';

if (isset($_REQUEST["xaction"])) {
	$xaction = $_REQUEST["xaction"];
}
if (isset($_REQUEST["data"])) {
	$data = $_REQUEST["data"];
}

if ($sort != "") 
{
   if($sort=="config_id")
   { 
   	  $order_field = "config_id";
	  $order_type  = $dir;
   }	
   else 
   { 
     $order_field = $sort;
	 $order_type  = $dir;
   } 		
}

	$objSiteConfigDetailMgmt = new siteConfigDetailMgmt();

	$arr = array();
	$k=0;
	$where .= "";
	
	$rs = $objSiteConfigDetailMgmt->getMasterRecords($limit,$start,$where,$order_field,$order_type);
	
	$total = $objSiteConfigDetailMgmt->getCountRecords(0,0,$where,"","");
	
	while($obj = dbObject($rs)) {
	
		$arr[$k] = $obj;  
		$k++;
	}
	echo '{"total":"'.$total.'","data":'.json_encode($arr).'}';
?>