Advertisement
Guest User

Untitled

a guest
May 26th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2. $url1 = json_decode(file_get_contents('http://www.movie.com:/retrieveMovies'), true);
  3. foreach ($url1 as $movie) {
  4.     $movieID = $movie['movieId'];
  5.  
  6.     $url2 = json_decode(file_get_contents(' http://movie.com/movieOne?seatNum=' . $movieID), true);
  7.     foreach ($url2 as $seat) {
  8.         $testingResult = $seat['avail'];
  9.         echo "<button onclick = testBTN('" . $testingResult . "')>Seat ID</button>";
  10.     }
  11. }
  12. ?>
  13. <script>
  14.     function testBTN(x) {
  15.         if (x == "OK") {
  16.             alert("Seat booked");
  17.         }
  18.         else {
  19.             alert("Error in booking seats");
  20.         }
  21.  
  22.     }
  23. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement