<!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="tool-name_files/reset.css" media="screen">
<link rel="stylesheet" type="text/css" href="tool-name_files/main_style.css" media="screen">
<link rel="stylesheet" type="text/css" href="tool-name_files/layout.css" media="screen">
<script src="jquery-1.10.2.js"></script>
<script src="jquery-ui.js"></script>
-->
<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_mobile(f)
{
	var r =f.elements['selected_device'];
	if (r[r.length-1].checked) {
		mess = ''
		if (f.model.value == '') mess += '\nYou need to enter phome model'
		if (f.make.value == '') mess += '\nYou need to enter phome make'
		if (f.os_version.value == '') mess += '\nYou need to enter phome OS version'
		if (f.firmware.value == '') mess += '\nYou need to enter phome firmware'
		if (mess == '') return true
		alert (mess)
		return false
	}
	return true
}
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;
}
function ck_tool (f)
{
	mess = '';
	if (f.toolname.value == '') {mess += 'You need to enter tool name.';};
	if (f.toolversion.value == '') {mess += '\nYou need to enter tool version.';};
	if (mess == '' ) {return true;};
	alert(mess);
	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();
                          ?>

<!--
 	<ul id="menu">
	 <li><a id="menu1nav" href="../Federated_Testing_Home_Page.php">Home</a></li>
	 <li><a id="menu3nav" href="http://localhost/about.php">About</a></li>
	 <li><a id="menu3nav" href="mobile-definitions.html">Glossary of Mobile Device Terms</a></li>
	 <li><a id="menu2nav" href="http://localhost/cgi-bin/FAQ.php">FAQs</a></li>
	 <li><a id="menu4nav" href="http://localhost/contacts.php">Contacts</a></li>
	</ul>
-->
    		</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"> Test a Mobile Device tool</a> &gt; Creating/Editing Mobile Device List</div>
						
<h1 style="font-size:1.8em">Creating/Editing Mobile Device List</h1>

<!--<h2 style="font-size:1.7em; color:#008000">Describe Mobile Devices</h2>-->
<h2 style="font-size:1.7em; color:#008000">Describing Mobile Devices</h2>
<!--<h1>Creating/Editing Mobile Device List</h1>-->
<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 record your list of test devices. You may add a new device to the list, revise an existing device description, or delete a device.
<!--Use this page to either: (1) Describe a new device, (2) revise a device description, or (3) delete a device.-->
</p><ul>
<!--<li><b>Describe A Device:</b>-->
<li><b>Add a new device:</b> 
fill out the fields in the form after the '<i>List of Test Devices</i>' table to describe the device.
Then select the '<i>Add New Device</i>' button to save it to the list.
<li>As for testing UICC/SIM card acquisition, this is optional. If you want to test UICC/SIM card acquisition, 
select one or more phones that have a UICC/SIM card.
</li><li><b>Revise an existing device:</b> Revise an existing device description by first selecting the device you want
to change from the '<i>List of Test Devices</i>' table and filling out only the description fields that you want to change. If you
leave a field blank then the current value of the field is unchanged, however, the OS, Network and UICC/SIM
fields have default values and must always be set to the value you want.  Click the '<i>Update Selected Device</i>'
button to apply the changes.
</li>
<li><b>Delete a device:</b> First select the device you want
to remove from the '<i>List of Test Devices</i>' table then click the '<i>Delete Selected Device</i>' button to remove it.
</ul>

<form method="POST" onsubmit="return ck_mobile(this)" action="ft_mdt_update_device.php">

<?php
$have_phones = FALSE;
$root = "/media/FT-LOGS";
if (!file_exists($root)) $root = "/tmp";
$config_name = sprintf ("%s/mdt-config.txt",$root);
$dev_name = sprintf ("%s/devices.txt",$root);
/*
printf ('<br>FILES: %s %s',$config_name,$dev_name);
*/
if (file_exists($dev_name)){
	$dfile = fopen(sprintf("%s/devices.txt",$root),"r");
	/*
	echo sprintf("<br>open %s<br>",$root);
	*/
	$p_line = fgets($dfile);
	while (!feof($dfile)){
		/*
		printf ("<br>LINE: %s",$p_line);
		*/
		$the_phones [] = $p_line;
		$p_line = fgets($dfile);
		$have_phones = TRUE;
	}
}
/*
echo "<br>Start of phone list";
if ($have_phones)
	{ echo '<br>have phones';
	foreach ($the_phones as $q){
		$p = explode(';',$q);
		echo "<br>";
		echo $p[0];
		echo ' ';
		echo $p[1];
		printf (" %s %s\n",$p[2],$p[3]);
	}
}
else { echo '<br>No phones';}
echo "<br>End of phone list<br>";
*/
?>


<p><i>List of Test Devices</i></p>
<table class="bordered_table" style="position:relative;top:-13px;">
<!--<table>
<caption>
Known Mobile Devices
</caption>
-->
<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>
<!--
<tr> <td> <input name="selected_device" value="phone01" type="radio"> </td>
<td> ****MAKER*** </td>
<td> ****MODEL**** </td>
<td> iOS </td>
<td> ****OS-VERSION*** </td>
<td> ****FIRMWARE**** </td>
<td> CDMA </td>
<td> SIM/UICC </td>
</tr>
-->

<?php
if ($have_phones)
	{ 
	foreach ($the_phones as $q){
		$p = explode(';',$q);
		printf ('<tr> <td> <input name="selected_device"');
		printf (' value=%s type="radio"> </td>',$p[0]);
		printf ("<td>%s</td>",$p[1]);
		printf ("<td>%s</td>",$p[2]);
		printf ("<td>%s</td>",$p[3]);
		printf ("<td>%s</td>",$p[4]);
		printf ("<td>%s</td>",$p[5]);
		printf ("<td>%s</td>",$p[6]);
		printf ("<td>%s</td></tr>",$p[7]);
	}
} else {
echo '<tr><td><input checked="checked" name="selected_device" value="new_device" type="radio"></td><td colspan="7" align="center">Enter Another Device</td></tr>';
	
}
?>

</tbody></table>
<!--<h2>Make edits or describe new device:</h2>-->
<!--<h2>Describe a new device or edit an existing device:</h2>-->
	<h3 style="font-size:1.6em; color:#9D0F19"> <b>Describe a new device or edit an existing device:</b></h3>
<p> Enter the device manufacturer: <input name="make" type="text"><br>
</p><p> Enter the device model and model number: <input name="model" type="text"><br>
</p><p>Select the device OS: <select name="os">
<option selected="selected" value="iOS">iOS</option>
<option value="Android">Android</option>
<option value="Other">Other</option>
</select>
</p><p> Enter the device OS Version: <input name="os_version" type="text"><br>
</p><p> Enter the device firmware: <input name="firmware" type="text"><br>
</p><p>Select the device network: <select name="network">
<option selected="selected" value="CDMA">CDMA</option>
<option value="CDMA/GSM">CDMA/GSM</option>
<option value="GSM">GSM</option>
</select>
<br>
</p><p><input checked="" name="has_sim" value="sim" type="radio"> Test UICC/SIM card acquisition with this phone<br>
<input checked="checked" name="has_sim" value="nosim" type="radio"> No test of UICC/SIM card acquisition test</p>

<!-- ======================================================== -->
</div>


<br><p><input value="Add New Device" name="update" type="submit">
<input value="Update Selected Device" name="update" type="submit">
<input value="Delete Selected Device" name="delete" type="submit">

</p></form>

<!--
	<p>
	<a href="mdt.php">
	Return to Mobile Device Home Page</a><br>
	</p>
-->
<br>
		        
		</div>
		<div class="push"></div>
	</div>
    <!-- Footer Starts-->
   <!-- Footer Starts-->
        <?php
     $fn = $_SERVER["SCRIPT_FILENAME"];
          print_footer_contents($fn);
        ?>
    <!-- Footer Ends-->

    <!-- Footer Ends-->
<!--
	<div class="footer"><div class="footerContentsWrapper"><p>The National Institute of Standards and Technology (NIST) is an agency of
 the U.S. Commerce Department.</p><br><br><p class="links"><a href="../Federated_Testing_Home_Page.php">Home</a>
 &nbsp;/&nbsp; <a href="http://localhost/about.php">About</a> &nbsp;/&nbsp;
<a href="mobile-definitions.html">Glossary of Mobile Device Terms</a>
&nbsp;/&nbsp; <a href="http://localhost/FAQ.php">FAQs</a> &nbsp;/&nbsp;
<a href="http://localhost/contacts.php">Contacts</a><br><br>Federated Testing Version:
1.1-3<br>Release Date: --/--/201-</p></div></div>    <!-- Footer Ends-->



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