<body bgcolor="#d3d3d3">
<?php include("includes/connect.php"); ?>
<p style="font-family:Arial,sans-serif; font-size:18px; color:blue">System: <?php echo $_POST['System'];?></p>
<hr size="1" noshade>
<?php $phpself=$_SERVER["PHP_SELF"]; ?>
<form action="$phpself" method="post">
<input type="submit" name="ausrechnen">
<hr size="1" noshade>
<br>
<?php
$System = $_POST['System'];
$query_string = mysql_query("SELECT DISTINCT Komponentenbezeichnung,Komponentenanzahl FROM haupttabelle where Systembezeichnung ='$System'",$connection);
$column_count = mysql_num_fields($query_string);
print("<TABLE BORDER=2>\n");
print("<TR ALIGN=LEFT VALIGN=TOP >");
print("<TD><p><STRONG>KOMPONENTEN</STRONG></p></TD>\n");
print("<TD><p><STRONG>MTBF</STRONG></p></TD>\n");
print("<TD><p><STRONG>MTBIF</STRONG></p></TD>\n");
print("<TD><p><STRONG>MTBSC</STRONG></p></TD>\n");
print("<TD><p><STRONG>MENGE</STRONG></p></TD>\n");
print("<TD><p><STRONG>MTBF_New</STRONG></p></TD>\n");
print("<TD><p><STRONG>MTBIF_New</STRONG></p></TD>\n");
print("<TD><p><STRONG>MTBSC_New</STRONG></p></TD>\n");
print("</TR>\n");
print("<TR ALIGN=LEFT VALIGN=TOP >");
print("</TR>\n");
while ($row = mysql_fetch_array($query_string)){
print("<TR ALIGN=LEFT VALIGN=TOP>");
for ($column_num = 0;$column_num < $column_count;$column_num++)
print ("<TD>$row[$column_num]</td>");
print ("<TD><p></p></TD>");
print ("<TD><p></p></TD>");
print ("<TD><input type=’text’ name=’eingabe$column_num’ size=’22’ maxlength=’14’></TD>");
if(isset($_GET['ausrechnen']))
{
$feld="eingabe" . $column_num;
$ergebnis= $row['column_num']*$_GET[$feld];
print ("<TD><input type='text' name='ergebnis$column_num' value='$ergebnis'></TD>");
}
else
{
print ("<TD><input type='text' name='ergebnis$column_num' value='eingabe'></TD>");
}
print ("<TD><p></p></TD>");
print ("<TD><p></p></TD>");
print("</TR>\n");
}
print("</TABLE>\n");
?>
<?php include("includes/disconnect.php"); ?>
</form>