Aaron Posted December 13, 2011 Report Share Posted December 13, 2011 how do I get the pilot ID variable? I think it's $pilotcode or something but I think you need a line of code to acctually get the pilot id and put it in the variable. plz help Quote Link to comment Share on other sites More sharing options...
Jeff Posted December 13, 2011 Report Share Posted December 13, 2011 <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ' ' .$pilot->firstname . ' ' . $pilot->lastname?> Quote Link to comment Share on other sites More sharing options...
Aaron Posted December 14, 2011 Author Report Share Posted December 14, 2011 thanks, but it didn't work I talked to a guy that works for a webdesign company in teamspeak and he said it's referencing the PilotData part or something. He says I need to find a page that says this "class PilotData {..." and then put one of these in there with the filename that the class PilotData is found in "include(filename)" or "require_once(filename)". And then have that code you gave me afterwards. Any ideas where that file is that I'm missing? Quote Link to comment Share on other sites More sharing options...
Jeff Posted December 14, 2011 Report Share Posted December 14, 2011 Where are you wanting to show the pilot info? The code will differ, depending on which page you are wanting to show. Quote Link to comment Share on other sites More sharing options...
Aaron Posted December 14, 2011 Author Report Share Posted December 14, 2011 The way I have it set up, I have an html form (bookingform.html), and it's action (bookingresults.php). They're both placed in core/pages. I've made a simple booking system because my VA is military, there are no set routes, so pilots will simply go onto the booking page and fill out the info and it will add their flight to the routes database. The only problem right now is that I want the flight number to be $pilotid and just overwrite each time hey fill out the form, I just need the code to get the $pilotid. Quote Link to comment Share on other sites More sharing options...
Aaron Posted December 14, 2011 Author Report Share Posted December 14, 2011 I found the Pilotdata.class.php and the function I need to get the pilot ID. Now how do I put it in the php document so that it puts the pilot id in a variable for me? Quote Link to comment Share on other sites More sharing options...
Jeff Posted December 14, 2011 Report Share Posted December 14, 2011 You are probably going to have to create a module so it can do what you want it to do. you can find the schedules and pilot modules in CORE/MODULES/SCHEDULES/SCHEDULES.PHP and CORE/MODULES/PILOTS/PILOTS.PHP Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 15, 2011 Administrators Report Share Posted December 15, 2011 Jeff is right, you'll need to create a module to do that. Check the docs Quote Link to comment Share on other sites More sharing options...
Aaron Posted December 15, 2011 Author Report Share Posted December 15, 2011 I read over the docs, I'm still a bit confused. I don't see why I need a module, It works fine, the only error is that it can't find the pilot id variable. I tryed making it into a module and this is what I got and now idk what now. class bookingsystem extends CodonModule { public $title = 'Booking System'; public function index() { <p> <span style="color: rgb(128,0,0)"><strong><span style="font-size: 36px">Book a Flight</span></strong></span></p> <form action="bookingresults.htm" method="post"> Departure Airport ICAO: <input name="depicao" /><br /> Arrival Airport ICAO: <input name="arricao" /><br /> Aircraft: <select id="aircraft" name="aircraft"> <option selected="selected" value="12">CC-130</option> <option value="13">CC-130J</option> <option value="17">CC-150</option> <option value="4">CC-144</option> <option value="7">CT-142</option> <option value="1">CP-140</option> <option value="20">CC-138</option> <option value="22">CU-170</option> <option value="10">CT-156</option> <option value="8">CC-177</option> <option value="3">CC-115</option> <option value="2">CP-140A</option> <option value="19">CT-114</option> <option value="11">CT-155</option> <option value="14">CF-18</option> <option value="16">F-35</option> <option value="18">CH-124</option> <option value="9">CH-146</option> <option value="6">CH-149</option> <option value="15">CH-139</option> <option value="21">CH-148</option> <option value="5">CH-147D</option></select> <br /> Route: <input name="route" /><br /> Altitude: <input name="flightlevel" /><br /> <input type="submit" value="Submit" /></form> } public function results() { <span style="color: rgb(128,0,0)"><strong><span style="font-size: 36px">Booking Results</span></strong></span> include(http://www.canforce.org/core/common/pilotdata.class.php) <?php PilotData::GetPilotCode($pilotid)?> <?php $con = mysql_connect("localhost:3306","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("canforce_phpvmsinstall", $con); $sql="INSERT INTO phpvms_schedules (id, code, flightnum, depicao, arricao, route, aircraft, flightlevel, deptime, arrtime, flighttime, enabled, bidid) VALUES ('$pilotid','CFC','$pilotid','$_POST[depicao]','$_POST[arricao]','$_POST[route]','$_POST[aircraft]','$_POST[flightlevel]','00:00','00:00','00:00','1','1')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con) ?> } Quote Link to comment Share on other sites More sharing options...
Aaron Posted December 17, 2011 Author Report Share Posted December 17, 2011 how do I load the pilotclass.class.php so that I get the pilot ID variable? Quote Link to comment Share on other sites More sharing options...
Aaron Posted December 17, 2011 Author Report Share Posted December 17, 2011 I got some help and the booking system is now functional, I'm going to work on perfecting it then gonna put a link for anyone who wants it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.