Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/ap/modify_ap_form.php
<?php
/* This file presents the add locations form.
 * C. Carl H Peterson 2005-2006
 * C. Port Networks LLC 2005-2006
 */  
				
if (isset($reg_error)) { 
	echo('There was an error: $reg_error, please try again.');
}
else
{
$APID=$_POST['APID'];
if ($debug) echo " AP ".$APID." AP";
$query="select dnsname,ipaddress,user,pass,macaddress,nasID,comunity,version,mib,longitude,latitude from AP where ID = '$APID'";
$result=$oreon->database->database->query($query);
$row = $oreon->database->database->fetch_object($result);
$dnsname=$row->dnsname;
$ipaddress=$row->ipaddress;
$user=$row->user;
$pass=$row->pass;
$macaddress=$row->macaddress;
$nasid=$row->nasID;
$comunity=$row->comunity;
$version=$row->version;
$latitude=$row->latitude;
$longitude=$row->longitude;
$mib=$row->mib;

if ($debug) echo " nas id ".$nasid." AP";
$query="select nasname,shortname,type,ports,secret,community,description from nas where ID = '$nasid'";
$result=$oreon->database->database->query($query);
$row = $oreon->database->database->fetch_object($result);
$nasname=$row->nasname;
$shortname=$row->shortname;
$nastype=$row->type;
$ports=$row->ports;
$secret=$row->secret;
$description=$row->description;
}
?>
		
			
<form action="phpmyprepaid.php "method="post">
<input type="hidden" name="buttonID" value="mod_ap">
<input type="hidden" name="formsubmit" value="true">
<input type="hidden" name="nasid" value="<?php echo $nasid ?>">
<table border="0">
<tr>
<td colspan="3" align="left"> <big style="font-family: Aircut"><span style="font-weight: bold; text-decoration: italic;"><b>Modify na to location <?php echo($_SESSION['LocName']); ?><br><br>Nas Information : </span></big></b></td>
	
</tr>
<tr>
	<td >
	<b>Short Name:</b> </td><td><input type="text" size="20" maxlength="40" name="dnsname" value="<?php echo $dnsname ?>">
	<td>
	</td>
<tr>
	<td>
	<b>IP Address:</b> </td><td><input type="text" size="20" maxlength="16" name="ipaddress" value="<?php echo $ipaddress ?>">
	</td>
	<td>
	</td>
</tr>
<tr>
 <td  align="left">
        <b>Nas type:    </b></td><td> 

<?php 

echo '<select name="nastype">';
$tab2=split(';',$nas_type_list);
foreach ($tab2 as $val)
	if ($nastype==$val)
		echo "<option  selected=\"selected\" value=\"$val\">$val";
	else
		echo "<option value=\"$val\">$val";
echo '</select></td></tr>';
echo '<tr>
	<td >
	<b>Port :  </b> </td><td><input size="5"  type="text" name="port" value="'.$ports.'">
	</td>

</tr>';
echo '<tr>
	<td >
	<b>Secret :  </b> </td><td><input type="text"  size="20" name="secret"  value="'.$secret.'">
	</td>

</tr>'; 
echo '<tr>
	<td>
	<b>Description :  </b>  </td><td> <input type="text"  size="40"  name="description" value="'.$description.'">
	</td>

</tr>'; 
echo '<tr>
	<td>
	<b>Mac address :  </b>  </td><td> <input type="text"  size="40"  name="macaddress" value="'.$macaddress.'">
	</td>

</tr>'; 
echo "<tr><td colspan=\"3\" ><br><big  style=\"font-family: Aircut\"><span style=\"font-weight: bold; text-decoration: italic;\">NAS information : </span></big></b></td></tr>";

echo '<tr>
	<td >
	<b>Latitude:</b></td><td> <input type="text" size="30" maxlength="100" name="latitude" value="'.$latitude.'">
	</td>
	</tr>';
echo '<tr>
	<td >
	<b>Longitude :</b></td><td> <input type="text" size="30" maxlength="100" name="longitude" value="'.$longitude.'">
	</td>
	</tr>';

if($ap['disp_snmp']==1){
		                echo("
<tr>
	<td >
	<b>Comunity:</b> </td><td>  <input type=\"text\" size=\"30\" maxlength=\"100\" name=\"comunity\" value=\"$comunity\">
	</td>
	<td>
	eg. public
	</td>
</tr>
<tr>
        <td >
	<b>Version:</b> </td><td>  <input type=\"text\" size=\"30\" maxlength=\"5\" name=\"version\" value=\"$version\">
	</td>
	<td>
	eg. 2c
	</td>
</tr>

<tr>
        <td>
	<b>Enter MIB:</b> </td><td> <input type=\"text\" size=\"30\" maxlength=\"100\" name=\"mib\" value=\"$mib\">
	</td>
	<td>
	eg. enterprises.99.7.101	
	</td>
</tr>
<tr>
	<td >
	<b>or select MIB:</b></td><td> 
	<select name=\"mib2\">
");
	foreach($ap_mib as $name=>$mib){
		echo("<option value=\"$mib\">$name</option>");
	} // EO foreach ap_mib
	print('</select></td></tr>');

}
				    
if($ap['disp_userpass']==1){ 
		echo("
<tr>
	<td>
	<b>User Name:</b> </td><td> <input type=\"text\" size=\"30\" maxlength=\"30\" name=\"user\" value=\"$user\">
	</td>
	<td>
	</td>
</tr>
<tr>
	<td >
	<b>Password:</b> </td><td> <input type=\"text\" size=\"30\" maxlength=\"30\" name=\"pass\" value=\"$pass\">
	</td>
	<td>
	</td>
</tr>");
} ?>
<tr>
	<td colspan="2" align="right">
	</td>
	<td>
	<input type="submit" class="smallButton" name="submit" value="modify NAS">
	<input type="hidden" name="APID" value="<?php echo $APID ?>">
	</td>
</tr>
			
</table>
</form>
						
Return current item: phpMyPrepaid