stat_product_list.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. require_once("util.php");
  3. require_once("NTK/NTK.php");
  4. require_once("../DataBase/Product.php");
  5. require_once("../DataBase/Group.php");
  6. require_once("../DataBase/Priceset.php");
  7. require_once("../DataBase/Price.php");
  8. require_once("../DataBase/Category.php");
  9. require_once("../DataBase/Tax.php");
  10. require_once("../DataBase/Assistant.php");
  11. require_once("../DataBase/Bill.php");
  12. require_once("../DataBase/Bill_Product.php");
  13. $group = new Group();
  14. $priceset = new Priceset();
  15. $category = new Category();
  16. $product = new Product();
  17. $price = new Price();
  18. $tax = new Tax();
  19. $assistant = new Assistant();
  20. $bill = new Bill();
  21. if(var_post("print", "") == "print")
  22. {
  23. $search = "";
  24. if(!var_post("group_all", ""))
  25. {
  26. if($search)
  27. $search .= " AND group_id='".var_post("group", "")."' ";
  28. else
  29. $search .= "group_id='".var_post("group", "")."' ";
  30. }
  31. if(!var_post("category_all", ""))
  32. {
  33. if($search)
  34. $search .= " AND category_id='".var_post("category", "")."' ";
  35. else
  36. $search .= "category_id='".var_post("category", "")."' ";
  37. }
  38. if(var_post("available", "") && !var_post("not_available", ""))
  39. {
  40. if($search)
  41. $search .= " AND available='1' ";
  42. else
  43. $search .= "available='1' ";
  44. }
  45. if(!var_post("available", "") && var_post("not_available", ""))
  46. {
  47. if($search)
  48. $search .= " AND available='0' ";
  49. else
  50. $search .= "available='0' ";
  51. }
  52. if(var_post("product_id_from", ""))
  53. {
  54. if($search)
  55. $search .= " AND (product_id >=".var_post("product_id_from", "").") ";
  56. else
  57. $search .= "(product_id >=".var_post("product_id_from", "").") ";
  58. }
  59. if(var_post("product_id_to", ""))
  60. {
  61. if($search)
  62. $search .= " AND (product_id <=".var_post("product_id_to", "").") ";
  63. else
  64. $search .= "(product_id <=".var_post("product_id_to", "").") ";
  65. }
  66. $product_data = $product->get('', array(), $search);
  67. $assistant_data = $assistant->get(var_post("assistant", ""));
  68. $priceset = new Priceset();
  69. $tmp = $priceset->get(var_post("priceset", ""));
  70. $priceset_data = $tmp[0];
  71. include("Druckvorlagen/zeilen.php");
  72. include("Druckvorlagen/list.php");
  73. }
  74. else
  75. {
  76. $toolbar_box = new NTKVBox("toolbar_box", 0, 0, False);
  77. $main_box = new NTKTable("main_box", 14, 4, False);
  78. $main_box->setStyle("background-color: #dfe7f3;");
  79. $main_box->add(new NTKLabel("", "Produktnummer von:"), 1, 0);
  80. $main_box->add(new NTKEntry("product_id_from", ""), 1, 1);
  81. $main_box->add(new NTKLabel("", "bis: "), 1, 2);
  82. $main_box->add(new NTKEntry("product_id_to", ""), 1, 3);
  83. $main_box->add(new NTKLabel("", "alle Gruppen"), 3, 0);
  84. $main_box->add(new NTKCheckbox("group_all", 1, True), 3, 1);
  85. $main_box->add(new NTKLabel("", "aus Gruppe"), 3, 2);
  86. $main_box->add(new NTKComboBox("group", $group->get("")), 3, 3);
  87. $main_box->add(new NTKLabel("", "verf&uuml;gbare"), 5, 0);
  88. $main_box->add(new NTKCheckbox("available", 1, True), 5, 1);
  89. $main_box->add(new NTKLabel("", "nicht verf&uuml;gbare"), 5, 2);
  90. $main_box->add(new NTKCheckbox("not_available", 1, False), 5, 3);
  91. $main_box->add(new NTKLabel("", "aus Preisliste"), 7, 0);
  92. $main_box->add(new NTKComboBox("priceset", $priceset->get("")), 7, 1);
  93. $main_box->add(new NTKLabel("", "alle Kategorien"), 9, 0);
  94. $main_box->add(new NTKCheckbox("category_all", 1, True), 9, 1);
  95. $main_box->add(new NTKLabel("", "aus Kategorie"), 9, 2);
  96. $main_box->add(new NTKComboBox("category", $category->get("")), 9, 3);
  97. $main_box->add(new NTKLabel("", "Mitarbeiter"), 11, 0);
  98. $main_box->add(new NTKComboBox("assitant", $assistant->get("")), 11, 1);
  99. $main_box->add(new NTKButton("submit", "Druckvorschau", "document.forms['print'].submit();"), 13, 3);
  100. $form = new NTKForm("print", "stat_product_list.php", $main_box);
  101. $form->addAttribute("print", "print");
  102. $toolbar_box->add($form, 0, 0);
  103. echo getHead();
  104. echo $toolbar_box->getHtml();
  105. }
  106. ?>
  107. </body>
  108. </html>