stat_product_date_count.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. echo getHead();
  22. $toolbar_box = new NTKVBox("toolbar_box", 5, 0, True);
  23. $product_id = var_post("product_id", "");
  24. $date_from = var_post("date_from", "");
  25. $date_to = var_post("date_to", "");
  26. if($product_id != "" && $date_from != "" && $date_to != "")
  27. {
  28. $product_amount = $product->getAmountByDate($product_id, $date_from, $date_to, 1);
  29. $bill_data = $product->getBillsByDate($product_id, $date_from, $date_to, 1);
  30. $customer_data = $product->getCustomersByDate($product_id, $date_from, $date_to, 1);
  31. $result_box = new NTKTable("result_box", 4, 2, False);
  32. $result_box->setStyle("background-color: #F8FF77;");
  33. $result_box->add(new NTKLabel("", "Produktnummer:"), 0, 0);
  34. $result_box->add(new NTKLabel("", "<b>".$product_id."</b>"), 0, 1);
  35. $result_box->add(new NTKLabel("", "Zeitraum:"), 1, 0);
  36. $result_box->add(new NTKLabel("", "von <b>".$date_from."</b> bis <b>".$date_to."</b>"), 1, 1);
  37. $result_box->add(new NTKLabel("", "Menge:"), 1, 0);
  38. $result_box->add(new NTKLabel("", "<b>".round($product_amount, 2)."</b>"), 1, 1);
  39. $result_box->add(new NTKLabel("", "In Rechnungen (Menge):"), 2, 0);
  40. $bills = "";
  41. for($i = 0; $i < count($bill_data); $i++)
  42. {
  43. $bills = $bills." ".$bill_data[$i][0]." (";
  44. $bills = $bills." ".$bill_data[$i][1].") ; ";
  45. }
  46. $result_box->add(new NTKLabel("", $bills), 2, 1);
  47. $result_box->add(new NTKLabel("", "Von Kunden:"), 3, 0);
  48. $customer_string = "";
  49. for($i = 0; $i < count($customer_data); $i++)
  50. {
  51. $customer_string = $customer_string." ".$customer_data[$i][0]."(";
  52. $customer_string = $customer_string." ".$customer_data[$i][1].") ; ";
  53. }
  54. $result_box->add(new NTKLabel("", $customer_string), 3, 1);
  55. $toolbar_box->add($result_box, 0, 0);
  56. }
  57. $main_box = new NTKTable("main_box", 6, 4, False);
  58. $main_box->setStyle("background-color: #dfe7f3;");
  59. $main_box->add(new NTKLabel("", "<b>Produktverkauf in einem bestimmten Zeitraum</b>"), 0, 0);
  60. $main_box->add(new NTKLabel("", "Produktnummer:"), 2, 0);
  61. $main_box->add(new NTKEntry("product_id", $product_id), 2, 1);
  62. $main_box->add(new NTKLabel("", "Von:"), 3, 0);
  63. $main_box->add(new NTKEntry("date_from", $date_from), 3, 1);
  64. $main_box->add(new NTKLabel("", "Bis:"), 3, 2);
  65. $main_box->add(new NTKEntry("date_to", $date_to), 3, 3);
  66. $main_box->add(new NTKButton("submit", "OK", "document.forms['stat_product_date_count'].submit();"), 5, 3);
  67. $form = new NTKForm("stat_product_date_count", "stat_product_date_count.php", $main_box);
  68. $toolbar_box->add($form, 10, 0);
  69. echo $toolbar_box->getHtml();
  70. ?>
  71. </body>
  72. </html>