<?php include_once 'header.php'; ?> <img id="top" src="top.png" alt=""> <div id="form_container"> <h1><a>Eliminar Items</a></h1> <form id="form_492329" class="appnitro" method="post" action="decider.php"> <div class="form_description"> <h2>Eliminar items</h2> <p>Aca va a ir un search box con autocompletado.</p> </div> <ul > <?php require_once 'controladoras/ItemController.php'; ItemController::getInstance()->getAllItems(); foreach (ItemController::$resultsFromSearch as $item) { ?> <a href="decider.php?removeId=<?php echo $item->getId(); ?> "><li> <?php echo $item->getName(); ?> <?php echo $item->getCode(); ?> </li></a><?php } ?>
<?php session_start(); require_once 'config.php'; require_once 'controladoras/ItemController.php'; foreach ($_POST as $key => $value) { if ($key == "form_id") { if ($_POST["form_id"] == '492329') { $ret = ItemController::getInstance()->saveItem($_POST); header("Location:http://" . $host . "/" . $mainURI . "/addItem.php"); } } else { if ($key == "idToUpdate") { $ret = ItemController::getInstance()->updateItem(); header("Location:http://" . $host . "/" . $mainURI . "/index.php"); } } } foreach ($_GET as $key => $value) { if ($key == 'removeId') { $ret = ItemController::getInstance()->eliminarItem($_GET['removeId']); } else { if ($key == "updateFormSearchInput") { $_SESSION['allItemsSet'] = 1; $searchBox = $_GET["updateFormSearchInput"]; ItemController::getInstance()->searchForItems($searchBox); include_once 'updateItem.php'; } } }