| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- require_once("util.php");
- require_once("NTK/NTK.php");
- ?>
- <html>
- <head>
- <title> Index </title>
- <?php
- include("Modules/Customer/db_action.php");
- $main_box = new NTKVBox("main_box", 0, 0, False);
- // Toolbar
- $page = "customer";
- $printfile = "";
- include("Modules/toolbar.php");
- // small Toolbar
- include("Modules/Customer/toolbar.php");
- // main content
- $action = var_get_post("action", "");
- $search = var_post("search_entry", "");
- $customer_id = var_get("customer_id", "");
- $onload .= "document.getElementById('search_entry').focus();";
- if($action == "new")
- {
- include("Modules/Customer/new_form.php");
- }
- elseif($action == "edit" && $customer_id != "")
- {
- $data = $customer->get($customer_id);
- include("Modules/Customer/edit_form.php");
- }
- elseif($action == "search" && $search != "")
- {
- $list_view = new NTKListView("list_view", array('Kundennummer','Name','Details'), "location.href = 'customer.php?action=edit&customer_id=%0%';");
- $results = $customer->get('', array('customer_id', 'prename', 'postname'), "customer_id LIKE '%$search%' OR prename LIKE'%$search%' OR postname LIKE '%$search%'");
- if(count($results) == 1)
- $onload = "location.href = 'customer.php?action=edit&customer_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('Kundennummer','Vorname','Nachname'), "location.href = 'customer.php?action=edit&customer_id=%0%';");
- $list_view->addLines($customer->get('', array('customer_id', 'prename', 'postname')));
- $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();
- ?>
- </body>
- </html>
|