[go: up one dir, main page]

Menu

[r20]: / stockTable.php  Maximize  Restore  History

Download this file

58 lines (49 with data), 3.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
include('includes/databaseLogin.php');
include('includes/installedLanguage.php');
echo "<!DOCTYPE html>";
?>
<html>
<head>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<?php
if(isset($_POST[sCode])){
echo "<table cellspacing=\"0\" style=\"width: 100%;\">";
echo "<tr><td style=\"width: 10%;\" align=\"center\"><b>" . _T("Code") . "</b></td><td style=\"width: 15%;\" align=\"center\"><b>" . _T("Name") . "</b></td><td style=\"width: 40%;\" align=\"center\"><b>" . _T("Description") . "</b></td><td style=\"width: 10%;\" align=\"center\"><b>" . _T("Position") . "</b></td><td style=\"width: 10%;\" align=\"center\"><b>" . _T("Quantity") . "</b></td><td style=\"width: 10%;\" align=\"center\"><b>" . _T("Status") . "</b></td><td style=\"width: 5%;\" align=\"center\"><b>" . _T("Select") . "</b></td></tr>";
$getProduct = mysql_query("SELECT * FROM products WHERE productStatusInStock REGEXP '^$_POST[pSIS]' AND productName REGEXP '^$_POST[pName]' AND productClinicCode REGEXP '^$_POST[pCode]' AND productDescription REGEXP '^$_POST[pDesc]' AND productStatus REGEXP '^$_POST[pStat]' ORDER BY productName");
$productCount = 0;
while($row = mysql_fetch_array($getProduct)) {
//Devo ancora fare il controllo sulla quantità
if(($_POST[pQuty]=='') || (($_POST[pSear] == '0') && ($_POST[pQuty] <= $row[productQuantity])) || (($_POST[pSear] == '1') && ($_POST[pQuty] >= $row[productQuantity])) || (($_POST[pSear] == '2') && ($_POST[pQuty] == $row[productQuantity]))){
$color='#FFFFFF';
if($row[productQuantity] <= $row[productLowerBound]){
$color='#FFFFC2';
}
if($row[productQuantity] == 0){
$color='#FFCCFF';
}
if($row[productStatus] > 0){
$statoProdotto = _T("In order");
}else{
$statoProdotto = _T("---");
}
$getCartPos = mysql_query("SELECT * FROM cart WHERE cartProductId = '$row[productID]'");
if(mysql_num_rows($getCartPos)){
echo "<tr bgcolor=" . $color . "><td align=\"center\">" . $row[productClinicCode] . "</td><td align=\"center\"><a class=\"aProductTitle\" name=\"" . $row[productID] . "\" href=\"#\">" . $row[productName] . "</a></td><td align=\"center\">" . $row[productDescription] . "</td><td align=\"center\">" . $row[productInStockPosition] . "</td><td align=\"center\">" . $row[productQuantity] . "</td><td align=\"center\">" . $statoProdotto . "</td><td align=\"center\"><input type=\"checkbox\" class=\"cCart\" name=\"p#" . $productCount . "_" . $row[productName] . "\" id=\"p#" . $productCount . "\" value=\"" . $row[productID] . "\" checked=\"checked\"></td></tr>";
}else{
echo "<tr bgcolor=" . $color . "><td align=\"center\">" . $row[productClinicCode] . "</td><td align=\"center\"><a class=\"aProductTitle\" name=\"" . $row[productID] . "\" href=\"#\">" . $row[productName] . "</a></td><td align=\"center\">" . $row[productDescription] . "</td><td align=\"center\">" . $row[productInStockPosition] . "</td><td align=\"center\">" . $row[productQuantity] . "</td><td align=\"center\">" . $statoProdotto . "</td><td align=\"center\"><input type=\"checkbox\" class=\"cCart\" name=\"p#" . $productCount . "_" . $row[productName] . "\" id=\"p#" . $productCount . "\" value=\"" . $row[productID] . "\"></td></tr>";
}
$productCount++;
}
}
//echo "<script> setBoxNumber(" . $productCount . "); </script>";
echo "<iframe style=\"display:none\" id=\"cartIframe\" src=\"\"></iframe>";
echo "</table>";
}else{
//ERROR
}
?>
</body>
</html>