print_dialog.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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_date_from)
  92. {
  93. if($search)
  94. $search .= " AND (date >='".$var_date_from."') ";
  95. else
  96. $search .= "(date >='".$var_date_from."') ";
  97. }
  98. if($var_date_to)
  99. {
  100. if($search)
  101. $search .= " AND (date <='".$var_date_to."') ";
  102. else
  103. $search .= "(date <='".$var_date_to."') ";
  104. }
  105. $bill_data = $bill->get("", array("bill_id"), $search);
  106. $bill_product = new Bill_Product();
  107. $tour_data[1] = "( Alle Touren )";
  108. $product = new Product();
  109. $product_data = $product->get();
  110. include("Druckvorlagen/tour.php");
  111. }
  112. else
  113. {
  114. $main_box = new NTKTable("main_box", 14, 4, False);
  115. $main_box->setStyle("background-color: #dfe7f3;");
  116. $main_box->add(new NTKLabel("", "Produktnummer von:"), 1, 0);
  117. $main_box->add(new NTKEntry("product_id_from", ""), 1, 1);
  118. $main_box->add(new NTKLabel("", "bis: "), 1, 2);
  119. $main_box->add(new NTKEntry("product_id_to", ""), 1, 3);
  120. $main_box->add(new NTKLabel("", "alle Gruppen"), 3, 0);
  121. $main_box->add(new NTKCheckbox("group_all", 1, True), 3, 1);
  122. $main_box->add(new NTKLabel("", "aus Gruppe"), 3, 2);
  123. $main_box->add(new NTKComboBox("group", $group->get("")), 3, 3);
  124. $main_box->add(new NTKLabel("", "verf&uuml;gbare"), 5, 0);
  125. $main_box->add(new NTKCheckbox("available", 1, True), 5, 1);
  126. $main_box->add(new NTKLabel("", "nicht verf&uuml;gbare"), 5, 2);
  127. $main_box->add(new NTKCheckbox("not_available", 1, False), 5, 3);
  128. $main_box->add(new NTKLabel("", "aus Preisliste"), 7, 0);
  129. $main_box->add(new NTKComboBox("priceset", $priceset->get("")), 7, 1);
  130. $main_box->add(new NTKLabel("", "alle Kategorien"), 9, 0);
  131. $main_box->add(new NTKCheckbox("category_all", 1, True), 9, 1);
  132. $main_box->add(new NTKLabel("", "aus Kategorie"), 9, 2);
  133. $main_box->add(new NTKComboBox("category", $category->get("")), 9, 3);
  134. $main_box->add(new NTKLabel("", "Mitarbeiter"), 11, 0);
  135. $main_box->add(new NTKComboBox("assitant", $assistant->get("")), 11, 1);
  136. $main_box->add(new NTKButton("submit", "Druckvorschau", "document.forms['print'].submit();"), 13, 3);
  137. $form = new NTKForm("print", "print_dialog.php", $main_box);
  138. $form->addAttribute("print", "print");
  139. $main_box->add($form, False, False, "background-color: #dfe7f3;");
  140. $main_box = new NTKTable("main_box", 3, 4, False);
  141. $main_box->setStyle("background-color: #dfe7f3;");
  142. $main_box->add(new NTKLabel("", "Rechnungszusammenfassung nach Datum"), 0, 0);
  143. $main_box->add(new NTKLabel("", "Von:"), 1, 0);
  144. $main_box->add(new NTKEntry("date_from", ""), 1, 1);
  145. $main_box->add(new NTKLabel("", "Bis:"), 1, 2);
  146. $main_box->add(new NTKEntry("date_to", ""), 1, 3);
  147. $main_box->add(new NTKButton("submit", "Druckvorschau", "document.forms['print_re'].submit();"), 2, 3);
  148. $form = new NTKForm("print_re", "print_dialog.php", $main_box);
  149. $form->addAttribute("print", "print_re");
  150. $main_box->add($form, False, False, "background-color: #dfe7f3;");
  151. echo getHead();
  152. echo $main_box->getHtml();
  153. }
  154. ?>
  155. <html>
  156. <body>
  157. agöflkifn
  158. </body>
  159. </html>