/Users/johnr/Desktop/IA pdf Downloads/_New Projects Downloads May 7th/CS_IA_Mattew/destinationpage.html |
1 <?php 2 spl_autoload_register(function ($class_name) { // https://www.php.net/manual/en/language.oop5.autoload.php 3 include $class_name . '.class.php'; 4 }); ?> 5 6 <!DOCTYPE html> 7 <head> 8 <link href="style.css" rel="stylesheet"> 9 </head> 10 <h1>Golfasian Inquiry Form</h1> 11 <body> 12 <form action="storeDestination.html" method="POST"> 13 <div class="container"> 14 Destinations:<br> 15 <?php 16 $destination = new Destination(); 17 $countryArray = $destination->getCountries(); 18 19 //using a nested foreach loop to loop through the 2d array of destinations 20 foreach($countryArray as $country){ 21 ?> 22 <fieldset class="destinations"> 23 <legend><?php echo $country;?></legend> 24 <?php 25 $cityArray = $destination->getCitiesFromCountry($country); 26 foreach($cityArray as $city){ ?> 27 <label class="checkbox-inline" for="<?php echo $city; ?>"> 28 <input type="checkbox" value="<?php echo $city; ?>" name="destinations[]" id="<?php echo $city; ?>"><?php echo $city; ?> 29 </label> 30 <?php } ?> 31 </fieldset> 32 <?php } ?> 33 <br> 34 <input type="submit" name="submit" value="Next Page"> 35 <input type="button" value="Back" onclick="history.back()"> 36 </div> 37 </form> 38 </body> 39 </html>