Asm 05 Instructions

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 3

DownloadAsm-05-instructions
Open PDF In BrowserView PDF
CS4028 Assignment 05 – PHP
Goetz Botterweck, Lero, University of Limerick
o

1 Invoice Form

o

1.1 Overview
In this assignment your objective is to create a web
form and corresponding action (both in PHP) which
can be used to generate simple invoices sent out
by the fictitious Limerick Laptop, Ltd.




Choose one OS out of: Win10,
Ubuntu
Optional features (can choose
none, one, or both): Touch Display,
SSD

form.php – Web form where an
employee can enter the details of a sale,
i.e., which laptop model was sold with
what options.
form-action.php – PHP Script called
from form.php as a form action (action
attribute of 
) when the submit button is pressed. Generates an invoice (including price calculations). This main functionality is augmented with a very simple settings page that allows to set the preferred currency.   settings.php – Minimal form to pick a currency from EUR, GBP, or SEK. settings-action.php – Form action called from settings.php (action attribute of ). Saves the chosen value in the PHP session variable _SESSION["currency"]. 1.2 form.php  The form should provide fields for the following data: o Name o Address (text area, 2 lines á 50 characters) o City o Country (dropdown), can be Ireland, UK, Sweden o (ZIP codes are not supported) o Choose one model out of: X13, X15, P5000 asm-05-instructions.docx 1.3 form-action.php  Rules for price calculation X13 base price 1300 EUR X15 base price 1500 EUR P5000 base price 1800 EUR Win10 0 EUR, i.e., included in the base price Ubuntu - 180 EUR (reduction) Touch Display + 250 EUR Upgrade to SSD + 300 EUR  The output of form-action.php should look somewhat like this: 1  It should look somewhat like this: 1.6 settings-action.php        1.4    This script is called from settings.php as a form action. It stores the chosen currency value in the session variable _SESSION["currency"] and gives some feedback message that it has done so. It will then provide a link to jump back to form.php. The output should look somewhzat like this:  Note that navigating to settings.php, The sender address of Limerick Laptops is then to settings-action.php, and fixed. finally back to form.php will cause the loss The address under "Bill To" is composed of data entered into the invoice form so from the input in the first input fields. far, unless additional measures are taken o Note that you might have to (e.g., saving the data in session variables). convert carriage returns entered in We ignore that for this simplified example. the textarea (using the [Enter] key) 1.7 Augment form.php to include into line breaks. currency The "Options" lines only show up if the particular options were actually chosen.  Expand form.php to show the currently Total shows the total price calculated from set currency in the footer. the sum of all chosen options.  The footer of form.php should also provide a link to jump to settings.php. Session variable  That should look somewhat like this (see Introduce session handling by extending footer at the bottom of the page): every PHP script with a few lines. The session variable _SESSION["currency"] will have the value EUR, GBP, or SEK. Default is EUR. 1.5 settings.php  This form will allow to pick one of EUR, GBP, or SEK from a list of radio buttons. asm-05-instructions.docx 2 1.8 Augment form-action.php      1.9 Other Notes  You should handle the case that initially no If the currency is set to a value different currency is defined. from EUR, use the following conversion factors to calculate a converted total. Besides that, to simplify things, we make the o 1 EUR = 0.89 GBP following assumptions: o 1 EUR = 9.83 SEK  No input validation (checking for required Use round() to round the converted fields etc.) total.  No sanitization of input (e.g., escaping Show the converted total in an additional special characters) column after the EUR total.  We assume form-action.php just generates If currency is EUR, then omit the additional a document without changing data. Hence, column. it is appropriate to use GET as a HTTP For instance, for currency SEK and the method. This avoids annoying confirmation input in the previous screenshot, the dialogs by the web browser during testing output should look somewhat like this: ("Do you really want to resubmit the same data?"). asm-05-instructions.docx 3

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Page Count                      : 3
Language                        : en-US
Tagged PDF                      : Yes
Author                          : Goetz Botterweck
Creator                         : Microsoft® Word 2016
Create Date                     : 2017:11:23 20:33:43+00:00
Modify Date                     : 2017:11:23 20:33:43+00:00
Producer                        : Microsoft® Word 2016
EXIF Metadata provided by EXIF.tools

Navigation menu