Table Name: Registration



Dublin City University

Accommodation (DCUA)

Technical Manual

Introduction

This document is the Technical manual for the Dublin City University Accommodation (DCUA) service. This is a 3rd year degree project aimed at making it easier for students to find accommodation in the immediate area around DCU. It provides a medium of interaction between students and landlords via the internet.

We believe that this project combats a real life problem, as there is no such active web-site for DCU at the moment. The aim of DCUA is to provide students with information on available accommodation in the area around DCU. Being on the internet, saves the student the hassle of going to newspapers or magazines for information. DCUA also saves landlords the hassle and expense of placing advertisements in newspapers or magazines or going through agencies.

Core Technologies

For our project we chose to the programming languages of PHP which is embedded in HTML, in conjunction with a MySql database on an Apache web server.

HTML is the language used for web-site development and PHP is embedded within this.

Some of the reasons we chose PHP were:

1) It is ideal for data driven web-sites.

2) It is a scripting language that is very simple to understand.

3) There's always plenty of support from documentation and mailing lists on the internet and bugs are fixed rapidly and easily

Some reasons for choosing MySql database were:

1) MySQL has pretty much full SQL support. And since we covered this as a part of our Database module in 3rd year, we wanted to get some practical application of using SQL.

2) Mysql is very simple to use with PHP.

3) Mysql is setup to run on the Apache server that Redbrick (DCU Networking Soc.) use so to get it set up was simply a matter of asking the admin staff of redbrick.

Some reasons for choosing Apache Web server:

1) Redbrick use the Apache web server and we were using Redbrick to develop the project and also to demo our project.

2) It is compatible with PHP and MySql so we would have no problems with languages, servers and databases being incompatible with each other which, for obvious reasons is very important.

Database Design

The two subsections of this section contain the Entity Relationship Diagram and the attribute descriptions for the database.

Entity Relationship Diagram

has deletes

may be may be

email

search for may own

Attribute Description

Table Name: Registration

|Attribute Name |Data Type |Default Value |Validation Constraint |

|Fname |Char[15] |blank |Not null |

|Sname |Char[15] |blank |Not null |

|Email |Varchar[35] |blank |Not null/Valid e-mail syntax |

|Password |Char[14] |blank |4 -10 chars long |

|Type |Char[3] |stu |Student/landlord |

Primary Key: Email

Table Name: Houses

|Attribute Name |Data Type |Default Value |Validation Constraint |

|id |Int[3] |AUTO |No constraints |

|add1 |Varchar[25] |Blank |Not null |

|add2 |Varchar[25] |Blank |Not null |

|code |Char[3] |Blank |D3/D5/D9/D11/D17 |

|type |Char[5] |House |House/digs |

|rent |Int[3] |Blank |Not null |

|singles |Int[3] |Blank |0 |

|doubles |Int[3] |Blank |0 |

|email |Varchar[60] |Email of user |Auto |

|description |Char[80] |Blank |Not null |

Primary Key: id

Foreign Key: email

Sequence Diagram

The option to query the database is available to both the student and the administration staff.

Use Case Model Detail: ‘Query Database’

Sequence Diagram:

[pic]

Menu for Landlord

|Options |Description |Default State |

|Add house |Adds a new record to the houses table |Disabled |

|Update house |Edits current record in the houses table |Disabled |

|Delete house |Deletes record from the houses table |Disabled |

|Cancel |Cancels addition or editing of a record in the houses |Disabled |

| |table | |

|Edit profile |Allows the user to change their current password and | |

| |e-mail address and confirmation is automatically be |Disabled |

| |sent to them via email | |

|Logout |Allows the landlord to log off the web-site. |Disabled |

Menu for Student

|Options |Description |Default State |

|Search |Search for desired accommodation in the database. |Disabled |

|(by parameters) | | |

|Search with map. |Allows student to search for accommodation in a desired|Disabled |

| |area. | |

|View Message |The user has access to a message board where they may |Disabled |

|Board |post or reply to messages. | |

|Edit profile |Allows the user to change their current password and | |

| |the e-mail address and confirmation will automatically |Disabled |

| |be sent to them via email. | |

|Logout |Allows the student to log off the web-site. |Disabled |

User Access Rights (for all User screens)

|User Level |Rights |

|Administration |Full access to search engine of users and houses and the power to |

| |delete a house or a user. |

|Student |Access to search engine for houses and message board. |

|Landlord |Access to view their own houses, add new house, update details of |

| |their current houses, delete house. |

Basic System Security

The way the web works is simple – document retrieval. All a web user has to specify is which document they would like to see, and the web server will return it. With our system, we need to have some sort of individual user interaction, and we should not allow users to see information belonging to other landlords, the houses they own for instance. Without much security, a prankster could also go around adding houses to the database in someone else’s name. This can be overcome by having a login screen. But that will only do so much.

To overcome this problem we have implemented sessions into our web-site. The

session for each user is created when the user logs onto the site with their unique email address and password.

$valid_session="yes";

session_register("valid_session");

Then, at the top of each file we have the lines

if($valid_session=="yes")

{

//Do what is requested

}

//and at the bottom we have

else

{

include ("session_error.html");

}

where “session_error.html” contains the message saying you must log on before accessing the requested page.

The use of sessions stops undesirables from hacking into or guessing a valid URL. For instance if I simply copied and pasted the url. used to add a new house to the database which is , I would receive an error message telling me I have to log into the site before accessing this page.

This is vital for system for system security.

Accessing the Database to retrieve and write information

Luckily, database access in Php is very straightforward. Php gives us access to very powerful prewritten functions to seamlessly interact with SQL databases, such as MySQL which we are using.

Here are the steps which we follow to connect to, and retrieve information from our SQL database.

Connecting

All we need to do is put in the lines

$db = mysql_connect("localhost", "root", "password”);

mysql_select_db("user",$db);

and now we are connect to the database and we can use the handle $db to refer to the database.

SQL SELECT statements

Under Php, all we need to do is specify that it is a mysql_query which we are doing and type our select statement. We can also assign the result of an sql statement to a variable as follows:

$result = mysql_query("SELECT * from houses WHERE id='$session_id'");

The result of the mysql_query is now in the variable $result.

Then we can include the line echo mysql_error(); which tells us if we have an error with our sql syntax.

-----------------------

DCUA

DCDCUA DCUA

landlords

houses

Students

Users

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download

To fulfill the demand for quickly locating and searching documents.

It is intelligent file search solution for home and business.

Literature Lottery

Related searches