<?php require_once "functions.php"; require_once "courierManager.class.php"; require_once "header.php"; $courierManager = new courierManager($mysqli); $orders_array = $courierManager->getAllData(); if (isset($_GET["update_2"])) { $courierManager->packageEnRoute($_GET["update_2"]); } if (isset($_GET["update_3"])) { $courierManager->packageReceived($_GET["update_3"]); } ?> <h3>Tellimused</h3> <table border="1"> <tr> <th>Kirjeldus</th> <th>Teel</th> <th>Kättesaadud</th> <th></th> <th></th> </tr> <?php for ($i = 0; $i < count($orders_array); $i++) { if ($orders_array[$i]->existance == "1") { echo "<tr>"; echo "<td>" . $orders_array[$i]->description . "</td>";
<?php require_once "functions.php"; require_once "courierManager.class.php"; require_once "header.php"; $courierManager = new courierManager($mysqli); $orders_array = $courierManager->getAllData(); ?> <table border="1"> <tr> <th>Tellimuste arv kokku</th> <th>Lõpetatud tellimuste arv</th> </tr> <?php $count = 0; for ($i = 0; $i < count($orders_array); $i++) { if ($orders_array[$i]->received == "1") { $count++; } } echo "<td>" . count($orders_array) . "</td>"; echo "<td>" . $count . "</td>"; ?> </table><br> <?php require_once "footer.php";
<?php require_once "functions.php"; require_once "courierManager.class.php"; require_once "header.php"; $courierManager = new courierManager($mysqli); $message = ""; $description = ""; $description_error = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_POST["add_new_order"])) { if (empty($_POST["description"])) { $description_error = "*** Kirjeldus on kohustuslik ***"; } else { $description = cleanInput($_POST["description"]); $message = $courierManager->addNewOrder($description); } } } $orders_array = $courierManager->getAllData(); if (isset($_GET["update_1"])) { $courierManager->packageExists($_GET["update_1"]); } function cleanInput($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?>