print.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. $var_print = var_post("print", "");
  22. $var_group_all = var_post("group_all", "");
  23. $var_group = var_post("group", "");
  24. $var_category_all = var_post("category_all", "");
  25. $var_category = var_post("category", "");
  26. $var_available = var_post("available", "");
  27. $var_not_available = var_post("not_available", "");
  28. $var_product_id_from = var_post("product_id_from", "");
  29. $var_product_id_to = var_post("product_id_to", "");
  30. $var_assistant = var_post("assistant", "");
  31. $var_priceset = var_post("priceset", "");
  32. $var_product_id = var_post("product_id", "");
  33. $var_date_from = var_post("date_from", "");
  34. $var_date_to = var_post("date_to", "");
  35. if($var_print == "print")
  36. {
  37. $search = "";
  38. if(!$var_group_all)
  39. {
  40. if($search)
  41. $search .= " AND group_id='".$var_group."' ";
  42. else
  43. $search .= "group_id='".$var_group."' ";
  44. }
  45. if(!$var_category_all)
  46. {
  47. if($search)
  48. $search .= " AND category_id='".$var_category."' ";
  49. else
  50. $search .= "category_id='".$var_category."' ";
  51. }
  52. if($var_available && !$var_not_available)
  53. {
  54. if($search)
  55. $search .= " AND available='1' ";
  56. else
  57. $search .= "available='1' ";
  58. }
  59. if(!$var_available && $var_not_available)
  60. {
  61. if($search)
  62. $search .= " AND available='0' ";
  63. else
  64. $search .= "available='0' ";
  65. }
  66. if($var_product_id_from)
  67. {
  68. if($search)
  69. $search .= " AND (product_id >=".$var_product_id_from.") ";
  70. else
  71. $search .= "(product_id >=".$var_product_id_from.") ";
  72. }
  73. if($var_product_id_to)
  74. {
  75. if($search)
  76. $search .= " AND (product_id <=".$var_product_id_to.") ";
  77. else
  78. $search .= "(product_id <=".$var_product_id_to.") ";
  79. }
  80. $product_data = $product->get('', array(), $search);
  81. $assistant_data = $assistant->get($var_assistant);
  82. $priceset = new Priceset();
  83. $tmp = $priceset->get($var_priceset);
  84. $priceset_data = $tmp[0];
  85. include("Druckvorlagen/zeilen.php");
  86. include("Druckvorlagen/list.php");
  87. }
  88. elseif($var_print == "print_re")
  89. {
  90. $search = "";
  91. if($var_product_id)
  92. {
  93. if($search)
  94. $search .= " AND (product_id >=".$var_product_id.") ";
  95. else
  96. $search .= "(product_id >=".$var_product_id.") ";
  97. }
  98. if($var_date_from)
  99. {
  100. if($search)
  101. $search .= " AND (date >='".$var_date_from."') ";
  102. else
  103. $search .= "(date >='".$var_date_from."') ";
  104. }
  105. if($var_date_to)
  106. {
  107. if($search)
  108. $search .= " AND (date <='".$var_date_to."') ";
  109. else
  110. $search .= "(date <='".$var_date_to."') ";
  111. }
  112. $bill_data = $bill->get("", array("bill_id"), $search);
  113. $bill_product = new Bill_Product();
  114. $tour_data[1] = "( Alle Touren )";
  115. $product = new Product();
  116. $product_data = $product->get();
  117. include("Druckvorlagen/tour.php");
  118. }
  119. elseif($var_print == "print_2")
  120. {
  121. if($var_product_id != "" && $var_date_from != "" && $var_date_to != "")
  122. {
  123. $product_amount = $product->getAmountByDate($var_product_id, $var_date_from, $var_date_to);
  124. echo "Menge von Produkt ".$var_product_id." : ".$product_amount;
  125. }
  126. }
  127. else
  128. {
  129. echo getHead();
  130. $main_box = new NTKTable("main_box", 14, 4, False);
  131. $main_box->setStyle("background-color: #dfe7f3;");
  132. $main_box->add(new NTKLabel("", "Produktnummer von:"), 1, 0);
  133. $main_box->add(new NTKEntry("product_id_from", ""), 1, 1);
  134. $main_box->add(new NTKLabel("", "bis: "), 1, 2);
  135. $main_box->add(new NTKEntry("product_id_to", ""), 1, 3);
  136. $main_box->add(new NTKLabel("", "alle Gruppen"), 3, 0);
  137. $main_box->add(new NTKCheckbox("group_all", 1, True), 3, 1);
  138. $main_box->add(new NTKLabel("", "aus Gruppe"), 3, 2);
  139. $main_box->add(new NTKComboBox("group", $group->get("")), 3, 3);
  140. $main_box->add(new NTKLabel("", "verf&uuml;gbare"), 5, 0);
  141. $main_box->add(new NTKCheckbox("available", 1, True), 5, 1);
  142. $main_box->add(new NTKLabel("", "nicht verf&uuml;gbare"), 5, 2);
  143. $main_box->add(new NTKCheckbox("not_available", 1, False), 5, 3);
  144. $main_box->add(new NTKLabel("", "aus Preisliste"), 7, 0);
  145. $main_box->add(new NTKComboBox("priceset", $priceset->get("")), 7, 1);
  146. $main_box->add(new NTKLabel("", "alle Kategorien"), 9, 0);
  147. $main_box->add(new NTKCheckbox("category_all", 1, True), 9, 1);
  148. $main_box->add(new NTKLabel("", "aus Kategorie"), 9, 2);
  149. $main_box->add(new NTKComboBox("category", $category->get("")), 9, 3);
  150. $main_box->add(new NTKLabel("", "Mitarbeiter"), 11, 0);
  151. $main_box->add(new NTKComboBox("assitant", $assistant->get("")), 11, 1);
  152. $main_box->add(new NTKButton("submit", "Druckvorschau", "document.forms['print'].submit();"), 13, 3);
  153. $form = new NTKForm("print", "print.php", $main_box);
  154. $form->addAttribute("print", "print");
  155. echo $form->getHtml();
  156. $main_box = new NTKTable("main_box", 3, 4, False);
  157. $main_box->setStyle("background-color: #dfe7f3;");
  158. $main_box->add(new NTKLabel("", "<b>Rechnungszusammenfassung nach Datum</b>"), 0, 0);
  159. $main_box->add(new NTKLabel("", "Von:"), 1, 0);
  160. $main_box->add(new NTKEntry("date_from", ""), 1, 1);
  161. $main_box->add(new NTKLabel("", "Bis:"), 1, 2);
  162. $main_box->add(new NTKEntry("date_to", ""), 1, 3);
  163. $main_box->add(new NTKButton("submit", "Druckvorschau", "document.forms['print_re'].submit();"), 2, 3);
  164. $form = new NTKForm("print_re", "print.php", $main_box);
  165. $form->addAttribute("print", "print_re");
  166. echo $form->getHtml();
  167. # maske zur listenerzeugung von verkaufszahlen pro produkt in einem bestimmten Zeitraum
  168. $main_box = new NTKTable("main_box", 5, 4, False);
  169. $main_box->setStyle("background-color: #dfe7f3;");
  170. $main_box->add(new NTKLabel("", "<b>Produktverkauf in einem bestimmten Zeitraum</b>"), 0, 0);
  171. $main_box->add(new NTKLabel("", "Produktnummer:"), 1, 0);
  172. $main_box->add(new NTKEntry("product_id", ""), 1, 1);
  173. $main_box->add(new NTKLabel("", "Von:"), 2, 0);
  174. $main_box->add(new NTKEntry("date_from", ""), 2, 1);
  175. $main_box->add(new NTKLabel("", "Bis:"), 2, 2);
  176. $main_box->add(new NTKEntry("date_to", ""), 2, 3);
  177. $main_box->add(new NTKButton("submit", "Druckvorschau", "document.forms['print_2'].submit();"), 4, 3);
  178. $form = new NTKForm("print_2", "print.php", $main_box);
  179. $form->addAttribute("print", "print_2");
  180. echo $form->getHtml();
  181. }
  182. ?>
  183. </body>
  184. </html>