Guest User

Untitled

a guest
Oct 23rd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. protected function generateView()
  2. {
  3. $this->getViewData();
  4. $this->generatePageHeader('Baecker');
  5. // to do: call generateView() for all members
  6. echo <<<EOF
  7. <div id="content">
  8. <div id="tableField">
  9. <div class="inside">
  10.  
  11. <form method="post" name="baker" id="baker" action="baker.php">
  12. <table id="bakerTable" summary="Alle Pizzen die von Kunden bestellt wurden">
  13. <!-- 1. Spalte !-->
  14. <tr>
  15. <td><!-- LEERFELD!--> </td>
  16. <th>
  17. bestellt
  18. </th>
  19. <th>
  20. im Ofen
  21. </th>
  22. <th>
  23. fertig
  24. </th>
  25. </tr>
  26. EOF;
  27. $this->getOrder();
  28. echo <<<EOF
  29. </form>
  30.  
  31. <!-- tableField INSIDE END !-->
  32. </div>
  33. <!-- tableField END !-->
  34. </div>
  35.  
  36.  
  37. <!-- Content END !-->
  38. </div>
  39. <!-- Wrapper END !-->
  40. </div>
  41. EOF;
  42. // to do: output view of this page
  43. //$this->generatePageFooter();
  44. }
  45.  
  46. protected function getOrder()
  47. {
  48. $count = 1;
  49. // Daten aus Tabelle holen
  50. $record = $this->verbindung->query("SELECT * from bestelltepizza");
  51.  
  52. while($row_record = $record->fetch_assoc())
  53. {
  54.  
  55. echo '<tr>';
  56. echo '<th>';
  57. echo utf8_encode($row_record['fPizzaName']);
  58. echo '</th>';
  59. $this->isCorrectStatus($row_record, 'bestellt', $count);
  60. $this->isCorrectStatus($row_record, 'imofen', $count);
  61. $this->isCorrectStatus($row_record, 'fertig', $count);
  62. echo '</tr>';
  63. $count++;
  64. }
  65. }
  66.  
  67. protected function isCorrectStatus($row_record, $status, $count)
  68. {
  69.  
  70. echo '<td>';
  71. if($row_record['Status'] == $status){
  72. echo '<input type="radio" name="pizza'.$count.'[id]" value="'.$status.'" checked/>';
  73. } else{
  74. echo '<input type="radio" name="pizza'.$count.'[status]" value="'.$status.'" onclick="this.form.submit()" />';
  75. }
  76. echo '</td>';
  77. }
Add Comment
Please, Sign In to add comment