コード例 #1
0
} 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) {
        $onload = "location.href = 'product.php?action=edit&product_id=" . $results[0][0] . "';";
    }
    $list_view->addLines($results);
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
} else {
    /*$list_view = new NTKListView("list_view", array('Produktnummer','Name','Beschreibung'), "location.href = '$PHP_SELF?action=edit&product_id=%0%';");
    	$list_view->addLines($product->get('', array('product_id', 'name', 'details')));
    	$main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");*/
    $main_box->add(new NTKSpacer(), -1, -1);
}
echo getHead();
echo $main_box->getHtml();
?>
コード例 #2
0
// 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;");
}
echo getHead();
echo $main_box->getHtml();
?>

</body>
</html>
コード例 #3
0
<?php

require_once "util.php";
require_once "NTK/NTK.php";
require_once "DataBase/Customer.php";
?>

<html>
<head>
	<title> Index </title>
	
<?php 
echo getHead();
$search = var_get("search", "");
if (strlen($search) >= 3) {
    $customer = new Customer();
    $main_box = new NTKVBox("main_box", 0, 0, False);
    $list_view = new NTKListView("list_view", array('Kundennummer', 'Vorname', 'Nachname'), "parent.frames['main'].document." . var_get("form", "") . "." . var_get("entry", "") . ".value = '%0%';parent.frames['main'].document." . var_get("form", "") . "." . var_get("next", "") . ".focus();");
    $list_view->addLines($customer->get('', array('customer_id', 'prename', 'postname'), "customer_id LIKE '%{$search}%' OR prename LIKE'%{$search}%' OR postname LIKE '%{$search}%'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
    echo $main_box->getHtml();
}
?>

</body>
</html>
コード例 #4
0
    $bill_box = new NTKHBox("bill_box", 0, 0);
    $bill_box->add(new NTKLabel("", "<b>Tournummer: " . $tour_id . " - Datum: " . $datum . "</b>"), False, False, "background-color: #dfe7f3;");
    $bill_box->add(new NTKLabel("", "Kundennummer:"), 150);
    $bill_box->add(new NTKEntry("customer_id", ""), 120);
    $bill_box->add(new NTKLabel("", "Mitarbeiter:"), 120);
    $bill_box->add(new NTKComboBox("assistant_id", $assistant->get()), 120);
    $bill_box->add(new NTKLabel("", "Tour:"), 80);
    $bill_box->add(new NTKComboBox("tour_id", $tour->get()), 120);
    $bill_box->add(new NTKButton("bill_button", "Erstelle Rechnung", "document.forms['bill_form'].submit();"), 200);
    $bill_form = new NTKForm("bill_form", "tour.php", $bill_box);
    $bill_form->addAttribute("db_action", "tour_to_bill");
    $bill_form->addAttribute("date", $datum);
    $bill_form->addAttribute("current_tour_id", $tour_id);
    $main_box->add($bill_form, 0, 0, "background-color: #dfe7f3; vertical-align: top;");
    $list_view = new NTKListView("list_view", array('Rechnungsnummer', 'Kunde'), "location.href = 'bill.php?from_page=tour&fp_tour_id={$tour_id}&fp_date=" . $datum . "&action=edit&bill_id=%0%';");
    $list_view->addLines($bill->get('', array('bill_id', 'bill.customer_id'), "bill.tour_id='{$tour_id}' AND date='" . $datum . "'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
} else {
    $list_view = new NTKListView("list_view", array('Tournummer', 'Bezeichner'), "location.href = 'tour.php?action=edit&tour_id=%0%';");
    $list_view->addLines($tour->get('', array('tour_id', 'name')));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
}
// main content
$main_box->add($spacer, -1, -1, "background-color: #dfe7f3;");
echo getHead();
echo $main_box->getHtml();
?>

</body>
</html>
コード例 #5
0
<?php

require_once "util.php";
require_once "NTK/NTK.php";
require_once "DataBase/Product.php";
?>

<html>
<head>
	<title> Index </title>
	
<?php 
echo getHead();
$search = var_get("search", "");
if (strlen($search) >= 3) {
    $product = new Product();
    $main_box = new NTKVBox("main_box", 0, 0, False);
    $list_view = new NTKListView("list_view", array('Produktnummer', 'Name', 'Beschreibung'), "parent.frames['main'].document." . var_get("form", "") . "." . var_get("entry", "") . ".value = '%0%';parent.frames['main'].document." . var_get("form", "") . "." . var_get("next", "") . ".focus();");
    $list_view->addLines($product->get('', array('product_id', 'name', 'details'), " product_id LIKE '%{$search}%' OR name LIKE'%{$search}%' OR details LIKE '%{$search}%'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
    echo $main_box->getHtml();
}
?>

</body>
</html>
コード例 #6
0
$printfile = "";
include "Modules/toolbar.php";
// small Toolbar
include "Modules/Category/toolbar.php";
// main content
$action = var_get_post("action", "");
$onload .= "document.getElementById('search_entry').focus();";
if ($action == "new") {
    include "Modules/Category/new_form.php";
} elseif ($action == "edit" && var_get("category_id", "") != "") {
    $data = $category->get(var_get("category_id", ""));
    include "Modules/Category/edit_form.php";
} elseif ($action == "search" && var_post("search_entry", "") != "") {
    $search = var_post("search_entry", "");
    $list_view = new NTKListView("list_view", array('Kategorienummer', 'Bezeichnung', 'Beschreibung'), "location.href = 'category.php?action=edit&category_id=%0%';");
    $list_view->addLines($category->get('', array('category_id', 'name', 'details'), "category_id LIKE '%{$search}%' OR name LIKE'%{$search}%' OR details LIKE '%{$search}%'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
} else {
    $list_view = new NTKListView("list_view", array('Kategorienummer', 'Bezeichnung', 'Beschreibung'), "location.href = 'category.php?action=edit&category_id=%0%';");
    $list_view->addLines($category->get('', array('category_id', 'name', 'details')));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
}
// main content
$main_box->add($spacer, -1, -1, "background-color:\t#dfe7f3;");
echo getHead();
echo $main_box->getHtml();
?>

</body>
</html>