include "Modules/toolbar.php";
// small Toolbar
include "Modules/Product/toolbar.php";
// main content
$action = var_get_post("action", "");
$search = var_post("search_entry", "");
$product_id = var_get_post("product_id", "");
$onload .= "document.getElementById('search_entry').focus();";
if ($action == "new") {
    include "Modules/Product/new_form.php";
} elseif ($action == "edit" && $product_id != "") {
    $data = $product->get($product_id);
    include "Modules/Product/edit_form.php";
} elseif ($action == "search" && $search != "") {
    $search_toggle = var_post("search_toggle", "");
    $search_category = var_post("search_category", "");
    $search_in = "";
    if ($search_category != "") {
        if ($search_toggle && count($search_category) > 0) {
            for ($i = 0; $i < count($search_category); $i++) {
                $search_in .= " category_id='" . $search_category[$i] . "' AND ";
            }
        } elseif (count($search_category) > 0) {
            for ($i = 0; $i < count($search_category); $i++) {
                $search_in .= " category_id<>'" . $search_category[$i] . "' AND ";
            }
        }
    }
    $list_view = new NTKListView("list_view", array('Produktnummer', 'Name', 'Beschreibung'), "location.href = 'product.php?action=edit&product_id=%0%';");
    $results = $product->get('', array('product_id', 'name', 'details'), $search_in . " (product_id LIKE '%{$search}%' OR name LIKE'%{$search}%' OR details LIKE '%{$search}%' OR order_number LIKE '%{$search}%')");
    if (count($results) == 1) {
<html>
<head>
	<title> Index </title>
	
<?php 
include "Modules/Assistant/db_action.php";
$main_box = new NTKVBox("main_box", 0, 0, False);
// Toolbar
$page = "assistant";
$printfile = "";
include "Modules/toolbar.php";
// small Toolbar
include "Modules/Assistant/toolbar.php";
// main content
$action = var_get_post("action", "");
$search = var_post("search_entry", "");
$assistant_id = var_get("assistant_id", "");
if ($action == "new") {
    include "Modules/Assistant/new_form.php";
} elseif ($action == "edit" && $assistant_id != "") {
    $data = $assistant->get($assistant_id);
    include "Modules/Assistant/edit_form.php";
} elseif ($action == "search" && $search != "") {
    $list_view = new NTKListView("list_view", array('Mitarbeiternummer', 'Vorname', 'Nachname'), "location.href = 'assistant.php?action=edit&assistant_id=%0%';");
    $list_view->addLines($assistant->get('', array('assistant_id', 'prename', 'postname'), "assistant_id LIKE '%{$search}%' OR prename LIKE'%{$search}%' OR postname LIKE '%{$search}%'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
} else {
    $list_view = new NTKListView("list_view", array('Mitarbeiternummer', 'Vorname', 'Nachname'), "location.href = 'assistant.php?action=edit&assistant_id=%0%';");
    $list_view->addLines($assistant->get('', array('assistant_id', 'prename', 'postname')));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
}
Esempio n. 3
0
<?php

require_once "util.php";
$group = new Group();
if ($action == "new") {
    $group->create(var_post("group_id", ""), array(var_post("group_name", "")));
} elseif ($action == "edit") {
    $group->update(var_post("group_id", ""), array(var_post("group_name", "")));
} elseif ($action == "delete") {
    $group->delete(var_get("group_id", ""));
}
$group_box = new NTKVBox("group_box", 0, 0, False);
$label = new NTKLabel("group_label", "<h3>Gruppen</h3>");
$group_box->add($label);
$group_list = $group->get('');
for ($i = 0; $i < count($group_list); $i++) {
    $group_box->add(new NTKEGroup($group_list[$i][0], $group_list[$i][1]));
}
$label = new NTKLabel("group_label", "<h4>neue Gruppe</h4>");
$group_box->add($label);
$group_box->add(new NTKEGroup("", "", True), -1);
$main_box->add($group_box, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
<?php

require_once "util.php";
require_once "NTK/NTK.php";
require_once "DataBase/Category.php";
$db_action = var_get_post("db_action", "");
$category = new Category();
switch ($db_action) {
    case "new":
        $category->create(array(var_post("category_id", ""), var_post("name", ""), var_post("details", "")));
        break;
    case "edit":
        $category->update(var_post("category_id", ""), array(var_post("name", ""), var_post("details", "")));
        break;
    case "delete":
        $category->delete(var_get("category_id", ""));
        break;
}
        } else {
            $search .= "(product_id >=" . var_post("product_id", "") . ") ";
        }
    }
    if (var_post("date_from", "")) {
        if ($search) {
            $search .= " AND (date >='" . var_post("date_from", "") . "') ";
        } else {
            $search .= "(date >='" . var_post("date_from", "") . "') ";
        }
    }
    if (var_post("date_to", "")) {
        if ($search) {
            $search .= " AND (date <='" . var_post("date_to", "") . "') ";
        } else {
            $search .= "(date <='" . var_post("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";
} else {
    $toolbar_box = new NTKVBox("toolbar_box", 0, 0, False);
    $main_box = new NTKTable("main_box", 5, 4, False);
    $main_box->setStyle("background-color: #dfe7f3;");
    $main_box->add(new NTKLabel("", "<b>Rechnungszusammenfassung nach Datum</b>"), 0, 0);
    $main_box->add(new NTKLabel("", "Von:"), 2, 0);
    $main_box->add(new NTKEntry("date_from", ""), 2, 1);
<?php

require_once "util.php";
require_once "DataBase/Customer.php";
require_once "DataBase/Tour.php";
require_once "DataBase/Priceset.php";
$db_action = var_get_post("db_action", "");
$customer = new Customer();
$tour = new Tour();
$priceset = new Priceset();
switch ($db_action) {
    case "new":
        $customer->create(var_post("customer_number", ""), array(var_post("password", ""), var_post("prename", ""), var_post("postname", ""), var_post("street", ""), var_post("streetnumber", ""), var_post("plz", ""), var_post("city", ""), var_post("telephone", ""), var_post("telefax", ""), var_post("email", ""), var_post("pricelist_id", ""), var_post("tour_id", ""), var_post("rabatt", ""), var_post("details", ""), var_post("bank_name", ""), var_post("bank_account", ""), var_post("blz", "")));
        break;
    case "edit":
        $customer->update(var_post("customer_number", ""), array(var_post("password", ""), var_post("prename", ""), var_post("postname", ""), var_post("street", ""), var_post("streetnumber", ""), var_post("plz", ""), var_post("city", ""), var_post("telephone", ""), var_post("telefax", ""), var_post("email", ""), var_post("pricelist_id", ""), var_post("tour_id", ""), var_post("rabatt", ""), var_post("details", ""), var_post("bank_name", ""), var_post("bank_account", ""), var_post("blz", "")));
        break;
    case "delete":
        $customer->delete(var_get("customer_id", ""));
        break;
}
require_once "DataBase/Price.php";
$db_action = var_get_post("db_action", "");
$product = new Product();
$tax = new Tax();
$category = new Category();
$priceset = new Priceset();
$price = new Price();
$group = new Group();
switch ($db_action) {
    case "new":
        $product->create(var_post("product_id", ""), array(var_post("name", ""), var_post("details", ""), var_post("category_id", ""), var_post("tax_id", ""), var_post("available", ""), var_post("group_id", ""), var_post("order_number", ""), var_post("anmerkung", "")));
        $priceset_list = $priceset->get();
        for ($i = 0; $i < count($priceset_list); $i++) {
            $price->create(var_post("priceset_id_" . $i, ""), var_post("product_id", ""), array(var_post("priceset_price_" . $i, "")));
        }
        break;
    case "edit":
        $product->update(var_post("product_id", ""), array(var_post("name", ""), var_post("details", ""), var_post("category_id", ""), var_post("tax_id", ""), var_post("available", ""), var_post("group_id", ""), var_post("order_number", ""), var_post("anmerkung", "")));
        $priceset_list = $priceset->get();
        for ($i = 0; $i < count($priceset_list); $i++) {
            if ($price->exists(var_post("priceset_id_" . $i, ""), var_post("product_id", ""))) {
                $price->update(var_post("priceset_id_" . $i, ""), var_post("product_id", ""), array(var_post("priceset_price_" . $i, "")));
            } else {
                $price->create(var_post("priceset_id_" . $i, ""), var_post("product_id", ""), array(var_post("priceset_price_" . $i, "")));
            }
        }
        break;
    case "delete":
        $product->delete(var_get("product_id", ""));
        break;
}
Esempio n. 8
0
$assistant = new Assistant();
$bill = new Bill();
$var_print = var_post("print", "");
$var_group_all = var_post("group_all", "");
$var_group = var_post("group", "");
$var_category_all = var_post("category_all", "");
$var_category = var_post("category", "");
$var_available = var_post("available", "");
$var_not_available = var_post("not_available", "");
$var_product_id_from = var_post("product_id_from", "");
$var_product_id_to = var_post("product_id_to", "");
$var_assistant = var_post("assistant", "");
$var_priceset = var_post("priceset", "");
$var_product_id = var_post("product_id", "");
$var_date_from = var_post("date_from", "");
$var_date_to = var_post("date_to", "");
if ($var_print == "print") {
    $search = "";
    if (!$var_group_all) {
        if ($search) {
            $search .= " AND group_id='" . $var_group . "' ";
        } else {
            $search .= "group_id='" . $var_group . "' ";
        }
    }
    if (!$var_category_all) {
        if ($search) {
            $search .= " AND category_id='" . $var_category . "' ";
        } else {
            $search .= "category_id='" . $var_category . "' ";
        }
Esempio n. 9
0
			<TD WIDTH="1" align="center" class="list_header">Inkl.Ust.</TD>
<?php 
} else {
    ?>
			<TD WIDTH="1" align="center" class="list_header">Exkl.Ust.</TD>
<?php 
}
?>
			<TD WIDTH="1" align="center" class="list_header">Steuer</TD>
			
		</TR>
	</THEAD>
	<TBODY>
<?php 
for ($i = 0; $i < count($product_data); $i++) {
    $price_data = $price->getPrice(var_post("priceset", ""), $product_data[$i][0]);
    $tax_data = $tax->get($product_data[$i][4]);
    ?>
		<TR VALIGN=TOP>
			<TD WIDTH="1" align="center" class="list"><?php 
    echo $product_data[$i][0] . "&nbsp;";
    ?>
</TD>
			<TD WIDTH="80%" align="left" class="list"><?php 
    echo $product_data[$i][1] . "&nbsp;";
    ?>
</TD>
			<TD WIDTH="1" align="left" class="list"><?php 
    echo $product_data[$i][2] . "&nbsp;";
    ?>
</TD>
<?php

require_once "util.php";
require_once "NTK/NTK.php";
require_once "DataBase/Customer.php";
require_once "DataBase/Tour.php";
$customer = new Customer();
$tour = new Tour();
if (var_post("print", "") == "print") {
    $search = "";
    $tour_data = "";
    if (!var_post("tour_all", "")) {
        $search = " tour_id='" . var_post("tour", "") . "' ";
        $tour_data = $tour->get(var_post("tour", ''), array());
    }
    $customer_data = $customer->get('', array(), $search);
    include "Druckvorlagen/zeilen.php";
    include "Druckvorlagen/customer_list.php";
} else {
    $toolbar_box = new NTKVBox("toolbar_box", 0, 0, False);
    $main_box = new NTKTable("main_box", 3, 2, False);
    $main_box->setStyle("background-color: #dfe7f3;");
    $main_box->add(new NTKLabel("", "alle Touren"), 0, 0);
    $main_box->add(new NTKCheckbox("tour_all", 1, False), 0, 1);
    $main_box->add(new NTKLabel("", "aus Tour"), 1, 0);
    $main_box->add(new NTKComboBox("tour", $tour->get("")), 1, 1);
    $main_box->add(new NTKButton("submit", "Druckvorschau", "document.forms['print'].submit();"), 2, 1);
    $form = new NTKForm("print", "stat_customer_list.php", $main_box);
    $form->addAttribute("print", "print");
    $toolbar_box->add($form, 0, 0);
    echo getHead();
<?php

require_once "util.php";
require_once "DataBase/Assistant.php";
$db_action = var_get_post("db_action", "");
$assistant = new Assistant();
switch ($db_action) {
    case "new":
        $assistant->create(var_post("assistant_id", ""), array(var_post("prename", ""), var_post("postname", ""), var_post("street", ""), var_post("streetnumber", ""), var_post("plz", ""), var_post("city", ""), var_post("telephone", ""), var_post("telefax", ""), var_post("email", ""), var_post("tax_number", ""), var_post("blz", ""), var_post("bank_account", ""), var_post("additional", ""), var_post("utax_id", ""), var_post("bank_name", ""), var_post("bill_ext", "")));
        break;
    case "edit":
        $assistant->update(var_post("assistant_id", ""), array(var_post("prename", ""), var_post("postname", ""), var_post("street", ""), var_post("streetnumber", ""), var_post("plz", ""), var_post("city", ""), var_post("telephone", ""), var_post("telefax", ""), var_post("email", ""), var_post("tax_number", ""), var_post("blz", ""), var_post("bank_account", ""), var_post("additional", ""), var_post("utax_id", ""), var_post("bank_name", ""), var_post("bill_ext", "")));
        break;
    case "delete":
        $assistant->delete(var_get("assistant_id", ""));
        break;
}
Esempio n. 12
0
<?php

require_once "util.php";
$priceset = new Priceset();
if ($action == "new") {
    $priceset->create(var_post("priceset_id", ""), array(var_post("priceset_name", ""), var_post("priceset_netto", "")));
} elseif ($action == "edit") {
    $priceset->update(var_post("priceset_id", ""), array(var_post("priceset_name", ""), var_post("priceset_netto", "")));
} elseif ($action == "delete") {
    $priceset->delete(var_get("priceset_id", ""));
}
$priceset_box = new NTKVBox("priceset_box", 0, 1, False);
$label = new NTKLabel("priceset_label", "<h3>Preiss&auml;tze</h3>");
$priceset_box->add($label);
$priceset_list = $priceset->get('');
for ($i = 0; $i < count($priceset_list); $i++) {
    $priceset_box->add(new NTKEPriceset($priceset_list[$i][0], $priceset_list[$i][1], $priceset_list[$i][2]));
}
$label = new NTKLabel("priceset_label", "<h4>neuer Preissatz</h4>");
$priceset_box->add($label);
$priceset_box->add(new NTKEPriceset("", "", 1, True), -1);
$main_box->add($priceset_box, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
if ($message != "") {
    print "<div class=\"error\">" . $message . "</div><br>";
}
?>
	<table border="0">
		<tr>
			<td>Kundennummer:</td>
			<td><input type="text" name="username" value="<?php 
var_post("username", "");
?>
"></td>
		</tr>
		<tr>
			<td>Passwort:</td>
			<td><input type="password" name="password" value="<?php 
var_post("password", "");
?>
"></td>
		</tr>
		<tr>
			<td colspan="2" align="right"><a href="#" onclick="javascript: document.forms['login_form'].submit();">Anmelden</a></td>
		</tr>
	</table>
</div>
<input type="submit" value="" class="invisible_submit">
</form>

<?php 
include "footer.php";
?>
Esempio n. 14
0
<?php

require_once "util.php";
$tax = new Tax();
if ($action == "new") {
    $tax->create(var_post("tax_id", ""), array(var_post("tax_name", ""), var_post("tax_rate", "")));
} elseif ($action == "edit") {
    $tax->update(var_post("tax_id", ""), array(var_post("tax_name", ""), var_post("tax_rate", "")));
} elseif ($action == "delete") {
    $tax->delete(var_get("tax_id", ""));
}
$tax_box = new NTKVBox("tax_box", 0, 0, False);
$label = new NTKLabel("tax_label", "<h3>Steuers&auml;tze</h3>");
$tax_box->add($label);
$taxlist = $tax->get('');
for ($i = 0; $i < count($taxlist); $i++) {
    $tax_box->add(new NTKETax($taxlist[$i][0], $taxlist[$i][1], $taxlist[$i][2]));
}
$label = new NTKLabel("tax_label", "<h4>neuer Steuersatz</h4>");
$tax_box->add($label);
$tax_box->add(new NTKETax("", "", "", True), -1);
$main_box->add($tax_box, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
require_once "DataBase/Assistant.php";
require_once "DataBase/Bill_Product.php";
$db_action = var_get_post("db_action", "");
$tour = new Tour();
$bill = new Bill();
$assistant = new Assistant();
switch ($db_action) {
    case "new":
        $tour->create(array(var_post("name", ""), var_post("assistant_id", "")));
        break;
    case "edit":
        $tour->update(var_post("tour_id", ""), array(var_post("name", ""), var_post("assistant_id", "")));
        break;
    case "delete":
        $tour->delete(var_get("tour_id", ""));
        break;
    case "tour_to_bill":
        $tour = new Tour();
        $tmp = $tour->get(var_get("tour_id", ""));
        $tour_data = $tmp[0];
        $bill = new Bill();
        $new_bill_id = $bill->create('', array(var_post("customer_id", ""), var_post("tour_id", ""), var_post("date", ""), var_post("assistant_id", ""), -1, 0));
        $bill_product = new Bill_Product();
        $product = new Product();
        $product_data = $product->get();
        $result = $bill_product->getTourZusammenfassung(var_post("current_tour_id", ""), var_post("date", ""));
        for ($i = 0; $i < count($result); $i++) {
            $bill_product->create(array($new_bill_id, $result[$i][0], $result[$i][2], '', '', '', ''));
        }
        break;
}
    case "delete":
        $bill->delete(var_get("bill_id", ""));
        if ($fp_tour_id != "") {
            $onload .= "location.href = 'tour.php?action=list_tour&tour_id=" . $fp_tour_id . "&date=" . $fp_date . "';";
        }
        break;
    case "position_add":
        $bill_data = $bill->get(var_post("bill_id", ""));
        /* autoset anmerkung vom produkt, wenn nichts als anmerkung gegeben */
        $details = var_post("details", "");
        if ($details == "") {
            $product_data = $product->get(var_post("product_id", ""));
            $details = $product_data[0][8];
        }
        if ($bill_data[0][5] == -1) {
            $bill_product->create(array(var_post("bill_id", ""), var_post("product_id", ""), var_post("amount", ""), $details, var_post("rabatt", ""), 0, 0));
        } else {
            $customer_data = $customer->get($bill_data[0][1]);
            $price_data = $price->getPrice($customer_data[0][11], var_post("product_id", ""));
            $product_data = $product->get(var_post("product_id", ""));
            $tax_data = $tax->get($product_data[0][4]);
            $bill_product->create(array(var_post("bill_id", ""), var_post("product_id", ""), var_post("amount", ""), $details, var_post("rabatt", ""), $price_data[0][3], $tax_data[0][2]));
        }
        break;
    case "position_delete":
        $bill_product->delete(var_get("bill_product_id", ""));
        break;
    case "position_edit":
        $bill_product->update(var_post("bill_product_id", ""), array(var_post("bill_id", ""), var_post("product_id", ""), var_post("amount", ""), var_post("details", ""), var_post("rabatt", ""), var_post("price", ""), var_post("tax", "")));
        break;
}