wyglada to tak:
http://paszkfil.robi.to/projekty_www/mle.jpg
napisane jest to tak:
$pdo -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $pdo -> query("SELECT id, id_kt, id_x, descr, software, \"user\", whereis, old_id, ignored, indomain, history, grp, alias, data, label FROM computers WHERE id_kt='KT347' OR id_kt='KT227' OR id_kt='KT230' OR id_kt='KT336' ORDER BY id_kt desc");
$pdo -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "<table width=\"100%\" height=\"0\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\">";
while($row = $stmt -> fetch())
{
$units="SELECT unit.serial, unit.descr, category.txt as category, unit.price, unit.delivery, unit.waranty, unit.fuck, unit.status FROM
unit, category WHERE id_cmp='".$row['id']."' AND unit.category=category.id ORDER BY category.txt asc";
$unit = $pdo -> query($units);
$units=$unit->fetchall();
$no=count($units);
echo "<tr>";
echo "<td width=\"10%\" class=\"belka\">KT no. / Alias</td>";
echo "<td width=\"20%\" class=\"belka\"><center><B><H1>".$row['id_kt']."</H1></B></center></td>";
echo "<td width=\"15%\" class=\"belka\"><center><B><H1>".$row['descr']."</H1></B></center></td>";
echo "<td width=\"10%\" class=\"belka\"><center><B>".$row['user']."</B></center> </td>";
echo "<td width=\"5%\" class=\"belka\"><center><B>".$row['whereis']."</B></center></td>";
echo "<td width=\"5%\" class=\"belka\"><center><B>last mod.<BR>".$row['data']."</B></center></td>";
echo "<td width=\"5%\" class=\"belka\"><center><B>cos</B></center></td>";
echo "<td width=\"30%\" class=\"belka\" align=\"left\">".$row['old_id']."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"10%\" class=\"table_th\">Type</td>";
echo "<td width=\"20%\" class=\"table_th\"><B>Item</B></td>";
echo "<td width=\"15%\" class=\"table_th\"><B>Serial no.</B></td>";
echo "<td width=\"10%\" class=\"table_th\">FV</td>";
echo "<td width=\"5%\" class=\"table_th\">Warranty</td>";
echo "<td width=\"5%\" class=\"table_th\">From</td>";
echo "<td width=\"5%\" class=\"table_th\">Price</td>";
echo "<td width=\"30%\" class=\"table_th\">History:</td>";
echo "</tr>";
$rowspan_test=false;
foreach ( $units as $row1 )
{
echo "<tr>\n\r";
echo "<td class=\"belka\" width=\"10%\" >".$row1['category']."</td>\n\r";
echo "<td class=\"txt\" width=\"20%\">".$row1['descr']."</td>\n\r";
echo "<td class=\"txt\" width=\"15%\">".$row1['serial']."</td>\n\r";
echo "<td class=\"txt\" width=\"10%\"><center>".$row1['fuck']."</center></td>";
echo "<td class=\"txt\" width=\"5%\"><center>".$row1['waranty']."</center></td>\n\r";
echo "<td class=\"txt\" width=\"5%\"><center>".$row1['delivery']."</center></td>";
echo "<td class=\"txt\" width=\"5%\"><center>".$row1['price']."</center></td>\n\r";
if ($rowspan_test===false)
{
echo "<td rowspan=\"".($no)."\" class=\"t1\" width=\"30%\"><pre>".$row['history']."</pre></td>\n\r";
$rowspan_test=true;
}
}
echo "</tr>\n\r";
echo "<tr>\n\r";
echo "<td colspan=\"8\">\n\r";
echo "<BR>";
echo "</td>\n\r";
echo "</tr>\n\r";
}
$stmt -> closeCursor();
echo "</TABLE>\n\r";
echo "<BR>";