Jump to content

Taran

Members
  • Posts

    204
  • Joined

  • Last visited

Posts posted by Taran

  1. I agree with Jordan. It appears that there are A LOT (not everyone) of VA owners on these forums that put down the new comers. How would you feel if someone put down your airline when you first opened? Just accept the competition, it makes it more realistic and keeps things interesting. Keep any rude comments to yourselves because no team who has put another down has ever made it. You don't see Deltava.org putting anyone down even they are better than most of us. That's how we all should be. So let's be a team even though we're not the same VA, Cheers!

    I hope that Impulse becomes better than all those who have put it down. All power to you Impulse, and if you need my help I'd be delighted!

    • Like 2
  2. Still not working on my end :/ If i'm supposed to put something else somewhere please help! Here's what i have:

    This code is in the HubStats.class.php

    public static function TotalHoursBetweenDates($icao, $startdate, $enddate) { //Count total hours
    $query = "SELECT SUM(flighttime) as hours FROM phpvms_pireps WHERE depicao = '$icao' OR arricao = '$icao' AND DATE(submitdate) >= '$startdate' AND DATE(submitdate) =< '$enddate'";
    $result = DB::get_row($query);
    return $result->hours;
    }
    

    This is the code i'm using to get the data displayed

    <?php echo HubStats::TotalHoursBetweenDates('KATL', date("Y-m-01"), date("Y-m-t"));?>
    

  3. Taran, you can modify the SQL for the TotalHours function to create another to specify a date range:

    public static function TotalHoursBetweenDates($icao, $startdate, $enddate) { //Count total hours
    $query = "SELECT SUM(flighttime) as hours FROM ".TABLE_PREFIX."pireps WHERE depicao = '".$icao."' OR arricao = '".$icao."' AND '".$startdate."' < submitdate < '".$enddate."'";
    $result = DB::get_row($query);
    return $result->hours;
    }
    

    (Not tested)

    For the folks back home who are wanting this as well, here's the corrected code that will be placed in the HubStats.class.php:

    public static function TotalHoursBetweenDates($icao, $startdate, $enddate) { //Count total hours
    $query = "SELECT SUM(flighttime) as hours FROM ".TABLE_PREFIX."pireps WHERE depicao = '".$icao."' OR arricao = '".$icao."' AND submitdate >= '".$startdate."' AND submitdate =< '".$enddate."'";
    $result = DB::get_row($query);
    return $result->hours;
    }
    

  4. Here's my layout.tpl

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
    <head>
    <meta http-equiv="X-UA-Compatible" content="IE=7">
    <title><?php echo $page_title; ?></title>
    <link rel="stylesheet" media="all" type="text/css" href="<?php echo SITE_URL?>/lib/skins/pureHTML5_blue/styles/style.css" />
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" />
    <?php echo $page_htmlhead; ?>
    <link rel="stylesheet" media="all" type="text/css" href="<?php echo SITE_URL?>/lib/skins/pureHTML5_blue/styles/html5.css" />
    <!-- JS BELOW -->
    <? Template::Show('forum_style.tpl'); ?>
    <!-- JS ABOVE -->
    <!--Simply copy and paste into <BODY>
    			 Just above the </BODY> tag. -->
    <script type="text/javascript">
    /*
    Snow Fall 1 - no images - Java Script
    Visit http://rainbow.arch.scriptmania.com/scripts/
     for this script and many more
    */
    // Set the number of snowflakes (more than 30 - 40 not recommended)
    var snowmax=35
    // Set the colors for the snow. Add as many colors as you like
    var snowcolor=new Array("#aaaacc","#ddddff","#ccccdd","#f3f3f3","#f0ffff")
    // Set the fonts, that create the snowflakes. Add as many fonts as you like
    var snowtype=new Array("Times","Arial","Times","Verdana")
    // Set the letter that creates your snowflake (recommended: * )
    var snowletter="*"
    // Set the speed of sinking (recommended values range from 0.3 to 2)
    var sinkspeed=0.6
    // Set the maximum-size of your snowflakes
    var snowmaxsize=30
    // Set the minimal-size of your snowflakes
    var snowminsize=8
    // Set the snowing-zone
    // Set 1 for all-over-snowing, set 2 for left-side-snowing
    // Set 3 for center-snowing, set 4 for right-side-snowing
    var snowingzone=1
    ///////////////////////////////////////////////////////////////////////////
    // CONFIGURATION ENDS HERE
    ///////////////////////////////////////////////////////////////////////////
    // Do not edit below this line
    var snow=new Array()
    var marginbottom
    var marginright
    var timer
    var i_snow=0
    var x_mv=new Array();
    var crds=new Array();
    var lftrght=new Array();
    var browserinfos=navigator.userAgent
    var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
    var ns6=document.getElementById&&!document.all
    var opera=browserinfos.match(/Opera/)
    var browserok=ie5||ns6||opera
    function randommaker(range) {
    						    rand=Math.floor(range*Math.random())
    		    return rand
    }
    function initsnow() {
    						    if (ie5 || opera) {
    														    marginbottom = document.body.scrollHeight
    														    marginright = document.body.clientWidth-15
    						    }
    						    else if (ns6) {
    														    marginbottom = document.body.scrollHeight
    														    marginright = window.innerWidth-15
    						    }
    						    var snowsizerange=snowmaxsize-snowminsize
    						    for (i=0;i<=snowmax;i++) {
    														    crds[i] = 0;
    										    lftrght[i] = Math.random()*15;
    										    x_mv[i] = 0.03 + Math.random()/10;
    														    snow[i]=document.getElementById("s"+i)
    														    snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
    														    snow[i].size=randommaker(snowsizerange)+snowminsize
    														    snow[i].style.fontSize=snow[i].size+'px';
    														    snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
    														    snow[i].style.zIndex=1000
    														    snow[i].sink=sinkspeed*snow[i].size/5
    														    if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
    														    if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
    														    if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
    														    if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
    														    snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)
    														    snow[i].style.left=snow[i].posx+'px';
    														    snow[i].style.top=snow[i].posy+'px';
    						    }
    						    movesnow()
    }
    function movesnow() {
    						    for (i=0;i<=snowmax;i++) {
    														    crds[i] += x_mv[i];
    														    snow[i].posy+=snow[i].sink
    														    snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i])+'px';
    														    snow[i].style.top=snow[i].posy+'px';
    														    if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
    																						    if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
    																						    if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
    																						    if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
    																						    if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
    																						    snow[i].posy=0
    														    }
    						    }
    						    var timer=setTimeout("movesnow()",50)
    }
    for (i=0;i<=snowmax;i++) {
    						    document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>")
    }
    if (browserok) {
    						    window.onload=initsnow
    }
    </SCRIPT>
    </head>
    <body>
    <?php echo $page_htmlreq ?>
    <section id="background-gradient"></section>
    <section id="pageWrap">
    <nav>
    <?php Template::Show('core_navigation.tpl'); ?> 
    </nav>
    <header>
    <?php Template::Show('core_header.tpl'); ?> 
    </header>
    <section class="clearfix" id="contentWrap">
    <?php echo $page_content; ?>
    </section>
    <footer>
    <?php Template::Show('core_footer.tpl'); ?>
    </footer>
    </section>
    </body>
    </html>
    

    here's my frontpage_main.tpl

    <aside>
    <iframe src="http://free.timeanddate.com/clock/i3ww8qil/n1/fn14/fc009/tct/pct/ahl/tt0/tw1/tm1/td1/th1/ta1" frameborder="0" width="233" height="19" allowTransparency="true"></iframe>
    <section class="box">
    <h1>News</h1>
    <?php PopUpNews::PopUpNewsList(5); ?>
    </section>
    <section class="box">
     <h1>HUB Wars (Hours)</h1>
     EGLL: <? echo HubStats::TotalHours(EGLL); ?><br />CYYZ: <? echo HubStats::TotalHours(CYYZ); ?><br />KATL: <? echo HubStats::TotalHours(KATL); ?><br />KSEA: <? echo HubStats::TotalHours(KSEA); ?><br />VHHH: <? echo HubStats::TotalHours(VHHH); ?>
    </section>
    <section class="box">
     <h1>In The Air</h1>
     <?php Screenshots::show_random_screenshot(); ?>
    </section>
    <section class="box">
     <h1>Statistics</h1>
     Pilots: <?php echo StatsData::PilotCount(); ?><br />Pilots Pending: <?php echo count(PilotData::GetPendingPilots())?><br />Hours: <?php echo StatsData::TotalHours(); ?><br />Flights: <?php echo StatsData::TotalFlights(); ?><br />Distance Flown: <?php echo StatsData::TotalMilesFlown(); ?><br />Passangers Carried: <?php echo StatsData::TotalPaxCarried (); ?><br /> VACentral Rank: <?php
    $cws = new CodonWebService();
    $xml = $cws->get('http://vacentral.net/airline/xml/vva_victorvirtualairlines');
    $xml = simplexml_load_string($xml);
    echo "{$xml->rank}";
    ?>
    </section>
    <section class="box">
     <h1>Latest Pilots</h1>
     <?php MainController::Run('Pilots', 'RecentFrontPage', 5); ?>
    </section>
    <section class="box">
    <?php
    $usersonline = StatsData::UsersOnline();
    $guestsonline = StatsData::GuestsOnline();
    ?>
    <h1>Pilots Online</h1>
        <?php
    $shown = array();
    foreach($usersonline as $pilot)
    {
    if(in_array($pilot->pilotid, $shown))
    continue;
    else
    $shown[] = $pilot->pilotid;
    echo "<p>";
    echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot->location).'" />';
    echo " {$pilot->firstname} {$pilot->lastname}<br />";
    echo "</p>";
    }
    ?>
        <p class="txt-red10">Currently
        <?php echo count($guestsonline);?>
        guest(s) visiting.
    </section>
    </aside>
    <section id="contentFrontPage">
    <h1>Welcome to Victor Virtual Airlines!</h1>
    We operate all around the world giving you a no-limit virtual airline to fly with! At VVA, you're not a number, you're a member of the family. Welcome aboard!
    We are also now hiring staff! To apply, please visit the Career Center.
    <article>
     <h3>Why do we do it?</h3>
     <iframe width="560" height="315" src="//www.youtube.com/embed/I712YXdJ6_0" frameborder="0" allowfullscreen></iframe>
     <h3>Latest Flights</h3>
     <?php
    $count = 5;
    $pireps = PIREPData::getRecentReportsByCount($count);
    ?>
     <table widtd="100%">
      <thead>
       <tr>
       <th>Flight No</th>
       <th>Departure</th>
       <th>Arrival</th>
       <th>Duration</th>
       <th>Pilot</th>
       <th>Status</th>
       </tr>
       </thead>
       <tbody>
    
       <?php
      if(count($pireps) > 0)
      {
     foreach ($pireps as $pirep)
     {
     {
       $pilotinfo = Pilotdata::getPilotdata($pirep->pilotid);
       $pilotid = Pilotdata::getPilotCode($pilotinfo->code, $pilotinfo->pilotid);
    
       if($pirep->accepted == '0') $status = 'REJECTED';
       if($pirep->accepted == '1') $status = 'ACCEPTED';
       else $status = 'PENDING';
      }
      ?>
       <tr>
       <td><?php echo $pirep->code.$pirep->flightnum; ?></td>
       <td><?php echo $pirep->depicao; ?></td>
       <td><?php echo $pirep->arricao; ?></td>
       <td><?php echo $pirep->flighttime; ?></td>
       <td><?php echo $pilotinfo->firstname.' '.$pilotinfo->lastname; ?></td>
       <td><?php
    
     if($pirep->accepted == PIREP_ACCEPTED)
      echo 'Accepted';
     elseif($pirep->accepted == PIREP_REJECTED)
      echo 'Rejected';
     elseif($pirep->accepted == PIREP_PENDING)
      echo 'Approval Pending';
     elseif($pirep->accepted == PIREP_INPROGRESS)
      echo 'Flight in Progress';
    
     ?>
       </td>
       </tr>
       <?php
     }}
      else
      {
       echo '<tr><td colspan="6">No flights yet made, first cooming soon!</td></tr>';
      }
      ?>
      </tbody>
     </table>
    </article>
    <article>
     <h3>Live Flights</h3>
     <?php Template::Show('acarsmap.tpl'); ?>
    </article>
    </section>
    

×
×
  • Create New...