Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function generateView()
- {
- $this->getViewData();
- $this->generatePageHeader('Baecker');
- // to do: call generateView() for all members
- echo <<<EOF
- <div id="content">
- <div id="tableField">
- <div class="inside">
- <form method="post" name="baker" id="baker" action="baker.php">
- <table id="bakerTable" summary="Alle Pizzen die von Kunden bestellt wurden">
- <!-- 1. Spalte !-->
- <tr>
- <td><!-- LEERFELD!--> </td>
- <th>
- bestellt
- </th>
- <th>
- im Ofen
- </th>
- <th>
- fertig
- </th>
- </tr>
- EOF;
- $this->getOrder();
- echo <<<EOF
- </form>
- <!-- tableField INSIDE END !-->
- </div>
- <!-- tableField END !-->
- </div>
- <!-- Content END !-->
- </div>
- <!-- Wrapper END !-->
- </div>
- EOF;
- // to do: output view of this page
- //$this->generatePageFooter();
- }
- protected function getOrder()
- {
- $count = 1;
- // Daten aus Tabelle holen
- $record = $this->verbindung->query("SELECT * from bestelltepizza");
- while($row_record = $record->fetch_assoc())
- {
- echo '<tr>';
- echo '<th>';
- echo utf8_encode($row_record['fPizzaName']);
- echo '</th>';
- $this->isCorrectStatus($row_record, 'bestellt', $count);
- $this->isCorrectStatus($row_record, 'imofen', $count);
- $this->isCorrectStatus($row_record, 'fertig', $count);
- echo '</tr>';
- $count++;
- }
- }
- protected function isCorrectStatus($row_record, $status, $count)
- {
- echo '<td>';
- if($row_record['Status'] == $status){
- echo '<input type="radio" name="pizza'.$count.'[id]" value="'.$status.'" checked/>';
- } else{
- echo '<input type="radio" name="pizza'.$count.'[status]" value="'.$status.'" onclick="this.form.submit()" />';
- }
- echo '</td>';
- }
Add Comment
Please, Sign In to add comment