I am developing a website based on aviation, and one engine I run on my website, called SimBrief, must include the code below so that I can send the specifications along with the aircraft and registration.
<script>
var acdata = {};
acdata["reg":"YU-APA"]=['{icao":"A319","name":"A319-132","engines":"V2527\/A5","cat":"M","equip":"SDE2E3GHILORVWY","transponder":"H","pbn":"PBN\/B1D2D3","maxpax":"144","oew":92.48391898655717,"mzfw":128.9704233781548,"mtow":149.9143382857184,"mlw":137.78891386555,"maxfuel":42.086245851093594}'];
acdata["reg":"YU-APH"]=['{icao":"A320","name":"A320-232","engines":"V2527\/A5","cat":"M","equip":"SDE2E3GHILORVWY","transponder":"H","pbn":"PBN\/B1D2D3","maxpax":"174","oew":95.98926895529675,"mzfw":134.4819799327768,"mtow":162.0397627058868,"mlw":142.1981591092476,"maxfuel":42.086245851093594}'];
</script>
Where YU-APA is an Airbus A319 and YU-APH is an Airbus A320.
<tr>
<td>Aircraft:</td>
<td>
<select class="form-control" name="type" id="Aircraft" value="<?php echo "{$schedule->aircraft}"; ?>">
<?php
$equipment = OperationsData::getAllAircraftSingle(true);
if(!$equipment) $equipment = array();
foreach($equipment as $equip){
echo '<option value="'.$equip->icao.'">'.$equip->icao.' - '.$equip->name.'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td>Registration:</td>
<td><select class="form-control" name="reg" id="Registration">
<option>YU-APA</option>
<option>YU-APB</option>
<option>YU-APC</option>
<option>YU-APD</option>
<option>YU-APE</option>
<option>YU-APF</option>
<option>YU-API</option>
<option>YU-APJ</option>
<option>YU-APH</option>
<option>YU-APG</option>
<option>YU-ARA</option>
<option>YU-ALN</option>
<option>YU-ALO</option>
<option>YU-ALP</option>
<option>YU-ALT</option>
<option>YU-ALU</option>
<option>YU-ALV</option>
<option>YU-AND</option>
<option>YU-ANI</option>
<option>YU-ANK</option>
</select></td>
</tr>
How can I make so that when I select "Airbus A319" in the Aircrafts dropdown, the YU-APA shows up in the Registrations dropdown, and when I select A320, the YU-APH appears? Obviously, there are more registrations for one aircraft.