if ($var_date_to) {
        if ($search) {
            $search .= " AND (date <='" . $var_date_to . "') ";
        } else {
            $search .= "(date <='" . $var_date_to . "') ";
        }
    }
    $bill_data = $bill->get("", array("bill_id"), $search);
    $bill_product = new Bill_Product();
    $tour_data[1] = "( Alle Touren )";
    $product = new Product();
    $product_data = $product->get();
    include "Druckvorlagen/tour.php";
} elseif ($var_print == "print_2") {
    if ($var_product_id != "" && $var_date_from != "" && $var_date_to != "") {
        $product_amount = $product->getAmountByDate($var_product_id, $var_date_from, $var_date_to);
        echo "Menge von Produkt " . $var_product_id . " : " . $product_amount;
    }
} else {
    echo getHead();
    $main_box = new NTKTable("main_box", 14, 4, False);
    $main_box->setStyle("background-color: #dfe7f3;");
    $main_box->add(new NTKLabel("", "Produktnummer von:"), 1, 0);
    $main_box->add(new NTKEntry("product_id_from", ""), 1, 1);
    $main_box->add(new NTKLabel("", "bis: "), 1, 2);
    $main_box->add(new NTKEntry("product_id_to", ""), 1, 3);
    $main_box->add(new NTKLabel("", "alle Gruppen"), 3, 0);
    $main_box->add(new NTKCheckbox("group_all", 1, True), 3, 1);
    $main_box->add(new NTKLabel("", "aus Gruppe"), 3, 2);
    $main_box->add(new NTKComboBox("group", $group->get("")), 3, 3);
    $main_box->add(new NTKLabel("", "verf&uuml;gbare"), 5, 0);
require_once "DataBase/Bill_Product.php";
$group = new Group();
$priceset = new Priceset();
$category = new Category();
$product = new Product();
$price = new Price();
$tax = new Tax();
$assistant = new Assistant();
$bill = new Bill();
echo getHead();
$toolbar_box = new NTKVBox("toolbar_box", 5, 0, True);
$product_id = var_post("product_id", "");
$date_from = var_post("date_from", "");
$date_to = var_post("date_to", "");
if ($product_id != "" && $date_from != "" && $date_to != "") {
    $product_amount = $product->getAmountByDate($product_id, $date_from, $date_to, 1);
    $bill_data = $product->getBillsByDate($product_id, $date_from, $date_to, 1);
    $customer_data = $product->getCustomersByDate($product_id, $date_from, $date_to, 1);
    $result_box = new NTKTable("result_box", 4, 2, False);
    $result_box->setStyle("background-color: #F8FF77;");
    $result_box->add(new NTKLabel("", "Produktnummer:"), 0, 0);
    $result_box->add(new NTKLabel("", "<b>" . $product_id . "</b>"), 0, 1);
    $result_box->add(new NTKLabel("", "Zeitraum:"), 1, 0);
    $result_box->add(new NTKLabel("", "von <b>" . $date_from . "</b> bis <b>" . $date_to . "</b>"), 1, 1);
    $result_box->add(new NTKLabel("", "Menge:"), 1, 0);
    $result_box->add(new NTKLabel("", "<b>" . round($product_amount, 2) . "</b>"), 1, 1);
    $result_box->add(new NTKLabel("", "In Rechnungen (Menge):"), 2, 0);
    $bills = "";
    for ($i = 0; $i < count($bill_data); $i++) {
        $bills = $bills . " " . $bill_data[$i][0] . " (";
        $bills = $bills . " " . $bill_data[$i][1] . ") ; ";