Ejemplo n.º 1
0
}
if (isset($_POST['ProductID'])) {
    $handleViewCheckbox = isset($_POST['OnView']) ? 1 : 0;
    $handleStoreCheckbox = isset($_POST['ToStore']) ? 1 : 0;
    $exesProductManager->saveProduct($_POST['ProductID'], $_POST['Price'], $_POST['Name'], $_POST['ProductCategoryID'], $handleViewCheckbox, $handleStoreCheckbox, $_POST['Amount'], $_POST['Unit']);
}
if (isset($_POST['CategoryID'])) {
    $exesProductManager->saveCategory($_POST['CategoryID'], $_POST['CategoryName']);
}
switch ($action) {
    case 'single':
        if (isset($_GET['id'])) {
            $product = $exesProductManager->getProductByID($_GET['id']);
            include 'module/' . $self->id . '/singleView.php';
        } else {
            SysApplication::show404();
        }
        break;
    case 'edit':
        if (isset($_GET['id'])) {
            $product = $exesProductManager->getProductByID($_GET['id']);
        } else {
            $product = new Product();
        }
        $categories = $exesProductManager->getCategoriesList();
        include 'module/' . $self->id . '/editView.php';
        break;
    case 'deleteProduct':
        $exesProductManager->deleteProduct($_GET['id']);
        break;
    case 'deleteCategory':