NTKEBillPosition.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. class NTKEBillPosition
  3. {
  4. function NTKEBillPosition($bill_product_id, $bill_id, $product_id, $amount, $details, $rabatt, $product_name, $new = False)
  5. {
  6. $this->bill_product_id = $bill_product_id;
  7. $this->bill_id = $bill_id;
  8. $this->product_id = $product_id;
  9. $this->amount = $amount;
  10. $this->details = $details;
  11. $this->rabatt = $rabatt;
  12. $this->product_name = $product_name;
  13. $this->new = $new;
  14. }
  15. function getHtml()
  16. {
  17. $html .= "<div width=\"100%\" height=\"100%\">\n";
  18. $html .= "<form name=\"bill_product_form_".$this->bill_product_id."\" action=\"bill.php\" method=\"POST\">\n";
  19. $html .= "<input type=\"hidden\" name=\"bill_product_id\" value=\"".$this->bill_product_id."\">\n";
  20. $html .= "<input type=\"hidden\" name=\"bill_id\" value=\"".$this->bill_id."\">\n";
  21. $html .= "<input type=\"hidden\" name=\"product_id\" value=\"".$this->product_id."\">\n";
  22. $html .= "<input type=\"hidden\" name=\"action\" value=\"edit\">\n";
  23. $html .= "<table width=\"100%\" height=\"100%\" border=0>\n";
  24. $html .= "<tr>\n";
  25. $html .= "<td align=right width=1>\n";
  26. $label = new NTKLabel("product_label", "Produktnummer");
  27. $html .= $label->getHtml();
  28. $html .= "</td>\n";
  29. $html .= "<td width=1>\n";
  30. $entry = new NTKEntry("product_id", $this->product_id, "width: 100px;");
  31. $html .= $entry->getHtml();
  32. $html .= "</td>\n";
  33. $html .= "<td align=left>\n";
  34. $label = new NTKLabel("product_name", "(".$this->product_name.")");
  35. $html .= $label->getHtml();
  36. $html .= "</td>\n";
  37. $html .= "<td align=right width=1>\n";
  38. $label = new NTKLabel("amount_label", "St&uuml;ckzahl");
  39. $html .= $label->getHtml();
  40. $html .= "</td>\n";
  41. $html .= "<td>\n";
  42. $entry = new NTKEntry("amount", $this->amount, "width: 50px;");
  43. $html .= $entry->getHtml();
  44. $html .= "</td>\n";
  45. $html .= "<td align=right width=1>\n";
  46. $label = new NTKLabel("details_label", "Anmerkung");
  47. $html .= $label->getHtml();
  48. $html .= "</td>\n";
  49. $html .= "<td>\n";
  50. $entry = new NTKEntry("details", $this->details, "width: 100%;");
  51. $html .= $entry->getHtml();
  52. $html .= "</td>\n";
  53. $html .= "<td align=right width=1>\n";
  54. $label = new NTKLabel("rabatt_label", "Rabatt");
  55. $html .= $label->getHtml();
  56. $html .= "</td>\n";
  57. $html .= "<td>\n";
  58. $entry = new NTKEntry("rabatt", $this->rabatt, "width: 50px;");
  59. $html .= $entry->getHtml();
  60. $html .= "</td>\n";
  61. if($this->new)
  62. {
  63. $html .= "<td colspan=\"2\">\n";
  64. $button = new NTKButton("button_delete", "hinzuf&uuml;gen", "document.forms['bill_product_form_".$this->bill_product_id."'].submit();");
  65. $html .= $button->getHtml();
  66. $html .= "</td>\n";
  67. $html .= "<input type=\"hidden\" name=\"db_action\" value=\"position_add\">\n";
  68. }
  69. else
  70. {
  71. $html .= "<td>\n";
  72. $button = new NTKButton("button_edit", "ok", "document.forms['bill_product_form_".$this->bill_product_id."'].submit();");
  73. $html .= $button->getHtml();
  74. $html .= "</td>\n";
  75. $html .= "<td>\n";
  76. $button = new NTKButton("button_delete", "l&ouml;schen", "location.href = 'bill.php?action=edit&bill_id=".$this->bill_id."&db_action=position_delete&bill_product_id=".$this->bill_product_id."';");
  77. $html .= $button->getHtml();
  78. $html .= "</td>\n";
  79. $html .= "<input type=\"hidden\" name=\"db_action\" value=\"position_edit\">\n";
  80. }
  81. $html .= "</tr>\n";
  82. $html .= "</table>\n";
  83. $html .= "</form>\n";
  84. $html .= "</div>\n";
  85. return $html;
  86. }
  87. }
  88. ?>