public static function start($parameters) { switch ($parameters['target']) { case 'buildTargetAddressesToOrderPerson': require_once dirname(__FILE__) . '/OrderPerson/OrderPersonController.php'; echo \shiporder\OrderPersonCOntroller::start(array('id' => isset($_GET['idOrderPerson']) ? $_GET['idOrderPerson'] : 0, 'target' => 'buildTargetAddressesToOrderPerson')); exit; case 'listOfItems': require_once dirname(__FILE__) . '/Item/ItemController.php'; $body = \shiporder\ItemController::start(); $title = 'Tooted'; break; case 'listOfOrderPerson': require_once dirname(__FILE__) . '/OrderPerson/OrderPersonController.php'; $body = \shiporder\OrderPersonController::start(array('target' => 'listOfOrderPerson')); $title = 'Kliendid'; break; case 'selectOrderPerson': require_once dirname(__FILE__) . '/OrderPerson/OrderPersonController.php'; $body = \shiporder\OrderPersonController::start(array('id' => $_GET['id'], 'target' => 'selectOrderPerson')); $title = 'Kliendid'; break; case 'listOfShipTo': require_once dirname(__FILE__) . '/ShipTo/ShipToController.php'; $body = \shiporder\ShipToController::start(); $title = 'Sihtkohad'; break; default: exit('Mida teeme?'); } require_once dirname(__FILE__) . '/View.php'; echo View::buildView(array('body' => $body, 'title' => $title)); }
public static function start($parameters) { switch ($parameters['target']) { case 'listOfItems': require_once dirname(__FILE__) . '/items/ItemController.php'; $body = \shiporder\ItemController::start(); $title = 'Tooted'; break; case 'listOfOrderPersons': require_once dirname(__FILE__) . '/order-persons/OrderPersonController.php'; $body = \shiporder\OrderPersonController::start(); $title = 'Kliendid'; break; case 'selectOrderPerson': require_once dirname(__FILE__) . '/orderpersons/OrderPersonController.php'; $body = \shiporder\OrderPersonController::start(array('id' => $_GET['id'], 'target' => 'selectOrderPerson')); $title = 'Kliendid'; break; default: exit('Mida teeme?'); } require_once dirname(__FILE__) . '/View.php'; echo View::buildView(array('body' => $body, 'title' => $title)); }
require_once dirname(__FILE__) . '/e_settings.php'; //tee selle failini, mille sulgudesse anname, FILE absoluutne tee juurkataloogist //et oskaks info item.php-st välja lugeda, mis on itemid: /** * This class controls items. * * @namespace shiporder */ class ItemController { /** * This function does anything we want. * Sometimes we want it to build something. Then, the result will be * returned. * * @access public * @return string * @uses \shiporder\Item for items list * @uses \shiporder\ItemView for the visual part of the list */ public static function start() { require_once dirname(__FILE__) . '/Item.php'; $items = \shiporder\Item::getListOfTypeItem(array()); require_once dirname(__FILE__) . '/ItemView.php'; $itemView = \shiporder\ItemView::buildListOfItems(array('items' => $items)); echo $itemView; } } \shiporder\ItemController::start();