<div id="main" class="span-24 last"> <h2>Administration</h2><h3>Stock</h3> <br /> <form action = "admin-stock.php" method = "get"> <label for="inv_item">Choose Inventory Item: </label> <span id="inv_item"> <input id="autocompleteItem" name="item"></input> </span> <input id="submitBTN" type="submit" value="Submit" /> </form> <?php if (isset($_GET['item'])) { try { $inv_stocks = Inv_stock::findByItem($_GET['item']); $item = new Inv_item($_GET['item']); printf("<br /><h3>%s - %s</h3><table><thead><tr><th>Branch</th><th>Quantity</th><th width=\"100\">Update</th></tr></thead><tbody>", $item->prepareId(), $item->prepareDescription()); foreach ($inv_stocks as $inv_stock) { $branch = new Branch($inv_stock->getBranchId()); printf("<tr><td>%s</td><td><input type=\"text\" value=\"%s\" /> %s</td><td><input class=\"updateBTN\" id=\"%s\" type=\"button\" value=\"Update\"/></td></tr>", $branch->prepareName() . " [" . $branch->prepareId() . "]", $inv_stock->getQuantity(), $item->prepareUnitOfMeasure(), $inv_stock->getId()); } echo "</tbody></table>"; } catch (fExpectedException $e) { echo $e->printMessage(); } } ?> </div> </div> <div id="messageBox" style="display: none;">Loading</div> <?php $tmpl->place('footer');
?> <script type="text/javascript" src="./js/inventory-view.js"></script> </head> <body> <div class = "container"> <div id="View" class = "view-frame span-23 last"> <?php if (!isset($_GET['id'])) { echo "<div class=\"ui-state-error ui-corner-all\">\r\n\t\t\t\t\t<span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: 30px;\"></span>\r\n\t\t\t\t\tYou arrived to this page in error</div>"; } else { try { $inv_item = new Inv_item($_GET['id']); ?> <div id="content"> <div id="Id" class="span-8"><h1 id="idCaption"><?php echo $inv_item->prepareId(); ?> </h1> <?php try { $profile = new fImage($inv_item->getImageUrl()); if ($profile->getWidth() != 300) { $profile->resize(300, 0); $profile->saveChanges(); } echo "<img class=\"view-img\" src=\"" . $inv_item->prepareImageUrl() . "\"></img>"; } catch (fExpectedException $e) { if ($e->getMessage() === "No filename was specified") { echo "<div class=\"info\">No picture available, please upload.</div><br />"; } else { echo "<div class=\"info\">" . $e->getMessage() . "</div><br />";