Location: PHPKode > projects > JaxBlog > JaxBlog/module/JaxTable/example.php
<?php
$request = isset($_GET['request']) ? $_GET['request'] : '';
$test = isset($_GET['test']) ? $_GET['test'] : '';

if ($request == 'xml') {
	header('Content-Type: text/xml');
	echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
	
	sleep(1.5);
	
	if ($test == 'test_empty') {
		echo "<root></root>\n";
		
	} else {
		$xml = "";
		$xml .= "<root>\n";
		$xml .= "	<list_titles>\n";
		$xml .= "		<record>ID</record>\n";
		$xml .= "		<record>First Name</record>\n";
		$xml .= "		<record>Last Name</record>\n";
		$xml .= "	</list_titles>\n";
		$xml .= "	<list_data>\n";
		$xml .= "		<record>\n";
		$xml .= "			<a0>001</a0>\n";
		$xml .= "			<a1>Daniel</a1>\n";
		$xml .= "			<a2>Juliano</a2>\n";
		$xml .= "		</record>\n";
		$xml .= "		<record>\n";
		$xml .= "			<a0>002</a0>\n";
		$xml .= "			<a1>Dan</a1>\n";
		$xml .= "			<a2>Dudley</a2>\n";
		$xml .= "		</record>\n";
		$xml .= "		<record>\n";
		$xml .= "			<a0>003</a0>\n";
		$xml .= "			<a1>Chris</a1>\n";
		$xml .= "			<a2>Freeman</a2>\n";
		$xml .= "		</record>\n";
		$xml .= "		<record>\n";
		$xml .= "			<a0>004</a0>\n";
		$xml .= "			<a1>Bob</a1>\n";
		$xml .= "			<a2>Blaney</a2>\n";
		$xml .= "		</record>\n";
		$xml .= "	</list_data>\n";
		$xml .= "</root>\n";
		echo $xml;
	}
	
	exit;
}

if ($test == 'second_column') {
	$onload = "jaxTable";
	$onload = "jaxTableRegister('example.php?request=xml', 'example');";
} elseif ($test == 'test_empty') {
	$onload = "jaxTableRegister('example.php?request=xml&test=test_empty', 'example');";
} else {
	$onload = "jaxTableRegister('example.php?request=xml', 'example');";
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<link type="text/css" rel="stylesheet" href="jax-table.css">
<script language="JavaScript" type="text/javascript" src="../common/jax-xmlhttprequest.js"></script>
<script language="JavaScript" type="text/javascript" src="../common/jax-common.js"></script>
<script language="JavaScript" type="text/javascript" src="../common/jax-effect.js"></script>
<script language="JavaScript" type="text/javascript" src="../common/jax-highlight.js"></script>
<script language="JavaScript" type="text/javascript" src="jax-table.js"></script>

<style type="text/css">
table { border: 1px solid #000000; }
</style>

<body onLoad="<?=$onload?>">

<div class="example_indent">
	<div id="example"></div>
</div>

<a href="example.php">Test with normal xml return</a><br />
<a href="example.php?test=second_column">Test with default sort ascending second column</a><br />
<a href="example.php?test=test_empty">Test with empty xml return</a>

</body>
</html>
Return current item: JaxBlog