if ($_POST['dat_room_id'] > 0) { $sql = 'SELECT COUNT(dat_id) AS is_reserved FROM ' . TBL_DATES . ' WHERE dat_begin <= \'' . $endDateTime->getDateTimeString() . '\' AND dat_end >= \'' . $startDateTime->getDateTimeString() . '\' AND dat_room_id = ' . $_POST['dat_room_id'] . ' AND dat_id <> ' . $getDateId; $result = $gDb->query($sql); $row = $gDb->fetch_object($result); if ($row->is_reserved) { $gMessage->show($gL10n->get('DAT_ROOM_RESERVED')); } $date->setValue('dat_room_id', $_POST['dat_room_id']); $room = new TableRooms($gDb); $room->readDataById($_POST['dat_room_id']); $number = intval($room->getValue('room_capacity')) + intval($room->getValue('room_overhang')); $date->setValue('dat_max_members', $number); if ($_POST['dat_max_members'] < $number && $_POST['dat_max_members'] > 0) { $date->setValue('dat_max_members', $_POST['dat_max_members']); } // Raumname für Benachrichtigung $raum = $room->getValue('room_name'); } } // write all POST parameters into the date object foreach ($_POST as $key => $value) { if (strpos($key, 'dat_') === 0) { $date->setValue($key, $value); } } // now save array with all roles that should see this event to date object
$itemsTable = new HtmlTable('tbl_invent', $page, true, true, 'table table-condensed'); // create array with all column heading values $columnHeading = array($gL10n->get('SYS_ABR_NO'), $gL10n->get('SYS_NAME'), $gL10n->get('SYS_ROOM'), $gL10n->get('MEM_UPDATED_ON'), ' '); $itemsTable->setColumnAlignByArray(array('left', 'left', 'left', 'left', 'right')); $itemsTable->disableDatatablesColumnsSort(5); $itemsTable->addRowHeadingByArray($columnHeading); $itemsTable->setDatatablesRowsPerPage($gPreferences['members_users_per_page']); $itemsTable->setMessageIfNoRowsFound('SYS_NO_ENTRIES'); $irow = 1; // count for line in table while ($row = $mglStatement->fetch()) { $timestampChange = new DateTimeExtended($row['timestamp'], 'Y-m-d H:i:s'); $room = new TableRooms($gDb, $row['room_id']); $roomLink = $g_root_path . '/adm_program/system/msg_window.php?message_id=room_detail&message_title=DAT_ROOM_INFORMATIONS&message_var1=' . $row['room_id'] . '&inline=true'; // create array with all column values $columnValues = array($irow, '<a href="' . $g_root_path . '/adm_program/modules/inventory/item.php?item_id=' . $row['inv_id'] . '">' . $row['item_name'] . '</a>', '<a class="admidio-icon-link-popup" href="' . $roomLink . '">' . $room->getValue('room_name') . '</a>'); $columnValues[] = $timestampChange->format($gPreferences['system_date'] . ' ' . $gPreferences['system_time']); $itemAdministration = ''; // Link to modify Item $itemAdministration .= '<a class="admidio-icon-link" href="' . $g_root_path . '/adm_program/modules/inventory/item_new.php?item_id=' . $row['inv_id'] . '"><img src="' . THEME_PATH . '/icons/edit.png" alt="' . $gL10n->get('MEM_EDIT_USER') . '" title="' . $gL10n->get('MEM_EDIT_USER') . '" /></a>'; // remove Item if ($gCurrentUser->isWebmaster()) { $itemAdministration .= '<a class="admidio-icon-link" href="' . $g_root_path . '/adm_program/modules/inventory/items_function.php?item_id=' . $row['inv_id'] . '&mode=6"><img src="' . THEME_PATH . '/icons/delete.png" alt="' . $gL10n->get('MEM_REMOVE_USER') . '" title="' . $gL10n->get('MEM_REMOVE_USER') . '" /></a>'; } else { $itemAdministration .= ' <img class="admidio-icon-link" src="' . THEME_PATH . '/icons/dummy.png" alt="dummy" />'; } $columnValues[] = $itemAdministration; $itemsTable->addRowByArray($columnValues); ++$irow;
} $outputLinkLocation .= ' <a class="admidio-icon-link" href="' . $route_url . '" target="_blank"> <img src="' . THEME_PATH . '/icons/map.png" alt="' . $gL10n->get('SYS_SHOW_ROUTE') . '" title="' . $gL10n->get('SYS_SHOW_ROUTE') . '" /> </a>'; } } else { $outputLinkLocation = $date->getValue('dat_location'); } } // if active, then show room information if ($date->getValue('dat_room_id') > 0) { $room = new TableRooms($gDb, $date->getValue('dat_room_id')); if ($getViewMode === 'html') { $roomLink = $g_root_path . '/adm_program/system/msg_window.php?message_id=room_detail&message_title=DAT_ROOM_INFORMATIONS&message_var1=' . $date->getValue('dat_room_id') . '&inline=true'; $outputLinkRoom = '<strong><a data-toggle="modal" data-target="#admidio_modal" href="' . $roomLink . '">' . $room->getValue('room_name') . '</a></strong>'; } else { $outputLinkRoom = $room->getValue('room_name'); } } // count participants of the date if ($date->getValue('dat_rol_id') > 0) { $participants = new Participants($gDb, $date->getValue('dat_rol_id')); $outputNumberMembers = $participants->getCount(); $outputNumberLeaders = $participants->getNumLeaders(); if ($getView === 'participants') { $participantsArray = $participants->getParticipantsArray($date->getValue('dat_rol_id')); } } // Links for the participation only in html mode if ($date->getValue('dat_rol_id') > 0 && $getViewMode === 'html') {
// 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'); $form->addEditor('room_description', null, $room->getValue('room_description'), array('height' => '150px')); $form->closeGroupBox(); $form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png')); $form->addHtml(admFuncShowCreateChangeInfoById($room->getValue('room_usr_id_create'), $room->getValue('room_timestamp_create'), $room->getValue('dat_usr_id_change'), $room->getValue('room_timestamp_change'))); // add form to html page and show page $page->addHtml($form->show(false)); $page->show();
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') . '&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&element_id=room_' . $room->getValue('room_id') . '&name=' . urlencode($room->getValue('room_name')) . '&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"> <div class="row"> <div class="col-sm-2 col-xs-4">' . $gL10n->get('ROO_CAPACITY') . '</div>
} // read all events for output if ($datesTotalCount != 0) { // Initialize counter and object instances $count = 0; $date = new TableDate($gDb); $participants = new Participants($gDb); // New array for the participants of a date $memberElements = array(); // Loop date array and add further information in right position of each date. foreach ($datesResult['recordset'] as $row) { $date->readDataById($row['dat_id']); // get avaiable room information if ($date->getValue('dat_room_id') > 0) { $room = new TableRooms($gDb, $date->getValue('dat_room_id')); $datesResult['recordset'][$count]['room_name'] = $room->getValue('room_name'); } // count members and leaders of the date role and push the result to the array if ($date->getValue('dat_rol_id') !== null) { $datesResult['recordset'][$count]['dat_num_members'] = $participants->getCount($date->getValue('dat_rol_id')); $datesResult['recordset'][$count]['dat_num_leaders'] = $participants->getNumLeaders($date->getValue('dat_rol_id')); } // For print view also read the participants and push the result to the array with index 'dat_rol_id' if ($getViewMode === 'print') { if ($date->getValue('dat_rol_id') > 0) { $memberElements[$date->getValue('dat_rol_id')] = $participants->getParticipantsArray($date->getValue('dat_rol_id')); } } $count++; } }
$organizations .= implode(',<br />- ', $gCurrentOrganization->getOrganizationsInRelationship(true, true, true)); echo $gL10n->get(strtoupper($getMessageId), $organizations); break; case 'SYS_DATA_GLOBAL': // show all organizations where this organization is mother or child organization $organizations = '- ' . $gCurrentOrganization->getValue('org_longname') . ',<br />- '; $organizations .= implode(',<br />- ', $gCurrentOrganization->getOrganizationsInRelationship(true, true, true)); echo $gL10n->get(strtoupper($getMessageId), $organizations); break; case 'room_detail': if (is_numeric($getMessageVar1)) { $room = new TableRooms($gDb, $getMessageVar1); echo ' <div class="row"> <div class="col-xs-4"><strong>' . $gL10n->get('SYS_ROOM') . ':</strong></div> <div class="col-xs-8">' . $room->getValue('room_name') . '</div> </div> <div class="row"> <div class="col-xs-4"><strong>' . $gL10n->get('ROO_CAPACITY') . ':</strong></div> <div class="col-xs-8">' . $room->getValue('room_capacity') . '</div> </div> <div class="row"> <div class="col-xs-4"><strong>' . $gL10n->get('ROO_OVERHANG') . ':</strong></div> <div class="col-xs-8">' . $room->getValue('room_overhang') . '</div> </div> <div class="row"> <div class="col-xs-4"><strong>' . $gL10n->get('SYS_DESCRIPTION') . ':</strong></div> <div class="col-xs-8">' . $room->getValue('room_description') . '</div> </div>'; } break;