View difference between Paste ID: x3jP9kjt and 0yrC7n2V
SHOW: | | - or go back to the newest paste.
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) {
7+
    $testingResult = $seat['avail'];
8-
        $testingResult = $seat['avail'];
8+
    echo "<button onclick = testBTN('" . $testingResult . "')>Seat ID</button>";
9-
        echo "<button onclick = testBTN('" . $testingResult . "')>Seat ID</button>";
9+
10
?>
11
<script>
12
    function testBTN(x) {
13
        if (x == "OK") {
14
            alert("Seat booked");
15
        }
16
        else {
17
            alert("Error in booking seats");
18
        }
19
20
    }
21
</script>