X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Forder.php;h=7c68455606b0d860fc8820ad4c4065243b4dbe7a;hb=b0347297ea5b4b7a8a4a5c2124c074b53539da6c;hp=2eae9e0ff0933e400aeb8ace76f43dc082ab05ea;hpb=de1ba4081f13f6c953780055aee9c4aa562a626d;p=readifood.git diff --git a/lib/order.php b/lib/order.php index 2eae9e0..7c68455 100644 --- a/lib/order.php +++ b/lib/order.php @@ -167,9 +167,16 @@ return; } + $candidates = array(); + foreach ($areas as $area) { + if (! count(get_area_contacts($area->getId()))) continue; + $candidates[] = $area; + } + if (! count($candidates)) return; + echo "

Show orders in area\n"; echo "\n"; @@ -185,9 +192,16 @@ return; } + $candidates = array(); + foreach ($cities as $city) { + if (! count(get_city_contacts($city->getId()))) continue; + $candidates[] = $city; + } + if (! count($candidates)) return; + echo "

Show orders in city\n"; echo "\n"; @@ -332,7 +346,7 @@ echo " State\n"; echo " \n"; echo "\n"; @@ -508,6 +522,16 @@ return $order->getId(); } + function confirm_delete_order($id = null) { + if (! check_admin(1, "delete an order")) return; + + if (isset($id)) $order = get_order_by_id($id); + if (! $order) return false; + + echo "

Confirm deletion

\n"; + echo "

You must confirm deletion of order $id: " . $order->getDeleteLink(true) . "

\n"; + } + function delete_order($id = null) { if (! check_admin(1, "delete an order")) return; @@ -655,6 +679,10 @@ if (count($args)) { switch ($args[0]) { case "delete": + confirm_delete_order($id); + break; + + case "confirmdelete": delete_order($id); break; }