| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- require_once("util.php");
- require_once("NTK/NTK.php");
- require_once("DataBase/Tour.php");
- require_once("DataBase/Assistant.php");
- ?>
- <html>
- <head>
- <title> Index </title>
- <?php
- include("Modules/Tour/db_action.php");
- $main_box = new NTKVBox("main_box", 0, 0, False);
- $action = var_get_post("action", "");
- $tour_id = var_get_post("tour_id", "");
- $datum = var_get_post("date", "");
- // Toolbar
- $page = "tour";
- $printfile = "";
- if($action == "list_tour")
- $printfile = "print_tour.php?tour_id=".$tour_id."&date=".$datum;
- include("Modules/toolbar.php");
- // small Toolbar
- include("Modules/Tour/toolbar.php");
- // main content
- if($action == "new")
- {
- include("Modules/Tour/new_form.php");
- }
- elseif($action == "edit" && $tour_id != "")
- {
- $data = $tour->get($tour_id);
- include("Modules/Tour/edit_form.php");
- }
- elseif($action == "search" && var_post("search_entry", "") != "")
- {
- $search = var_post("search_entry", "");
- $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'), "tour_id LIKE '%$search%' OR name LIKE'%$search%'"));
- $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
- }
- elseif($action == "list_tour")
- {
- $assistant = new Assistant();
- $tour = new Tour();
- $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>
|