if ($type=='1'){
echo "<table>\n\r<tr>\n\r<th>Код Товара</th>\n\r<th>Количество</th>\n\r<th>Наименование</th>\n\r</tr>"."\n\r";
$ar_1=array("");
$i=1;
while ($i<$number) {
if (in_array($ar_code[$i],$ar_1)==false) {
$query3="SELECT `producer`,`name` FROM `orders_items` WHERE `code`=$ar_code[$i]";
$result3 = mysql_query($query3);
$number3 = MYSQL_NUMROWS($result3);
$query6="SELECT SUM(count) AS kolvo FROM `orders_items` WHERE `code`=$ar_code[$i]";
$result6 = mysql_query($query6);
$SthisItC = mysql_result($result6,0,"kolvo");
$Sprod3 = mysql_result($result3,0,"producer");
$Snaim3 = mysql_result($result3,0,"name");
$ar_1[$i]=$ar_code[$i];
$cc1=substr($ar_code[$i], 0, 1);
if (($disks=='on' and $cc1=='4') OR ($tyres=='on' and $cc1=='1')) {
echo "<tr>\n\r<td>".$ar_code[$i]."</td>\n\r<td>".$SthisItC."</td>\n\r<td>".$Sprod3." - ".$Snaim3."</td>\n\r</tr>\n\r";
}
}
$i++;
};
echo "</table>";