/** * implements the content of the viewed page * * @param OutputDevice $od */ protected function addPageContent(OutputDevice $od) { $table = new base_html_model_Table(); $form = new base_html_model_Form(); $cellUsernameLabel = new base_html_model_table_Cell(); $cellUsernameLabel->setContent($form->label('Benutzername', 'userName')); $cellUsernameInput = new base_html_model_table_Cell(); $cellUsernameInput->setContent($form->textInput('userName')); $cellPasswordLabel = new base_html_model_table_Cell(); $cellPasswordLabel->setContent($form->label('Passwort', 'password')); $cellPasswordInput = new base_html_model_table_Cell(); $cellPasswordInput->setContent($form->passwordInput('password')); $row = new base_html_model_table_Row(); $row->addCell($cellUsernameLabel); $row->addCell($cellUsernameInput); $row1 = new base_html_model_table_Row(); $row1->addCell($cellPasswordLabel); $row1->addCell($cellPasswordInput); $table->addRow($row); $table->addRow($row1); $od->addContent($form->start(HTML_ROOT . '/de/ajax.php?class=base_login_ajax_DoLogin', 'post', array('class' => 'ajaxForm', 'id' => 'login'))); $od->addContent($table->toString()); $od->addContent($form->submitButton('login', 'Einloggen')); $od->addContent($form->end()); }
private function _setFilterOptions() { $form = new base_html_model_Form(); $output = $form->start('#', 'post', array('id' => 'tableOperations')); $output .= Html::startTag('div', array('class' => 'tableOperations')); $output .= Html::startTag('div', array('id' => 'sort')); $output .= 'Sortieren nach: '; $output .= "<select name='sort' onChange='this.form.submit()'>"; foreach ($this->showColumns as $colName => $colLabel) { if ($colName == $this->controller->getFilterParam('sort')) { $output .= "<option value='$colName' selected>$colLabel</option>"; } else { $output .= "<option value='$colName'>$colLabel</option>"; } } $output .= '</select>'; $output .= "<select name='direction' onChange='$(\"#tableOperations\").submit()'>"; $output .= "<option value='" . base_database_Order::ASC . "'>aufsteigend</option>"; $output .= "<option value='" . base_database_Order::DESC ."'"; if ($this->controller->getFilterParam('direction') == base_database_Order::DESC) { $output .= ' selected'; } $output .= ">absteigend</option>"; $output .= "</select>"; $output .= Html::endTag('div'); $output .= Html::startTag('div', array('class' => 'numberOfData')); $output .= 'Einträge '; $output .= "<select name='limit' onChange='this.form.submit()'>"; $limit = $this->controller->getFilterParam('limit'); foreach (array(10, 25, 50, 100) as $number) { if ($number == $limit) { $output .= "<option value=$number selected='selected'>$number</option>"; } else { $output .= "<option value=$number>$number</option>"; } } $output .= "</select> "; $numPages = ceil($this->controller->countData() / $limit); $output .= "Seite: " . Html::singleTag('input', array('name' => 'page', 'id' => 'pager', 'size' => 1, 'value' => $this->controller->getFilterParam('page'))) . " / " . Html::startTag('span', array('id' => 'numPages')) . $numPages . Html::endTag('span'); $output .= Html::endTag('div'); $output .= Html::endTag('div'); return $output; }
$titlesForOrderTable = array('Artikel', 'NettoPreis', 'Menge', 'Gesamt'); foreach ($titlesForOrderTable as $title) { $cell = new base_html_model_table_Cell(); $cell->setContent($title); $row->addCell($cell); } $table->addHeadRow($row); $orderBox = Html::startTag('div', array('id' => 'order')); $orderBox .= Html::startTag('p', array('id' => 'orderHeadline')) . 'Warenkorb' . Html::endTag('p'); $orderBox .= Html::startTag('div', array('id' => 'orderNoContent')) . 'Es wurden noch keine Waren ausgewählt' . Html::endTag('div'); $orderBox .= Html::startTag('div', array('id' => 'orderContent')); $form = new base_html_model_Form(); $orderBox .= $form->start('ajax.php?controller=medexchange_ajax_save_medorder_Controller', 'post', array('class' => 'ajaxForm')); $orderBox .= $table->toString(); $orderBox .= Html::startTag('div', array('id' => 'totalAmount')) . "Gesamt:\t" . Html::startTag('span') . Html::endTag('span') . " €" . Html::endTag('div') . "<br />"; $formElement = new base_form_element_Submit(new Fieldinfo('MedOffer')); $formElement->setName('submit'); $formElement->setValue('Absenden'); $orderBox .= $formElement->display(); $orderBox .= $form->end(); $orderBox .= Html::endTag('div'); $orderBox .= Html::endTag('div'); $od->addContent( $orderBox); }