The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.

Where an E-catalog can provide quick access to information

Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by Jean-Luc Palmyre, 2020-05-23 03:12:46

Developing an E-catalog for Autoland’s car dealership business

Where an E-catalog can provide quick access to information

Keywords: E-Catalogue, Web based, car dealership,Environmental friendly

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

5.6.1.6 About.php

This displays the details about the company and its location. It also displays a
map of exactly where Autoland is located. At first I wanted to use google maps
to display this but since Autoland cannot be found on google maps because
Seychelles being a very small country I had to revert to a manual method.

Relation to design:

PAGE 51

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

5.6.1.7 product_mager/index.php

Since there will be a facility for an administrator to manage the e-catalogue
directly from the website itself without having to go into the backhand to per-
form changes, it is essential to have a login facility for the admin for security
reasons. The administrator though needs to configure this manually in
PhpMyAdmin in order to add a user, change password or delete.
Firstly, it calls the dbcon.php file to attempt to connect to the database.

dbcon.php file attempting connection:

After successful connection the index.php file will call the login.php file which
will check if whether the input is a match or not.

login.php attempting to find a match from the database entry in the users table. When
a match is found and the authentication is successful it will open the home.php page.

PAGE 52

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report
Relation to design:

PAGE 53

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

5.6.1.8 home.php

The functions for this page is to produce the list of products in the database
under each category. It is a bit similar to the index.php file but here we are
displaying every product in a table with their price. Since in the require-
ments we needed a function to be able to delete product entries, here we
have created this function.

The program here basically retrieves data from the database about the cat-
egories and products. It displays the product list according to the current
category selected. It creates a button next to each product to allow it to
be deleted by the admin.

PAGE 54

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Relation to design:

PAGE 55

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

5.6.1.9 product_add.php

Since I specified in the requirements that the website needs to have the
function to add new products without going into the database backhand
to do this, the function of product_add.php is exactly for this. Text boxes
are created for input with their respective category names. The add but-
ton basically updates the database with the new data. Input fields are
also validated to check for missing entries.

PAGE 56

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Relation to design:

PAGE 57

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

5.6.2 Uploadform.php

We need a function to upload images for the respective vehicle after adding it to
the database. This page what it does is simply providing the facility to browse for
an image on the PC and uploading it to the directory of images. This page also
displays the list of images currently in the directory.

When the upload.php file is called, it uploads the selected image in the directory where
images are stored. The code for this is displayed below:

PAGE 58

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Relation to design:

PAGE 59

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

5.6.3 results.php

The search function is available in the sidebar of the website. When the
user inputs data which he/she wishes to search for, by clicking on the
search button will call the results.php file. This files main function is to lo-
cate the data in the database and return any possible match on the results
page. The result page also displays the amount of records it has found from
the search.

PAGE 60

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

5.6.4 Screenshots of the resulting interfaces of the Autoland’s e-catalogue
prototype

Figure 36: Screenshot of home page

Figure 35: Screenshot of product view

PAGE 61

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 37: Screenshot of product view in another category

Figure 38: Screenshot of search result page

PAGE 62

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 40: Screenshot of admin login page

Figure 39: Screenshot of Admin main page

PAGE 63

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 42: Screenshot of add product page

Figure 41: screenshot of upload image page

PAGE 64

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 43: Screenshot of about page

PAGE 65

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

5.7 Prototype Testing

5.7.1 Testing requirements

Testing the system will ensure that all the functionalities are working ac-
cordingly without any error. If any errors are available this will allow me
to fix them before it is sent out to the company and customers for feed-
back.

Test Expected Result

1. Display of product details  The names of all the categories of ve-
hicles available are on display.
2. Search results
 The names of the vehicles under the
3. Login admin selected category can be viewed.

 The vehicles image and price detail is
displayed after the vehicle is selected.

 The search function must not be case
sensitive

 The correct information is retrieved
from the database

 Number of records is correctly dis-
played.

 User cannot directly enter the admin
page without authentication

 Login facility is displayed with suc-
cessful login directing the user to the
home.php page

 Error message is displayed for wrong
password and username combo

 Error message is displayed for empty
fields

PAGE 66

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report
4. Admin functions
 The vehicles are listed accordingly to
5.7.1 Testing result correspond with the category.

1. Product details  User is able to delete product

 User is able to add new product

 User is able to upload image

 User is able to delete image

 Error message is displayed for empty
fields or invalid data

Figure 52: Screenshot of product details test

Firstly, the product details are tested to see whether it is being displayed or not.
After selecting category SUV, we find that all the vehicles listed under SUV is being
displayed correctly. This results means the first test is passed without any bugs
since all the categories of vehicles available is displayed accordingly.

PAGE 67

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 53: screenshot of category Trucks on display

Secondly, we then change the category and selected “Trucks”. As you can see from the
screenshot above all the vehicles listed under trucks is being displayed correctly. The re-
sult is the same for all the other categories.

Figure 54: Screenshot of testing vehicle image

Next I checked whether the vehicle image and its price was being displayed correctly. As
shown in the screenshot above, after clicking the vehicle “Isuzu D-Max”, this was dis-
played correctly as it should. Image was present and so was the price info.

PAGE 68

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report
2. Search results

Figure 55: Screenshot of search detail

For the search function firstly I checked whether the input box was case sensitive. I
entered the word “honda” like shown above (figure 55) in lower-case and the search the
database. The results below (figure 56) show that all the vehicles with the text “honda”
present in it was displayed despite they were in upper-case. This means that the search
function was not case-sensitive which is exactly like it should be.

The second test for this function was to check whether the amount of vehicles found was
displayed. The figure shows that 9 records were found from the database and this
matches the list given.

The test results for the search function showed no bugs. Testing completed successfully.

Figure 56: Test result of search function

PAGE 69

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report
3. Login admin

Figure 57: Test result of error message for empty field

To be able to update and manage the website the administrator would need to login. This
function was tested. Firstly, checked to see what happens when no input is entered and
the login button is clicked. This resulted in an error message as shown in figure above.
Secondly I entered the username and clicked login without entering a password. This was
to check whether this field complied with its properties of ‘NOT NULL’. The result dis-
played an error message as shown in figure 57 above.

Figure 58: Invalid input error message

The other test was to check what happens if we enter the authentication details wrongly.
I entered a username and a password that does not match. This resulted in the error mes-
sage displayed above in figure 58. The tests show that the error messages are being cor-
rectly displayed by the system.

PAGE 70

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 59: Display of admin main page after successful login

The last test for the login page was to check whether the correct page was being
directed to after successful login or authentication. This time I entered the correct
password and username, the result showed the page was directed to the
home.php (figure 59) page as it should.

PAGE 71

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

4. Admin functions

i. Delete product

The first test of the admin functions is to test whether the product list is displayed
accordingly to the category. After login into the admin page, I selected the SUV
category, All the vehicles recorded under SUV was on display properly as it should
(figure 60). This was the same for all categories respectively.

Figure 60: Delete product button displayed

The second test was to test whether the function to delete records was working
properly as it should. From the same category, I selected the “BMW X1” vehicle
and deleted the record by clicking the delete button. This resulted in the record
being deleted as show in figure below. I also checked the database to ensure it
was deleted there also (see figure 61 below).

Figure 61: Delete product test result

PAGE 72

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 62: Deleted product removed from database

PAGE 73

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

ii. Next text is to check whether the upload new product form is working as it should.
This is a form which permits the admin to upload new vehicles into the database. The
details required for the new vehicle to be uploaded was inserted into the required
fields (see figure 65 below). The after I clicked the “Add product button” and this
displayed the vehicle under the category it was assigned to (see figure 64 below). I
also went to check into the backhand of PhpMyAdmin to see if really the data was
updated into the database as well (see figure 65 below).

Figure 63: input of new product data being tested

Figure 64: New product inserted into the system

PAGE 74

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 65: New product also updated into the database

iii. Error message
Testing the fields for input when adding a new vehicle with different inputs
or blank fields to see if the error handling was being handled properly. The
error message was displayed each time a field was left empty and where the
data type was not a match.

Figure 66: Error message of invalid input

PAGE 75

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

iv. Upload image

The next test is to check the upload image function. This requires to test if
the browse button is opening the window necessary to browse for the im-
age.

I went into the upload image page, I clicked the browse button and the re-
sulting window opened as expected (see figure 67 below).

Figure6 7: Upload window open test

I then selected the “Untitled.jpg” image to upload and clicked open. The
name of the chosen image is displayed as expected in the text box.

Figure 68: Selected image name displayed

PAGE 76

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

After selecting the image, I tested whether the upload button was doing its function cor-
rectly and that is to upload the image in the directory (see figure 69 below) and display
the name in the list on the website (see figure 70 below). I also checked to see whether
the vehicle linked to the image is displaying in the main menu in the home page.

Figure 69: image uploaded in directory of local server

Figure 10: Image uploaded to list of image in directory on the website

PAGE 77

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 11: Image not displaying correctly

The figure 71 above shows that the image was not being displayed. The question I asked myself
was “Why?”. I then realised that the program maps an image in the directory to a specific vehicle
through the code name and image name. The name of the image must be similar to the code
name given when entering the data for the new product. I therefore changed the name of the
image to match the code name being “Brio.jpg” and tested it again. The result below in figure
shows that now the image is being displayed correctly as it should.

Figure 12: image displayed correctly after resolving issue

PAGE 78

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

6.0 Discussion

After completion of the prototype and in-house testing of the system, now it’s
time for the users to test it. The purpose is to get a feedback from the group of
people to see what do they think about the system the pros and cons and also
what to improve upon.
Firstly, I got the two group of people which I had conducted the survey with (po-
tential and past clients of Autoland) and also Mr. Mein who would be the main
admin to test the system.
In this section this is what I will be discussing and analysing. The results obtained
from the feedbacks sent for the prototype.

6.1 Feedback from user testing (past and potential clients)

Do you find it easy to find information you need about
vehicles and Autoland from the E-catalogue?

EasNyo, 5t %soHaerads,y0, %3%

very Easy, 92%

very Easy Easy Not so easy Hard

Figure 44: result of Test survey Q1

As you can see from figure above, 92% of the respondents found it very easy to
find the information displayed on the website. This means in terms of user friend-
liness the E-catalogue design and structure has been well received and all the in-
formation has been seen without issues.

PAGE 79

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Is the price and image of the vehicle sufficient
information for you to make your buying decision?

Yes30%

No70%

Yes No

Figure 45: Result of Test survey Q2

On this figure above we are seeing a negative response towards the details pre-
sented to the test users. They don’t think sufficient information is available hence
this might point out that even though the e-catalogue may be useful, the customer
may still contact the company for more details. This may not reduce the amount
of unnecessary visits and calls received by the sales office.

Would you advise someone to visit the E-catalogue
first before contacting Autoland for more details?

Maybe66% Yes32%
No2%

Yes No Maybe

Figure 46: Result of Test survey Q2

Only 32% of the respondents said they would advise on visiting the E-catalogue
before contacting Autoland. This may well be because of the lack of product
details available, meaning the image and price itself is not enough to satisfy the
customer needs. Though since only 2% replied with No as an answer, it means that
there is actually a useful purpose to the E-catalogue.

PAGE 80

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Additional comments:

The users also gave additional comments of their own regarding the prototype
after testing. Most of them suggested that information regarding vehicle speci-
fications should be made available. This will allow them to compare among the
vehicles for them to see what suits their needs.

Some of the users suggested that they would like to see the different colours of
the vehicles available for viewing. This might be because some of them take col-
our as a requirement for buying decisions.

The transmission available (auto or manual) and the comparison in prices de-
pending on each was also a strong suggestion made by the users after user test-
ing.

6.2 Feedback from company representative (Mr. Mein) after testing

Mr. Mein gave me quite a positive feedback after testing both the user and admin
feature of the E-catalogue. When it came to the interface of the system, he was
pleased about the simplicity and ease of navigation through the website. He also
acknowledges that fact that I took his proposition of leaving space for banner ads
to be displayed in the future. He expressed his satisfaction with the look and feel
of the E-catalogue with special mention of the choice of colours for the design.
The search function was well appreciated and said this makes life easier for the
visitors to find specific data. Though he was quite satisfied with the front end, he
also gave some recommendations about the details displayed. Like the users had
mentioned, he also felt that after browsing he felt there was a lack of details for
the vehicles. He said it would be in the company’s best interest to add specifica-
tion details for the vehicles and also that he would like to see a function where
the image of the vehicle could be rotated 360 degrees to see all angles of the car.

For the admin side of the system, he found it quite user friendly to add new prod-
ucts and images and delete records. He advised that it would have been better to
actually upload the image of the specific vehicle while adding the data of the ve-
hicle in the database. This would have made life easier for him and prevent any
confusion.

He also noted that the E-catalogue could help the business gain competitive ad-
vantage over their competitors with its unique style compared to the others here
in Seychelles. He also stated that the company would be glad to invest in such a
system since this also solves their problem of storing data for the vehicles. They
can now have a computerises system and this will eliminate extra cost and paper
work.

PAGE 81

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

6.3 Improvement work on the prototype that could be undertaken
after feedback

I was glad to see how the testers responded positively towards the prototype,
from the front-end users to the administrator. After they had outlined certain im-
provement which is needed to make it is clear that the E-catalogue contains weak-
nesses which need to be worked upon to elevate its level to be of a standard which
will make it successful after its launch.

Firstly, the vehicle specification needs to be made available. This will give the au-
dience more details in order to compare between on vehicle and another. To solve
the problem, the database would need to be modified and enlarged to cater for
all the different specs categories. After this coding of PHP to pull this data would
be needed and modification of the HTML files would be necessary to display this
data accordingly on the website. This will make the E-catalogue more detailed
content wise.

Secondly, images of different types of colour of the vehicle would need to be up-
loaded for viewing. Clients may sometimes be looking to see if a specific colour is
available, maybe they want to buy a car which is of their favourite colour. To solve
this, an image linking to each colour would need to be created so that when the
user clicks the choice of colour vehicle of this colour is displayed. It would help to
make the website more attractive and modern.

Thirdly, some test users wanted a function whereby they could request a test drive
of a vehicle. For this to be possible a button would need to be placed next to each
vehicle hence adjust the design to accommodate this. Coding of the button so that
it displays a page whereby the customer would fill in his/her details in order to get
an appointment for the test drive.

Finally, the advice given by Mr. Mein from the feedback stated that he would have
preferred if the uploading images function would be on the same page as the add
product so that it does not create confusion. Basically what will be needed to do
here is to create a table in the database whereby images of each are stored instead
of having it stored directly into a directory. Then we could place the browse and
upload buttons on the same page as the add product. Coding would need to be
adjusted to comply with the new design and database.

PAGE 82

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

7.0 Conclusion

The prototype E-catalogue for Autoland was finally developed after 6 months of
hard work and was successfully tested by the test users and also the company’s
representative. This project’s ultimate aim was to develop a solution to showcase
Autoland’s fleet online to replace the paper based marketing method in use with
the aim to promote the use of E-catalogues and facilitate access to information.
To develop the E-catalogue I used the requirements which was obtained via the
interview, questionnaire survey and also an observation of current available sys-
tems. The group of people whom I conducted the analysis of the problems with
was the same group to undertake the evaluation to see whether they think the
new system is more useful compared to previous methods and also to take rec-
ommendations on how the system could better improved for future use.

To achieved the aim, objectives was set and needed to be met in order to have a
successful system. The waterfall model was followed without any difficulty to un-
dertake the software development. One of the objectives was to create a data-
base system to store data about Autoland’s fleet in order to reduce paper work
and also have a computerized way to store this data. The database system was
designed according to the data collected and was implemented to work success-
fully with the E-catalogue using PHP as the server side scripting. Through the test-
ing phase, the users who tested the system expressed their satisfaction towards
the interface of the system which meant that it could eventually lead to customer
attraction in the future since they agreed that it facilitated access to information
about Autoland and its fleet. On the company’s side, the representative who
tested the system expressed great satisfaction to it as he mentioned that this
would reduce the paper work and also the cost of marketing by going digital. The
positive feedback meant that the E-catalogue would be used in the future hence
eliminate paper waste which meets the aim for contributing towards a greener
Seychelles.

Despite positive feedbacks, the system also had a few weak points that was men-
tioned which can be used to help develop it better for the future. The inclusion of
vehicle spec details was mentioned in particular to give more details about the
vehicles in order for the visitors of the e-catalogue to compare in order to make
better decisions. The types of colour of the vehicles also was recommended to be
displayed and also a function whereby a test-drive could be requested would fur-
ther improve the system. This will give the E-catalogue more content in order to
be more attractive by passing on more info to the visitors which may lead to po-
tential customers. The admin side of the system it was recommended that the
uploading picture function is on the same page as when uploading vehicle details.
This would limit confusion or potential human error hence facilitate the work of
the admin.

PAGE 83

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

8.1 Appendices

8.1 Appendix A _ permission letter & project plan

Figure 47: Permission letter from the company to access data

PAGE 84

Jean-Luc Palmyre SRN:120299364

Repreentation of task schedule trhough Gantt Chart 01-Oct-1621-O

ltem Identificatio1n-Oct-1164

Literature Survey 16-Oct-16

Literature Search 16-Oct-16 1

Literature Review 2-Nov-1

Interview and Questionnaire design 16-N

Preliminary Project Report

Analysis

Data collection and info gathering

Requirements Analysis

Define activities and processes of the system (Functional requirements)

Define characteristics of the system (Non-Functional requirements)

Design

System requirements modelled using diagrams

Design database system

Design interface of website layout

Implementation

Build up Database (MySQL)

Implement interface of website layout

Develop different web pages of the system

Construct system components

Hosting the web page

Testing

User Testing

Prototype evaluation

User feedback

Analysis

Final Project Report

Introduction

Literature Review

Methods

Figure 48: Gantt chart Results

Discussion

Conclusion Start
Appendices & Reference List Days
Rem
Evaluation
Proof reading and final editing

CO3320 PPR

Oct-1610-Nov-1630-Nov-1620-Dec-1609-Jan-1729-Jan-1718-Feb-1710-Mar-1730-Mar-1719-Apr-17

30

14

16 30 45

Nov-16 7

22-Dec-16 25

13-Jan-17 8

13-Jan-17 3

15-Jan-17 3

18-Jan-17 3

21-Jan-17 2

23-Jan-17 16

22-Jan-17 2

25-Jan-17 7

2-Feb-17 7

8-Feb-17 30

8-Feb-17 3

12-Feb-17 7

19-Feb-17 7

27-Feb-17 7

5-Mar-17 5

11-Mar-17 14
14
11-Mar-17
12
26-Mar-17 7

26-Mar-17 5

2-Apr-17 14
1
16-Jan-17 90 3

16-Jan-17 1 PAGE 854

18-Jan-17 2 5

1-Feb-17 14

16-Feb-17 30

17-Mar-17

t Date 5-Apr-17
s completed 7-Apr-17
maining days 11-Apr-17

18-Apr-17

Jean-Luc Palmyre SRN:120299364 CO3320 PPR

8.2 Appendix_B Interview Transcript

Interviewer: Jean-Luc Palmyre Date: 19/Jan/2017
Interviewee:

Jude Mein

Subject: Autoland business processes

Good Morning Mr Mein, thank you for making time to meet me for this
interview. Just a few questions regarding the business of Autoland. Firstly….

1. What has been Autoland’s main difficulty when it comes to storing information
and how is it affection your work and the business itself?

Jude: First of all, we do not have a database system where we can store data about
our vehicles. That’s in terms of prices, specs, colour and models.

2. How is information currently being stored?

Jude: We have mainly been accustomed to paper based work over the past 10
years of our existence and now we actually want to move away from that.

3. How do you advertise the cars which you import?

Jude: Autoland mainly uses leaflets and newspaper ads to advertise our fleet.
We sometimes do TV ads as well but mostly we do paper based advertisements.

4. How costly has been the fees for advertisement?

Jude: We do actually spend quite a bit of money when it comes to marketing costs.
Since we do not have our own website where people can go to check for
information, we have to target the audience by other means like I’ve stated
before. The board actually have put to our attention that we need to reduce our
expenses in this area for the future.

5. What approach does your customers usually take to get in touch with a sales
person?

Jude: Usually we get a lot of people coming into our office at providence to check
our fleets since we also have a showroom but unfortunately we are running out
of space right now. We also get a lot of people calling our sales agent to request
information. Sometimes we do get e-mails as well but not much compared to visits
and calls.

6. How do you think the introduction of an E-catalogue might help Autoland’s
business process?

PAGE 86

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Jude: This I think will come at an advantage in terms of marketing our fleets. We
will get to display all our vehicles to the audience and have this available 24/7. I
also think it will reduce our workload in terms of having to deal with a lot of calls
and visitors because these things take your time and sometimes unnecessary
visits or calls can be avoided if the information is available online. This will give
us a competitive advantage as we could be the first to try using such a system
here in Seychelles. I also think personally we could use this as a form of revenue
in advertising ads in the future for garages and spare part shops which supply for
our vehicles.

7. Do you have an idea what type of information you would like the e-catalogue to
contain rather than the vehicle names?

Jude: The most important information our clients usually asks about firstly is the
price of the vehicle, this will give them an idea if it is within their budget to
purchase such a vehicle. Mostly the decisions come down to pricing at the end of
the day and it will be up to us to convince them that they will be getting value for
their money. Also the brands we offer must be on display for copyright reasons.

8. How is customer attraction being affected by the lack of accessible information
24/7?

Jude: Sometimes I meet a few people who tell me they didn’t know that it was
Autoland who is the importer for a certain type of vehicle. When I hear this kind
of comment I fell we are losing many more potential customers then we actually
think. Information is vital in this competitive business world. We need to reach
out to a bigger audience than what we already are achieving right now.

9. What type of brands to Autoland deal with?

Jude: We do have a few. We are the sole dealer for BMW and Chevrolet here in
Seychelles. We also have Honda and also Isuzu trucks. We are one of two company
who is contracted to deal for multiple brands. Therefor I believe having our own
website will help the audience better understand what we offer.

Me: Thank you for your time again Mr. Mein. It has been a fruitful interview and I will
contact you when I complete the project so that some testing on your side can
be done.

Jude: I’ll be glad to help you in any way I can. Good luck with your studies!

PAGE 87

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

8.3 Appendix_C Questionnaire surveys

Figure 49: Questionnaire survey 1

PAGE 88

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 50: Questionnaire survey 2

PAGE 89

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Figure 51: Questionnaire survey 3

PAGE 90

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

8.4 Appendix_D Code listings from other sources

Index.php

*********************************************************************/

* Title: category product source code

* Author: Machebele, Shering

* Date: 2016

* Code version: 1.0

* Availability: http://www.sourcecodester.com/php.html

*********************************************************************/

<?php
require('db/database.php');
require('db/category.php');
require('db/category_db.php');
require('db/product.php');
require('db/product_db.php');

if (isset($_POST['action'])) {
$action = $_POST['action'];

} else if (isset($_GET['action'])) {
$action = $_GET['action'];

} else {
$action = 'list_products';

}

if ($action == 'list_products') {
$category_id ="";
if(isset($_GET['category_id'])) {
$category_id = $_GET['category_id'];
}
if (empty($category_id)) {
$category_id = 1;
}

$current_category = CategoryDB::getCategory($category_id);
$categories = CategoryDB::getCategories();
$products = ProductDB::getProductsByCategory($category_id);

include('product_catalog/product_list.php');
} else if ($action == 'view_product') {

$categories = CategoryDB::getCategories();

$product_id = $_GET['product_id'];
$product = ProductDB::getProduct($product_id);

include('product_catalog/product_view.php');
}
?>

PAGE 91

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Category_db.php

*********************************************************************/

* Title: category product source code

* Author: Machebele, Shering

* Date: 2016

* Code version: 1.0

* Availability: http://www.sourcecodester.com/php.html

*********************************************************************/

<?php
class CategoryDB {

public static function getCategories() {
$db = Database::getDB();
$query = 'SELECT * FROM categories
ORDER BY categoryID';
$result = $db->query($query);
$categories = array();
foreach ($result as $row) {
$category = new Category($row['categoryID'],
$row['categoryName']);
$categories[] = $category;
}
return $categories;

}

public static function getCategory($category_id) {
$db = Database::getDB();
$query = "SELECT * FROM categories
WHERE categoryID = '$category_id'";
$statement = $db->query($query);
$row = $statement->fetch();
$category = new Category($row['categoryID'],
$row['categoryName']);
return $category;

}
}
?>

PAGE 92

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Product_db.php

*********************************************************************/

* Title: category product source code

* Author: Machebele, Shering

* Date: 2016

* Code version: 1.0

* Availability: http://www.sourcecodester.com/php.html

*********************************************************************/

<?php
class ProductDB {

public static function getProducts() {
$db = Database::getDB();
$query = 'SELECT * FROM products
INNER JOIN categories
ON products.categoryID = categories.categoryID';
$result = $db->query($query);
$products = array();
foreach ($result as $row) {
$category = new Category($row['categoryID'],
$row['categoryName']);
$product = new Product($category,
$row['productCode'],
$row['productName'],
$row['listPrice']);
$product->setId($row['productID']);
$products[] = $product;
}
return $products;

}

public static function getProductsByCategory($category_id) {
$db = Database::getDB();

$category = CategoryDB::getCategory($category_id);

$query = "SELECT * FROM products
WHERE categoryID = '$category_id'
ORDER BY productID";

$result = $db->query($query);
$products = array();
foreach ($result as $row) {

$product = new Product($category,
$row['productCode'],
$row['productName'],
$row['listPrice']);

$product->setId($row['productID']);
$products[] = $product;
}

PAGE 93

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

return $products;
}

public static function getProduct($product_id) {
$db = Database::getDB();
$query = "SELECT * FROM products
WHERE productID = '$product_id'";
$result = $db->query($query);
$row = $result->fetch();
$category = CategoryDB::getCategory($row['categoryID']);
$product = new Product($category,
$row['productCode'],
$row['productName'],
$row['listPrice']);
$product->setID($row['productID']);
return $product;

}

public static function deleteProduct($product_id) {
$db = Database::getDB();
$query = "DELETE FROM products
WHERE productID = '$product_id'";
$row_count = $db->exec($query);
return $row_count;

}

public static function addProduct($product) {
$db = Database::getDB();

$category_id = $product->getCategory()->getID();
$code = $product->getCode();
$name = $product->getName();
$price = $product->getPrice();

$query =
"INSERT INTO products
(categoryID, productCode, productName, listPrice)
VALUES
('$category_id', '$code', '$name', '$price')";

$row_count = $db->exec($query);
return $row_count;
}

}
?>

PAGE 94

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Home.php

*********************************************************************/

* Title: index database source code

* Author: Machebele, Shering

* Date: 2016

* Code version: 1.0

* Availability: http://www.sourcecodester.com/php.html

*********************************************************************/

<?php
require('../db/database.php');
require('../db/category.php');
require('../db/category_db.php');
require('../db/product.php');
require('../db/product_db.php');

if (isset($_POST['action'])) {
$action = $_POST['action'];

} else if (isset($_GET['action'])) {
$action = $_GET['action'];

} else {
$action = 'list_products';

}

if ($action == 'list_products') {
$category_id ="";
if(isset($_GET['category_id'])) {
$category_id = $_GET['category_id'];
}
if (empty($category_id)) {
$category_id = 1;
}

// Get product and category data
$current_category = CategoryDB::getCategory($category_id);
$categories = CategoryDB::getCategories();
$products = ProductDB::getProductsByCategory($category_id);

// Display the product list
include('product_list.php');
} else if ($action == 'delete_product') {
// Get the IDs
$product_id = $_POST['product_id'];
$category_id = $_POST['category_id'];

// Delete the product
ProductDB::deleteProduct($product_id);

// Display the Product List page for the current category

PAGE 95

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

header("Location: .?category_id=$category_id");
} else if ($action == 'show_add_form') {

$categories = CategoryDB::getCategories();
include('product_add.php');
} else if ($action == 'add_product') {
$category_id = $_POST['category_id'];
$code = $_POST['code'];
$name = $_POST['name'];
$price = $_POST['price'];

// Validate the inputs
if (empty($code) || empty($name) || empty($price)) {

$error = "Invalid product data. Check all fields and try
again.";

include('../errors/error.php');
} else {

$current_category = CategoryDB::getCategory($category_id);
$product = new Product($current_category, $code, $name,
$price);
ProductDB::addProduct($product);

// Display the Product List page for the current category
header("Location: .?category_id=$category_id");

}
}
?>

PAGE 96

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Upload.php

*********************************************************************/

* Title: index database source code

* Author: Machebele, Shering

* Date: 2016

* Code version: 1.0

* Availability: http://www.sourcecodester.com/php.html

*********************************************************************/

<?php

require_once 'file_util.php'; // the get_file_list function

require_once 'image_util.php'; // the process_image function

$image_dir = '../images';
$image_dir_path = getcwd() . DIRECTORY_SEPARATOR . $image_dir;

$action = '';
if (isset($_POST['action'])) {

$action = $_POST['action'];
} else if (isset($_GET['action'])) {

$action = $_GET['action'];
}
switch ($action) {

case 'upload':
if (isset($_FILES['file1'])) {
$filename = $_FILES['file1']['name'];
if (empty($filename)) {
break;
}
$source = $_FILES['file1']['tmp_name'];
$target = $image_dir_path . DIRECTORY_SEPARATOR . $file-

name;
move_uploaded_file($source, $target);

}
break;
case 'delete':
$filename = $_GET['filename'];
$target = $image_dir_path . DIRECTORY_SEPARATOR . $filename;
if (file_exists($target)) {

unlink($target);
}
break;
}
$files = get_file_list($image_dir_path);
include('uploadform.php');
?>

PAGE 97

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

8.5 Appendix_E Code listings written by myself

Header.php

<!DOCTYPE html>

<html lang="en">

<head>
<title>Autoland</title>
<!-- This is where the css stylesheet is linked to the

website,
since the header is displayed on all pages its

called each time the header loads on a page-->
<link rel="stylesheet" type="text/css"
href="/Autoland/main.css" />

</head>
</div>

<div id="page"> <!-- Company moto and Logo displayed in
header -->

<div id="header" style="vertical-align:middle; text-
align:center">

<img src="images/Autoland.jpg" width="250" height="50">
<h1>Welcome to Autoland Seychelles</h1>
<h2>Executive brands brought closer to you!</h2>

</div>

</html>

PAGE 98

Jean-Luc Palmyre SRN:120299364 CO3320 Final Report

Footer.php

<div id="footer">

<!-- Show avaialble brands affiliated with Autoland -->

<img src="images/BMW.png" alt="" width="100" height="100"/>
<img src="images/chevrolet.png" alt="" width="100" height="100"/>
<img src="images/isuzu-logo.png" alt="" width="100" height="100"/>
<img src="images/Honda.png" alt="" width="100" height="100"/>

<!-- Copyright name of Autoland displayed -->

<p class="copyright">
&copy; <?php echo date("Y"); ?> Autoland Seychelles

(PTY) Ltd.<br/>
Enquire: [email protected]

</p>
</div>
</div>

PAGE 99


Click to View FlipBook Version