Location: PHPKode > scripts > eNetman > enetman-20050830/enetman/html/edit-type.php
<?
echo "<TABLE width='20%' cellspacing=0 border=0 cellpadding=0 align='center'>";
echo "<tr>";
echo "<td>";

$query = "SELECT * FROM types WHERE ID=$ID";

$result = mysql_query($query);

echo "<form name='updatemain' method='post' action='index.php?page=edit-type.php&view=$view&ID=$ID'>\n";
echo "<input type='hidden' name='action' value='update,type,$ID'>\n";
echo "<table bgcolor='000000' cellpadding=0 border=0 cellspacing=0 align='center' width='100%'>\n";
echo "\t<tr>\n";
echo "\t\t<td>\n";
echo "\t\t\t<table cellpadding=0 border=0 cellspacing=1 width='100%'>\n";

$num = mysql_num_fields($result);

echo "\t\t\t\t<tr>\n";
echo "\t\t\t\t\t<td colspan=$num align='center' bgcolor='#D3DCE3'><h3><b>$view</b></td>\n";
echo "\t\t\t\t</tr>\n";

echo "\t\t\t\t<tr>\n";
echo "\t\t\t\t\t<td colspan=$num align='center' bgcolor='#CCCCCC'><img src='' width=1 height=1></td>\n";
echo "\t\t\t\t</tr>\n";

$n=0;
$line = mysql_fetch_array($result, MYSQL_ASSOC);
foreach ($line as $col_value) {
	$title = mysql_field_name($result,$n);
	if($title == "ID") {
		echo "\t\t\t\t<tr>\n";
		echo "\t\t\t\t\t<td bgcolor='#FFFFFF'>&nbsp;&nbsp;<b>$title</b></td><td bgcolor='#FFFFFF'>&nbsp;&nbsp;$col_value</td>\n";
		echo "\t\t\t\t</tr>\n";
	} elseif ($title == "Details") {
		echo "\t\t\t\t<tr>\n";
                echo "\t\t\t\t\t<td valign=top bgcolor='#FFFFFF'>&nbsp;&nbsp;<b>$title</b></td><td bgcolor='#FFFFFF'>&nbsp;&nbsp;<textarea class='frmTAStyle' type='text' name='$title'>$col_value</textarea>\n";
                echo "\t\t\t\t</tr>\n";
	} elseif ($title != "dataType") {
		echo "\t\t\t\t<tr>\n";
                echo "\t\t\t\t\t<td bgcolor='#FFFFFF'>&nbsp;&nbsp;<b>$title</b></td><td bgcolor='#FFFFFF'>&nbsp;&nbsp;<input class='frmStyle' type='text' name='$title' value='$col_value'>\n";
                echo "\t\t\t\t</tr>\n";
	}
	$n++;
}

echo "\t\t\t\t<tr>\n";
echo "\t\t\t\t\t<td colspan=2 align='center' bgcolor='#FFFFFF'><input type='button' value='Update' class='frmStyle' onClick='updatemain.submit();'>&nbsp;&nbsp<input type='button' value='Delete' onClick=\"deletefull('index.php?page=types.php&view=$view','type','$ID');\"class='frmStyle'></td>\n";
echo "\t\t\t\t</tr>\n";
echo "\t\t\t</table>\n";
echo "\t\t</td>\n";
echo "\t</tr>\n";
echo "</table>\n";
echo "</form>";

mysql_free_result($result);

echo "</td></tr></table>";


mysql_close($link);

?>
Return current item: eNetman