One if() instead of two ?:

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@106 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2007-07-10 20:26:17 +00:00
parent a9907f186c
commit 362210876a

View file

@ -63,20 +63,22 @@ if ($_POST) {
<form action="" method="post" enctype="multipart/form-data"> <form action="" method="post" enctype="multipart/form-data">
<?php <?php
echo ($fields ? "<table border='0' cellspacing='0' cellpadding='2'>\n" : ""); if ($fields) {
foreach ($fields as $name => $field) { echo "<table border='0' cellspacing='0' cellpadding='2'>\n";
echo "<tr><th>" . htmlspecialchars($name) . "</th><td>"; foreach ($fields as $name => $field) {
if (!isset($data)) { echo "<tr><th>" . htmlspecialchars($name) . "</th><td>";
$value = $field["default"]; if (!isset($data)) {
} elseif (strlen($data[$name]) && ($field["type"] == "enum" || $field["type"] == "set")) { $value = $field["default"];
$value = intval($data[$name]); } elseif (strlen($data[$name]) && ($field["type"] == "enum" || $field["type"] == "set")) {
} else { $value = intval($data[$name]);
$value = $data[$name]; } else {
$value = $data[$name];
}
input($name, $field, $value);
echo "</td></tr>\n";
} }
input($name, $field, $value); echo "</table>\n";
echo "</td></tr>\n";
} }
echo ($fields ? "</table>\n" : "");
?> ?>
<p> <p>
<input type="hidden" name="token" value="<?php echo $token; ?>" /> <input type="hidden" name="token" value="<?php echo $token; ?>" />