-
Notifications
You must be signed in to change notification settings - Fork 0
/
StockCheckDisplaysFunctions.php
88 lines (67 loc) · 1.79 KB
/
StockCheckDisplaysFunctions.php
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
// -------------------
// --- PHP Imports ---
// -------------------
require_once('Common/Common.php');
function displayStockCheckForm($productId)
{
$actionUrl = "StockCheckPage.php";
echo '<font face="Arial" size="6">Stock Checker:</font>';
echo "<br />";
echo 'Enter a product ID to check the stock levels throughout the country.';
echo "<br />";
echo "<br />";
echo ' <form name="input" action="'.$actionUrl.'" method="get">
Product ID: <input type="text" name="productId" value="'.$productId.'" />
<input type="submit" value="Submit" />
</form>';
echo "<br />";
}
function displayStockTableIreland($productId)
{
echo '
<table width="800" id="stock" border="1">
<tr>
<th>Store Name</th>
<th>Stock Status</th>
<th> </th>
<th>Store Name</th>
<th>Stock Status</th>
</tr>';
//Irish Stores
$i=0;
$stores = getIrishStores();
while (list($storeName1, $storeId1) = each($stores))
{
list($storeName2, $storeId2) = each($stores);
$i=$i+1;
if ($i%2)
{
//not alt table row
$altText="";
}
else
{
$altText=' class="alt"';
}
echo '<tr'.$altText.'>';
echo '<td>'.$storeName1.'</td>';
echo '<td id="status'.$storeId1.'"> <span id="'.$storeId1.'"></span></td>';
echo '<SCRIPT LANGUAGE="javascript">';
echo 'updateStock("'.$productId.'","'.$storeId1.'");';
echo '</SCRIPT>';
//Check that we have two valid storeIds ... damn you wexford!
if ($storeId2 != "")
{
echo '<td></td>';
echo '<td>'.$storeName2.'</td>';
echo '<td id="status'.$storeId2.'"> <span id="'.$storeId2.'"></span></td>';
echo '<SCRIPT LANGUAGE="javascript">';
echo 'updateStock("'.$productId.'","'.$storeId2.'");';
echo '</SCRIPT>';
}
echo '</tr>';
}
echo '</table>';
}
?>