0% found this document useful (0 votes)
39 views18 pages

CSY2028 Assignment 2 Report

The document discusses requested changes and testing of a website for Claire's Cars. It outlines 10 requested changes to the site and the solutions for addressing issues like repetitive code, admin access, and adding new manufacturers. It then details 13 tests performed on the site and confirms the expected and actual results matched for all tests.

Uploaded by

Pratik Paudel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views18 pages

CSY2028 Assignment 2 Report

The document discusses requested changes and testing of a website for Claire's Cars. It outlines 10 requested changes to the site and the solutions for addressing issues like repetitive code, admin access, and adding new manufacturers. It then details 13 tests performed on the site and confirms the expected and actual results matched for all tests.

Uploaded by

Pratik Paudel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

CSY2038

Assignment 2
Website for Claire’s cars

Video link: https://video.northampton.ac.uk/media/web+programming+assignment/1_que4id8p


Conten
t
Website for Claire’s cars........................................................................................................................1
Requested changes checklist:................................................................................................................3
Analysing existing code:........................................................................................................................3
Testing...................................................................................................................................................5
Bugs and Weaknesses...........................................................................................................................7
Bugs...................................................................................................................................................7
Weaknesses.......................................................................................................................................7
Evaluation..............................................................................................................................................8
Before................................................................................................................................................8
After...................................................................................................................................................8
Appendices:...........................................................................................................................................9
References...........................................................................................................................................17
Requested changes checklist:

No: Requested Change: Completed:


1 Sunday hours should be changed to closed.
2 Set up a page for Claire's careers with the phrase "Claire's Cars presently does
not have any employment positions but try checking back soon because new
positions are constantly added."
3 Resolve adding new manufacturers not appearing issue
4 I want to "Archive" the automobiles that have been displayed on the internet;
is it possible?
5 the cost of vehicles in stores, new and used
6 Add fields for mileage and engine type and allow the creation of admin
accounts
7 fields for mileage and engine type
8 Allow at least four photographs to be submitted for an automobile.
9  Post articles containing alternative images and indicate where and by whom
they were posted.
10 Create a company website with an inquiry form.

Analysing existing code:

1) Repetitive code:

Issue: Each location employments the same code that's


seen within the screenshot. All of the formats
incorporate the same login for the admin sub-nav bar.
The code for this site is scattered all through. The issue
with this method is that it may take two times as long
to construct the location since you'd got to put the
indistinguishable code to each page. An illustration of
this is often the header range on each page.

Solution: One arrangement to this issue is to set up a


common organizing page, which would comprise of a
single page presenting all the content that's moreover replicated on each page. Concurring to this,
all that's essential is to alter the substance and publish it into the format. Usually done by changing
the most substance of the format page to a variable. The variable will store the information from the
page.

Layout page showing solution:


Like you could see from the snapshot, the page's
title and primary content have been substituted
with two variables. Your blog will have this
design, and when you go across it, each webpage
will pass by with its own title and contents.

2) Future changes to the website:

Issue: If you wanted to change the opening hours' time or day, you would have to change each
page individually rather than just one thing.
Solution: You can substitute a function for this section of code and include the times in the
function.Then only one place in the function needs to be changed in the code.Another approach
is to have multiple functions, then simply call the function you want to modify.Since not all of
the functions will be used, there will be unused code as a result.

3) Admin Access:

Issue: Since it is set up as a whole new website, entering the admin section of the website
presents a challenge. The admin index publication's URL must be entered. The switch from the
administration site towards the user site is not seamless.

Solution: You can readily fix this by including further into admin panels main website. To enter
this, configure a button that opens the admin home panel. This may then have a login section,
making the website secure and inaccessible to visitors. This might save time while changing the
layout of the website. They are able to share a layout page, so updates either need to be to be
made once rather than having to be made on both the administration and user sides.

4) Files stored in Public:

Issue: All of the platform's papers are in the public folder. By accessing every file's name, such as
Cars.je/AdminPage, everybody may see the file, putting your website at risk of hacking.
Solution: Only pages that the user needs to access should indeed be put in the document library
to resolve issue. Therefore, the one and only available to the public files in this case should be
the photos folder, CSS, and index files. Clients won't being able to view more pages without first
utilizing the index as a consequence.

5) Individual pages for manufacturers:

Issue: The website featured separate sites for each manufacturer, so if you intended to add a
new manufacturing to the website, you would be required to make a new webpage to show the
automobiles associated with that company.
Solution: Narrator can always just make a single page that gathers all the data, depending on the
manufacturer of the device. This may be done by include every manufacturer ID in the url and
ensuring that the right user visits. The listing will get a new manufacturer from relatively similar
database and follow procedure when you add one. After that, adding firms toward the page is
simple.

Testing

Test Test: Expected result: Actual Result:


No:
1 testing Admin Log in with Login should be possible registered as
the proper information for users. anticipated
2 testing the admin login No one can log in Functioned as
with false information intended
3 Test logout functions user ought to log off. Functioned as
intended
4 Once admin has been User should be Functioned as
chosen, test the left nav prompted to log in if intended
bar. logged out.
5 homepage test ought to bring up all Functioned as
articles intended
6 Showroom test page should pass the vehicles Functioned as
with specifics intended
7 Test the contact page. to complete an inquiry Functioned as
form intended
8 Testing manufacturer should include all Functioned as
navigation in showrooms vehicles made by a intended
specific manufacturer
9 Manufacturers of test ought to direct people Functioned as
admin navigation bar to the makers' page intended
10 Verify the manufacturer Allows you to change Functioned as
section edit the manufacturer's intended
name
11 Try removing the Remove the Functioned as
manufacturer. manufacturer intended
12 Test the admin vehicle should show a list of Functioned as
navigation bar vehicles intended
13 Try adding cars Must present the Functioned as
paperwork to add a new intended
automobile
14 modify a test vehicle should display the Functioned as
completed form and the intended
editable automobile
15 Test the automobile button Must archive the vehicle Functioned as
archive. and eliminate it from intended
the list of vehicles.
16 Archived navigation button bring a listing of Functioned as
for an automobile automobiles that have intended
been archived
17 Get rid of an old vehicle Should remove the Functioned as
vehicle from both the intended
vehicles archive and
inventory.
18 restore the archived Should return the Functioned as
automobile vehicle to the cars list intended
after removing it from
the archive list.
19 Master account navigation should display the form Functioned as
button for administrators to add or remove an intended
admin
20 admins' navigation button Must state that display Functions as
absent of master account cannot be used; master intended
account only
21 Nav bar button for inquiries should provide a list of Functions as
unanswered questions intended
22 Complete inquiries button Should declare the Functions as
investigation to be intended
finished and take it off
the list.
23 Nav bar button to generate should provide a form Functions as
articles for writing articles on intended

Bugs and Weaknesses

Bugs

Error No: Error Solution


1 Choosing the administrators link in the menu bar Implementing a display the
when signed out results in an empty page. login page if $_Session also
isn't logged in is necessary.
2 When selecting admin from the navigation bar after So that the index page runs
logging out. If you use another of the login screen the very same procedure
instead of the initial one, an error page will appear. inside the controller, it must
be linked to the same page.
They don't currently have such
a log-in feature built into the
function.

Weaknesses

Weakness Weakness Solution


no:
1 The primary key sector's Developing variables that extend beyond the
subnavigational bars are coded primary focus area is one approach to this
into the template, resulting in problem.You should also take advantage of the
duplicate code. requirement to read a document that contains
the unique code for the sub-navigation in order
to only change the navigation bar once.
2 Templates apply a little CSS should again have a separate class for the
styling to tables and forms. appearance of tables or types.The class you want
to use can then be specified when designing the
columns or forms.
3 The data class contains all of the The data that the method is requesting from the
functions for scanning the database ought to be broken down into several
database.This could become files and classes.
quite extensive and complicated.
4 The administrative sub-nav bar This should be removed and placed in a separate
login code is the same in all file that can be required on each page, thereby
designs, which results in a lot of reducing the amount of time required to make
repetition. changes.

Evaluation
I will summarize and evaluate the site both before and after the changes in this section.
Before
The website's customer-facing section was well-designed, straightforward, and functional.Navigating
made it simple for me to locate what I was looking for.
Numerous flaws existed on the website, as previously mentioned.Due to the fact that I had to make
the same changes on multiple pages, making changes was difficult and time-consuming.Another
disadvantage of this website is that in order to view the administrator's index page, you must quickly
enter the URL.Customers won't be able to access her website's administration pages otherwise.
I find the viewing options and functionality of the website to be extremely limited.For instance, if I
wanted to include a new manufacturer, I could, but visitors to my website wouldn't be able to see
the cars made by that manufacturer because the manufacturer didn't have a website.
After
It is simple to add new pages and features to the website as needed due to its current structure.The
site's direct link to the admin page makes it simple for an administrator user to switch between her
two sections of the site.Instead of changing the URL, admin users can now switch quickly with a
button click, saving a lot of time when adding details, completing tasks, and reviewing
changes.increase.
The website's code is clear and well-organized, making it suitable for further modification.You can
quickly find the files you need to make the changes you want by using the site's directory
division.For instance, locating the page in the template files file and making the necessary
adjustments is all that is required to make a textual update to the content.

Adding a new feature or making changes to the website now takes four times as long as it did before
because it focuses on only needing to make the change once on the website.
There is still room for improvement in this code;For instance, requires can be used to add sub-
navigation bars.This will further reduce code that is used over and over. A fresh update may be
made to the index page, which now employs a lengthy if statement.It's possible for a website to
operate with just one point of access and to utilize $_GET variables to identify this same requested
page.After this was called, functionality would be added to the content.As a result, there is no longer
a need for a lengthy If statement, which cuts down on the number the of code in the index file.
Appendices:

This is the home page of the website where a user can run see the stories that the admin posted in
the website.

This is the car sales list website where all the car list which is on sale is listed here with all the details
that is required
This is the contact where the user can contact to the admin where user can place their name email
and number and also there message what they want to buy and send to the admin.

This is the career opportunities website page of the website where user can find all the job
opportunities in this website and can apply to the website.
This is the about us page where user can find all the details about the website owner and the
company details and can contact to them easily.

This is the Admin login page where admin login through this page using their username and
password that is already given to the admin.
This is the admin home page where all the posted stories can be seen in this page.

This is the admin account where admin can add edit or delete secondary admin.
This is the manufacturers account where different has got different account and can be add, edit, or
delete in this page.

This is the job vacancy page where admin can posted a job in this page and can get different jobs for
the company.
This is the add story page where admin can post a story in this page and can be shown to the user
page and admin home page.

This is the archieved cars page where all the cars which is archieved can be shown and can be
updated price in this pages.
This is the cars page where all the cars list is shown here which can be added edit delete or
archieved.

This is the on sale cars pages where all the car which is on sale is displayed in this page for the
websites.
This is the enquiries page where local user enquiries can be seen and can be implemented in the
website and provide services to the customer.

This is the showroom page of the website where all the car is in the showroom is displayed to the
admin.

References
www.php.net. (n.d.). PHP: $_FILES - Manual. [online] Available at:
http://php.net/manual/en/reserved.variables.files.php [Accessed 13 Nov. 2022].
‌Stack Overflow. (n.d.). php - How to add simple image upload to a form? [online] Available
at: https://stackoverflow.com/questions/4422210/how-to-add-simple-image-upload-to-a-form
[Accessed 13 Nov. 2022].
Anon, (n.d.). Car Selling and Showroom Management System Using PHP and MySQL |
Projectworlds. [online] Available at: https://projectworlds.in/free-projects/php-projects/car-
selling-and-showroom-management-system-using-php-and-mysql/ [Accessed 13 Nov. 2022].
‌ demy. (n.d.). Build Car Dealership Website Using PHP. [online] Available at:
U
https://www.udemy.com/course/build-car-dealership-website-using-php/ [Accessed 13 Nov.
2022].
www.sourcecodester.com. (n.d.). Auto Dealer Management System in PHP/OOP Free
Source Code | Free Source Code Projects and Tutorials. [online] Available at:
https://www.sourcecodester.com/php/15371/auto-dealer-management-system-phpoop-free-
source-code.html [Accessed 13 Nov. 2022].

sourceforge.net. (n.d.). php mysql car dealership free download - SourceForge. [online]
Available at: https://sourceforge.net/directory/os:windows/?q=php+mysql+car+dealership
[Accessed 13 Nov. 2022].

Enoria, T. (2022). Vehicle Sales Management System PHP with Source Code. [online]
SourceCodeHero. Available at: https://sourcecodehero.com/vehicle-sales-management-
system-php-with-source-code/.

PHP MVC ARCHITECTURE www.javatpoint.com. (2019). PHP MVC Architecture -


javatpoint. [online] Available at: https://www.javatpoint.com/php-mvc-architecture
PHP 5 File Upload 18 | P a g e W3schools.com. (2019). PHP 5 File Upload. [online]
Available at: https://www.w3schools.com/php/php_file_upload.asp

PHP Functions W3schools.com. (2019). PHP 5 Functions. [online] Available at:


https://www.w3schools.com/php/php_functions.asp

Controller controller, A. (2019). An example of an MVC controller. [online] Stack Overflow.


Available at: https://stackoverflow.com/questions/1737868/an-example-of-an-mvccontroller
Getting started with php templates Smashing Magazine. (2019). Getting Started With PHP
Templating — Smashing Magazine. [online] Available at:
https://www.smashingmagazine.com/2011/10/gettingstarted-with-php-templating

You might also like