<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CFTT Federated Testing CD - test a Mobile Device tool</title>
<link rel="stylesheet" type="text/css" href="../css/reset.css" media="screen" />
<link rel="stylesheet" type="text/css" href="../css/main_style.css" media="screen" />
<link rel="stylesheet" type="text/css" href="../css/layout.css" media="screen" />
<script>
function ck_selection(f)
{
#	ok = false
	ok = true
	var r =f.elements['selected_device'];
	for (ix = 0, lx = r.length; ix < lx; ix++){
		if (r[ix].checked) {ok = true}
	}
	if (ok) return true
	alert('No device selected, You have to select a device');
	alert(r)
	return false;
}
function ck_selection1(f)
{
	mess = 'fix this mess';
	if (f.selected_device.value == '')
	{
		alert('You need to select a device');
		return false;
	}
	mess += ':\n'+f;
	mess += ':\n'+f.selected_device[0].value;
	alert(mess+': '+f.selected_device.value);
	return false;
}
</script>
<style>
	table, th, td {
	   border-collapse: collapse;
	   border: 1px solid black;
	   } 
	tr {
	   border-collapse: collapse;
	   border: 2px solid black;
	   } 
</style>
</head>
<body id="menu1">
	<div id="mainWrapper">
		<div id="topBannerContainer">
			<div id="logoContainer">
  				<img src="../images/banner.png" alt="CFTT Federated Testing - NIST">
			</div>
            <!-- Menu Starts-->
			<div id="menuContainer">
				  <?php
						include '../include/global.php';
						print_main_horizontal_menu_contents();
				  ?>
    		</div>
            <!-- Menu Ends-->
		</div>
		<!-- TopBanner Ends-->
	  
		<!-- Main Content Starts-->	
		<div id="subContentContainer">
		  <div id="leftContent">
		    <div id="leftLinks">
<div>
<?php
include '../include/mdt-global.php';
?>
		    </div>
		    </div>
		  </div>			
		  <div id="rightContent">
<!--		    <div id="breadcrumb"><a href="../Federated_Testing_Home_Page.php">Home</a> > Test a disk imaging tool</div>-->
			<div id="breadcrumb"><a href="../Federated_Testing_Home_Page.php" class="nav">Home</a> &gt; <a href="/mobiledevice/mdt.php" class="nav"> Mobile Device Testing Home</a> &gt; Recording Device Setup</div>			

<?php
	
$continue = 1;

// is_ftlogs_mounted() returns the path to where we should store log files (e.g.,  
// /tmp or /media/FT-LOGS). It also checks if the user has mounted their log drive.
// is_ftlogs_mounted() will return 0/false and print an error message if the 
// user's log drive is not mounted
$root = is_ftlogs_mounted(FALSE);

if (!$root) { 
	// if the user's log drive isn't mounted, don't continue
	$continue = 0;
}

// if the user's log drive isn't mounted, don't continue
if ($continue){	
	$have_phones = FALSE;
	$dev_name = sprintf ("%s/devices.txt",$root);

	if (file_exists($dev_name)){
		$dfile = fopen($dev_name,"r");

		$p_line = fgets($dfile);
		while (!feof($dfile)){
			//printf ("<br>LINE: %s",$p_line);
			$the_phones [] = $p_line;
			$p_line = fgets($dfile);
			$have_phones = TRUE;
		}
	}

	$start_page_and_table = <<<YYY
<h1 style="font-size:1.8em">Recording Device Setup (1 of 3)</h1>
<h2 style="font-size:1.7em; color:#008000">Selecting a Mobile Device</h2>
<div style="padding: 0em 1em .25em .5em; background: #eeeeee url(/images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x;">
<!-- ======================================================== -->
<!--<p>Use this page to select device to record setup.</p>-->
<p>Use this page to select a device to document its setup. Select a device from the '<i>List of Test Devices</i>' table below, then click the '<i>Continue</i>' button.</p>
<form method="POST" onsubmit="return ck_mobile(this)"
action="ft_mdt_record_setup.php">
<p><i>List of Test Devices</i></p>
<table class="bordered_table" style="position:relative;top:-13px;">
<tbody><tr>
<th><b>Select</b></th>
<th><b>Make</b></th>
<th><b>Model</b></th>
<th><b>OS</b></th>
<th><b>Version</b></th>
<th><b>Firmware</b></th>
<th><b>Network</b></th>
<th><b>SIM/UICC</b></th>
</tr>
YYY;

	$close_table_and_form = <<<YYY
</tbody></table>
<!-- ======================================================== -->
</div><br>
<!--<input value="Record Setup for Selected Device" name="select" type="submit">-->
&nbsp;&nbsp;&nbsp;&nbsp;<input value="Continue" name="select" type="submit">
</form>
YYY;
			  
	echo $start_page_and_table; // print first part of page
	include '../include/mdt-ptab.php'; // print table contents
	echo $close_table_and_form; // print remainder of page
}
?>
<!--
	<p>
	<a href="mdt.php">
	Return to Mobile Device Home Page</a><br>
	</p>
-->
<br>		        
		</div>
		<div class="push"></div>
	</div>
    <!-- Footer Starts-->
        <?php
     $fn = $_SERVER["SCRIPT_FILENAME"];
          print_footer_contents($fn);
        ?>
    <!-- Footer Ends-->

</div></body></html>
