97 lines
2.7 KiB
PHP
97 lines
2.7 KiB
PHP
<?php
|
|
// Datenbank-Verbindungsparameter
|
|
require_once ('dbutils.php');
|
|
require_once ('admin.php');
|
|
require_once ('queuecontent.php');
|
|
require_once ('products.php');
|
|
require_once ('roomtables.php');
|
|
require_once ('reports.php');
|
|
require_once ('bill.php');
|
|
require_once ('closing.php');
|
|
require_once ('printqueue.php');
|
|
require_once ('feedback.php');
|
|
require_once ('reservation.php');
|
|
require_once ('rating.php');
|
|
require_once ('customers.php');
|
|
require_once ('commonutils.php');
|
|
require_once ('utilities/Logger.php');
|
|
|
|
$module = $_GET["module"];
|
|
$command = $_GET["command"];
|
|
|
|
Logger::logcmd($module,$command,"");
|
|
|
|
$plugins = havePlugins();
|
|
|
|
if (defined('IS_INSTALLMODE')) {
|
|
$pdo = DbUtils::openDbAndReturnPdoStatic();
|
|
$memlimit = CommonUtils::getConfigValue($pdo, "memorylimit", '256');
|
|
if ($memlimit != "-1") {
|
|
$memlimit = $memlimit . 'M';
|
|
}
|
|
ini_set('memory_limit',$memlimit);
|
|
$pdo = null;
|
|
}
|
|
|
|
if ($module == 'admin') {
|
|
$adminModule = new Admin();
|
|
$adminModule->handleCommand($command);
|
|
} else if ($module == 'queue') {
|
|
$queueContent = new QueueContent();
|
|
$queueContent->handleCommand($command);
|
|
} else if ($module == 'products') {
|
|
$products = new Products();
|
|
$products->handleCommand($command);
|
|
} else if ($module == 'roomtables') {
|
|
$roomtables = new Roomtables();
|
|
$roomtables->handleCommand($command);
|
|
} else if ($module == 'reports') {
|
|
$reports = new Reports();
|
|
$reports->handleCommand($command);
|
|
} else if ($module == 'bill') {
|
|
$reports = new Bill();
|
|
$reports->handleCommand($command);
|
|
} else if ($module == 'closing') {
|
|
$closingModule = new Closing();
|
|
$closingModule->handleCommand($command);
|
|
} else if ($module == 'printqueue') {
|
|
$printQueue = new PrintQueue();
|
|
$printQueue->handleCommand($command);
|
|
} else if ($module == 'feedback') {
|
|
$feedback = new Feedback();
|
|
$feedback->handleCommand($command);
|
|
} else if ($module == 'reservation') {
|
|
$reservation = new Reservation();
|
|
$reservation->handleCommand($command);
|
|
} else if ($module == 'rating') {
|
|
$rating = new Rating();
|
|
$rating->handleCommand($command);
|
|
} else if ($module == 'customers') {
|
|
$rating = new Customers();
|
|
$rating->handleCommand($command);
|
|
}
|
|
|
|
|
|
function havePlugins() {
|
|
if (file_exists("../plugins")) {
|
|
if (file_exists("../plugins/config.json")) {
|
|
$content = file_get_contents("../plugins/config.json");
|
|
|
|
$pluginconfig = json_decode($content);
|
|
|
|
$props = get_object_vars($pluginconfig);
|
|
$keys = array_keys($props);
|
|
foreach ($keys as $aKey) {
|
|
$aPluginConfig = $pluginconfig->$aKey;
|
|
$className = $aPluginConfig->PluginClass;
|
|
require_once "../plugins/$className.php";
|
|
}
|
|
CommonUtils::setPluginConfig($pluginconfig);
|
|
return $pluginconfig;
|
|
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
?>
|