I was wondering if there was a way we could check if pireps are accepted or unaccepted. I was think of something like we can check if the user is an admin or not if he is then the system would check if there are unaccepted pireps. If there are the user would be redirected to the admin page or could be given a notification?
Yes there is One easy way I’ve come up with, if you go to this link below, and scroll down. You will see a map towards the bottom. Accepted, Rejected, Pending, with all info inregards to Aircraft, and much more . Plus the route on the Map for said PIREP. You will have to make some changes to the code I’ve provided in regards to point to YOUR server ICON’s. I have pasted the Code Snippet for anyone who so desires to use this. Hurry up and go to the Link provided, as I am shutting down my Server as of Jan.2nd, 2018. So don’t wait to long. Remember, this pirep map is at the bottom near the footer. On one note, I have reversed the airplane icon for those who don’t understand coding to the phpvms default aircraft. And, I’ve attached the actual file for everyone. Enjoy !
Jim L. CEO Heritage VA
The Link to view the PIREP Map ;
The Actual Code:
\<?php /\* The following script below was used by the old timers from Heritage VA. This script of course is free to use by anyone. It is designed to work also with ANY Bootstrap system, and is 100% automated for ALL pireps recorded, including any staff members and Admins that fly. Sadly Heritage VA has closed, but we are still active with phpvms forums and will help in anyway possible to fellow members. We Hope you enjoy this little snippet, we did, and it looks awesome. Thank you all. And may God speed ! December 19th, 2017 \*/ ?\> \<!--SATELLITE REMARKED OUT FOR TERRAIN BELOW--\> \<div id="arrivals" style="width:94%; height: 680px"\>\</div\> \<script type="text/javascript"\> var MY\_MAPTYPE\_ID\_2 = 'alaskamap'; \<!--DO NOT CHANGE --\> \<!-- Snazzy Maps, can be changed to whatever you want @ snazzymaps site.--\> var stylez\_2 = [{"featureType":"all","elementType":"geometry","stylers":[{"hue":"#ff4400"},{"saturation":-68},{"lightness":-4},{"gamma":0.72}]},{"featureType":"landscape.man\_made","elementType":"geometry","stylers":[{"hue":"#0077ff"},{"gamma":3.1}]},{"featureType":"landscape.natural.terrain","elementType":"geometry.fill","stylers":[{"visibility":"on"}]},{"featureType":"poi.park","elementType":"all","stylers":[{"hue":"#44ff00"},{"saturation":-23}]},{"featureType":"transit","elementType":"labels.text.stroke","stylers":[{"saturation":-64},{"hue":"#ff9100"},{"lightness":16},{"gamma":0.47},{"weight":2.7}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"lightness":-48},{"hue":"#ff5e00"},{"gamma":1.2},{"saturation":-23}]},{"featureType":"water","elementType":"all","stylers":[{"hue":"#00ccff"},{"gamma":0.44},{"saturation":-33}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"hue":"#007fff"},{"gamma":0.77},{"saturation":65},{"lightness":99}]},{"featureType":"water","elementType":"labels.text.stroke","stylers":[{"gamma":0.11},{"weight":5.6},{"saturation":99},{"hue":"#0091ff"},{"lightness":-86}]}] var latlng = new google.maps.LatLng(\<?php echo Config::Get('MAP\_CENTER\_LAT')?\>,\<?php echo Config::Get('MAP\_CENTER\_LNG')?\>); var bounds = new google.maps.LatLngBounds(); bounds.extend(latlng); var center = bounds.getCenter(); var options = { center : center, backgroundColor : '#FFFFFF', streetViewControl : true, zoomControlOptions : { style : google.maps.ZoomControlStyle.SMALL }, minZoom : 2, mapTypeControlOptions : { mapTypeIds : [google.maps.MapTypeId.TERRAIN, MY\_MAPTYPE\_ID\_2] }, mapTypeId : MY\_MAPTYPE\_ID\_2 }; var styledMapOptions\_2 = { name : "RoadMap" }; var map\_2 = new google.maps.Map(document.getElementById("arrivals"), options); var alaskamap = new google.maps.StyledMapType(stylez\_2, styledMapOptions\_2); map\_2.mapTypes.set(MY\_MAPTYPE\_ID\_2, alaskamap); var flightMarkers\_2 = []; var image = new google.maps.MarkerImage('\<?php echo SITE\_URL; ?\>/lib/images/onground.png', \<!--default phpvms,can be changed to what you want--\> new google.maps.Size(32, 32), new google.maps.Point(0, 0), new google.maps.Point(5, 5)); var depmarker = []; var arrmarker = []; \<?php $pirep\_list = PIREPData::getRecentReportsByCount(20); $shown = array(); foreach($pirep\_list as $pirep) { // Dont show repeated routes if(in\_array($pirep-\>code.$pirep-\>flightnum, $shown)) { continue; } else $shown[] = $pirep-\>code.$pirep-\>flightnum; if(empty($pirep-\>arrlat) || empty($pirep-\>arrlng) || empty($pirep-\>deplat) || empty($pirep-\>deplng)) { continue; } ?\> dep\_location = new google.maps.LatLng( \<?php echo $pirep-\>deplat ?\> ,\<?php echo $pirep-\>deplng ?\> ); arr\_location = new google.maps.LatLng( \<?php echo $pirep-\>arrlat ?\> ,\<?php echo $pirep-\>arrlng ?\> ); flightMarkers\_2[flightMarkers\_2.length] = new google.maps.Marker({ position : dep\_location, map : map\_2, icon : image, title : "\<?php echo "$pirep-\>depname ($pirep-\>depicao)";?\>" }); flightMarkers\_2[flightMarkers\_2.length] = new google.maps.Marker({ position : arr\_location, map : map\_2, icon : image, title : "\<?php echo "$pirep-\>arrname ($pirep-\>arricao)";?\>" }); depmarker[depmarker.length] = new google.maps.Marker({ position : dep\_location, map : map\_2, icon : new google.maps.MarkerImage( "http://chart.googleapis.com/chart?chst=d\_text\_outline&chld=80FF00|14|h|000000|b|\<?php echo "$pirep-\>depicao";?\>", null, null, new google.maps.Point(20, 22)) }); arrmarker[arrmarker.length] = new google.maps.Marker({ position : arr\_location, map : map\_2, icon : new google.maps.MarkerImage( "http://chart.googleapis.com/chart?chst=d\_text\_outline&chld=BC1A15|14|h|000000|b|\<?php echo "$pirep-\>arricao";?\>", null, null, new google.maps.Point(29, 19)) }); var flightPath\_2 = new google.maps.Polyline({ path : [dep\_location, arr\_location], strokeColor : "#E68A01", strokeOpacity : 0.9, strokeWeight : 2, geodesic : true }).setMap(map\_2); \<?php } ?\> if (flightMarkers\_2.length \> 0) { var bounds = new google.maps.LatLngBounds(); for (var i = 0; i \< flightMarkers\_2.length; i++) { bounds.extend(flightMarkers\_2[i].position); } } map\_2.fitBounds(bounds); \</script\> \<?php $count = 20; $pireps = PIREPData::getRecentReportsByCount($count); ?\> \<table class="sky\_table" width="94%" cellspacing="0" border="1"\> \<tr\> \<th\>Flight\</th\> \<th\>Pilot\</th\> \<th\>Departure\</th\> \<th\>Arrival\</th\> \<th\>Aircraft\</th\> \<th\>Duration\</th\> \<th\>V/S\</th\> \<th\>Status\</th\> \</tr\> \<?php if(count($pireps) \> 0) { foreach ($pireps as $pirep) { $pilotinfo = PilotData::getPilotData($pirep-\>pilotid); $pilotid = PilotData::getPilotCode($pilotinfo-\>code, $pilotinfo-\>pilotid); $acrid = OperationsData::getAircraftByReg($pirep-\>registration); echo '\<tr\>'; echo '\<td\>\<button type="button" class="btn btn-default"\>\<a href="'.SITE\_URL.'/index.php/pireps/viewreport/'.$pirep-\>pirepid.'"\>'.$pirep-\>code.$pirep-\>flightnum.'\</a\>\</td\>\</button\>'; echo '\<td\>\<button type="button" class="btn btn-default"\>\<a href="'.SITE\_URL.'/index.php/profile/view/'.$pilotinfo-\>pilotid.'"\>'.$pilotinfo-\>firstname.' '.$pilotinfo-\>lastname.'\</a\>\</button\>\</td\>'; echo '\<td\>'.$pirep-\>depicao.'\</td\>'; echo '\<td\>'.$pirep-\>arricao.'\</td\>'; echo '\<td\>\<button type="button" class="btn btn-primary btn-sm"\>\<span class="badge"\>'.$pirep-\>aircraft.'\</td\>\</span\>\</button\>'; echo '\<td\>'.$pirep-\>flighttime.'\</td\>'; echo '\<td\>\<button type="button" class="btn btn-danger btn-sm"\>\<span class="badge"\>'.$pirep-\>landingrate.' ft/m\</td\>\</span\>\</button\>'; if($pirep-\>accepted == PIREP\_ACCEPTED) echo '\<td\>\<button type="button" class="btn btn-success"\>Accepted\</button\>\</td\>'; elseif($pirep-\>accepted == PIREP\_REJECTED) echo '\<td\>\<button type="button" class="btn btn-danger"\>\<span class="label label-important"\>\<font color="black"\>Rejected\</font\>\</span\>\</button\>\</td\>'; elseif($pirep-\>accepted == PIREP\_PENDING) echo '\<td\>\<button type="button" class="btn btn-warning"\>\<span class="label label-warning"\>\<font color="black"\>Pending\</font\>\</span\>\</button\>\</td\>'; elseif($pirep-\>accepted == PIREP\_INPROGRESS) echo '\<td\>On Progress\</td\>'; echo '\</tr\>'; } } else { echo '\<tr\>\<td\>There are no recent flights!\</td\>\</tr\>'; } ?\> \</tbody\> \</table\> \<div class="clear"\>\</div\> \<div class="clear"\>\</div\>