function get_locations_arg() { $locations = get_locations(); $args = array(); foreach ($locations as $location) { $args[$location->ID] = $location->NAME; } return $args; }
$query .= ' WHERE 1 ' . implode('', $where_array); $where_array[$entry] = $tmp; } else { $query .= $where; } $query .= " AND `{$entry}` != '' {$query_permitted} GROUP BY `{$entry}` ORDER BY `{$entry}`"; foreach (dbFetchColumn($query) as $item) { if ($entry == 'os') { $name = $config['os'][$item]['text']; } else { $name = nicecase($item); } $search_items[$entry][$item] = $name; } } foreach (get_locations() as $entry) { $search_items['location'][$entry] = $entry == '' ? 'UNSET' : htmlspecialchars($entry); } foreach (get_type_groups('device') as $entry) { $search_items['group'][$entry['group_id']] = $entry['group_name']; } $search_items['sort'] = array('hostname' => 'Hostname', 'location' => 'Location', 'os' => 'Operating System', 'uptime' => 'Uptime'); $form = array('type' => 'rows', 'url' => generate_url($vars)); // First row $form['row'][0]['hostname'] = array('type' => 'text', 'name' => 'Hostname', 'value' => $vars['hostname'], 'width' => '180px', 'placeholder' => TRUE); $form['row'][0]['location'] = array('type' => 'multiselect', 'name' => 'Select Locations', 'width' => '180px', 'json' => TRUE, 'value' => $vars['location'], 'values' => $search_items['location']); $form['row'][0]['os'] = array('type' => 'multiselect', 'name' => 'Select OS', 'width' => '180px', 'value' => $vars['os'], 'values' => $search_items['os']); $form['row'][0]['hardware'] = array('type' => 'multiselect', 'name' => 'Select Hardware', 'width' => '180px', 'value' => $vars['hardware'], 'values' => $search_items['hardware']); $form['row'][0]['group'] = array('type' => 'multiselect', 'name' => 'Select Groups', 'width' => '180px', 'value' => $vars['group'], 'values' => $search_items['group']); // Select sort pull-rigth $form['row'][0]['sort'] = array('type' => 'select', 'icon' => 'oicon-sort-alphabet-column', 'right' => TRUE, 'width' => '150px', 'value' => $vars['sort'], 'values' => $search_items['sort']);
} ?> <div class="row"> <div class="col-lg-2"> <input placeholder="主机名" type="text" name="hostname" id="hostname" class="input" value="<?php htmlentities($vars['hostname']); ?> " /> </div> <div class="col-lg-2"> <select class="selectpicker" name="location" id="location"> <option value="">所有物理位置</option> <?php // FIXME function? foreach (get_locations() as $location) { $value = base64_encode(json_encode(array($location))); $name = $location == '' ? '[[UNKNOWN]]' : htmlspecialchars($location); echo '<option value="' . $value . '"'; if (array($location) === $vars['location']) { echo " selected"; } echo ">" . $name . "</option>"; } ?> </select> </div> <div class="col-lg-2"> <select class="selectpicker" name='os' id='os'> <option value=''>所有操作系统</option> <?php
<?php require_once '../../../util/main.php'; require_once '../../authenticate.php'; require_once '../../../view/headerForAdmin.php'; require_once '../../../model/database.php'; require_once '../../../model/location_db.php'; require_once '../../../model/employee_db.php'; $managers = get_managers(); $locations = get_locations(); ?> <div class="heading"> <div class="clearfix"> <div class="pull-left"> <h3>Employees</h3> </div> <div class="pull-right"> <button class="btn btn-default btn-xs" type="button" onclick="sodon_main.create('');"> <i class="glyphicon glyphicon-file text-primary"></i> Add New Employee </button> </div> </div> </div> <div class="row"> <div class="col-xs-3"> <input id="searchParams" type="hidden" value=""> <div class="panel panel-default">
* first -> location identifier * second -> x coordinate of the center of the circle * thrid -> y coordinate of the center of the circle */ function get_locations($loc_file) { $locs = array(); $fh = fopen($loc_file, "rb"); /* while there is data in the file */ while (!feof($fh)) { /* grab a line from the file */ $line = fgets($fh); /* if the line starts with a '#' or isnt long enough then ignore it */ if ($line[0] == '#' || strlen($line) < 5) { continue; } /* convert the line into an array */ $pts = explode(',', $line); /* chop off any whitespace from each field */ for ($i = 0; $i < sizeof($pts); $i++) { $pts[$i] = rtrim($pts[$i]); } /* push new data onto the end of the array */ array_push($locs, $pts); } return $locs; } echo_header(); $pts = get_locations("locations.txt"); echo_locations($pts); echo_footer();
function show_map($config) { ?> <div class="row" style="margin-bottom: 10px;"> <div class="col-md-12"> <style type="text/css"> #chart_div label { width: auto; display:inline; } #chart_div img { max-width: none; } </style> <!-- <div id="reset" style="width: 100%; text-align: right;"><input type="button" onclick="resetMap();" value="重置地图" /></div> --> <div id="chart_div" style="height: <?php echo $config['frontpage']['map']['height']; ?> px;"></div> <?php if ($config['frontpage']['map']['api'] != 'google-mc') { ?> <script type='text/javascript' src='//www.google.com/jsapi'></script> <script type='text/javascript'> google.load('visualization', '1.1', {'packages': ['geochart']}); google.setOnLoadCallback(drawRegionsMap); function drawRegionsMap() { var data = new google.visualization.DataTable(); data.addColumn('number', '纬度'); data.addColumn('number', '经度'); data.addColumn('string', '位置'); data.addColumn('number', '状态'); data.addColumn('number', '设备'); data.addColumn({type: 'string', role: 'tooltip'}); data.addColumn('string', 'url'); data.addRows([ <?php $locations_up = array(); $locations_down = array(); foreach (get_locations() as $location) { $location_name = $location == '' ? '[[UNKNOWN]]' : strtr(htmlspecialchars($location), "'", "`"); $location_url = generate_location_url($location); $devices_down = array(); $devices_up = array(); $count = $GLOBALS['cache']['device_locations'][$location]; $down = 0; foreach ($GLOBALS['cache']['devices']['id'] as $device) { if ($device['location'] == $location) { if ($device['status'] == "0" && $device['ignore'] == "0") { $down++; $devices_down[] = $device['hostname']; $lat = $device['location_lat']; $lon = $device['location_lon']; } else { if ($device['status'] == "1") { $devices_up[] = $device['hostname']; $lat = $device['location_lat']; $lon = $device['location_lon']; } } } } $count = $count < 100 ? $count : 100; if ($down > 0) { $locations_down[] = "[{$lat}, {$lon}, '{$location_name}', {$down}, " . $count * $down . ", '" . count($devices_up) . " 设备启用, " . count($devices_down) . " 设备关闭: (" . implode(", ", $devices_down) . ")', '{$location_url}']"; } else { if ($count) { $locations_up[] = "[" . $lat . ", " . $lon . ", '" . $location_name . "', 0, " . $count . ", '" . count($devices_up) . " Devices UP: (" . implode(", ", $devices_up) . ")', '{$location_url}']"; } } } echo implode(",\n ", array_merge($locations_up, $locations_down)); ?> ]); var options = { region: '<?php echo $config['frontpage']['map']['region']; ?> ', resolution: '<?php echo $config['frontpage']['map']['resolution']; ?> ', displayMode: 'markers', keepAspectRatio: 0, //width: 1240, //height: 480, is3D: true, legend: 'none', enableRegionInteractivity: true, <?php if ($config['frontpage']['map']['realworld']) { echo "\t\t datalessRegionColor: '#93CA76',"; } else { echo "\t\t datalessRegionColor: '#d5d5d5',"; } if ($config['frontpage']['map']['realworld']) { echo "\t\t backgroundColor: {fill: '#000000'},"; } ?> backgroundColor: {fill: 'transparent'}, magnifyingGlass: {enable: true, zoomFactor: 5}, colorAxis: {values: [0, 1, 2, 3], colors: ['darkgreen', 'orange', 'orangered', 'red']}, markerOpacity: 0.75, sizeAxis: {minValue: 1, maxValue: 10, minSize: 10, maxSize: 40} }; var view = new google.visualization.DataView(data); // exclude last url column in the GeoChart view.setColumns([0, 1, 2, 3, 4, 5]); var chart = new google.visualization.GeoChart(document.getElementById('chart_div')); google.visualization.events.addListener(chart, 'ready', onReady); function onReady() { google.visualization.events.addListener(chart, 'select', gotoLocation); } function gotoLocation() { var selection = chart.getSelection(); var item = selection[0]; var url = data.getValue(item.row, 6); window.location = url; } chart.draw(view, options); }; </script> <?php } else { // begin google-mc $where = ' WHERE 1 '; $where .= generate_query_permitted(array('device'), array('ignored' => TRUE)); //Detect map center if (!is_numeric($config['frontpage']['map']['center']['lat']) || !is_numeric($config['frontpage']['map']['center']['lng'])) { $map_center = dbFetchRow('SELECT MAX(`location_lon`) AS `lng_max`, MIN(`location_lon`) AS `lng_min`, MAX(`location_lat`) AS `lat_max`, MIN(`location_lat`) AS `lat_min` FROM `devices` ' . $where); $map_center['lat'] = ($map_center['lat_max'] + $map_center['lat_min']) / 2; $map_center['lng'] = ($map_center['lng_max'] + $map_center['lng_min']) / 2; $config['frontpage']['map']['center']['lat'] = $map_center['lat']; $config['frontpage']['map']['center']['lng'] = $map_center['lng']; //Also auto-zoom if (!is_numeric($config['frontpage']['map']['zoom'])) { $map_center['lat_size'] = abs($map_center['lat_max'] - $map_center['lat_min']); $map_center['lng_size'] = abs($map_center['lng_max'] - $map_center['lng_min']); $l_max = max($map_center['lng_size'], $map_center['lat_size'] * 2); // This is the magic array (2: min zoom, 10: max zoom). foreach (array(1 => 10, 2 => 9, 4 => 8, 6 => 7, 15 => 5, 45 => 4, 90 => 3, 360 => 2) as $g => $z) { if ($l_max <= $g) { $config['frontpage']['map']['zoom'] = $z; break; } } } /// r($map_center); } else { if (!is_numeric($config['frontpage']['map']['zoom'])) { $config['frontpage']['map']['zoom'] = 4; } } ?> <script type='text/javascript' src='//www.google.com/jsapi'></script> <script type="text/javascript" src="js/google/markerclusterer.js"></script> <script src="//maps.google.com/maps/api/js?sensor=false"></script> <?php if ($config['frontpage']['map']['clouds']) { ?> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=weather"></script><?php } ?> <script type="text/javascript"> google.load('visualization', '1.1', {'packages': ['geochart']}); function getMapData() { var data = new google.visualization.DataTable(); data.addColumn('number', '纬度'); data.addColumn('number', '经度'); data.addColumn('number', '正常数量'); data.addColumn('number', '停止数量'); data.addColumn({type: 'string', role: 'tooltip'}); data.addColumn('string', '位置'); data.addColumn('string', 'url'); data.addRows([ <?php $locations = array(); foreach ($GLOBALS['cache']['devices']['id'] as $device) { if ($device["status"] == "0" && $device["ignore"] == "0" && $device["disabled"] == "0") { $locations[$device['location_lat']][$device['location_lon']]["down_hosts"][] = $device; } elseif ($device["status"] == "1") { $locations[$device['location_lat']][$device['location_lon']]["up_hosts"][] = $device; } } foreach ($locations as $la => $lat) { foreach ($lat as $lo => $lon) { $num_up = count($lon["up_hosts"]); $num_down = count($lon["down_hosts"]); $total_hosts = $num_up + $num_down; $tooltip = "{$total_hosts} Hosts"; $location_name = ""; if ($num_down > 0) { $location_name = $lon['down_hosts'][0]['location'] == '' ? '[[UNKNOWN]]' : strtr(htmlspecialchars($lon['down_hosts'][0]['location']), "'", "`"); $location_url = generate_location_url($lon['down_hosts'][0]['location']); $tooltip .= "\\n\\nDown hosts:"; foreach ($lon["down_hosts"] as $down_host) { $tooltip .= "\\n" . $down_host['hostname']; } } elseif ($num_up > 0) { $location_name = $lon['up_hosts'][0]['location'] == '' ? '[[UNKNOWN]]' : strtr(htmlspecialchars($lon['up_hosts'][0]['location']), "'", "`"); $location_url = generate_location_url($lon['up_hosts'][0]['location']); } echo "[{$la}, {$lo}, {$num_up}, {$num_down}, \"{$tooltip}\", '{$location_name}', '{$location_url}'],\n "; } } ?> ]); return data; } function initialize() { var data = getMapData(); var markers = []; var base_link = '<?php echo generate_url(array("page" => "devices")); ?> '; for (var i = 0; i < data.getNumberOfRows(); i++) { var latLng = new google.maps.LatLng(data.getValue(i, 0), data.getValue(i, 1)); icon_ = '//maps.gstatic.com/mapfiles/ridefinder-images/mm_20_green.png'; var num_up = data.getValue(i, 2); var num_down = data.getValue(i, 3); var location = data.getValue(i, 5); var ratio_up = num_up / (num_up + num_down); if (ratio_up < 0.9999) { icon_ = '//maps.gstatic.com/mapfiles/ridefinder-images/mm_20_red.png'; } var marker = new google.maps.Marker({ position: latLng, icon: icon_, title: data.getValue(i, 4), location: location, num_up: num_up, num_down: num_down, url: data.getValue(i, 6) }); // marker.num_up = num_up; // marker.num_down = num_down; markers.push(marker); google.maps.event.addDomListener(marker, 'click', function() { window.location.href = this.url; }); } var styles = []; for (var i = 0; i < 4; i++) { image_path = "/images/mapclusterer/"; image_ext = ".png"; styles.push({ url: image_path + i + image_ext, height: 52, width: 53 }); } var mcOptions = {gridSize: 30, maxZoom: 15, zoomOnClick: false, styles: styles }; var markerClusterer = new MarkerClusterer(map, markers, mcOptions); var iconCalculator = function(markers, numStyles) { var total_up = 0; var total_down = 0; for (var i = 0; i < markers.length; i++) { total_up += markers[i].num_up; total_down += markers[i].num_down; } var ratio_up = total_up / (total_up + total_down); //The map clusterer really does seem to use index-1... index_ = 1; if (ratio_up < 0.9999) { index_ = 4; // Could be 2, and then more code to use all 4 images } return { text: (total_up + total_down), index: index_ }; } markerClusterer.setCalculator(iconCalculator); } var center_ = new google.maps.LatLng(<?php echo $config['frontpage']['map']['center']['lat']; ?> , <?php echo $config['frontpage']['map']['center']['lng']; ?> ); var map = new google.maps.Map(document.getElementById('chart_div'), { zoom: <?php echo $config['frontpage']['map']['zoom']; ?> , center: center_, mapTypeId: google.maps.MapTypeId.ROADMAP }); <?php if ($config['frontpage']['map']['clouds']) { ?> var cloudLayer = new google.maps.weather.CloudLayer(); cloudLayer.setMap(map); <?php } ?> function resetMap() { map.setZoom(4); map.panTo(center_); } google.maps.event.addListener(map, 'click', function(event) { map.setZoom(map.getZoom() + <?php echo $config['frontpage']['map']['zooms_per_click']; ?> ); map.panTo(event.latLng); }); google.maps.event.addDomListener(window, 'load', initialize); </script> <?php } // End google-mc ?> </div> </div> <?php }
function booking_form() { global $booking; $html = '<div id="bookingForm"> <form class="formStep1" method="POST" enctype="multipart/form-data"> <div class="step1"> <div class="form-group narrow"> <input type="text" name="pickup" id="pickup" class="required" placeholder="' . __('Pickup Location', 'vbs') . '" /> <select style="display: none;" id="pickup_location" name="pickup_location"> <option value="">' . __('Select location...', 'vbs') . '</option> ' . get_locations() . ' </select> <input type="text" name="dropoff" id="dropoff" class="required" placeholder="' . __('Dropoff Location', 'vbs') . '" /> <select style="display: none;" id="dropoff_location" name="dropoff_location"> <option value="">' . __('Select location...', 'vbs') . '</option> ' . get_locations() . ' </select> <button class="act route" type="submit">' . __('Route!', 'vbs') . '</button> </div> <div class="form-group narrow selection"> <button class="act pick-loc-select" type="submit">' . __('Select Location', 'vbs') . '</button> <button class="act drop-loc-select" type="submit">' . __('Select Location', 'vbs') . '</button> </div> <div class="form-group"> <input type="text" name="date_pickup" id="date_pickup" class="required" /> <input type="text" name="time_pickup" id="time_pickup" class="required" /> </div> <div class="form-group wide"> <label for="return">' . __('Return trip required?', 'vbs') . '</label> <input type="checkbox" name="return" id="return" /> </div> <div class="form-group return_group" style="display: none;"> <input type="text" name="date_return" id="date_return" /> <input type="text" name="time_return" id="time_return" /> </div> <div class="form-group" id="route-info" style="display: none;"></div> <div id="route_map" style="display: none;"> <div id="map-canvas" style="width: 500px !important; height: 500px !important;"></div> </div> <div id="validation"></div> <button class="btn" data-goto="2" type="submit"><i class="fa fa-arrow-right"></i> ' . __('Select Car', 'vbs') . '</button> </div> <!-- step1 end --> </form> <form id="bookingForm" class="formStep2" method="POST" enctype="multipart/form-data"> <div class="step2" style="display: none;"> <h3 class="section">' . __('Select car', 'vbs') . '</h3> <div class="cars"></div> <button class="btn" data-goto="3" type="submit"><i class="fa fa-arrow-right"></i> ' . __('Details', 'vbs') . '</button> </div> <!-- step2 end --> </form>'; if (is_user_logged_in()) { $user = wp_get_current_user(); $html .= '<form id="bookingForm" class="formStep3" method="POST" enctype="multipart/form-data"> <div class="step3" style="display: none;"> <div class="info"> <h3 class="section">' . __('Contact info:', 'vbs') . '</h3> <div class="form-group"> <input readonly type="text" name="first_name" id="first_name" class="required" value="' . $user->user_firstname . '" /> <input readonly type="text" name="last_name" id="last_name" class="required" value="' . $user->user_lastname . '" /> </div> <div class="form-group"> <input readonly type="text" name="email" id="email" class="required" value="' . $user->user_email . '" /> <input type="text" name="phone" id="phone" class="required" placeholder="' . __('Phone', 'vbs') . '" /> </div> <div class="form-group wide"> <textarea name="comments" id="comments">' . __('Message to driver', 'vbs') . '</textarea> </div> <div class="form-group"> <h3 class="section">' . __('Payment Method:', 'vbs') . '</h3> Paypal <input type="radio" name="payment" id="payment" class="required" value="paypal" /> Cash <input type="radio" name="payment" id="payment" class="required" value="cash" /> </div> </div> <button class="btn" data-goto="4" type="submit"><i class="fa fa-arrow-right"></i> ' . __('Summary', 'vbs') . '</button> </div> <!-- step3 end --> </form>'; } else { $html .= '<form id="bookingForm" class="formStep3" method="POST" enctype="multipart/form-data"> <div class="step3" style="display: none;"> <div class="info"> <h3 class="section">' . __('Contact info:', 'vbs') . '</h3> <div class="form-group"> <input type="text" name="first_name" id="first_name" class="required" placeholder="' . __('First name', 'vbs') . '" /> <input type="text" name="last_name" id="last_name" class="required" placeholder="' . __('Last name', 'vbs') . '" /> </div> <div class="form-group"> <input type="text" name="email" id="email" class="required" placeholder="' . __('Email', 'vbs') . '" /> <input type="text" name="phone" id="phone" class="required" placeholder="' . __('Phone', 'vbs') . '" /> </div> <div class="form-group wide"> <textarea name="comments" id="comments">' . __('Message to driver', 'vbs') . '</textarea> </div> <div class="form-group"> <h3 class="section">' . __('Payment Method:', 'vbs') . '</h3> Paypal <input type="radio" name="payment" id="payment" class="required" value="paypal" /> Cash <input type="radio" name="payment" id="payment" class="required" value="cash" /> </div> </div> <button class="btn" data-goto="4" type="submit"><i class="fa fa-arrow-right"></i> ' . __('Summary', 'vbs') . '</button> </div> <!-- step3 end --> </form>'; } $html .= '<form id="bookingForm" class="formStep4" method="POST" enctype="multipart/form-data"> <div class="step4" style="display: none;"> <h3 class="section">' . __('Booking Summary', 'vbs') . '</h3> <ul class="summary"> <li><b>Full Name: </b><span id="s_full-name"></span></li> <li><b>Email: </b><span id="s_email"></span></li> <li><b>Phone: </b><span id="s_phone"></span></li> <li><b>Comments: </b><span id="s_comments"></span></li> <li><br /></li> <li><b>Pickup Location: </b><span id="s_pickup"></span></li> <li><b>Dropoff location: </b><span id="s_dropoff"></span></li> <li><b>Date & Time: </b><span id="s_date-pickup"></span></li> <li><b>Return Journey: </b><span id="s_return"></span></li> <li><b>Return Date & Time: </b><span id="s_date-return"></span></li> <li><br /></li> <li><b>Total Cost: </b>' . $booking['currency_symbol'] . '<span id="s_cost"></span></li> <li><b>Payment method: </b><span id="s_payment"></span></li> </ul> <button class="btn" data-goto="end" type="submit"><i class="fa fa-arrow-right"></i> ' . __('Book!', 'vbs') . '</button> </div> <!-- step4 end --> <input type="hidden" name="security" id="security" value="' . wp_create_nonce("booking-nonce") . '" /> <input type="hidden" name="base_location" id="base_location" value="' . $booking['base_location'] . '" /> </form> <div class="final" style="display: none;"> <div class="response"></div> <!-- server response --> <div class="addon" style="display: none;"></div> <!-- additional data --> </div> <!-- result end --> </div>'; return $html; }
</div> <div class="widget-content"> <table id="locations-table" class="table table-bordered table-striped data-table"> <thead> <tr> <th>Location Name</th> <th>Latitude</th> <th>Longitude</th> <th>Actions</th> </tr> </thead> <tbody> <?php get_locations(); ?> </tbody> </table> </div> <!-- .widget-content --> </div> <!-- .widget --> <div class="actions"> <button onclick="window.location='add_location.php';" class="btn btn-quaternary"><span class="icon-plus"></span>Create New Location</button> </div> <!-- .actions --> </div> <!-- .grid --> </div> <!-- .container -->
</tbody> </table> </div> </div> <!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< JASON: Added panel to display artefacts --> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"> Artefacts </h3> </div> <div class="panel-body" id = "artefacts"> <h3> Todo: Put the players and weapons in rooms </h3> <?php foreach (get_locations() as $char) { ?> <h5> <?php echo $char['name']; ?> </h5> <?php } ?> </div> </div> <!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< --> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"> Dice
if ($webinar->description !== "") { echo '<tr> <td valign="top">Description:</td> <td width="20px"> </td> <td valign="top">' . $webinar->description . '</td> </tr>'; } if ($webinar->agenda !== "") { echo '<tr> <td valign="top">Agenda:</td> <td width="20px"> </td> <td valign="top">' . $webinar->agenda . '</td> </tr>'; } echo '</table>'; $locations = get_locations($webinar->id); if (count($locations) > 2) { echo '<form method="get" action="view.php">'; echo '<div><input type="hidden" name="f" value="' . $webinar->id . '"/>'; choose_from_menu($locations, 'location', $location, ''); echo '<input type="submit" value="' . get_string('showbylocation', 'webinar') . '"/>'; echo '</div></form>'; } print_session_list($course->id, $webinar->id, $location, $webinar); $OUTPUT->box_end(); echo $OUTPUT->footer(); function print_session_list($courseid, $webinarid, $location, $webinar) { global $USER; global $CFG; global $DB;
$pagetitle = format_string($facetoface->name); $f2frenderer = $PAGE->get_renderer('mod_facetoface'); $completion = new completion_info($course); $completion->set_module_viewed($cm); echo $OUTPUT->header(); if (empty($cm->visible) and !has_capability('mod/facetoface:viewemptyactivities', $context)) { notice(get_string('activityiscurrentlyhidden')); } echo $OUTPUT->box_start(); echo $OUTPUT->heading(get_string('allsessionsin', 'facetoface', $facetoface->name), 2); if ($facetoface->intro) { echo $OUTPUT->box_start('generalbox', 'description'); echo format_module_intro('facetoface', $facetoface, $cm->id); echo $OUTPUT->box_end(); } $locations = get_locations($facetoface->id); if (count($locations) > 2) { echo html_writer::start_tag('form', array('action' => 'view.php', 'method' => 'get')); echo html_writer::start_tag('div'); echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'f', 'value' => $facetoface->id)); echo html_writer::select($locations, 'location', $location, ''); echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('showbylocation', 'facetoface'))); echo html_writer::end_tag('div') . html_writer::end_tag('form'); } print_session_list($course->id, $facetoface->id, $location); if (has_capability('mod/facetoface:viewattendees', $context)) { echo $OUTPUT->heading(get_string('exportattendance', 'facetoface')); echo html_writer::start_tag('form', array('action' => 'view.php', 'method' => 'get')); echo html_writer::start_tag('div'); echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'f', 'value' => $facetoface->id)); echo get_string('format', 'facetoface') . ' ';
require_once MODULE_DIR . "access/class.IPAccess.inc"; require_once INIT_DIR . "env.inc"; require_once INIT_DIR . "db.inc"; require_once MODULE_DIR . "user/mod.user.inc"; require_once INIT_DIR . "smarty.inc"; require_once MODULE_DIR . "structure/mod.structure.inc"; require_once MODULE_DIR . "user/mod.usergroup.inc"; //require_once(MODULE_DIR . "productcatalog/mod.category.inc"); //require_once(MODULE_DIR . "productcatalog/mod.variable.inc"); //require_once(MODULE_DIR . "productcatalog/mod.product.inc"); require_once MODULE_DIR . "statistics/mod.query.inc"; require_once MODULE_DIR . "ind_functions.inc"; include_once MODULE_DIR . "edasimuuja.inc"; //require_once(MODULE_DIR . "sitevariables/mod.sitevariables.inc"); if (!$objIPAccess->fnValidate($arrAllowIP["access"], $_SERVER["REMOTE_ADDR"]) or $objIPAccess->fnValidate($arrAllowIP["deny"], $_SERVER["REMOTE_ADDR"])) { header("Location: " . LOGINCENTER_PATH); } if (!is_object($_SESSION["user"])) { header("Location: " . LOGINCENTER_PATH); } require_once CONFIG_DIR . $_SESSION["lang"] . ".translation.inc"; foreach ($_GET as $key => $value) { $_GET[$key] = norm($value); } $strTemplate = "content.maad.tpl"; $tree = get_locations($_GET['country'], $_GET['region']); $engSmarty->assign("tree", $tree); $engSmarty->assign("_GET", $_GET); $engSmarty->assign("boolRefreshTree", $_GET["refreshtree"]); $engSmarty->assign("arrTranslation", $arrTranslation); $engSmarty->display("admin/" . $strTemplate);
} else { header("Location: " . $_GET['state']); } } } // VIP cache $vips = array("https://rhiaro.co.uk", "https://rhiaro.co.uk/", "http://tigo.rhiaro.co.uk/"); if (isset($_SESSION['me']) && in_array($_SESSION['me'], $vips) && !isset($_SESSION['locations'])) { $locations = get_locations("https://rhiaro.co.uk/locations"); } elseif (!isset($_SESSION['locations'])) { $locations = set_default_locations(); } else { $locations = $_SESSION['locations']; } if (isset($_POST['locations_source'])) { $fetch = get_locations($_POST['locations_source']); if (!$fetch) { $errors["Problem fetching locations"] = "The locations url needs to return a single page AS2 Collection as JSON."; } else { $locations = $fetch; } } if (isset($locations["id"])) { $locations_source = $locations["id"]; } function dump_headers($curl, $header_line) { echo "<br>YEAH: " . $header_line; // or do whatever return strlen($header_line); }