Jump to content

Pilot ID variable


Aaron

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)
?> 
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...