| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- require_once("util.php");
- require_once("NTK/NTK.php");
- ?>
- <html>
- <head>
- <title> Index </title>
- <?php
- $action = var_get_post("action", "");
- $bill_id = var_get_post("bill_id", "");
- $from_page = var_get_post("from_page", "");
- $fp_tour_id = var_get_post("fp_tour_id", "");
- $fp_date = var_get_post("fp_date", "");
- include("Modules/Bill/db_action.php");
- $main_box = new NTKVBox("main_box", 0, 0, False);
- // Toolbar
- $page = "bill";
- $printfile = "";
- if($action == "edit" && $bill_id != "")
- $printfile = "print_bill.php?bill_id=".$bill_id;
- include("Modules/toolbar.php");
- // small Toolbar
- include("Modules/Bill/toolbar.php");
- // main content
- $onload .= "document.getElementById('search_entry').focus();";
- if($action == "new")
- {
- include("Modules/Bill/new_form.php");
- }
- elseif($action == "edit" && $bill_id != "")
- {
- $data = $bill->get($bill_id);
- $edit_action = var_get_post("edit_action", "");
- include("Modules/Bill/edit_form.php");
- }
- elseif($action == "search" && var_post("search_entry", "") != "")
- {
- $search = var_post("search_entry", "");
- $list_view = new NTKListView("list_view", array('ID', 'Rechnungsnummer', 'Kunde','Tour'), "location.href = 'bill.php?action=edit&bill_id=%0%';");
- $results = $bill->get('', array('bill_id', 'bill_number', 'customer.prename', 'bill.tour_id'), "customer.prename LIKE '%$search%' OR bill_number LIKE '%$search%' OR bill.customer_id LIKE'%$search%' OR bill.tour_id LIKE '%$search%'");
- if(count($results) == 1)
- $onload = "location.href = 'bill.php?action=edit&bill_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('ID', 'Rechnungsnummer','Kunde','Tour'), "location.href = 'bill.php?action=edit&bill_id=%0%';");
- $list_view->addLines($bill->get('', array('bill_id', 'bill_number', 'customer.prename', 'bill.tour_id')));
- $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");*/
- $main_box->add(new NTKSpacer(), -1, -1);
- }
- // main content
- //$main_box->add($spacer, -1, -1, "background-color: #dfe7f3;");
- echo getHead();
- echo $main_box->getHtml();
- ?>
- </body>
- </html>
|