<?php 
/**
 * iCrew v4 LITE - Virtual Airline Crew Center
 * Copyright (c) 2017 iCrewSystems
 * 
 * This CrewCenter & and it's Modules (which are distinguished, and limited to unless specified)
 * are protected by copyright under Indian Copyright Act, 1957, with the 2012 amendments
 * No part of the website design or layout may be reproduced or transmitted in any form or by any other 
 * means electronic or mechanical to include photocopying, recording, reproducing, or electronic storage.
 * Any such act represents a copyright violation and theft of intellectual property owned by iCrewSystems. 
 * 
 * @author: Leonard Selvaraja
 * @copyright: Copyright (c) 2017, iCrewSystems
 * @link http://www.icrewsystems.com
 * @service name: iCrewSystems Virtual Airline Intermediate Services (with additions) 
 * Caution : NO SUPPORT WILL BE PROVIDED IF ANY MODULE / TEMPLATE IS FOUND TO BE TAMPERED WITH.
 */
 ?>
 
<?php
	$var ='you can hear the LIVE ATIS broadcast from our WX briefing room for any airport in the world?, you can post your screenshots in our Screenshot Center and we will publish them and use them for various purposes?, you can view who all is online by toggling the Alternate Side Bar? Give it a try!, you can write emails which contain graphical information to all your fellow Pilots and Staff using iMail?, you can view the Airport Information of all Airports in our database by navigating to the Airports Database?, staff are always there to help you out? Hop on the Discord Channel and let\'s talk!, your views are of Paramount importance to us?, you can login to Discord and join the conversation with all of our pilots? It\'s fun!' ;
	$result = explode(',',$var); //Split it by ','
?>
<script>
    $(function() {
    setTimeout(function() {
    $.bootstrapGrowl("<h4>iCrew <strong>Notifications </strong> </h4>Hey <?php echo Auth::$userinfo->firstname; ?>, Welcome back to <?php echo SITE_NAME ?>. Did you know, <?php echo $result[array_rand($result)] ?> ", {
    ele: 'body', // which element to append to
    type: 'info', // (null, 'info', 'danger', 'success')
    offset: {from: 'top', amount: 20}, // 'top', or 'bottom'
    align: 'right', // ('left', 'right', or 'center')
    width: 250, // (integer, or 'auto')
    delay: 11000, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
    allow_dismiss: true, // If true then will display a cross to close the popup.
    stackup_spacing: 10 // spacing between consecutively stacked growls.
    });
    }, 2000);
    });      
</script>
	
	<?php 
		if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN))
		{
			$count = 1;
			$pireps = PIREPData::getRecentReportsByCount($count);
			if(count($pireps) > 0) {
				foreach ($pireps as $pirep)
			 {
			if($pirep->accepted == '1') 
			   {
			     ?>
			 <script>
				$(function() {
				
				setTimeout(function() {
				$.bootstrapGrowl("<h4>Staff <strong>Notifications </strong> </h4> There are no PIREPs pending ", {
				ele: 'body', // which element to append to
				type: 'danger', // (null, 'info', 'danger', 'success')
				offset: {from: 'top', amount: 20}, // 'top', or 'bottom'
				align: 'right', // ('left', 'right', or 'center')
				width: 250, // (integer, or 'auto')
				delay: 11000, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
				allow_dismiss: true, // If true then will display a cross to close the popup.
				stackup_spacing: 10 // spacing between consecutively stacked growls.
				});
				}, 6000);
				});
			</script>
			<?php }
			   else 
			   { ?>
			<script>
        	$(function() {
				        
        setTimeout(function() {
        $.bootstrapGrowl("<h4>Staff <strong>Notifications </strong> </h4> There are PIREPs waiting to be accepted ", {
          ele: 'body', // which element to append to
          type: 'danger', // (null, 'info', 'danger', 'success')
          offset: {from: 'top', amount: 20}, // 'top', or 'bottom'
          align: 'right', // ('left', 'right', or 'center')
          width: 250, // (integer, or 'auto')
          delay: 11000, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
          allow_dismiss: true, // If true then will display a cross to close the popup.
          stackup_spacing: 10 // spacing between consecutively stacked growls.
          
          
        });
        }, 6000);
        });
			</script>
			   <?php }
		}
			} else {
				
			}
			
		}
		else
		{
			
		}
			
	
?>
<?php
$bids = SchedulesData::GetBids(Auth::$pilot->pilotid);
if(!$bids)
     { 
     	$bidsmessage = "You dont have any bids";
     	
     } 
     else {
     	foreach($bids as $bid)
{
                   $bidsmessage = "Your next flight is ".$bid->code.$bid->flightnum." from ".$bid->depicao." to ".$bid->arricao."";
}
                    
                }
            ?>
            <script>
        $(function() {
        
        setTimeout(function() {
        $.bootstrapGrowl("<h4>iCrew <strong>Notifications </strong> </h4> <?php echo $bidsmessage ?>", {
          ele: 'body', // which element to append to
          type: 'success', // (null, 'info', 'danger', 'success')
          offset: {from: 'top', amount: 20}, // 'top', or 'bottom'
          align: 'right', // ('left', 'right', or 'center')
          width: 250, // (integer, or 'auto')
          delay: 11000, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
          allow_dismiss: true, // If true then will display a cross to close the popup.
          stackup_spacing: 10 // spacing between consecutively stacked growls.
          
          
        });
        }, 8000);
        });
			</script>
