jqGrid Example – PHP

	$param_array = $_GET;
	$page = $util->filterArrayValue($param_array, 'page', 'Page', 'int', false);
	$limit = $util->filterArrayValue($param_array, 'rows', 'Rows', 'int', false);
	$sidx = $util->filterArrayValue($param_array, 'sidx', 'Index Row', 'text', false);
	$sord = $util->filterArrayValue($param_array, 'sord', 'Direction', 'text', false);


if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
	header("Content-type: application/xhtml+xml;charset=utf-8"); 
} else {
	header("Content-type: text/xml;charset=utf-8");

$et = ">";
$output = "<?xml version='1.0' encoding='utf-8'?$et\n";
$output .= "<rows>";
$output .= "<page>".$page."</page>";
$output .= "<total>".$total_pages."</total>";
$output .= "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_assoc($result)) {
	$output .= "<row id='". $row['id']."'>";

		foreach($column_array as $key => $value){
			$output .= '<cell><![CDATA[' . $row[$value] . ']]></cell>';
	$output .= "</row>";
$output .=  "</rows>";	

echo $output;

3 thoughts on “jqGrid Example – PHP

  1. I was suggested this akley australia blog by way of my cousin. I am no longer certain whether or not this publish is written by him as no one else recognize such special about my difficulty. You’re incredible! Thanks!

  2. A lot of thanks for all of your hard work on this web site. Kate really likes getting into research and it is easy to see why.mulberry bags uk mulberry purse sale , We learn all about the compelling medium you give efficient items through your web blog and as well as foster response from other ones on that subject matter then our own girl mulberry sale bags is without a doubt mulberry handbags sale studying so much. Take pleasure in the rest of the year. You are always carrying out a dazzling job.

  3. My partner and I stumbled over here from a different web page and thought I should check things out.
    I like what I see so now i am following you. Look forward to looking over
    your web page repeatedly.

Comments are closed.