Location: PHPKode > scripts > eNetman > enetman-20050830/enetman/html/add-type.php
<?
error_reporting(0);
foreach ($_POST as $varname => $varvalue) {
        $$varname = $varvalue;
}
foreach ($_GET as $varname => $varvalue) {
        $$varname = $varvalue;
}
foreach ($_SERVER as $varname => $varvalue) {
        $$varname = $varvalue;
}
if($debug) {
        error_reporting(1);
        error_reporting(E_ALL);
}

echo "<form name='addmain' method='post' action='index.php?page=add.php&view=$view&nonav=1'>\n";
echo "<input type='hidden' name='action' value='add,type'>\n";
echo "<TABLE width='80%' cellspacing=0 border=0 cellpadding=0 align='center'>";
echo "<tr>";
echo "<td width='50%'>";

$query = "SELECT * FROM types";

$result = mysql_query($query);

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";

echo "\t\t\t\t<tr>\n";
echo "\t\t\t\t\t<td colspan=2 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=2 align='center' bgcolor='#CCCCCC'><img src='' width=1 height=1></td>\n";
echo "\t\t\t\t</tr>\n";

$num = mysql_num_fields($result);
$rnum = 0;
while($rnum != $num) {
        $colValue = mysql_field_name($result, $rnum);
	if(($colValue != "ID") && ($colValue != "dataType") && ($colValue != "Details")) {
		echo "\t\t\t\t<tr>\n";
                echo "\t\t\t\t\t<td bgcolor='#FFFFFF'>&nbsp;&nbsp;<b>$colValue</b></td><td bgcolor='#FFFFFF'><input class='frmStyle' type='text' name='$colValue'>\n";
                echo "\t\t\t\t</tr>\n";
	} elseif($colValue == "Details") {
		echo "\t\t\t\t<tr>\n";
                echo "\t\t\t\t\t<td bgcolor='#FFFFFF' valign='top'>&nbsp;&nbsp;<b>$colValue</b></td><td bgcolor='#FFFFFF'><textarea class='frmTAStyle' type='text' name='$colValue'></textarea>\n";
                echo "\t\t\t\t</tr>\n";
	}
	$rnum++;
}
echo "</table></td></tr></table>";

echo "<tr><td bgcolor='#ffffff'><img src='' height='20' width='1'></td></tr>";
echo "<tr><td bgcolor='#ffffff' align='center'><input class='frmStyle' type='button' value='Add $view' onClick='addmain.submit();'></td></tr>";

echo "</table>";

echo "</form>";

?>
Return current item: eNetman