Jump to content

Check if all pireps are accepted

Recommended Posts

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?

Share this post

Link to post
Share on other sites

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 */ ?>

<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 = 

	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();

	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 = [];
$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; }
		$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
if (flightMarkers_2.length > 0) {
	var bounds = new google.maps.LatLngBounds();
	for (var i = 0; i < flightMarkers_2.length; i++) {

$count = 20;
$pireps = PIREPData::getRecentReportsByCount($count);
<table class="sky_table" width="94%" cellspacing="0" border="1">
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>';
    echo '<tr><td>There are no recent flights!</td></tr>';
<div class="clear"></div>
<div class="clear"></div>



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now