| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- require_once("util.php");
- require_once("NTK/NTK.php");
- require_once("../DataBase/Tour.php");
- require_once("../DataBase/Bill.php");
- 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(var_post("customer_id", ""), var_post("tour_id", ""), var_post("assistant_id", ""), -1, var_post("date", ""));
- $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($new_bill_id, $result[$i][0], $result[$i][2], '', 0, 0, 0);
- }
- break;
- }
- ?>
|