{ "key_pair_value_system": true, "answer_rating_count": "", "question_feedback_html": { "html_star": "", "html_star_feedback": "" }, "answer_average_rating_value": "", "answer_date_js": "2024-09-10T05:04:01-04:00", "answer_date": "2024-09-10 05:04:01", "is_docs_available": null, "is_excel_available": null, "is_pdf_available": null, "count_file_available": 0, "main_page": "student_question_view", "question_id": "9996208", "url": "\/study-help\/questions\/1-the-php-file-alrightphp-movie-seat-booking-pick-a-9996208", "question_creation_date_js": "2024-09-10T05:04:01-04:00", "question_creation_date": "Sep 10, 2024 05:04 AM", "meta_title": "[Solved] 1. the php file (alright.php) Movie Seat | SolutionInn", "meta_description": "Answer of - 1. the php file (alright.php) Movie Seat Booking Pick a movie: Avengers: Endgame (RM10.5) Frozen (RM12) N\/A Selected O | SolutionInn", "meta_keywords": "1,php,file,alrightphp,movie,seat,booking,pick,avengers,endgame,rm10.5,frozen", "question_title_h1": "1. the php file (alright.php) Movie Seat Booking Pick a movie: Avengers: Endgame (RM10.5) Frozen (RM12) N\/A Selected Occupied A1 A2 A3 A4 B1 B2", "question_title": "1. the php file (alright.php) Movie Seat Booking Pick a movie: Avengers:", "question_title_for_js_snippet": "1 the php file (alright php) Movie Seat Booking Pick a movie Avengers Endgame (RM10 5) Frozen (RM12) N A Selected Occupied A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4 D1 D2 D3 D4 E1 E2 E3 E4 E5 E6 F1 F2 F3 F4 G1 G2 G3 G4 H1 H2 H3 H4 You have selected 0 seats Adult (age 20 70) Your order total is RM Confirm 2 PHP file (next php) Checkout CART Price this part is the one i meant i want to fetch 'harga' from alright php to here thanksin advance Food Drinks RM5 Total Seat RM8 Seat D4 RM2 Total RM30 Payment Accepted Cards Name on Card Credit card number Expire Date CVV Checkout Previous 3 java (alright js) const container document querySelector(' container') const seats document querySelectorAll(' row seat not( occupied)') const count document getElementById('count') const duduk document querySelectorAll(' row seat id') const movieSelect document getElementById('movie') populateUI() let ticketPrice movieSelect value Save selected movie index and price function setMovieData(movieIndex, moviePrice) localStorage setItem('selectedMovieIndex', movieIndex) localStorage setItem('selectedMoviePrice', moviePrice) Update total and count function updateSelectedCount() const selectedSeats document querySelectorAll(' row seat selected') const seatsIndex selectedSeats map(seat seats indexOf(seat)) localStorage setItem('selectedSeats', JSON stringify(seatsIndex)) const selectedSeatsCount selectedSeats length count innerText selectedSeatsCount total innerText selectedSeatsCount ticketPrice setMovieData(movieSelect selectedIndex, movieSelect value) Get data from localstorage and populate UI function populateUI() const selectedSeats JSON parse(localStorage getItem('selectedSeats')) if (selectedSeats null selectedSeats length 0) seats forEach((seat, index) if (selectedSeats indexOf(index) 1) seat classList add('selected') ) const selectedMovieIndex localStorage getItem('selectedMovieIndex') if (selectedMovieIndex null) movieSelect selectedIndex selectedMovieIndex Movie select event movieSelect addEventListener('change', e ticketPrice e target value setMovieData(e target selectedIndex, e target value) updateSelectedCount() ) Seat click event container addEventListener('click', e if ( e target classList contains('seat') e target classList contains('occupied') ) e target classList toggle('selected') updateSelectedCount() ) Initial count and total set updateSelectedCount() my problem is, i cannot fetch data from alright php to next php how to solve this i want fetch harga (which mean total) in alright php(the 1st code) to next php(the2nd code) ", "question_description": "

1. the php file (alright.php)<\/strong> <\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

Movie Seat Booking<\/title><\/p> <p> <link rel=\"stylesheet\" href=\"next.php\" \/><\/p> <p> <\/head><\/p> <p> <\/p> <p> <body><\/p> <p> <div><\/div><\/p> <p> <h2><label>Pick a movie:<\/label><\/h2><\/p> <p> <select id=\"movie\"><\/p> <p> <option value=\"2\">Avengers: Endgame (RM10.5)<\/option><\/p> <p> <option value=\"2\">Frozen (RM12)<\/option><\/p> <p> <\/select><\/p> <p> <\/p> <p> <ul><\/p> <p> <li><div><\/div> <small>N\/A<\/small><\/li><\/p> <p> <li><div><\/div><small>Selected<\/small><\/li><\/p> <p> <li><div><\/div><small>Occupied<\/small><\/li><\/p> <p> <\/ul><\/p> <p> <\/p> <p> <div><\/p> <p> <div><\/div><\/p> <p> <\/p> <p> <div><\/p> <p> <div id =\"A1\">A1<\/div> <div id =\"A2\">A2<\/div><\/p> <p> <div id =\"A3\">A3<\/div> <div id =\"A4\">A4<\/div><\/p> <p> <\/div><!--end for seat A row--><\/p> <p> <div><\/p> <p> <div id =\"B1\">B1<\/div> <div id =\"B2\">B2<\/div><\/p> <p> <div id =\"B3\">B3<\/div> <div id =\"B4\">B4<\/div><\/p> <p> <\/div><!--end for seat B row--><\/p> <p> <div><\/p> <p> <div id =\"C1\">C1<\/div> <div id =\"C2\">C2<\/div><\/p> <p> <div id =\"C3\">C3<\/div> <div id =\"C4\">C4<\/div><\/p> <p> <\/div><!--end for seat C row--><\/p> <p> <div><\/p> <p> <div id =\"D1\">D1<\/div> <div id =\"D2\">D2<\/div><\/p> <p> <div id =\"D3\">D3<\/div> <div id =\"D4\">D4<\/div><\/p> <p> <\/div><!--end for seat D row--><\/p> <p> <div><\/p> <p> <div id =\"E1\">E1<\/div> <div id =\"E2\">E2<\/div><\/p> <p> <div id =\"E3\">E3<\/div> <div id =\"E4\">E4<\/div><\/p> <p> <div id =\"E5\">E5<\/div> <div id =\"E6\">E6<\/div><\/p> <p> <\/div><!--end for seat E row--><\/p> <p> <div><\/p> <p> <div id =\"F1\">F1<\/div> <div id =\"F2\">F2<\/div><\/p> <p> <div id =\"F3\">F3<\/div> <div id =\"F4\">F4<\/div><\/p> <p> <\/div><!--end for seat F row--><\/p> <p> <div><\/p> <p> <div id =\"G1\">G1<\/div> <div id =\"G2\">G2<\/div><\/p> <p> <div id =\"G3\">G3<\/div> <div id =\"G4\">G4<\/div><\/p> <p> <\/div><!--end for seat G row--><\/p> <p> <div><\/p> <p> <div id =\"H1\">H1<\/div> <div id =\"H2\">H2<\/div><\/p> <p> <div id =\"H3\">H3<\/div> <div id =\"H4\">H4<\/div><\/p> <p> <\/div><!--end for seat H row--><\/p> <p> <\/div><\/p> <p> <p><!--calculate total price accorfing to the seat total--><\/p> <p> You have selected <span id=\"count\">0<\/span> seats.<span id=\"total\"><\/span><\/p> <p> <\/p> <p> <form oninput=\"harga.value=(12*parseInt(quantity1.value))\"><\/p> <p> Adult (age 20 - 70) <input type=\"number\" id=\"quantity1\" value=\"0\" min=\"0\" max=\"100\"> <\/p> <p> <\/form><\/p> <p> <form action=\"next.php\" method=\"post\" id=\"nameform\" ><\/p> <p> <output>Your order total is: RM<\/output><output name=\"harga\" for = \"quantity1 quantity2 quantity3 quantity4 quantity5\" ><\/output><\/p> <p> <button type=\"submit\" form=\"nameform\" value=\"submit\" href=\"next.php\">Confirm<\/button><\/p> <p> <?php $name = $_POST['harga'] ;?><\/p> <p> <\/form><\/p> <p> <script src=\"alright.js\"><\/script><\/p> <p> <\/body><\/p> <p><\/html><\/p> <p> <\/p> <p> <\/p> <p><strong>2.PHP file (next.php)<\/strong><\/p> <p><html><\/p> <p><head><\/p> <p> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><\/p> <p> <link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/4.7.0\/css\/font-awesome.min.css\"><\/p> <p> <link rel=\"stylesheet\" href=\"next.css \"><\/p> <p> <link rel=\"stylesheet\" href=\"https:\/\/www.w3schools.com\/w3css\/4\/w3.css\"><\/p> <p> <link rel=\"stylesheet\" href=\"alright.php\"><\/p> <p><\/head><\/p> <p> <body><\/p> <p> <h3><strong>Checkout<\/strong> <\/h3><\/p> <p> <div><\/p> <p> <h3> <strong> CART <\/strong><i><\/i><\/span><\/h4><\/p> <p> <em><strong><p>Price <?php echo '$name';?> \/\/this part is the one i meant. i want to fetch 'harga' from alright.php to here thanksin advance<\/strong><\/em><\/p> <p> <p>Food & Drinks <span>RM5<\/span><\/p><\/p> <p> <p>Total Seat <span>RM8<\/span><\/p><\/p> <p> <p>Seat D4 <span>RM2<\/span><\/p><\/p> <p> <hr><\/p> <p> <p>Total <span><b>RM30<\/b><\/span><\/p><\/p> <p> <\/div> <\/p> <p> <div ><\/p> <p> <h3>Payment<\/h3><\/p> <p> <label for=\"fname\">Accepted Cards<\/label><\/p> <p> <div><\/p> <p> <i><\/i><\/p> <p> <i><\/i><\/p> <p> <i><\/i><\/p> <p> <i><\/i><\/p> <p> <\/div><\/p> <p> <label for=\"cname\">Name on Card<\/label><\/p> <p> <input type=\"text\" id=\"cname\" name=\"cardname\" placeholder=\"John More Doe\"><\/p> <p> <label for=\"ccnum\">Credit card number<\/label><\/p> <p> <input type=\"text\" id=\"ccnum\" name=\"cardnumber\" placeholder=\"1111-2222-3333-4444\"><\/p> <p> <label for=\"expdate\"> Expire Date<\/label><\/p> <p> <input type=\"text\" id=\"expdate\" name=\"expdate\" placeholder=\"01\/10\/28\"><\/p> <p> <label for=\"cvv\">CVV<\/label><\/p> <p> <input type=\"text\" id=\"cvv\" name=\"cvv\" placeholder=\"123\"><\/p> <p> <\/div><\/p> <p> <\/p> <p> <\/p> <p> Checkout <\/p> <p> \u00ab Previous <\/p> <p> <\/p> <p><\/body><\/p> <p><\/html><\/p> <p> <\/p> <p><strong>3.java (alright.js)<\/strong><\/p> <p> <\/p> <p>const container = document.querySelector('.container');<\/p> <p>const seats = document.querySelectorAll('.row .seat:not(.occupied)');<\/p> <p>const count = document.getElementById('count');<\/p> <p>const duduk = document.querySelectorAll('.row .seat #id');<\/p> <p>const movieSelect = document.getElementById('movie');<\/p> <p> <\/p> <p>populateUI();<\/p> <p> <\/p> <p>let ticketPrice = +movieSelect.value;<\/p> <p> <\/p> <p>\/\/ Save selected movie index and price<\/p> <p>function setMovieData(movieIndex, moviePrice) {<\/p> <p> localStorage.setItem('selectedMovieIndex', movieIndex);<\/p> <p> localStorage.setItem('selectedMoviePrice', moviePrice);<\/p> <p>}<\/p> <p> <\/p> <p>\/\/ Update total and count<\/p> <p>function updateSelectedCount() {<\/p> <p> const selectedSeats = document.querySelectorAll('.row .seat.selected');<\/p> <p> const seatsIndex = [...selectedSeats].map(seat => [...seats].indexOf(seat));<\/p> <p> localStorage.setItem('selectedSeats', JSON.stringify(seatsIndex));<\/p> <p> const selectedSeatsCount = selectedSeats.length;<\/p> <p> count.innerText = selectedSeatsCount;<\/p> <p> total.innerText = selectedSeatsCount * ticketPrice;<\/p> <p> setMovieData(movieSelect.selectedIndex, movieSelect.value);<\/p> <p>}<\/p> <p>\/\/ Get data from localstorage and populate UI<\/p> <p>function populateUI() {<\/p> <p> const selectedSeats = JSON.parse(localStorage.getItem('selectedSeats'));<\/p> <p> <\/p> <p> if (selectedSeats !== null && selectedSeats.length > 0) {<\/p> <p> seats.forEach((seat, index) => {<\/p> <p> if (selectedSeats.indexOf(index) > -1) {<\/p> <p> seat.classList.add('selected');<\/p> <p> }<\/p> <p> });<\/p> <p> }<\/p> <p> <\/p> <p> const selectedMovieIndex = localStorage.getItem('selectedMovieIndex');<\/p> <p> <\/p> <p> if (selectedMovieIndex !== null) {<\/p> <p> movieSelect.selectedIndex = selectedMovieIndex;<\/p> <p> }<\/p> <p>}<\/p> <p> <\/p> <p>\/\/ Movie select event<\/p> <p>movieSelect.addEventListener('change', e => {<\/p> <p> ticketPrice = +e.target.value;<\/p> <p> setMovieData(e.target.selectedIndex, e.target.value);<\/p> <p> updateSelectedCount();<\/p> <p>});<\/p> <p> <\/p> <p>\/\/ Seat click event<\/p> <p>container.addEventListener('click', e => {<\/p> <p> if (<\/p> <p> e.target.classList.contains('seat') &&<\/p> <p> !e.target.classList.contains('occupied')<\/p> <p> ) {<\/p> <p> e.target.classList.toggle('selected');<\/p> <p> <\/p> <p> updateSelectedCount();<\/p> <p> }<\/p> <p>});<\/p> <p> <\/p> <p>\/\/ Initial count and total set<\/p> <p>updateSelectedCount();<\/p> <p> <\/p> <p> <\/p> <p><strong>my problem is, i cannot fetch data from alright.php to next.php. how to solve this? i want fetch \"harga\" (which mean total) in alright.php(the 1st code) to next.php(the2nd code).<\/strong> <\/p> <p> <\/p>", "transcribed_text": "", "related_book": { "title": null, "isbn": null, "edition": null, "authors": null, "cover_image": null, "uri": null, "see_more_uri": "" }, "free_related_book": { "isbn": "", "uri": "", "name": "", "edition": "" }, "question_posted": "2024-09-10 05:04:01", "see_more_questions_link": "\/study-help\/questions\/computer-science-computer-network-2023-February-20", "step_by_step_answer": "The Answer is in the image, click to view ...", "students_also_viewed": [ { "url": "\/study-help\/psychology\/discuss-what-happens-when-children-develop-two-languages-including-the-1987274", "description": "Discuss what happens when children develop two languages, including the roles of basic face-to-face communication and academic language.", "stars": 0 }, { "url": "\/the-following-adjusted-trial-balance-for-bell-servicing-was-prepared", "description": "The following adjusted trial balance for Bell Servicing was prepared at the end of the fiscal year, December 31, 2014: Required 1. Prepare a classified multiple-step income statement that would be...", "stars": 3 }, { "url": "\/study-help\/questions\/sunland-furniture-co-consists-of-two-divisions-bedroom-division-10122944", "description": "Sunland Furniture Co . consists of two divisions, Bedroom Division and Dining Room Division. The results of operations for the most recent quarter are: \\ table [ [ , \\ table [ [ Bedroom ] , [...", "stars": 3 }, { "url": "\/study-help\/questions\/intro-below-is-the-balance-sheet-for-rumble-clock-inc-5636294", "description": "Intro Below is the balance sheet for Rumble Clock Inc. for December 31 of 2019 and 2020. 2019 2020 2019 2020 Cash Accounts receivable Inventory Current assets 950 1,050 2,850 3,150 2,850 3,150 6,650...", "stars": 3 }, { "url": "\/study-help\/questions\/now-suppose-grant-had-a-stopwatch-and-starts-the-stopwatch-5362529", "description": "Now, suppose Grant had a stopwatch and starts the stopwatch when Alan starts running. Grant notices that Alan reaches his max speed when the stopwatch reads 8 seconds, and Alan is at the 60 yard-line...", "stars": 3 }, { "url": "\/study-help\/questions\/an-electric-motor-raises-the-container-of-a-liquid-a-5404035", "description": "An electric motor raises the container of a liquid a vertical distance of 7.5 m in only 6.0 s. During this time its power input is 9.5 kW. a) How much work does the motor do on the liquid? b) How...", "stars": 3 }, { "url": "\/study-help\/questions\/as-your-final-task-as-a-sales-and-marketing-intern-1000109", "description": "As your final task as a sales and marketing intern, you have been asked to evaluate a further promotional plan for 1 month-this time to boost occupancy rates at the Crystal Hotel. This will include a...", "stars": 3 }, { "url": "\/study-help\/questions\/suppose-a-jets-fuselage-measures-80-feet-long-and-7-1024031", "description": "Suppose a jet's fuselage measures 80 feet long and 7 feet in diameter. Our objective is to design a reference wing for it using the following parameters: The subsonic aerodynamic center at 0.25c is...", "stars": 3 }, { "url": "\/study-help\/questions\/coffeex-is-a-leading-coffee-importer-and-distributor-for-coffee-1000193", "description": "Coffeex is a leading coffee importer and distributor for coffee capsules. The worldwide volume of coffee exports rose to a record of 4.5 billion tones in 2010, or $7 billion. Coffeex was the first...", "stars": 3 } ], "next_back_navigation": { "previous": "\/study-help\/questions\/face-value-630000-interest-9-percent-per-year-payable-each-9996207", "next": "\/study-help\/questions\/questions-710-financing-car-purchases-suppose-you-go-to-buy-9996209" }, "breadcrumbs": [ { "name": "Study help", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers" }, { "name": "Computer Science", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers\/computer-science" }, { "name": "Databases", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/computer-science-databases" }, { "name": "1. the php file (alright.php) Movie Seat Booking Pick a movie: Avengers:", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/1-the-php-file-alrightphp-movie-seat-booking-pick-a-9996208" } ], "skill_details": { "skill_id": "656", "skill_name": "Databases", "parent_id": "8" } }