NTKEBillDetails.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. class NTKEBillDetails
  3. {
  4. function NTKEBillDetails($bill_product_id, $bill_id, $details, $new = False)
  5. {
  6. $this->bill_product_id = $bill_product_id;
  7. $this->bill_id = $bill_id;
  8. $this->details = $details;
  9. $this->new = $new;
  10. }
  11. function getHtml()
  12. {
  13. $html .= "<div width=\"100%\" height=\"100%\">\n";
  14. $html .= "<form name=\"bill_details_form_".$this->bill_product_id."\" action=\"bill.php\" method=\"POST\">\n";
  15. $html .= "<input type=\"hidden\" name=\"bill_product_id\" value=\"".$this->bill_product_id."\">\n";
  16. $html .= "<input type=\"hidden\" name=\"bill_id\" value=\"".$this->bill_id."\">\n";
  17. $html .= "<input type=\"hidden\" name=\"product_id\" value=\"-1\">\n";
  18. $html .= "<input type=\"hidden\" name=\"amount\" value=\"0\">\n";
  19. $html .= "<input type=\"hidden\" name=\"action\" value=\"edit\">\n";
  20. $html .= "<table width=\"100%\" height=\"100%\" border=1>\n";
  21. $html .= "<tr>\n";
  22. if(!$this->new)
  23. {
  24. global $PHP_SELF;
  25. $html .= "<td width=\"32\"><a href=\"".$PHP_SELF."?action=edit&bill_id=".$this->bill_id."&bill_product_id=".$this->bill_product_id."&db_action=move_down\"><img src=\"Icons/down.png\" border=\"0\"></a></td>\n";
  26. $html .= "<td width=\"32\"><a href=\"".$PHP_SELF."?action=edit&bill_id=".$this->bill_id."&bill_product_id=".$this->bill_product_id."&db_action=move_up\"><img src=\"Icons/up.png\" border=\"0\"></a></td>\n";
  27. }
  28. $html .= "<td align=right>\n";
  29. $label = new NTKLabel("details_label", "Textzeile");
  30. $html .= $label->getHtml();
  31. $html .= "</td>\n";
  32. $html .= "<td width=\"200px\">\n";
  33. $entry = new NTKEntry("details", $this->details, "width: 200px;");
  34. $html .= $entry->getHtml();
  35. $html .= "</td>\n";
  36. if($this->new)
  37. {
  38. $html .= "<td colspan=\"2\">\n";
  39. $button = new NTKButton("button_new", "hinzuf&uuml;gen", "document.forms['bill_details_form_".$this->bill_product_id."'].submit();");
  40. $html .= $button->getHtml();
  41. $html .= "</td>\n";
  42. $html .= "<input type=\"hidden\" name=\"db_action\" value=\"position_add\">\n";
  43. }
  44. else
  45. {
  46. $html .= "<td>\n";
  47. $button = new NTKButton("button_edit", "ok", "document.forms['bill_details_form_".$this->bill_product_id."'].submit();");
  48. $html .= $button->getHtml();
  49. $html .= "</td>\n";
  50. $html .= "<input type=\"hidden\" name=\"db_action\" value=\"position_edit\">\n";
  51. $html .= "<td>\n";
  52. $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."';");
  53. $html .= $button->getHtml();
  54. $html .= "</td>\n";
  55. }
  56. $html .= "</tr>\n";
  57. $html .= "</table>\n";
  58. $html .= "</form>\n";
  59. $html .= "</div>\n";
  60. return $html;
  61. }
  62. }
  63. ?>