Esempio n. 1
0
if ($getRoomId > 0) {
    $headline = $gL10n->get('SYS_EDIT_VAR', $getHeadline);
} else {
    $headline = $gL10n->get('SYS_CREATE_VAR', $getHeadline);
}
// add current url to navigation stack
$gNavigation->addUrl(CURRENT_URL, $headline);
// Create room object
$room = new TableRooms($gDb);
if ($getRoomId > 0) {
    $room->readDataById($getRoomId);
}
if (isset($_SESSION['rooms_request'])) {
    // durch fehlerhafte Eingabe ist der User zu diesem Formular zurueckgekehrt
    // nun die vorher eingegebenen Inhalte ins Objekt schreiben
    $room->setArray($_SESSION['rooms_request']);
    unset($_SESSION['rooms_request']);
}
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$roomsMenu = $page->getMenu();
$roomsMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// show form
$form = new HtmlForm('rooms_edit_form', $g_root_path . '/adm_program/modules/rooms/rooms_function.php?room_id=' . $getRoomId . '&mode=1', $page);
$form->openGroupBox('gb_name_properties', $gL10n->get('SYS_NAME') . ' & ' . $gL10n->get('SYS_PROPERTIES'));
$form->addInput('room_name', $gL10n->get('SYS_ROOM'), $room->getValue('room_name'), array('maxLength' => 100, 'property' => FIELD_REQUIRED));
$form->addInput('room_capacity', $gL10n->get('ROO_CAPACITY') . ' (' . $gL10n->get('ROO_SEATING') . ')', $room->getValue('room_capacity'), array('type' => 'number', 'minNumber' => 0, 'maxNumber' => 99999, 'property' => FIELD_REQUIRED));
$form->addInput('room_overhang', $gL10n->get('ROO_OVERHANG'), $room->getValue('room_overhang'), array('type' => 'number', 'minNumber' => 0, 'maxNumber' => 99999, 'helpTextIdLabel' => 'DAT_ROOM_OVERHANG'));
$form->closeGroupBox();
$form->openGroupBox('gb_description', $gL10n->get('SYS_DESCRIPTION'), 'admidio-panel-editor');
Esempio n. 2
0
//read rooms from database
$sql = 'SELECT room.*, ' . $additionalFields . '
          FROM ' . TBL_ROOMS . ' room
               ' . $additionalTables . '
         ORDER BY room_name';
$rooms_result = $gDb->query($sql);
if ($gDb->num_rows($rooms_result) == 0) {
    // Keine Räume gefunden
    $page->addHtml('<p>' . $gL10n->get('SYS_NO_ENTRIES') . '</p>');
} else {
    $room = new TableRooms($gDb);
    //Räume auflisten
    while ($row = $gDb->fetch_array($rooms_result)) {
        // GB-Objekt initialisieren und neuen DS uebergeben
        $room->clear();
        $room->setArray($row);
        $page->addHtml('
        <div class="panel panel-primary" id="room_' . $room->getValue('room_id') . '">
            <div class="panel-heading">
                <div class="pull-left">
                    <img class="admidio-panel-heading-icon" src="' . THEME_PATH . '/icons/home.png" alt="' . $room->getValue('room_name') . '" />' . $room->getValue('room_name') . '
                </div>
                <div class="pull-right text-right">
                    <a class="admidio-icon-link" href="' . $g_root_path . '/adm_program/modules/rooms/rooms_new.php?room_id=' . $room->getValue('room_id') . '&amp;headline=' . $textRoom . '"><img 
                        src="' . THEME_PATH . '/icons/edit.png" alt="' . $gL10n->get('SYS_EDIT') . '" title="' . $gL10n->get('SYS_EDIT') . '" /></a>
                    <a class="admidio-icon-link" data-toggle="modal" data-target="#admidio_modal"
                        href="' . $g_root_path . '/adm_program/system/popup_message.php?type=room&amp;element_id=room_' . $room->getValue('room_id') . '&amp;name=' . urlencode($room->getValue('room_name')) . '&amp;database_id=' . $room->getValue('room_id') . '"><img 
                        src="' . THEME_PATH . '/icons/delete.png" alt="' . $gL10n->get('SYS_DELETE') . '" title="' . $gL10n->get('SYS_DELETE') . '" /></a>
                </div>
            </div>
            <div class="panel-body">