我撰写了相当出色的字句,根据与其他领域相匹配的制约因素,把3个领域退回。 根据最后结果,委员会有3项成果,将回报结果2。
public function ListRoomTotals($room, $date, $dateTo = null) {
// If dateTo hasn t been set, make it now
if(!isset($dateTo) or $dateTo == "") {
$dateTo = $date;
}
// Return an array with each bundle number and the quantity for each day
$scanner = $this->GetScannerNumber($room);
$sql = "SELECT * FROM `scanners` WHERE `Scanner` IN (";
foreach($scanner as $x) {
$sql .= $x . ",";
}
$sql .= "0)
AND `Date` BETWEEN " . $date . " AND " . $dateTo . "
GROUP BY `KordNo`, `BundleNumber`;";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
$sql = "SELECT `BundleReference`, `QtyIssued`, `WorksOrder`,
FROM `ArchiveBundle`
WHERE `KordNo` = " . $row[ KordNo ] . "
AND `BundleNumber` = " . $row[ BundleNumber ] . " ;";
$result2 = mysql_query($sql);
while($row = mysql_fetch_array($result2)) {
$sql = "SELECT `ArchiveBundle`.`QtyIssued`, `ArchiveBundle`.`WorksOrder`,
`ArchiveBundle`.`Colour`, `ArchiveBundle`.`Size`
FROM `ArchiveBundle`
WHERE `ArchiveBundle`.`KordNo` = " . $x[ KordNo ] . " AND
`ArchiveBundle`.`BundleNumber` = " . $x[ BundleNumber ] . " ;";
$result3 = mysql_query($sql);
$row = mysql_fetch_row($result3);
// Now we need to query what the product group is
$sql = "SELECT `Stock`.`ProductGroup`
FROM `Stock`, `TWOrder`
WHERE `TWOrder`.`WorksOrderNumber` = " . $row[1] . " AND
`TWOrder`.`Colour` = " . $row[2] . " AND
`TWOrder`.`Size` = " . $row[3] . " AND
`Stock`.`ProductCode` = `TWOrder`.`Product`;";
$result4 = mysql_query($sql);
$row2 = mysql_fetch_row($result4);
if(in_array($row2[0], array(50, 100, 150, 300 , 350 , 925 ,930, 940)))
{
while($row = mysql_fetch_array($result2)) {
if($row[0] != "") {
$final[] = $row;
} else {
$final[] = array("Can t find bundle number", "N/A");
}
}
}
return $final;
}
我可以在以下一页使用这一功能。
$result = $scanner->ListRoomTotals($_GET[ room ], $_GET[ date ]);
$total = 0;
foreach($result as $x) {
$content .= "<tr>
<td>" . $x[0] . "</td>
<td>" . $x[1] . "</td>
</tr>";
$total += $x[1];
}
$weeklyTotal += $total;
$content .= "<tr><td>Total Pairage:</td><td>" . $total . " </td></tr>
<tr><td>Total Dozens:</td><td>" . number_format($total/12,2) . "</td></tr></table>
</td>
我知道,它可能写得很坏,因为它是没有正确归还的主要原因。 是否有任何人可能建议分裂。 我很粗略地讲,在php上,我对它的理解很差。 谢谢。