public function execute($dataContainer) { //no direct access defined('_AEXEC') or die("Access denied"); require_once 'AdminCheckoutProcessing.php'; require_once 'AdminCheckoutInterface.php'; parent::entryPoint($dataContainer); parent::initSmartyVariables($dataContainer); $this->_interface = $dataContainer->getInterface(); $checkoutInterface = new AdminCheckoutInterface($this->relPath); $checkoutProcessing = new AdminCheckoutProcessing($checkoutInterface); if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_GET['action'])) { $action = $_GET['action']; switch ($action) { case 1: //Checkout if (isset($_POST['card_ID'])) { $checkoutProcessing->Checkout($_POST['card_ID']); } else { $checkoutProcessing->Checkout(null); } break; case 2: //Settings anzeigen $checkoutProcessing->ShowSettings(); break; case 3: //Settings ändern $checkoutProcessing->SaveSettings($_POST['count_last_meals']); break; case 4: //Farbeinstellungen anzeigen $checkoutProcessing->ShowColorSettings(); break; case 5: //Farbeinstellungen ändern $checkoutProcessing->SaveColorSettings($_POST); break; } } else { if (parent::execPathHasSubmoduleLevel(1, $this->_submoduleExecutionpath)) { $this->submoduleExecuteAsMethod($this->_submoduleExecutionpath); } else { $checkoutInterface->ShowInitialMenu(); } } }
/** * The Entry-Point of this Module, initializes the needed Data * * Dies displaying a Message when User tries to access from outside * * @param DataContainer $dataContainer contains data needed by the Module */ protected function entryPoint($dataContainer) { parent::entryPoint($dataContainer); parent::initSmartyVariables(); }
public function execute($dataContainer) { defined('_AEXEC') or die('Access denied'); require_once 'AdminSoliInterface.php'; require_once 'AdminSoliProcessing.php'; parent::entryPoint($dataContainer); parent::initSmartyVariables($dataContainer); $this->_interface = $dataContainer->getInterface(); $soliInterface = new AdminSoliInterface($this->relPath); $soliProcessing = new AdminSoliProcessing($soliInterface); if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_GET['action'])) { $action = $_GET['action']; switch ($action) { case 1: //add coupon if (isset($_POST['UID']) && isset($_POST['StartDateYear'])) { $soliProcessing->AddCoupon($_POST['StartDateYear'] . '-' . $_POST['StartDateMonth'] . '-' . $_POST['StartDateDay'], $_POST['EndDateYear'] . '-' . $_POST['EndDateMonth'] . '-' . $_POST['EndDateDay'], $_POST['UID']); } else { $soliProcessing->AddCoupon(NULL, NULL, NULL); } break; case 2: //show coupons $soliProcessing->ShowCoupons(); break; case 3: //show Soliusers $soliProcessing->ShowUsers(); break; case 4: //show SoliOrders for specific User and Week if (isset($_POST['ordering_kw']) && isset($_POST['user_id'])) { $soliProcessing->ShowSoliOrdersByDate($_POST['ordering_kw'], $_POST['user_id']); } else { $soliProcessing->ShowSoliOrdersByDate(false, false); } break; case 5: //delete coupon if (isset($_POST['delete'])) { $soliProcessing->DeleteCoupon($_GET['ID'], true); } else { if (isset($_POST['not_delete'])) { $soliProcessing->ShowCoupons(); } else { $soliProcessing->DeleteCoupon($_GET['ID'], false); } } break; case 6: //Change Soli-Settings if (isset($_POST['user_id'])) { $soliProcessing->ChangeSettings($_POST['soli_price']); } else { $soliProcessing->ChangeSettings(NULL); } break; case 7: //copy old orders to soli if (isset($_POST['copy'])) { // $soliProcessing->CopyOldOrdersToSoli(); CopyOldOrdersToSoli::init($soliInterface, $this->_em); CopyOldOrdersToSoli::execute(); } else { if (isset($_POST['dont_copy'])) { $soliInterface->ShowInitialMenu(); } else { $soliInterface->AskCopyOldOrdersToSoli(); } } break; case 8: //Download SoliOrders of all Users for a specific week/month if (isset($_POST['ordering_kw'])) { $soliProcessing->AllSoliOrdersToPDFByWeekOrMonth($dataContainer, $_POST['ordering_kw'], true); } elseif (isset($_POST['ordering_month'])) { $soliProcessing->AllSoliOrdersToPDFByWeekOrMonth($dataContainer, $_POST['ordering_month'], false); } else { $soliInterface->AskWeekForPdf(); } break; } } else { if (parent::execPathHasSubmoduleLevel(1, $this->_submoduleExecutionpath)) { $this->submoduleExecuteAsMethod($this->_submoduleExecutionpath); } else { $soliInterface->ShowInitialMenu(); } } }
/** * Initializes the Variables of this Class * * @param dataContainer $dataContainer contains needed Data */ protected function entryPoint($dataContainer) { parent::entryPoint($dataContainer); $this->_interface = $dataContainer->getInterface(); }