Jump to content

AGuyFawkesMask

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by AGuyFawkesMask

  1. That's a good idea, parkho, but I actually solved the issue myself! Have a look: <div id="depapttab"> <p>Select your departure airport:</p> <select id="depicao" name="depicao"> <option value="">Select All</option> <?php $exclude = array(13, 18, 19, 22); // Airport IDs found in phpVMS_airports not to be included in the dropdown menu if(!$depairports) $depairports = array(); foreach($depairports as $airport) { if(!in_array($airport->id, $exclude)) { // Exclude values in the above array from the dropdown menu echo '<option value="'.$airport->icao.'">'.$airport->icao.' - '.$airport->name.'</option>'; } } ?> </select> <input type="submit" name="submit" value="Find Flights" /> </div> It was really just a small error that I failed to catch. I was using... if(!in_array($depairports->id, $exclude)) ...instead of... if(!in_array($airport->id, $exclude)) What a silly mistake! Anyway, all fixed now. Hopefully this can be of benefit to some other users. (I think I tagged the right search words.) Thanks for the suggestion, though. And have a good holiday!
  2. Good evening, everyone--and happy holidays! I'm unsure whether or not this is the appropriate section to ask whether or not anyone developed a solution for this yet, but I'm not exactly asking for support. This is just a question. Has anyone ever written a script that excludes certain airports from showing up in the depapttab, arrapttab dropdown menus on their schedules_searchform.tpl? This would be useful to me because I have certain airports right now in my phpvms_airports table that were previously used during temporary "charter" activities. Today, we no longer utilize them in our day-to-day operation. Here's what I originally came up with: <div id="depapttab"> <p>Select your departure airport:</p> <select id="depicao" name="depicao"> <option value="">Select All</option> <?php $exclude = array(13, 18, 19, 22); if(!$depairports) $depairports = array(); foreach($depairports as $airport) { if(!in_array($depairports->id, $exclude)) { echo '<option value="'.$airport->icao.'">'.$airport->icao.' - '.$airport->name.'</option>'; } } ?> </select> <input type="submit" name="submit" value="Find Flights" /> </div> Unfortunately, none of this worked though. Any insight? I have a feeling it might be connected to modules/Schedules.php, but I'm unsure. Thanks in advance for the assistance.
  3. I know this is an old post, but did anyone ever come out with a fix for this bug? I'm running version 2.1.934 and I'm noticing still that the form is only utilizing the last field (the distance search field) if I input information into the last field and then switch back to another field (i.e. equipment, a departure/arrival airport, etc.). Really curious to see how someone finds a work-around for this issue.
  4. Thanks, twelka. Resetting the hours did indeed fix the issue. I appreciate the help!
  5. Hi all, This question might seem obvious, but I need a firm answer from someone who's familiar with phpVMS to tell me what the "Reset total hours count" option does in the maintenance section of the admin panel. I have some hours that have not been accounted for on my roster (due to direct input via the database, phpMyAdmin) and I'd them to show up. However, I don't want to select the "reset total hours count" button if it will erase all of my hours. Thanks. I appreciate the help in advance.
  6. Hi everyone, I'm interested in creating a mod for my admin panel that allows my flight scheduling department to automatically generate random flight numbers via a script I set up. The only function the script serves is to generate a random flight number and store it in a MySQL database such that it can't be used again. However, right now that script is exposed and isn't apart of the phpVMS admin panel. Anyone can access it if they have the URL. To fix this, I'm interested in bringing it into the admin panel. The problem I'm afraid I'm going to have is figuring out which files I'll need to create/edit to bring this simple script in there. In advance, I appreciate your help. This is by far one of the most active, most helpful VA forums I know of and I feel that that should be heard. Here are the two scripts: generate.php <html> <head> <style type="text/css"> #title { color: white; background-color: #2d90c9; font-size: x-large; font-weight: bold; font-family: "Century Gothic",Georgia,Serif; } #body { color: black; font-size: small; font-family: "Arial",Georgia,Serif; } </style> <title>Generate Flight Numbers</title> <?php $rand_num = (rand(100, 999)); ?> </head> <body> <center> <div id="title">Generate Flight Numbers</div><br> <form method="post" action="update.php"> <div id="body">Random flight number: <input type="text" name="flight_number" size="10" value="<?php echo $rand_num ?>" /></div><br> <input onClick="javascript:location.reload(true)" type="button" value="Get New Number" /> <input type="submit" value="Update Database" /></form> <?php $connect = mysql_connect("CENSORED","CENSORED","CENSORED"); if (!$connect) { die('Connection failed. Cannot login.' . mysql_error()); } mysql_select_db("CENSORED",$connect); $query = mysql_query("SELECT * FROM flight_numbers"); $total_flights = mysql_num_rows($query); ?> <div id="body">Total number of flights in database: <?php echo $total_flights; ?></div> </center> </body> </html> update.php <?php $connect = mysql_connect("CENSORED","CENSORED","CENSORED"); if (!$connect) { die('Connection failed. Cannot login.' . mysql_error()); } mysql_select_db("CENSORED",$connect); $flight_number = $_POST['flight_number']; $insert = "INSERT INTO flight_numbers (flight_number) VALUES ('$flight_number')"; if (mysql_query($insert)) { echo "$flight_number successfully added to database.<br><br>This page will now automatically redirect."; echo '<meta http-equiv="refresh" content="2; url=generate.php">'; exit; } else { echo "This page will now automatically redirect.<br><br>"; echo '<meta http-equiv="refresh" content="2; url=generate.php">'; die('Cannot write to database. Reason: ' . mysql_error()); } mysql_close(); ?> All I want to do is add this into my admin panel, I just don't know how to get started. Again, I appreciate all of your help in advance.
  7. Currently, the fleet at my airline only consists of one (1) type of aircraft. This makes the "By Equipment" search function on the schedule_searchform.tpl page quite redundant. I'm curious to see how I can edit this function such that it enables my pilots to search through our timetable via an aircraft's registration (tail number), instead. However, I'm not sure which files I have to edit to make this work, nor am I aware of the appropriate commands I need to utilize. So far, I've edited the following: core/templates/schedule_searchform.tpl core/modules/Schedules.php core/common/SchedulesData.class.php I also had a look at core/common/OperationsData.class.php, but didn't see anything I had to edit there. Has anyone implemented this particular feature before?
  8. Sorry to [bUMP] this topic to the top of the forum, but does anyone have any knowledge in this area? I can't expect much, as this isn't a WordPress community by any means, but if anyone knows anything, it'd be much appreciated. Thank you,
  9. Happy Friday, everyone. I've been pondering ways to decrease the inefficiencies during normal operations at my VA and one of the things I've become determined to engineer is a connection between my WordPress blog and the phpVMS news feature. I'm currently using my blog for all news-related announcements, ranging from press releases to NOTAMs, and I'm using the phpVMS news feature strictly for NOTAMs. In the pilot center, the "News" section appears as a "Dispatch Center" relaying various information from across my entire site, once of them being NOTAMs. These NOTAMs appear as a link, but upon a user selecting a NOTAM, they are directed to the blog where the NOTAM is published. This has all been accomplished via the phpvms_news table via adding a new field to the table (Field: redirect_link). However, I currently have to copy the title of the post and post URL and then fill out the "Add News" form in the Admin Center whenever I publish a NOTAM via my blog. To eliminate this inefficiency, I'm interested in syncing the phpVMS news feature with my WordPress blog such that whenever I publish a blog post containing the category "NOTAM," it will simultaneously post it in the phpvms_news table. This can't be too difficult to do, the only issue is that I've never experimented with WordPress before and would appreciate it if, as I develop the snippet, someone could guide me through the process and advise if I'm getting anything wrong. Thanks in advance--I appreciate the help!
  10. Sorry to bump, but I can't wait for this feature. Something like this will greatly increase people's revenue on flights and allow for a wider profit margin
  11. UPDATE: Problem solved. Realized I forgot to edit the news.php module
  12. UPDATE: I realized I also had to edit SiteData.class.php and was able to get the admin center to input the link into the right field in my phpvms_news database, but I can't get it to display the appropriate link on my site. Any ideas?
  13. Hi all, I'm interested in modifying the news_additem.tpl file such that the subject field will display the subject, but also be a link at the same time. i.e. NOTAM: Electronic kneeboard technology now available in the Downloads section I've added a field to my phpvms_news table called "redirect_link" and I've edited my news_newsitem.tpl such that it appears as follows: <a href="<?php echo $redirect_link; ?>"><?php echo $subject; ?></a> I added the following line to news_additem.tpl <input type="text" name="redirect_link" value="<?php if(isset($newsitem->redirect_link)) { echo $newsitem->redirect_link; }?>" size="100%" /> I also added some lines to SiteCMS.php in the admin/modules folder. However, when the link is displayed on my site, it's not doing anything and is displaying the link to the page I'm currently on. Also, I see that the link is being placed in the body field in the phpvms_news table upon adding/editing a news item via the admin panel. Can anyone guide me through which lines I need to add/edit in my SiteCMS.php file? I believe this is where the error is originating. Thanks in advance.
  14. Still no luck. Thanks for the advice, Aaron, but I think it has something to do with Profile.php. I haven't re-uploaded the original yet, so I will and I'll get back to you.Thank you all for being patient with me and giving me a hand with this. It's a huge help.
  15. Kyle- You make a good point, but I just checked the size of the avatar my partner is uploading and it's only 65 KB. That should go through fine. phpVMS, by default, also resizes images automatically, correct?
  16. No luck I re-uploaded the avatars folder from the stock phpvms.full package and it's still not working. Let me do the same with my Profile.php and see what happens. Will report back.
  17. Anyone come up with anything? Sorry to be an annoyance here, but I've looked further into the matter and it seems that new avatars are not being added to the lib/avatars folder.
  18. Sorry to bump this, but you did a great job with this, Jeffery. Really helps me out a lot, too. Thanks.
  19. The final code ended up being: <?php $adminuserid_res = mysql_query("SELECT pilotid FROM phpvms_adminlog WHERE message='Approved PIREP #".$pirep->pirepid."'"); $adminuserid_row = mysql_fetch_assoc($adminuserid_res); $adminuserid = $adminuserid_row['pilotid']; $adminfirstname_res= mysql_query("SELECT firstname FROM phpvms_pilots WHERE pilotid='".$adminuserid."'"); $adminfirstname_row = mysql_fetch_assoc($adminfirstname_res); $adminfirstname = $adminfirstname_row['firstname']; $adminlastname_res= mysql_query("SELECT lastname FROM phpvms_pilots WHERE pilotid='".$adminuserid."'"); $adminlastname_row = mysql_fetch_assoc($adminlastname_res); $adminlastname = $adminlastname_row['lastname']; ?> I forgot that I needed to fetch the data from the query. My mistake!
  20. It's still echoing: Any other ideas? I feel like I might be using a wrong command/tag here, specifically with MySQL. Just a thought.
  21. Thanks for the quick reply, parkho, but yes--I'm looking to get the pilotid. Any ideas?
  22. Hi all, I'm currently working on modifying pirep_viewreport.tpl such that not only does it display the submit date and pilot name, but also displays who approved the PIREP and the approval date. I figured that if I could located the action taken by an admin in the phpvms_adminlog table, I could lookup the pilotid for that action, locate the pilot name in phpvms_pilots, and display firstname, lastname. However, when I execute this script on the page, it displays firstname, lastname as: Here is the code for the script: <?php $pirepid = $report->pirepid; $adminuserid = mysql_query("SELECT pilotid FROM phpvms_adminlog WHERE message=Approved PIREP #'.$pirepid.'"); $adminfirstname = mysql_query("SELECT firstname FROM phpvms_pilots WHERE pilotid='.$adminuserid.'"); $adminlastname = mysql_query("SELECT lastname FROM phpvms_pilots WHERE pilotid='.$adminuserid.'"); ?> And underneath the script is the echo command: <a href="<?php echo SITE_URL.'/index.php/profile/view/'.$adminuserid?>"><?php echo $adminfirstname.' '.$adminlastname?></a> I'm sure I'm just missing a single line or two. I'm not a pro in php or MySQL by any means, but if someone can point out the flaws here, I'd really appreciate it Thanks in advance!
  23. Ah! This makes for an excellent solution in the interim, but do you know if anyone's using a script that sends multiple emails prior to a member actually being marked as retired?
  24. Thanks for the reply, Fernando. I was able to locate those lines in my local.config.php file, but do you have any ideas how I could go about writing a script to send out warning emails to a member *before* they're marked inactive?
  25. Yeah, that's exactly what I did. Just working on styling the form now.
×
×
  • Create New...