예제 #1
0
                                                         foreach ($_POST['detail_discount'] as $item_id => $discount) {
                                                             $price = isset($_POST['detail_price_taxfree']) ? $_POST['detail_price_taxfree'][$item_id] : $_POST['detail_old_price_taxfree'][$item_id];
                                                             $input = array('item_id' => $item_id, 'discount' => $discount, 'price' => $price);
                                                             $pluginOrderOrder_Item->updateDiscount($input);
                                                         }
                                                     }
                                                     Html::redirect($_SERVER['HTTP_REFERER']);
                                                 } else {
                                                     if (isset($_GET['unlink_order'])) {
                                                         $pluginOrderOrder->check($_GET['id'], 'w');
                                                         $pluginOrderOrder->unlinkBudget($_GET['id']);
                                                         Html::redirect($_SERVER['HTTP_REFERER']);
                                                     } else {
                                                         $pluginOrderOrder->checkGlobal("r");
                                                         Html::header(__("Orders management", "order"), '', "plugins", "order", "order");
                                                         $pluginOrderOrder->showForm($_GET["id"], array('withtemplate' => $_GET['withtemplate']));
                                                         Html::footer();
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
예제 #2
0
    }
    Html::back();
} elseif (isset($_POST["update_detail_item"])) {
    if (isset($_POST['detail_price_taxfree'])) {
        foreach ($_POST['detail_price_taxfree'] as $item_id => $price) {
            $input = array('item_id' => $item_id, 'price_taxfree' => $price);
            $pluginOrderOrder_Item->updatePrice_taxfree($input);
        }
    }
    if (isset($_POST['detail_discount'])) {
        foreach ($_POST['detail_discount'] as $item_id => $discount) {
            $price = isset($_POST['detail_price_taxfree']) ? $_POST['detail_price_taxfree'][$item_id] : $_POST['detail_old_price_taxfree'][$item_id];
            $input = array('item_id' => $item_id, 'discount' => $discount, 'price' => $price);
            $pluginOrderOrder_Item->updateDiscount($input);
        }
    }
    Html::back();
} elseif (isset($_GET['unlink_order'])) {
    $pluginOrderOrder->check($_GET['id'], UPDATE);
    $pluginOrderOrder->unlinkBudget($_GET['id']);
    Html::back();
} else {
    $pluginOrderOrder->checkGlobal(READ);
    Html::header(__("Orders", "order"), $_SERVER['PHP_SELF'], "management", "PluginOrderMenu", "order");
    if ($_GET['id'] == "") {
        $pluginOrderOrder->showForm(-1, array('withtemplate' => $_GET["withtemplate"]));
    } else {
        $pluginOrderOrder->display($_GET);
    }
    Html::footer();
}