<?php

// Call in the XComponents engine and options file

define('MOD_PHP', substr(PHP_SAPI, 0, 3) != 'cgi'); // Are we running as mod_php?

define('DOCROOT', 

	MOD_PHP && isset($_SERVER['DOCUMENT_ROOT']) ? 

		$_SERVER['DOCUMENT_ROOT'] : 

		(

			MOD_PHP && isset($_SERVER['SCRIPT_FILENAME']) ? 

				substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])) : 

				(

					substr(str_repeat('../', count(explode('/', preg_replace('_/+_', '/', $_SERVER['PHP_SELF'])))-2), 0, -1) != '' ?

						substr(str_repeat('../', count(explode('/', preg_replace('_/+_', '/', $_SERVER['PHP_SELF'])))-2), 0, -1) :

						'.'

				)

		)

	);

include(DOCROOT . '/dmx/dmx_options.php');

include(DOCROOT . '/dmx/core/php/dmx_shop_handler.php');

include(DOCROOT . '/dmx/core/php/dmx_shop_components.php');



// Abs code starts here

$abs_root = '';

@include(DOCROOT . '/abs_version_control.php');

include(DOCROOT . $abs_root . '/common/header.php');

?>



<!-- MAIN CONTENT AREA -->

<div id="main_area" onmouseover="sub_menu_hide();">

	<div id="main_area_content">

		

		<div class="main_column">

		<!-- ----------------- -->

		<!-- BEGIN MAIN COLUMN -->

		<!-- ----------------- -->

			

<h1 class="developer_highlight">best.php demo</h1>



<pre>

// USES (Page Environment variables)

// $abs_subject['range'], which contains the 'number range' that the page is about

//

// EXPECTS

// No additional parameters

</pre>



<?php if (!(isset($_REQUEST['abs_display']) && $_REQUEST['abs_display'])) : ?>

<form method="get">

<input name="abs_display" type="hidden" value="1"> 

<table>

<tr>

	<td style="text-align: right">$abs_range</td>

	<td>

		<select name="abs_range">

			<option>0800</option>

			<option>0844</option>

			<option>0845</option>

			<option>0870</option>

			<option>0871</option>

			<option>0207</option>

			<option>07-D</option>

			<option>07-K</option>

		</select>

	</td>

</tr>

<tr>

	<td style="text-align: right;"></td>

	<td><input type="submit" value="Show Adapting Body"></td>

</tr>

</table>

</form>

<?php endif; ?>





		<!-- --------------- -->

		<!-- END MAIN COLUMN -->

		<!-- --------------- -->

		</div>

		

		<div class="sidebar">

		<!-- ------- -->

		<!-- SIDEBAR -->

		<!-- ------- -->



<div class="sidebar_box_heading">

	<h2>Controls</h2>

</div>

<div class="sidebar_box_content">

	<div>

		

		<br>

		

		<p>

		<a href="<?=$_SERVER['PHP_SELF'];?>">Restart test</a>

		</p>

		

		<p>

		<a href="index.php">Adapting body index page</a>

		</p>

				

	</div>

</div>



		<!-- ----------- -->

		<!-- END SIDEBAR -->

		<!-- ----------- -->

		</div>

		

		<br style="clear: both;">



<?php

if (isset($_REQUEST['abs_display']) && $_REQUEST['abs_display']) {

	// Prepare variables for adapting body based on test harness input

	$abs_subject['range'] = $_REQUEST['abs_range'];

}

?>



<?php if (isset($_REQUEST['abs_display']) && $_REQUEST['abs_display']) : ?>

<h2 class="developer_highlight">Test values</h2>

<table>

<tr>

	<td style="text-align: right">$abs_subject['range'] : </td>

	<td><?=$abs_subject['range'];?></td>

</tr>

</table>



<h2 class="developer_highlight">Output</h2>

	

<?php include($abs_adapt_body . 'best.php'); ?>



<?php endif; ?>



	</div>

</div>

<!-- END MAIN CONTENT AREA -->



<?php include(DOCROOT . $abs_root . '/common/footer.php'); ?>

