Jump to content

can't figure out how to structure this


Ninjakreborn

Recommended Posts

I am recieving a large volume of data from check boxes.
Here is the actual field information

[code] <form name="form3" id="form3" action="eventincidentaccidentform4.php" method="post">
<table class="test">
<tr>
<td colspan="4" style="text-align:left;"><h2>Action Taken(Select all that apply)</h2></td>
</tr>
<?php
echo "<tr>";
select("actiontaken[abortedtakeoff]", "Aborted Takeoff", "abortedtakeoff");
select("actiontaken[cancelledflight]", "Cancelled Flight", "cancelledflight");
echo "</tr>";
echo "<tr>";
select("actiontaken[declaredemergency]", "Declared Emergency", "declaredemergency");
select("actiontaken[delayedflight]", "Delayed Flight", "delayedflight");
echo "</tr>";
echo "<tr>";
select("actiontaken[diversion]", "Diversion", "diversion");
select("actiontaken[goaround]", "Go Around", "goaround");
echo "</tr>";
echo "<tr>";
select("actiontaken[groundaircraftatoutstation]", "Ground AirCraft At Outstation", "groundaircraftatoutstation");
select("actiontaken[inflightshutdown]", "In Flight Shutdown", "inflightshutdown");
echo "</tr>";
echo "<tr>";
select("actiontaken[missedapproach]", "Missed Approach", "missedapproach");
select("actiontaken[returnaircrafttomaintenance]", "Return Aircraft To Maintenance", "returnaircrafttomaintenance");
echo "</tr>";
echo "<tr>";
select("actiontaken[returntogate]", "Return To Gate", "returntogate");
select("actiontaken[turnback]", "Turn Back", "turnback");
echo "</tr>";
?>
<tr><td colspan="4"><hr /></td></tr>
<tr>
<td colspan="4" style="text-align:left;"><label for="phaseofflight"><h2>Phase Of Flight:(Select One)</h2></label></td>
</tr>
<tr>
<td colspan="4"><select name="phaseofflight" id="phaseofflight">
<option selected="selected">Please Select One!</option>
<option>Fueling</option>
<option>Towing</option>
<option>Pre Flight</option>
<option>Boarding</option>
<option>Taxi Out</option>
<option>Runup</option>
<option>Takeoff</option>
<option>Climb</option>
<option>Cruise</option>
<option>Holding</option>
<option>Decent</option>
<option>Approach</option>
<option>Landing</option>
<option>Taxi In</option>
<option>Parking</option>
<option>Deplanning</option>
<option>Post Flight</option>
</select></td>
</tr>
<tr><td colspan="4"><hr /></td></tr>
<tr>
<td colspan="4" style="text-align:left;"><h2>Classification(Select all that apply)</h2></td>
</tr>
<?php
echo "<tr>";
select("classification[aircraftdamage]", "Aircraft Damage", "aircraftdamage");
select("classification[aircraftonrunway]", "Aircraft On Runway", "aircraftonrunway");
echo "</tr>";
echo "<tr>";
select("classification[aircraftlogsmanualsorphase]", "Aircraft Logs / Manuals / Phase (missing, incomplete, inaccurate)", "aircraftlogsmanualsorphase");
select("classification[airportclosure]", "Airport Closure", "airportclosure");
echo "</tr>";
echo "<tr>";
select("classification[alternatorfailure]", "Alternator Failure", "alternatorfailure");
select("classification[atcdelay]", "ATC Delay", "atcdelay");
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"4\"><p style=\"padding-bottom:0px; margin-bottom:0px; text-align:left;\"><b>Avionics Failure</b></p></td>";
echo "</tr>";
echo "<tr>";
select("classification[avionicsfailure-communication]", "Communication", "communication");
echo "<td></td>";
echo "<td></td>";
echo "</tr>";
echo "<tr>";
select("classification[avionicsfailure-navigation]", "Navigation", "navigation");
echo "<td></td>";
echo "<td></td>";
echo "</tr>";
echo "<tr><td colspan=\"4\">&nbsp;</td></tr>";
echo "<tr>";
select("classification[battery]", "Battery", "battery");
select("classification[birdstrike]", "Bird Strike", "birdstrike");
echo "</tr>";
echo "<tr>";
select("classification[brakefailure]", "Brake Failure", "brakefailure");
select("classification[collision]", "Collision (Aircraft Or Object)", "collision");
echo "</tr>";
echo "<tr>";
select("classification[crewincapacitation]", "Crew Incapacitation", "crewincapacitation");
select("classification[debrisonrunway]", "Debris On Runway", "debrisonrunway");
echo "</tr>";
echo "<tr>";
select("classification[deviationofatcinstructions]", "Deviation Of ATC Instructions", "deviationofatcinstructions");
select("classification[distruptiveorsickpassenger]", "Disruptive/Sick Passenger", "disruptiveorsickpassenger");
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"4\">&nbsp;</td>";
echo "</tr>";
echo "<tr>";
select("classification[doorwarning]", "Door Warning", "doorwarning");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
text("classification[doorwarningwhichone]", "Which Door?", 200, "");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"4\">&nbsp;</td>";
echo "</tr>";
echo "<tr>";
select("classification[dooropening]", "Door Opening", "cdooropening");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
text("classification[dooropeningwhichone]", "Which Door?", 200, "");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"4\">&nbsp;</td>";
echo "</tr>";
echo "<tr>";
select("classification[electricalfailure]", "Electrical Failure", "electricalfailure");
select("classification[emergencyevacuation]", "Emergency Evacuation", "emergencyevacuation");
echo "</tr>";
echo "<tr>";
select("classification[enginefailure]", "Engine Failure", "enginefailure");
select("classification[enginefire]", "Engine Fire", "enginefire");
echo "</tr>";
echo "<tr>";
select("classification[fireorsmokeincabin]", "Fire/Smoke In Cabin", "fireorsmokeincabin");
select("classification[flapfailure]", "Flap Failure", "flapfailure");
echo "</tr>";
echo "<tr>";
select("flattire", "Flat Tire", "flattire");
select("flightcontrolfailure", "Flight Control Failure", "flightcontrolfailure");
echo "</tr>";
echo "<tr>";
select("classification[fuelleak]", "Fuel Leak", "fuelleak");
select("classification[fuelquantity]", "Fuel Quantity", "fuelquantity");
echo "</tr>";
echo "<tr>";
select("classification[hardlanding]", "Hard Landing", "hardlanding");
select("classification[icing]", "Icing", "icing");
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"4\" style=\"text-align:left;\"><p><b>Instrument Failure?</b></p></td>";
echo "</tr>";
echo "<tr>";
select("classification[flightinstrument]", "Flight Instrument", "flightinstrument");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
text("classification[flightinstrumentwhich]", "Which One?", 200, "");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
select("classification[engineinstrument]", "Engine Instrument", "engineinstrument");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
text("classification[engineinstrumentwhich]", "Which One?", 200, "");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr><td colspan=\"4\">&nbsp;</td></tr>";

echo "<tr>";
echo "<td><label for=\"landinggear\"><b>Landing Gear</b></label></td>";
echo "<td></td><td></td><td></td>";
echo "</tr>";
echo "<tr>";
select("classification[landinggear[blowdown]]", "Blow Down", "blowdown");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
select("classification[landinggear[failtoextend]]", "Fail To Extend", "failtoextend");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
select("classification[landinggear[failtoretract]]", "Fail To Retract", "failtoretract");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
select("classification[landinggear[hydraulicleak]]", "Hydraulic Leak", "hydraulicleak");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
select("classification[landinggear[hydraulicsystelfailure]]", "Hydraulic System Failure", "hydraulicsystelfailure");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
select("classification[landinggear[indicationfailure]]", "Indication Failure", "indicationfailure");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"4\">&nbsp;</td>";
echo "</tr>";
echo "<tr>";
select("classification[lighteningstrike]", "Lightening Strike", "lighteningstrike");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
select("classification[magnetofailedorrough]", "Magneto (Failed Or Rough):", "magnetofailedorrough");
select("classification[nearmidaircollission]", "Near Mid-Air Collission", "nearmidaircollission");
echo "</tr>";
echo "<tr>";
select("classification[paxinjury]", "Pax Injury", "paxinjury");
select("classification[propstrike", "Prop Strike", "propstrike");
echo "</tr>";
echo "<tr>";
select("classification[roughengine]", "Rough Engine", "roughengine");
select("classification[runwayincursion]", "Runway Incursion", "runwayincursion");
echo "</tr>";
echo "<tr>";
select("classification[starterfailureorwarning]", "Starter (Failure Or Warning)", "failureorwarning");
select("classification[tailstrike]", "Tail Strike", "talestrike");
echo "</tr>";
echo "<tr>";
select("classification[turbulence]", "Turbulence", "turbulence");
select("classification[vacuumfailure]", "Vacuum Failure", "vacuumfailure");
echo "</tr>";
echo "<tr>";
select("classification[waketurbulence]", "Wake Turbulence", "waketurbulence");
select("classification[weatherbelowminimums]", "Weather Below Minimums", "weatherbelowminimums");
echo "</tr>";
echo "<tr>";
select("classification[weatherbelowhighminimums]", "Weather Below High Minimums", "weatherbelowhighminimums");
select("classification[weightandbalance]", "Weight And Balance", "weightandbalance");
echo "</tr>";
echo "<tr>";
select("classification[windshear]", "Wind Shear", "windshear");
echo "<td></td><td></td>";
echo "</tr>";
echo "<tr>";
select("classification[other]", "Other", "cother");
echo "<td colspan=\"2\"></td>";
echo "</tr>";
echo "<tr>";
text("classification[othertext]", "Required(if selected)", 200, "");
echo "<td colspan=\"2\"></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"4\">&nbsp;</td>";
echo "<tr>";
echo "<td colspan=\"4\"><label for=\"description\">Brief Description:</label></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"4\"><textarea name=\"description\" id=\"description\" cols=\"30\" rows=\"10\"></textarea></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"4\"><input name=\"submit\" id=\"submit\" type=\"submit\" value=\"Continue\" />
<input name=\"clear\" id=\"clear\" type=\"reset\" value=\"Clear\" /></td>";
echo "</tr>";
?>
</table>
</form>[/code]
You can see I am starting 1 array, 1 just drop down list, and another array.
I have done a good job collecting, and arraying/validating the information.
However now it's time for what is coming next, I have to create the database structure, of how to store it.
So far I am  making 1 new field of each of the action taken so it's
actiontaken-variable
actiontaken-variable2
in the database, if they are filled out, then those are put in as the variable name in the database
I did the same for phase of flight which was just a select drop down menu, but now I have to do classification and there are like 50 different possible fields of data, I don't really want to create 50 fields of information, and pass through them like that, I don't see how this is going to work

Any advice on a decent database strucutre, I have the first part of the table in the database worked out, because they were only text, and stuff on the first 2 form pages, but then I came across this.
Link to comment
https://forums.phpfreaks.com/topic/27457-cant-figure-out-how-to-structure-this/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.