-
Posts
2284 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
phpVMS Resources
Downloads
Everything posted by mark1million
-
Maybe you can mash this up to get what you want, this will run outside vms, should also work inside with a bit of alteration. <?php error_reporting(E_ALL); include '/YOURPATH TO CORE//core/codon.config.php'; $allpilots = PilotData::getAllPilots(); foreach($allpilots as $pilot) { } ?> <h3>Aerosoft Pilot Hours Validation</h3> <p>To Quick search name or pilot id hit Ctrl + F and and type in data.</p> <?php if(!$allpilots) { echo 'There are no pilots!</div>'; return; } ?> <table width="380" cellspacing="1" cellpadding="5" border="1"> <thead> <tr> <th width="60px">Pilot ID</th> <th width="200px">Name</th> <th width="55px">Hours</th> <th width="65px">Active/Inactive</th> </tr> </thead> <tbody> <?php foreach($allpilots as $pilot) { /* To include a custom field, use the following example: <td> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> </td> For instance, if you added a field called "IVAO Callsign": echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign'); */ ?> <tr> <td width="1%" nowrap><a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <td> <div align="left"><img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <?php echo $pilot->firstname.' '.$pilot->lastname?> </div></td> <td><div align="center"><?php echo $pilot->totalhours?></div></td> <td><div align="center"><?php If ($pilot->retired == 0) { echo '<img src="/images/green-status.gif" />'; } else { echo '<img src="/images/red-status.gif" />'; } ?></div></td></div></td> <?php } ?> </div> </tbody> </table>
-
Even easier if you have a old machine, just download ubuntu server 32bit you will be up and running in an hour or so.
-
You would need a static ip address or transfer your dns service to dyndns.org there you can fully manage your dns and download a client which if your ipaddress dies change it will update the dns records with the new one but this is not instant their can be a 5 minute delay at max. What ever you do do not host on winamp, just install apache mysql and php manually, its fairly easy to do it.
-
Dave, I have been trying to get this to display on the top pilot page for hours now, i just cant seem to get it. <h3>Top 10 Landings for <?php echo date("F Y");?></h3> <table width="700" border="1" cellspacing="1" cellpadding="1"> <tr> <th>Pilot</th> <th>Aircraft</th> <th>Arrival Field</th> <th>Landing Rate</th> <th>Date Flown</th> </tr> <?php foreach($stats as $stat) { $pilot = PilotData::getPilotData($stat->pilotid); $aircraft = OperationsData::getAircraftInfo($stat->aircraft); echo '<tr>'; echo '<td>'.PilotData::getPilotCode($pilot->code, $pilot->pilotid).' - '.$pilot->firstname.' '.$pilot->lastname.'</td>'; echo '<td align="center">'.$aircraft->fullname.'</td>'; echo '<td align="center">'.$stat->arricao.'</td>'; echo '<td align="center">'.$stat->landingrate.'</td>'; echo '<td align="center">'.date(DATE_FORMAT, strtotime($stat->submitdate)).'</td>'; echo '</tr>'; } ?> </table> I have added a new call to the module TouchdownStats.php, } public function top_landing_this_month () { $this->set('stats', TouchdownStatsData::get_stats_by_cur_month()); $this->show('touchdownstats/touchdownstats_index.tpl'); And also a new sql query to the TouchdownStatsData.class.php //added By Mark Grant 03-02-2011 public function get_stats_by_cur_month () { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' AND MONTH(submitdate)=MONTH(now()) AND YEAR(submitdate)=YEAR(now()) ORDER BY landingrate DESC LIMIT 10"; return DB::get_results($query); } Everything works fine when i use the url to call, http://www.easyjetva.com/index.php/TouchdownStats/top_landing_this_month but when i add that code to the tp_index.php i keep getting Invalid argument supplied for foreach(), i have tried renaming the variables but i cant seem to get it, any help would be appreciated. Thanks.
-
Nope, what's the site you are using?
-
Sorry didn't explain fully, i want that data on another page but i cant include it as it needs to be ran as a url,
-
Right i have this working and limiting nicely now I want to put this page in another page but i cant seem to get it to work, any ideas would be great, i have tried, <?php MainController::Run('TouchdownStats', 'display_TouchdownStats/top_landing_this_month'); ?> here is the page, http://www.easyjetva.com/index.php/TouchdownStats/top_landing_this_month cheers.
-
:) :) Top man. Thankyou.
-
OK the now() works but its bringing back all the years so Feb 2010 and 2011, how do i limit the year.
-
Right i have had to do a bit of syntax adjustment but its working to a point, the top function seems to pull back all the landings from every month, doesnt seem to limit by current month. I will keep playing and see what i can do
-
Cheers i will give that a go in a bit let you know, as for the error a simple, error_reporting(0); will stop that outputting to screen
-
Great, Just check that line echo '<a href="http://www.vataware.com/pilot.cfm?cid=' . $fieldvalue . '" target="_blank">' . $fieldvalue . '</a></a>' ; Dont think it needs 2 closing tags.
-
Independence Air Virtual is Open!!
mark1million replied to regional_elite's topic in Virtual Airlines Discussion
Nice Find!!! -
I put my link in the id success div goes across the top of the page nicely, that was ages ago though i couldn't tell you the tpl file.
-
Current month with maybe a selection drop down?
-
Ah ok just change the image part to the variable $fieldvalue I have not tested but should be OK
-
The code above presumes you have a field value in registration called Vatsim ID That is a line from my pilots list tpl
-
Sorry guys i have just read this thread, this is more complex than it need be. Add another field on registration VatsimID, IVAO ID etc or what you like then you can call that field in the pilots list or where ever you like, Examples, http://www.easyjetva.com/index.php/pilots You can then output the id's as a link variable. <td><div align="center"> <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'Vatsim ID' ); if( $fieldvalue != '' ) { echo '<a href="http://www.vataware.com/pilot.cfm?cid=' . $fieldvalue . '" target="_blank"><img src="/images/charticon.jpg" width="28" height="28" border="0" alt="Vatsim ID" /></a></a>' ; } else { echo '<img src="/images/nonreg.png" width="20" height="18" border="0" alt="Not Listed" /></a>' ; } ?> </div></td>
-
Thank you, worked a treat. Hope you don't mind but im going to put your group icon on my home page, i get quote a lot of traffic so hopefully you will get some of it
-
Yeh that sounds good, i would be willing to share my limited knowledge of php to get this thing off the ground. Maybe instead of predefined awards how about admin defined awards so each va's admin could create on the fly but like you said it would need the logic coding beforehand so that wouldn't quite work in all circumstanced but for amount of landings, pax, miles etc should be fine.
-
That would be a good edition as this is all manually done at the moment apart from the ranks which are tied in to specified hours in the admin section. You would have to create a module for the admin side with the logic and definable parameters. Would be nice to see
-
If you have root access just do, iptables -A INPUT -s ipaddress -j DROP replace the ipaddress with the up you want to ban. Basically that will use the iptables in linux to drop a connection that has an ipaddress you specify.
-
Dave, is there a simple way if adding the historical stats in to a dropdown list? Would look much nicer as the list is starting to get a bit long now, Cheers.
-
Not with in phpvms script but you can use your server to ban these, are you in linux or windows? Also what kind of access do you have to your server. If you using a Linux distro you can use, Permanently Ban IP Addresses, iptables -A INPUT -s IPADDRESSOFBAN -j DROP iptables-save > firewall.log and iptables-restore < firewall.log If you using Windows go in to iis and then security from there you can add ipaddresses to ban.