function formatSession($post) { $acfs = get_fields($post->ID); $customs = array(); foreach (get_post_custom($post->ID) as $ckey => $value) { if (strpos($ckey, '_conferencer_') !== 0) { continue; } $ckey = substr($ckey, 13); $customs[$ckey] = @unserialize($value[0]) ? @unserialize($value[0]) : $value[0]; } $post = array_merge((array) $post, (array) $customs, (array) $acfs); $room = get_post($post['room']); return array('id' => $post['ID'], 'title' => $post['post_title'], 'by' => getSpeakers($post['speakers']), 'room' => getRoom($post['room']), 'details' => $post['post_content']); }
<div id="content" class="content"> <h1>Update Reservation</h1> <div class="main-content"> <div class="data-form"> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post"> <label>Room Number : </label><input type="text" name="room_no" value="<?php echo $data[0]['room_no']; ?> " readonly > <?php $roominfo = getRoom($data[0]['room_no']); ?> <label> Room Description :</label><label><?php echo $roominfo[0]['category'] . ' ' . $roominfo[0]['room_description']; ?> </label> <input type="hidden" name="order" value="<?php echo $_GET['order']; ?> " > <input type="hidden" name="book-date" value="<?php echo $data[0]['booking_date']; ?> " > <input type="hidden" name="room_description" value="<?php echo $roominfo[0]['room_id'];
function getRoomIds(array $areas) { $room_ids = array(); if (isset($_GET['room'])) { $split = explode(',', $_GET['room']); foreach ($split as $room) { $room_ids[] = (int) $room; } } else { $room_ids[] = 0; } $wholeAreaRoom = array(); foreach ($areas as $area) { if (!isset($wholeAreaRoom[0])) { $wholeAreaRoomKey = 0; } else { $wholeAreaRoomKey = 0 - $area['area_id']; } $wholeAreaRoom[$wholeAreaRoomKey] = array('room_id' => 0, 'room_name' => __('Whole area'), 'area_id' => $area['area_id']); } $rooms = array(); foreach ($room_ids as $room_id) { $theROOM = getRoom($room_id); if (!count($theROOM) || !array_key_exists($theROOM['area_id'], $areas)) { // -> Room not found OR on a different area return $wholeAreaRoom; } $rooms[$theROOM['room_id']] = $theROOM; } if (!count($rooms)) { return $wholeAreaRoom; } return $rooms; }
of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //room has been registred before if it was set in _GET if (!isset($room)) { $room = 0; } else { $theROOM = getRoom($room); if (!count($theROOM)) { $room = 0; } elseif ($theROOM['area_id'] != $area) { $room = 0; } } if ($room == 0) { $theROOM = array('room_id' => 0, 'room_name' => _('Whole area'), 'area_id' => $area); } if (!isset($pview)) { $pview = ''; } if (basename($_SERVER['PHP_SELF']) == 'day.php' || basename($_SERVER['PHP_SELF']) == 'day2.php') { $thisFile = 'day.php'; } elseif (basename($_SERVER['PHP_SELF']) == 'month.php') {
header('Location:index.php'); } else { session_regenerate_id(true); $_SESSION["last_acted_on"] = time(); if (isset($_POST['update'])) { $no = $_POST['room_number']; $name = $_POST['name']; $tp = $_POST['room_type']; $des = $_POST['description']; $query = "update room set name='" . $name . "' , cat_id='" . $tp . "' , room_id='" . $des . "' where room_no='" . $no . "'"; updateRoom($query); header('Location: room.php'); } if (isset($_GET['number'])) { $number = $_GET['number']; $rooms = getRoom($number); } if (isset($_POST['add'])) { $no = getRoomId(); $name = $_POST['name']; $tp = $_POST['room_type']; $des = $_POST['description']; $query = "insert into room values ('" . $no . "','" . $name . "' , '" . $tp . "' , '" . $des . "' )"; UpdateRoom($query); header('Location: room.php'); } ?> <!doctype html> <html> <head> <meta charset="utf-8">
$ymd .= '0'; } $ymd .= $month; if (strlen($i) == 1) { $ymd .= '0'; } $ymd .= $i; echo $i; echo '</a></center>'; echo '</td></tr>' . chr(10); echo '<tr><td>'; $entries = array(); $timed_entries = array(); if ($room != 0) { $rooms = array(); $rooms[$room] = getRoom($room); } foreach ($rooms as $room_id => $room3) { $start = mktime(0, 0, 0, $month, $i, $year); $end = mktime(23, 59, 59, $month, $i, $year); $events_room = checktime_Room($start, $end, $area, $room_id); if (isset($events_room[$room_id])) { foreach ($events_room[$room_id] as $entry_id) { $event = getEntry($entry_id); if (count($event)) { /* if($event['time_start'] < $start) { $event['entry_name'] .= ' ('._('started').' '.date('H:i d-m-Y', $event['time_start']).')'; $event['time_start'] = $start; }*/
function getRoomName($room_id, $user) { if ($room = getRoom($room_id, $user)) { return $room['deleted'] ? false : $room['name']; } else { $room = getRoom($room_id); return $room['name']; } }
function templateAssignEntry($var, $entry) { global ${$var}; if (count($entry)) { ${$var}->assign('entry_id', $entry['entry_id']); ${$var}->assign('entry_name', $entry['entry_name']); ${$var}->assign('entry_title', $entry['entry_title']); ${$var}->assign('confirm_email', $entry['confirm_email']); if ($entry['confirm_email']) { ${$var}->assign('confirm_email2', _('yes')); } else { ${$var}->assign('confirm_email2', _('no')); } ${$var}->assign('entry_type_id', $entry['entry_type_id']); if ($entry['entry_type_id'] == 0) { $entry_type = _('Non selected'); } else { $entry_type = getEntryType($entry['entry_type_id']); if (count($entry_type)) { $entry_type = $entry_type['entry_type_name']; } else { $entry_type = 'ERROR'; } } ${$var}->assign('entry_type', $entry_type); ${$var}->assign('num_person_child', $entry['num_person_child']); ${$var}->assign('num_person_adult', $entry['num_person_adult']); ${$var}->assign('num_person_count', $entry['num_person_count']); if ($entry['num_person_count']) { ${$var}->assign('num_person_count2', _('yes')); } else { ${$var}->assign('num_person_count2', _('no')); } ${$var}->assign('program_id', $entry['program_id']); $program = getProgram($entry['program_id']); if (count($program)) { ${$var}->assign('program_id_name', $program['program_name']); ${$var}->assign('program_id_desc', $program['program_desc']); } else { ${$var}->assign('program_id_name', ''); ${$var}->assign('program_id_desc', ''); } ${$var}->assign('program_description', $entry['program_description']); ${$var}->assign('service_alco', $entry['service_alco']); if ($entry['service_alco']) { ${$var}->assign('service_alco2', _('yes')); } else { ${$var}->assign('service_alco2', _('no')); } ${$var}->assign('service_description', $entry['service_description']); ${$var}->assign('comment', $entry['comment']); ${$var}->assign('infoscreen_txt', $entry['infoscreen_txt']); ${$var}->assign('time_start', $entry['time_start']); ${$var}->assign('time_end', $entry['time_end']); ${$var}->assign('room_id', $entry['room_id']); // Room $rooms = array(); if (!count($entry['room_id'])) { $rooms[] = _('Whole area'); } elseif (count($entry['room_id']) == '1') { // Single room foreach ($entry['room_id'] as $rid) { if ($rid == '0') { $rooms[] = _('Whole area'); } else { $room = getRoom($rid); if (count($room)) { $rooms[] = $room['room_name']; } else { $rooms[] = 'ERROR'; } } } } else { foreach ($entry['room_id'] as $rid) { if ($rid != '0') { $room = getRoom($rid); if (count($room)) { $rooms[] = $room['room_name']; } else { $rooms[] = 'ERROR'; } } } } if (!count($rooms)) { $rooms[] = _('Whole area'); } ${$var}->assign('room', implode(', ', $rooms)); ${$var}->assign('rooms', $rooms); ${$var}->assign('area_id', $entry['area_id']); // Area $area = getArea($entry['area_id']); if (count($area)) { $area = $area['area_name']; } else { $area = 'ERROR'; } ${$var}->assign('area', $area); ${$var}->assign('user_assigned', $entry['user_assigned']); ${$var}->assign('user_assigned2', $entry['user_assigned2']); // User_assigned_names $names = array(); $names2 = array(); foreach ($entry['user_assigned'] as $user_id) { if ($user_id != 0) { $user = getUser($user_id); if (count($user)) { $names[] = $user['user_name']; $names2[] = '<a href="user.php?user_id=' . $user['user_id'] . '">' . $user['user_name'] . '</a>'; } else { $names[] = 'ERROR'; $names2[] = 'ERROR'; } } } if ($entry['user_assigned2'] != '') { $names[] = $entry['user_assigned2']; $names2[] = $entry['user_assigned2']; } if (!count($names)) { $names[] = _('Nobody'); $names2[] = _('Nobody'); ${$var}->assign('user_assigned_any', false); } else { ${$var}->assign('user_assigned_any', true); } ${$var}->assign('user_assigned_names', implode(', ', $names)); ${$var}->assign('user_assigned_names2', implode(', ', $names2)); ${$var}->assign('customer_id', $entry['customer_id']); ${$var}->assign('customer_name', $entry['customer_name']); ${$var}->assign('contact_person_name', $entry['contact_person_name']); ${$var}->assign('contact_person_phone', $entry['contact_person_phone']); ${$var}->assign('contact_person_email', $entry['contact_person_email']); ${$var}->assign('customer_municipal_num', $entry['customer_municipal_num']); ${$var}->assign('customer_municipal', $entry['customer_municipal']); ${$var}->assign('created_by', $entry['created_by']); // created_by_name $user = getUser($entry['created_by']); if (count($user)) { ${$var}->assign('created_by_name', $user['user_name']); } else { ${$var}->assign('created_by_name', ''); } ${$var}->assign('time_created', $entry['time_created']); ${$var}->assign('edit_by', $entry['edit_by']); // Edit_by_names $names = array(); foreach ($entry['edit_by'] as $user_id) { $user = getUser($user_id); if (count($user)) { $names[] = $user['user_name']; } else { $names[] = 'ERROR'; } } if (!count($names)) { $names[] = _('Nobody'); } ${$var}->assign('edit_by_names', implode(', ', $names)); ${$var}->assign('time_last_edit', $entry['time_last_edit']); ${$var}->assign('user_last_edit', $entry['user_last_edit']); $user = getUser($entry['user_last_edit']); if (count($user)) { ${$var}->assign('user_last_edit_name', $user['user_name']); } else { ${$var}->assign('user_last_edit_name', ''); } ${$var}->assign('rev_num', $entry['rev_num']); ${$var}->assign('invoice', $entry['invoice']); if ($entry['invoice'] == '1') { ${$var}->assign('invoice2', true); ${$var}->assign('invoice3', _('yes')); } else { ${$var}->assign('invoice2', false); ${$var}->assign('invoice3', _('no')); } ${$var}->assign('invoice_status', $entry['invoice_status']); switch ($entry['invoice_status']) { case '0': ${$var}->assign('invoice_status2', _('not to be made')); break; case '1': ${$var}->assign('invoice_status2', 'skal lages, ikke klar'); break; case '2': ${$var}->assign('invoice_status2', 'skal lages, klar til fakturering'); break; case '3': ${$var}->assign('invoice_status2', 'faktura laget og sendt'); break; case '4': ${$var}->assign('invoice_status2', 'betalt'); break; } ${$var}->assign('invoice_electronic', $entry['invoice_electronic']); if ($entry['invoice_electronic'] == '1') { ${$var}->assign('invoice_electronic2', true); ${$var}->assign('invoice_electronic3', _('yes')); } else { ${$var}->assign('invoice_electronic2', false); ${$var}->assign('invoice_electronic3', _('no')); } ${$var}->assign('invoice_email', $entry['invoice_email']); ${$var}->assign('invoice_comment', $entry['invoice_comment']); ${$var}->assign('invoice_internal_comment', $entry['invoice_internal_comment']); ${$var}->assign('invoice_ref_your', $entry['invoice_ref_your']); ${$var}->assign('invoice_address_id', $entry['invoice_address_id']); $invoice_address = getAddress($entry['invoice_address_id']); if (count($invoice_address)) { ${$var}->assign('invoice_address', $invoice_address['address_full']); } else { ${$var}->assign('invoice_address', ''); } ${$var}->assign('invoice_content', $entry['invoice_content']); ${$var}->assign('mva_vis', $entry['mva_vis']); ${$var}->assign('mva', $entry['mva']); ${$var}->assign('mva_grunnlag', $entry['mva_grunnlag']); ${$var}->assign('mva_grunnlag_sum', $entry['mva_grunnlag_sum']); ${$var}->assign('faktura_belop_sum', $entry['faktura_belop_sum']); ${$var}->assign('faktura_belop_sum_mva', $entry['faktura_belop_sum_mva']); ${$var}->assign('eks_mva_tot', $entry['eks_mva_tot']); ${$var}->assign('grunnlag_mva_tot', $entry['grunnlag_mva_tot']); } }
function getRoomFromEntry($entry, $key) { $rooms = array(); foreach ($entry[$key . '_id'] as $room) { $room = getRoom($room); if (count($room)) { $rooms[] = $room['room_name']; } } return implode($rooms, ', '); }
function printWeekdayWithEntries($timed_entries, $entries, $start) { ksort($timed_entries); $last_time = $start; foreach ($timed_entries as $t => $thisentries) { foreach ($thisentries as $entry_id) { if ($last_time < $t) { ?> <tr> <td class="dayplan" style="font-weight: bold;"><?php echo date('H:i', $last_time) . '-' . date('H:i', $t); ?> </td> <td class="dayplan"> </td> <td class="dayplan"> </td> <td class="dayplan" style="color: gray; font-style: italic;"><?php echo __('Nothing'); ?> </td> </tr> <?php } ?> <tr> <td class="dayplan"><b><?php echo date('H:i', $entries[$entry_id]['time_start']) . '-' . date('H:i', $entries[$entry_id]['time_end']); ?> </b></td> <td class="dayplan"> <?php // Rooms $room_name = array(); if (!count($entries[$entry_id]['room_id'])) { echo '<i>' . __('Whole area') . '</i>'; } else { $Any_rooms = false; foreach ($entries[$entry_id]['room_id'] as $rid) { if ($rid != '0') { $Any_rooms = true; $room_tmp = getRoom($rid); if (count($room_tmp)) { $room_name[] = str_replace(' ', ' ', $room_tmp['room_name']); } } } if (!$Any_rooms) { echo '<i>' . str_replace(' ', ' ', __('Whole area')) . '</i>'; } else { echo implode(', ', $room_name); } } ?> </td> <td class="dayplan" style="font-size: 10px"><?php echo $entries[$entry_id]['num_person_child'] . ' / ' . $entries[$entry_id]['num_person_adult']; ?> </td> <td class="dayplan"><a href="entry.php?entry_id=<?php echo $entry_id; ?> "><?php echo $entries[$entry_id]['entry_name']; ?> </a></td> </tr> <?php if ($last_time < $entries[$entry_id]['time_end']) { $last_time = $entries[$entry_id]['time_end']; } } } }
if (!$entry_add) { $checkroom2 = $checkroom; $checkroom = array(); foreach ($checkroom2 as $rid => $entries) { foreach ($entries as $thisentry) { if ($thisentry != $entry_id) { $checkroom[$rid][$thisentry] = $thisentry; } } } } foreach ($checkroom as $rid => $entries) { if ($rid == 0) { $warning_tmp = '<b>Hele bygningen</b> er booket for: '; } else { $thisroom = getRoom($rid); if (!count($thisroom)) { $warning_tmp = __('One of the rooms you have selected is already booked for') . ': '; } else { $warning_tmp = '<b>' . $thisroom['room_name'] . '</b>' . __(' is already booked at the time you have selected for') . ': '; } } $i = 0; $warning_tmp .= '<ul>'; foreach ($entries as $entryid) { $i++; $entrytmp = getEntry($entryid); if (count($entrytmp)) { $warning_tmp .= '<li>' . iconHTML('page_white') . ' <i>' . $entrytmp['entry_name'] . '</i> (' . '<a href="entry.php?entry_id=' . $entrytmp['entry_id'] . '">Vis booking</a>)' . '</li>'; //if($i != count($entries)) // $warning_tmp .= ' '._('and for').' ';
function readEntryLog($log) { if (!count($log)) { return array(); } $return = array(); if ($log['log_action'] == 'add') { $middlestring = _('set to'); } else { $middlestring = _('changed to'); } foreach ($log['log_data'] as $index => $value) { if ($index != 'rev_num') { switch ($index) { case 'entry_name': if ($value == '') { $return[] = _('Entry name') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Entry name') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'entry_title': if ($value == '') { $return[] = _('Entry title') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Entry title') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'time_start': $return[] = _('Start time') . ' ' . $middlestring . ' <i>' . date('H:i d-m-Y', $value) . '</i>'; break; case 'time_end': $return[] = _('End time') . ' ' . $middlestring . ' <i>' . date('H:i d-m-Y', $value) . '</i>'; break; case 'area_id': $area = getArea($value); if (count($area)) { $return[] = _('Area') . ' ' . $middlestring . ' <i>' . $area['area_name'] . '</i>'; } else { $return[] = _('Area') . ' ' . $middlestring . ' <i>--' . _('Name not found') . '--</i>'; } break; case 'room_id': $value = splittIDs($value); if (!count($value)) { $return[] = _('Room') . ' ' . $middlestring . ' <i>' . _('Whole area') . '</i>'; } else { $values = array(); foreach ($value as $id) { if ($id == '0') { $values[] = _('Whole area'); } else { $thisone = getRoom($id); if (count($thisone)) { $values[] = $thisone['room_name']; } } } $return[] = _('Room') . ' ' . $middlestring . ' <i>' . implode(', ', $values) . '</i>'; } break; case 'user_assigned': $value = splittIDs($value); if (!count($value)) { $return[] = _('Users assigned') . ' ' . $middlestring . ' <i>' . _('Nobody') . '</i>'; } else { $values = array(); foreach ($value as $id) { if ($id == '0') { $values[] = _('Nobody'); } else { $thisone = getUser($id); if (count($thisone)) { $values[] = $thisone['user_name']; } } } $return[] = _('Users assigned') . ' ' . $middlestring . ' <i>' . implode(', ', $values) . '</i>'; } break; case 'user_assigned2': if ($value == '') { $return[] = _('Manual user assigned') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Manual user assigned') . ' ' . $middlestring . ' "' . $value . '"'; } break; /* * Not in use... case 'customer_name': $return .= _('Customer').' '.$middlestring.' "'.$value.'"'; break;*/ /* * Not in use... case 'customer_name': $return .= _('Customer').' '.$middlestring.' "'.$value.'"'; break;*/ case 'customer_id': if ($value == 0) { $return[] = _('Customer') . ' <i>' . _('not set') . '</i>'; } else { $customer = getCustomer($value); if (count($customer)) { $return[] = _('Customer') . ' ' . $middlestring . ' <i>' . $customer['customer_name'] . '</i>'; } else { $return[] = _('Customer ID') . ' ' . $middlestring . ' "' . $value . '"'; } } break; /* * Not in use... case 'customer_municipal': $return .= _('Municipal').' '.$middlestring.' "'.$value.'"'; break;*/ /* * Not in use... case 'customer_municipal': $return .= _('Municipal').' '.$middlestring.' "'.$value.'"'; break;*/ case 'customer_municipal_num': require "libs/municipals_norway.php"; if (isset($municipals[$value])) { $return[] = _('Municipal') . ' ' . $middlestring . ' <i>' . $municipals[$value] . '</i>'; } elseif ($value == '') { $return[] = _('Municipal') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Municipal') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'contact_person_name': if ($value == '') { $return[] = _('Contact person') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Contact person') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'contact_person_phone': if ($value == '') { $return[] = _('Contact persons phone number') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Contact persons phone number') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'contact_person_email': if ($value == '') { $return[] = _('Contact persons email') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Contact persons email') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'num_person_child': if ($value == "" || $value == 0) { $return[] = _('Number of children') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Number of children') . ' ' . $middlestring . ' ' . $value; } break; case 'num_person_adult': if ($value == "" || $value == 0) { $return[] = _('Number of adults') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Number of adults') . ' ' . $middlestring . ' ' . $value; } break; case 'num_person_count': if ($value == "" || $value == 0) { $return[] = _('Count these numbers') . ' ' . $middlestring . ' <i>' . _('not count in booking system / Datanova / cash register') . '</i>'; } else { $return[] = _('Count these numbers') . ' ' . $middlestring . ' <i>' . _('count in booking system') . '</i>'; } break; case 'program_description': if ($value == '') { $return[] = _('Program description') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Program description') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'service_alco': if ($value) { $return[] = _('Alcohol') . ' <i>' . _('is to be served') . '</i>'; } else { $return[] = _('Alcohol') . ' <i>' . _('is not to be served') . '</i>'; } break; case 'service_description': if ($value == '') { $return[] = _('Service description') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Service description') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'comment': if ($value == '') { $return[] = _('Comment') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Comment') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'infoscreen_txt': if ($value == '') { $return[] = _('Text on infoscreen') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Text on infoscreen') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice': if ($value) { $return[] = _('Invoice') . ' <i>' . _('should be made') . '</i>'; } else { $return[] = _('Invoice') . ' <i>' . _('should not be made') . '</i>'; } break; case 'invoice_info': case 'invoice_internal_comment': if ($value == '') { $return[] = _('Invoice') . ' - ' . _('Internal comment') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('Internal comment') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice_comment': if ($value == '') { $return[] = _('Invoice') . ' - ' . _('Comment') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('Comment') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice_ref_your': if ($value == '') { $return[] = _('Invoice') . ' - ' . _('Your reference') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('Your reference') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice_electronic': if ($value) { $return[] = _('Invoice') . ' <i>' . _('is to be sendt by e-mail') . '</i> (' . _('E-delivery') . ')'; } else { $return[] = _('Invoice') . ' <i>' . _('is to be sendt by regular mail') . '</i> (' . _('Not') . ' ' . strtolower(_('E-delivery')) . ')'; } break; case 'invoice_email': if ($value == '') { $return[] = _('Invoice') . ' - ' . _('E-mail') . ' <i>' . _('not set') . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('E-mail') . ' ' . $middlestring . ' "' . $value . '"'; } break; case 'invoice_address_id': if ($value == 0) { $return[] = _('Invoice') . ' - ' . _('Address') . ' <i>' . _('not set') . '</i>'; } else { $address = getAddress($value); if (count($address)) { $return[] = _('Invoice') . ' - ' . _('Address') . ' ' . $middlestring . ' <i>' . str_replace("\n", ', ', $address['address_full']) . '</i>'; } else { $return[] = _('Invoice') . ' - ' . _('Address') . ' ' . $middlestring . ' "' . $value . '"'; } } break; case 'invoice_content': if (!is_array($value)) { $return[] = _('Invoice') . ' - ' . _('Content') . ' has got syntax error in the log.'; } else { foreach ($value as $linenr => $line) { $return[] = _('Invoice') . ' - ' . _('Content') . ' - ' . _('line') . ' <i>' . $linenr . '</i> ' . $middlestring . ': ' . _('name') . ': <i>' . $line['name'] . '</i>, ' . 'pris/stk: <i>' . $line['belop_hver'] . '</i>, ' . _('amount') . ': <i>' . $line['antall'] . '</i>, ' . _('tax') . ': <i>' . $line['mva'] * 100 . '%</i>, ' . 'sum u/MVA: <i>' . $line['belop_sum_netto'] . '</i>'; } } break; case 'program_id': if ($value == 0) { $return[] = _('Fixed program') . ' <i>' . _('not set') . '</i>'; } else { $program = getProgram($value); if (count($program)) { $return[] = _('Fixed program') . ' ' . $middlestring . ' <i>' . $program['program_name'] . '</i>'; } else { $return[] = _('ID of fixed program') . ' ' . $middlestring . ' "' . $value . '"'; } } break; case 'entry_type_id': if ($value == 0) { $return[] = _('Entry type') . ' <i>' . _('not set') . '</i>'; } else { $entry_type = getEntryType($value); if (count($entry_type)) { $return[] = _('Entry type') . ' ' . $middlestring . ' <i>' . $entry_type['entry_type_name'] . '</i>'; } else { $return[] = _('ID of entry type') . ' ' . $middlestring . ' "' . $value . '"'; } } break; case 'confirm_id': $return[] = '<a href="entry_confirm_view.php?confirm_id=' . $value . '">' . _('Confirmation sent') . '</a>'; break; case 'confirm_comment': $return[] = _('Comment') . ': ' . $value; break; default: if (substr($index, 0, 11) == 'email_faild') { $return[] = _('Confirmation was <b>not sent</b> to') . ' <i>' . $value . '</i>'; break; } elseif (substr($index, 0, 5) == 'email') { $return[] = _('Confirmation was sent to') . ' <i>' . $value . '</i>'; break; } if (is_array($value)) { $return[] = $index . ' = ' . print_r($value, true); } else { $return[] = $index . ' = ' . $value; } break; } } } return $return; }
<table> <caption>Start Date: <?php echo $from; ?> End Date: <?php echo $to; ?> </caption><tr><td>Room_no</td> <td>Name</td> <td>Description</td> <td> Room type</td> </tr> <?php if ($available) { foreach ($available as $value) { $data = getRoom($value['room_no']); foreach ($data as $val) { echo "<tr><td>" . $val['room_no'] . "</td>"; echo "<td>" . $val['name'] . "</td>"; echo "<td>" . $val['room_description'] . "</td>"; echo "<td>" . $val['category'] . "</td></tr>"; } } } else { echo "No Available Rooms of that type"; } } ?> </table> </div>
function template_ical($entry) { // $entry = getEntry($entry_id) from sending_ical if (!count($entry)) { return ''; } $return = ''; $return .= __('Entry name') . ': ' . $entry['entry_name'] . chr(10); $return .= __('Entry ID') . ': ' . $entry['entry_id'] . chr(10); $return .= __('Entry type') . ': '; if ($entry['entry_type_id'] == '0') { $return .= __('Non'); } else { $entry_type = getEntryType($entry['entry_type_id']); if (count($entry_type)) { $return .= $entry_type['entry_type_name']; } } $return .= chr(10); $return .= __('Starts') . ': ' . date('H:i d-m-Y', $entry['time_start']) . chr(10); $return .= __('Finished') . ': ' . date('H:i d-m-Y', $entry['time_end']) . chr(10); if (count($entry['user_assigned']) > 1) { $return .= chr(10); } $return .= __('Assigned to') . ': '; if (!count($entry['user_assigned'])) { $return .= __('Nobody') . chr(10); } elseif (count($entry['user_assigned']) == '1') { foreach ($entry['user_assigned'] as $user_id) { if ($user_id == '0') { $return .= __('Nobody') . chr(10); } else { $user = getUser($user_id); if (count($user)) { $return .= $user['user_name'] . chr(10); } } } } else { foreach ($entry['user_assigned'] as $user_id) { $user = getUser($user_id); if (count($user)) { $return .= ' - ' . $user['user_name'] . chr(10); } } } $area = getArea($entry['area_id']); $return .= __('Area') . ': ' . $area['area_name'] . chr(10); $return .= __('Room') . ': '; if (!count($entry['room_id'])) { $return .= __('Whole area') . chr(10); } elseif (count($entry['room_id']) == '1') { // Single room foreach ($entry['room_id'] as $rid) { if ($rid == '0') { $return .= __('Whole area') . chr(10); } else { $room = getRoom($rid); if (count($room)) { $return .= $room['room_name'] . chr(10); } else { $return .= __('Can\'t find room') . chr(10); } } } } else { $rooms = false; foreach ($entry['room_id'] as $rid) { if ($rid != '0') { $rooms = true; $room = getRoom($rid); if (count($room)) { $return .= ' - ' . $room['room_name'] . chr(10); } } } if (!$rooms) { $return .= __('Whole area') . chr(10); } } if ($entry['customer_id'] == '0') { $return .= __('Customer') . ': ' . __('Non selected') . chr(10); } else { $return .= __('Customer') . ': ' . $entry['customer_name'] . ' (' . __('Customer ID') . ' ' . $entry['customer_id'] . ')' . chr(10); } $return .= __('Customer') . ': ' . $entry['customer_name'] . chr(10); $return .= __('Contact person') . ': ' . $entry['contact_person_name'] . chr(10); $return .= __('Contact telephone') . ': ' . $entry['contact_person_phone'] . chr(10); $return .= __('Contact persons email') . ': ' . $entry['contact_person_email'] . chr(10); $return .= __('Municipal') . ': ' . $entry['customer_municipal'] . chr(10); $user_created = getUser($entry['created_by']); if (count($user_created)) { $return .= __('Booking created by') . ': ' . $user_created['user_name'] . chr(10); } $return .= __('Comment') . ':' . chr(10); $return .= nl2br($entry['comment']); return $return; }
} else { $room = getRoom($rid); if (count($room)) { echo $room['room_name']; } else { echo _('Can\'t find room'); } } } } else { echo '<ul>' . chr(10); $rooms = false; foreach ($entry['room_id'] as $rid) { if ($rid != '0') { $rooms = true; $room = getRoom($rid); if (count($room)) { echo '<li>' . $room['room_name'] . '</li>' . chr(10); } } } if (!$rooms) { echo '<li>' . _('Whole area') . '</li>' . chr(10); } echo '</ul>' . chr(10); } echo '</td></tr>' . chr(10); echo '<tr><td align="right">' . '<img src="./img/icons/email.png" style="border: 0px solid black; vertical-align: middle;"> ' . '<b>' . _('Confirmation email sent?') . '</b> </td><td>'; if ($entry['confirm_email']) { echo _('yes'); } else {
foreach ($timed_entries as $t => $thisentries) { foreach ($thisentries as $entry_id) { if ($last_time < $t) { echo '<tr><td class="dayplan"><b>' . date('H:i', $last_time) . '-' . date('H:i', $t) . '</b></td><td class="dayplan"> </td><td class="dayplan"> </td><td class="dayplan"><font color="gray"><i>' . _('Nothing') . '</i></font></td></tr>'; } echo '<tr><td class="dayplan"><b>' . date('H:i', $entries[$entry_id]['time_start']) . '-' . date('H:i', $entries[$entry_id]['time_end']) . '</b></td><td class="dayplan">'; // Rooms $room_name = array(); if (!count($entries[$entry_id]['room_id'])) { echo '<i>' . _('Whole area') . '</i>'; } else { $Any_rooms = false; foreach ($entries[$entry_id]['room_id'] as $rid) { if ($rid != '0') { $Any_rooms = true; $room_tmp = getRoom($rid); if (count($room_tmp)) { $room_name[] = str_replace(' ', ' ', $room_tmp['room_name']); } } } if (!$Any_rooms) { echo '<i>' . str_replace(' ', ' ', _('Whole area')) . '</i>'; } else { echo implode(', ', $room_name); } } echo '</td>'; echo '<td class="dayplan"><font size="1">'; echo $entries[$entry_id]['num_person_child'] . ' / ' . $entries[$entry_id]['num_person_adult']; echo '</font></td>';
// year;month;day;hour;minute;room;view // 0; 1; 2; 3; 4; 5; 6 if (isset($_GET['starttime'])) { $abc = explode(';', $_GET['starttime']); if (count($abc) >= 7) { $a_year = (int) $abc[0]; $a_month = (int) $abc[1]; $a_day = (int) $abc[2]; $a_hour = (int) $abc[3]; $a_minute = (int) $abc[4]; $a_room = (int) $abc[5]; $_GET['view'] = $abc[6]; $time_start = mktime($a_hour, $a_minute, 0, $a_month, $a_day, $a_year); addValue('time_start', $time_start); addValueArray('room_id', splittIDs($a_room)); $a_room = getRoom($a_room); if (count($a_room)) { addValue('area_id', $a_room['area_id']); } if (isset($_GET['endtime'])) { $abc = explode(';', $_GET['endtime']); if (count($abc) >= 7) { $a_year = (int) $abc[0]; $a_month = (int) $abc[1]; $a_day = (int) $abc[2]; $a_hour = (int) $abc[3]; $a_minute = (int) $abc[4]; $time_end = mktime($a_hour, $a_minute, 0, $a_month, $a_day, $a_year); addValue('time_end', $time_end); } }
} if ($admin) { //Get the IP $url = "<br>{$_SERVER['HTTP_HOST']}<br><small>(open url in your browser)</small>"; $number = "You are ADMIN <a href='?ilove=llamas' class='btn btn-primary'>Logout <span class='glyphicon glyphicon-log-out'></span></a>\n <a href='instructions.php' class='btn btn-warning' target='_blank'>Instructions</a>"; } else { $url = ""; } echo "<div class='col-xs-12' style='background-color: #444; color:#fff; border-radius: 0px 0px 5px 5px'><h1>CSLC Question Queue\n {$url}\n\t\t\t\t\t\t<br><small>{$number}</small></h1></div><br>"; //begin the row echo "<div class='row'>"; /*************************************** * Set optional Info * ***************************************/ if (!$admin && isset($_SESSION['uid'])) { echo "\n\t\t\t\t\t<div class='col-xs-12'>\n\t\t\t\t\t\t<h4>Tell us more! <small>(Optional)</small></h4>\n\t\t\t\t\t\t<form name='additional' method='post' action='' role='form'>\n\t\t\t\t\t\t\t<div class='form-group'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='optional' value='true'>\n\t\t\t\t\t\t\t\t<div class='col-sm-6'>\n\t\t\t\t\t\t\t\t\t<label for='name'>Nickname</label>\n\t\t\t\t\t\t\t\t\t<input name='name' type='text' class='form-control' value='" . getName($_SESSION['uid']) . "'>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='col-sm-6'>\n\t\t\t\t\t\t\t\t\t<label for='room'>Room</label>\n\t\t\t\t\t\t\t\t\t<input name='room' type='text' class='form-control' value='" . getRoom($_SESSION['uid']) . "'>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='col-sm-2'>\n\t\t\t\t\t\t\t\t\t<label for='room'></label>\n\t\t\t\t\t\t\t\t\t<input name='submit' type='submit' class='form-control btn-success btn' value='Save'>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>"; } /*************************************** * Ask Question form * ***************************************/ if (!$admin) { echo "\n\t\t\t\t\t<div class='col-xs-12 col-sm-4'>\t\t\t\t\t\t\n\t\t\t\t\t\t<form name='ask' method='post' action='' role='form' onSubmit='return validate()'>\n\t\t\t\t\t\t\t<input type='hidden' name='time' value='" . time() . "'>\n\t\t\t\t\t\t\t<input type='hidden' name='browser' value=''>\n\t\t\t\t\t\t\t<div class='bg-info'><h3>Virtually raise your hand!</h3></div>\n\t\t\t\t\t\t\t<div class='form-group'>\n\t\t\t\t\t\t\t\t<label for='class'>Class</label></td>\n\t\t\t\t\t\t\t\t<select name='class' id='classSelect' class='form-control'>\n\t\t\t\t\t\t\t\t\t<option value=''>Select Class...</option>\n\t\t\t\t\t\t\t\t\t<option value='CNSA'>CS1111 - C for CNSA</option>\n\t\t\t\t\t\t\t\t\t<option value='Intro I'>CS1121 - Intro To Prog. I</option>\n\t\t\t\t\t\t\t\t\t<option value='Intro II'>CS1122 - Intro To Prog. II</option>\n\t\t\t\t\t\t\t\t\t<option value='Accel Intro'>CS1131 - Accelerated Intro to Prog.</option>\n\t\t\t\t\t\t\t\t\t<option value='C'>CS1142 - Programming at the Hardware Software Interface</option>\n\t\t\t\t\t\t\t\t\t<option value='Discrete'>CS2311 - Discrete Structures</option>\n\t\t\t\t\t\t\t\t\t<option value='Data Structures'>CS2321 - Data Structures</option>\n\t\t\t\t\t\t\t\t\t<option value='OTHER'>Other</option>\n\t\t\t\t\t\t\t\t<select>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='form-group'>\n\t\t\t\t\t\t\t\t<label for='question'>Question</label>\n\t\t\t\t\t\t\t\t<textarea id='question-text' class='form-control' name='question' placeholder='Please write a detailed question.'></textarea>\n\t\t\t\t\t\t\t\tLooking for some fun? Try adding @haha or @hey to your question! See more fun things by reading the source code of this page!\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='col-xs-12 btn-danger' style='display:none' id='questionError'></div>\n\t\t\t\t\t\t\t<input type='submit' class='btn btn-success form-control' value='Ask Question!'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<script>\n\t\t\t\t\t\tdocument.ask.browser.value = window.screen.availWidth + ' ' + window.screen.availHeight + ' ' + window.navigator.platform + ' ' + window.navigator.userAgent;\n\t\t\t\t\t</script>"; } //if there is a question form, then we need to adjust the size of the column //accordingly. If not, make this full screen $classSize = "col-xs-12 col-sm-8"; if ($admin) { $classSize = "col-xs-12"; } echo "\n\t\t\t\t<div id='livetable' class='{$classSize}'>"; //Auto update stuffs here