Frezi2005

Untitled

May 2nd, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. <html>
  2. <head>
  3. <link href="style.css" rel="stylesheet">
  4. <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
  5. </head>
  6. </html>
  7.  
  8. <?php
  9. // require the Faker autoloader
  10. require_once 'vendor/fzaninotto/faker/src/autoload.php';
  11. // alternatively, use another PSR-4 compliant autoloader
  12. // use the factory to create a Faker\Generator instance
  13. $faker = Faker\Factory::create();
  14. $date = new DateTime('now');
  15. $now = $date->format('Y-m-d H:i:s');
  16. $departure = $faker->date;
  17. //$arrival = $departure + 6;
  18. $price = rand(100, 4000);
  19. //$flightTime = $faker->dateTimeBetween($startDate = '$departure', $endDate = '$arrival', $timezone = null);
  20. $list = file_get_contents("airports.json");
  21. $airportsList = json_decode($list, true);
  22. $randCity = rand(0, count($airportsList) - 1);
  23. var_dump($airportsList[$randCity]);
  24. function planeTicketGenerator($faker, $now, $price) {
  25. echo <<<END
  26. <table>
  27. <tr style="background-color: #a8d8ff">
  28. <td colspan="3" style="text-align:left;">TICKETS IN REAL PRICE</td>
  29. </tr>
  30. <tr>
  31. <td style="width:200px;"></td>
  32. <td><img src="BoeingLogo.png" alt="BoeingLogo" style="width:200px;"/></td>
  33. <td><img src="AirPlaneLogo.png" alt="AirPlaneLogo" style="width:200px;"/></td>
  34. </tr>
  35. <tr style="height:50px;background-color: #93cfff;">
  36. <td>From: $faker->city</td>
  37. <td>To: $faker->city</td>
  38. <td></td>
  39. </tr>
  40. <tr style="background-color: #93cfff;">
  41. <td>XXX</td>
  42. <td>XXX</td>
  43. <td>XXX</td>
  44. </tr>
  45. <tr style="background-color: #93cfff;">
  46. <td colspan="2">Departure: $faker->date</td>
  47. <td>Price: $price $faker->currencyCode</td>
  48. </tr>
  49. <tr>
  50. <td>Flight with the airline: Ryanair</td>
  51. <td colspan="2">Passenger surname: $faker->firstName $faker->lastName</td>
  52. </tr>
  53. </table>
  54. END;
  55. }
  56. planeTicketGenerator($faker, $now, $price);
  57. // $now
  58. // <br />
  59. // From: $faker->city To: $faker->city
  60. // <br />
  61. // Departure: $faker->date Arrival: $faker->date
  62. // <br />
  63. // Name: $faker->firstName Surname: $faker->lastName
  64. // <br />
  65. // Adress: $faker->streetAddress
  66. // <br />
  67. // Price: $price
  68. ?>
Advertisement
Add Comment
Please, Sign In to add comment