| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- require_once("util.php");
- require_once("../DataBase/Product.php");
- require_once("../DataBase/Tax.php");
- require_once("../DataBase/Category.php");
- require_once("../DataBase/Priceset.php");
- require_once("../DataBase/Group.php");
- require_once("../DataBase/Price.php");
- $db_action = var_get_post("db_action", "");
- $product = new Product();
- $tax = new Tax();
- $category = new Category();
- $priceset = new Priceset();
- $price = new Price();
- $group = new Group();
- switch($db_action)
- {
- case "new":
- $product->create(var_post("product_id", ""), array( var_post("name", ""),
- var_post("details", ""),
- var_post("category_id", ""),
- var_post("tax_id", ""),
- var_post("available", ""),
- var_post("group_id", ""),
- var_post("order_number", ""),
- var_post("anmerkung", "")));
- $priceset_list = $priceset->get();
- for($i = 0; $i < count($priceset_list); $i++)
- $price->create(var_post("priceset_id_".$i, ""), var_post("product_id", ""), var_post("priceset_price_".$i, ""));
- break;
- case "edit":
- $product->update(var_post("product_id", ""), array( var_post("name", ""),
- var_post("details", ""),
- var_post("category_id", ""),
- var_post("tax_id", ""),
- var_post("available", ""),
- var_post("group_id", ""),
- var_post("order_number", ""),
- var_post("anmerkung", "")));
- $priceset_list = $priceset->get();
- for($i = 0; $i < count($priceset_list); $i++)
- {
- if($price->exists(var_post("priceset_id_".$i, ""), var_post("product_id", "")))
- $price->update(var_post("priceset_id_".$i, ""), var_post("product_id", ""), array(var_post("priceset_price_".$i, "")));
- else
- $price->create(var_post("priceset_id_".$i, ""), var_post("product_id", ""), var_post("priceset_price_".$i, ""));
- }
- break;
- case "delete":
- $product->delete(var_get("product_id", ""));
- break;
- }
- ?>
|