Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve Build a web application using davaScript and PHP for an online chocolate shop. The customer is required to fill in his promotional code

please solve image text in transcribed
image text in transcribed
Build a web application using davaScript and PHP for an online chocolate shop. The customer is required to fill in his promotional code (if he has one) then click the button Apply to get discount, a database will be searched to verify the code (PHP). Then, the customer will fill in the required quantity. After entering the quantity and clicking the button calculate, the total will be displayed in the input box total (Javascript). Download the attached folder from black board and use the file choco.php in the quiz. Database (1 pt) 1) Create a database using phpmyadmin and name it choco. Create a table and name it discount, include 1 field in the table and name it code and set its data type to varchar PHP (4.5 pt] 3) When the user clicks "Apply" page choco.php will search the database for the promotional code. 4) If the code is found, the discount field will display 50 as in fiqure 1 otherwise it will display 0 as in fiqure 4. 5) A message indicating the last used valid promo code will be displayed in brown (use cookies that last 5 mints to achieve this functionality) as in fiqure 4 6) Discount field will show 0 when page first load. as in fiqure 3 Javascript (2.5pt) 7) When the user clicks calculate (event), the total will be calculated using total=(180 * quantity). Where quantity is the value entered by the user in the quantity field and 180SR is the unit price. If the customer has a valid promotional code, he will receive a discount of 50SR. total =(180 - quantity)-discount as in fiqure 2 8) Promotional code will be validated before form submission (clicking Apply button). Accepted codes are 3 digit numbers that start with PC. Alert the users when an unaccepted code in entered. As in fiqure 5 9) The total should be displayed in red color if the customer received a discount. Run (1 pt) cis 423: Web-based Syruern (Gs-Giroup1) Imam Abdulrahman A Fawal Univenity College of Computer Science & it 11) Use the same database tables and fields names as in question (in bold). 12) You may not add extra script (pages). 13) Write your names and BBgroupt as an HTML comment- 14) Create a folder with your RBeroupli, add your PHP script file and sql file then compress the folder and upload it to blackboard. cl-write you names and group Piese = "text/css' s/style? cl-javascript part escript? elscripts elieads. chody? ch2;Choco chocolatechis cform id "cform"? ctable? etroctdreinput type = "submiq" id = "submitgto" namee"submit6sn" valuez"Applye/td>e/trs ctrsetdacinput id a "calculate" type = "button" value a "calculate > e/tdoc/tr

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Rules In Database Systems Third International Workshop Rids 97 Sk Vde Sweden June 26 28 1997 Proceedings Lncs 1312

Authors: Andreas Geppert ,Mikael Berndtsson

1997th Edition

3540635165, 978-3540635161

More Books

Students also viewed these Databases questions

Question

What is the preferred personality?

Answered: 1 week ago