Professional Documents
Culture Documents
Filip Apostolski
May, 2009
Approved
Filip Apostolski
Abstract
The following report contains information related to the development of CITYs alumni web site. The main aim of the project is to develop a web based application that is going to make it possible for the former students of CITY College to keep in touch with each other and that will substitute the manual system of the alumni office with an automated one. First of all, the tasks that need to be completed are stated. There is a separate chapter where each task that was identified as necessary in order to successfully develop the alumni web site of CITY College is presented and described in detail. After each phase of the software development life cycle will be explained, the created system will be evaluated together with the software development process that was applied in order to implement the web site.
DECLARATION
All sentences or passages quoted in this thesis from other people's work have been specifically acknowledged by clear cross referencing to author, work and page(s). I understand that failure to do this amounts to plagiarism and will be considered grounds for failure in this thesis and the degree examination as a whole.
29 May, 2009
1. Introduction ....................................................................7
1.1Aim.................................................................................................................................7 1.2 Objectives......................................................................................................................8 1.3 Project Content..............................................................................................................9
4. Analysis ........................................................................24
4.1 Current Situation at CITY...........................................................................................24 4.2 Requirements elicitation .............................................................................................24 4.2.1 Identifying the Users and Functional Requirements............................................24 4.2.2 Use Case Diagram................................................................................................26 4.2.2.1 Register .............................................................................................................27 4.2.2.2 Log In................................................................................................................28 4.2.2.3 Add News..........................................................................................................29 4.2.2.4 Modify news .....................................................................................................30 4.2.2.5 Remove news ....................................................................................................30 4.2.2.6 View News........................................................................................................31 4.2.2.7 Add Event .........................................................................................................32
4.2.2.8 Modify event .....................................................................................................32 4.2.2.9 Remove event....................................................................................................32 4.2.2.10 View event ......................................................................................................32 4.2.2.11 View Profile ....................................................................................................33 4.2.2.12 Update Profile .................................................................................................33 4.2.2.13 Find member ...................................................................................................34 4.2.2.14 Add Alumnus of the Month ............................................................................35 4.2.2.15 View Alumnus of the Month ..........................................................................35 4.2.2.16 Broadcast e-mail .............................................................................................35 4.2.2.17 Add Alumni Officer ........................................................................................36
5. Design...........................................................................37
5.1 Design of the database ................................................................................................37 5.1.1 Entity Relationship Diagram (ERD) ....................................................................37 5.1.2 Justification of the proposed ERD .......................................................................38 5.1.2.1 The EVENT Entity............................................................................................38 5.1.2.2 The NEWS Entity .............................................................................................38 5.1.2.3 The USER entity ...............................................................................................39 5.1.2.4 The MEMBER Entity .......................................................................................39 5.1.2.5 The ALUMNUS OF THE MONTH Entity ......................................................40 5.1.3 Relational Schema................................................................................................40 5.2 Architectural Design ...................................................................................................42
6. Implementation .............................................................43
6.1 Technologies Comparison...........................................................................................43 6.1.1 Hypertext Preprocessor (PHP) .............................................................................43 6.1.2 Active Server Pages (ASP) ..................................................................................43 6.1.3 Java Server Pages (JSP) .......................................................................................44 6.1.4 Ajax......................................................................................................................45 6.1.5 Summary ..............................................................................................................45 6.2 Development Tools and Technologies........................................................................46 6.2.1 HTML ..................................................................................................................46 6.2.2 CSS.......................................................................................................................46 6.2.3 PHP ......................................................................................................................46 6.2.4 MySQL.................................................................................................................46 6.2.5 Apache .................................................................................................................46 6.3 Implementation flow ...................................................................................................47 6.3 Essential code and implementation justification.....................................................48 6.3.1Connect to database ..............................................................................................48 6.3.2 Register ................................................................................................................49 6.3.3 Log In...................................................................................................................50 6.4.4 Find Member........................................................................................................51 6.4.5 View Personal Profile ..........................................................................................52 6.4.6 Update Profile ......................................................................................................52 6.4.7 Add alumni officer ...............................................................................................53 6.4.8 Broadcast e-mail ..................................................................................................54
6.4.9 View events..........................................................................................................54 6.4.10. Add event ..........................................................................................................55 6.4.11. Modify event .....................................................................................................55 6.4.12 Remove event.....................................................................................................56
7. Testing ..........................................................................57
7.1 Unit Testing.................................................................................................................57 7.2 Integration Testing ......................................................................................................57 7.3 System Testing............................................................................................................58
8. Evaluation.....................................................................59
8.1 Process and plan evaluation ........................................................................................59 8.1.1 Process Plan .........................................................................................................59 8.1.2 Process Evaluation ...............................................................................................59 8.2 System Evaluation.......................................................................................................60
10. Bibliography ............................................................... 63 Appendix A Interview ...................................................64 Appendix B Use Cases ..................................................65
B.1 Log In .....................................................................................................................65 B.2 Add event ...............................................................................................................65 B.3 Modify Event..........................................................................................................66 B.4 Remove Event ........................................................................................................66 B.5 View eventa............................................................................................................67
Appendix D Poster.........................................................77
1. Introduction
Many universities around the world offer services and benefits to the alumni students. This is the main roll of the alumni offices. In order to make the services and benefits available for the graduated students, many universities have alumni websites. An alumni website is a web based application where the former students can take advantage of the benefits and services that a university offers after they graduate. Being a member of an alumni web site of a university offers many services and benefits for the graduated students. For example, the alumni web site of a university keeps a person in track with the events that are organized by the university and informs the members when some important events will occur that have not been organized by the university. Furthermore, an alumni website contains information about some important news which is related to the university or some important news that is related to a persons field of study. Another advantage of being a member of an alumni web site, which is considered to be the main reasons why many universities have an alumni web site, is that a person can easily find some information concerning a former student and the person can easily contact any other member of the alumni community. Citys alumni web site is of great importance to the university at the moment. Because of the fact that the number of people that have graduated at City is growing fast, maintaining contact with the graduates has become a very important issue. Furthermore, it is also very important for CITY to make it possible for a graduated student to be able to maintain contact with another graduated student. At this moment, Citys alumni web page does exist, however it is not functional. The online community doesnt exist at this point. The web site only offers information about the benefits and services that the online community should offer and information about some news and events that have occurred or will occur in the future.
1.1Aim
The aim of the project is to create a web based application that is going to make it possible for the alumni students to keep in touch with each other and that will substitute the manual system of the alumni office with an automated one. The graduated students can easily find some information such as contact details for another graduate of CITY College using the application, which means that they can easily contact any person that is a member of the alumni web site. Making it possible for the former students to keep in touch is not the only functionality that the application will offer. The former students can easily contact the alumni officer if some help is required. Furthermore, the former students will have access to some news that are related to CITY
college and some events that have happened inside the college. Another reason why such an application can be found useful is that City College can easily monitor a persons career, which is a very important issue for many educational institutions around the world.
1.2 Objectives
The aim of a project is divided into many different steps called objectives. In order to eventually get to the aim of the project, the following objectives should be completed: A literature review must be conducted about other universitys alumni web sites in order to gain an idea of what the application should offer. A literature review is also very useful when it comes to adding some extra functionalities that can be found useful and have not been requested by the client. Interviewing the person in charge of Citys alumni office in order to see what are His/her expectations. Identifying the different types of users that Citys alumni web site should have. Formally defining the requirements in order to create some scenarios. The use case specifications and the scenarios are found to be very useful later on in the design, implementation and testing phase. Furthermore, the use cases forma mean for determining that the user requirements have been met. Conducting a literature review about the possible technologies that can be used to make Citys alumni web site in order to find the most suited one for such an application. Choosing a software engineering methodology that is considered to be the best choice for this type of application. Making a thorough analysis of the system in order to understand exactly what the system should do and in order to create a good quality design of the system. Designing a possible solution to the problem. Implementing all the appropriate classes using the previously chosen technology and connecting them so that they can communicate with each other. After the code has been implemented a proper amount of testing must be done in order to make the application fully functional and free of any possible bugs or errors.
2. Literature Review
2.1 Similar Work
As mentioned above many universities around the world have already created an alumni web site. Even though the functionalities that the application should offer are clear, a proper amount of literature review must be conducted. By making a literature review for similar works, extra functionalities can be added to the application that can be useful and have not been requested by the client. It is very important to pay attention to the human - computer interaction (HCI) issues, meaning carefully examining the appearance of the websites in order to make Citys alumni web site easy to use and navigate.
10
2.1.1.1 Users On the alumni web site of Sheffield Hallam university three different types of users can be identified. The first type of users is everyone that wants to visit the alumni web site. The second type of users is the members of the alumni community. The members of the online community are the former students that have graduated. The third type of users is the alumni officer. The alumni web site must have at least one alumni officer. The alumni officer is the person that is responsible for modifying and maintaining the web site. 2.1.1.2 Functionalities The non-member users have access to only a few links that are concerned with the benefits and services of being a member of the alumni community and to the links that are concerned with the news and events that have happened or will happen in the future. Furthermore, a person that is not a member of the alumni web site and has graduated on Shefield Hallam University has access to the register functionality, which is used to become a member of the alumni web site. The non member users do not have access to the functionalities that the online community offers. The users which are members of the alumni web site have access to everything that the nonmember users have plus the functionalities that the online alumni community offers. The main functionalities that the alumni community offers are viewing and updating the personal profile, finding a member of the community and sending and receiving e-mails. Extra functionalities which can be found useful are access to the class notes, subscription to the universitys magazine and e-mail forwarding. The main functionalities are the ones that an alumni web site must offer and the extra functionalities are functionalities which are useful however they are optional. The alumni officer users probably have access to everything that the members can access except for view and update profile. They are the people responsible for modifying and maintaining the web site. Some functionalities of the alumni officer users that can be identified and which are used to maintain the web site are add and delete news, add and delete events and add and remove class notes. Furthermore, broadcast e-mail functionality might exist because most of the members will subscribe to the universitys magazine which is sent by e-mail. It would be very time consuming for the alumni officers to send e-mails to each of the members one by one if the broadcast e-mail functionality does not exist. 2.1.1.3 User Interface The interface of the web site is user friendly, meaning that it is easy to use and to navigate. The interface is user-friendly because the website is not overcrowded with many links that are not connected with the alumni web site. Further on, another reason why the interface is
11
user-friendly is that the different types of links are separated into different frames. The links that can be visited by both member and non-member users are located in a frame on the left side of the window. The links that can be used only by the members of the online community are separated from the other links in a frame and they are located on the right side of the window.
2.1.2.1 Users On the alumni web site of the University of Melbourne three different types of user can be identified. The first type of user is the non-member user which can be interested in visiting the university's web site for any reason. The second type of users is the members of the alumni web site. A member can be every person that has graduated on the University of
12
Melbourne. Finally, the third type of users is the alumni officers. There must be at least one or more alumni officer users. 2.1.2.2 Functionalities The first type of users, the non-member users can not use the functionalities that the online community offers. They can access only some of the links that contain information about the services and the benefits that the online community offers. Furthermore, the nonmember user can access the news and events links and they can download a sample of the university's magazine. At last, people that have graduated on the University of Melbourne can register and become members of the alumni web site. The second type of users, the former students that have graduated and which are members of the alumni web site, have access to everything that the non-member users can access and they can use the functionalities that the online community offers. The main functionalities that the online community offers are view profile, update profile, find a member of the alumni community and sending and receiving e-mail. Furthermore, members have access to some more events than the non-member users, events which take place inside the university. Extra functionalities that can be found useful are downloading the universitys magazine, view publications and e-mail forwarding. The alumni officer users most likely have access to everything that the members can access. They are responsible for modifying and maintaining the web site. The functionalities which are used to maintain the web site are add and remove news, add and remove events, upload magazine and add and remove publication. 2.1.2.3 User Interface The interface of the web site is not user friendly, meaning that it is not easy to use and to navigate. The site is contains many links which are not related to the alumni community. This means that the web site is overcrowded with many unnecessary links. A person that will visit the web site for the first time will might have difficulties in finding the information that s\he was looking for.
13
2.1.3.1 Users Four different types of users can be identified in Oxford's alumni web site. The first type of users can be every person that wants to visit the web site and is not a member of the alumni web site. The second type of users is the former students of the University of Oxford that have graduated. In the Oxford alumni web site, the current students of the university can also become members of the alumni web site. The current students are identified as the third type of users. The fourth type of users is the alumni officers. 2.1.3.2 Functionalities The non-member users can visit the web site and see only information about the services of the alumni community. Furthermore, this type of users can view some news and events that have occurred or will occur in the future, however not all of them. The local events can be viewed only by the members of the web site. If a non-member user is a current student or a
14
graduated student from the University of Oxford, the register functionality can be used in order to become a member of the alumni web site. The second type of users, the former students which are members of the web site can do everything that the non-member users can. They also have access to the functionalities that the online community offers. The functionalities that the alumni web site offers to graduated students who are members are access to all events, view profile, update profile, find a person that is a member of the web site, sending and receiving e-mail and e-mail forwarding. Furthermore, the graduated students have the benefit of receiving career advice. The current students have access to everything that the graduated students who are members of the alumni web site have, except for the e-mail forwarding functionality and the benefit of receiving career advices. The alumni officers most probably have access to everything that the site offers. They are responsible for modifying and maintaining the web site. Some functionalities that are used in order to maintain the web site are add and remove news and add and remove events. 2.1.3.3 User Interface The interface that the site offers is very simple and user friendly, meaning that it is easy to use and to navigate. The web site is not overcrowded with many links. Each link that can be accessed by both people that are not members and people that are members is located in a frame on the top of the window. It is very useful that the site offers a link that leads the user to the new information or events that have been added by the alumni officer.
15
2.1.4.1 Users In Harvards alumni association web site three different types of users can be identified. The first type of users are the people that are not a member of the alumni association. The second type of users are the members of the online community. The members of the web site are the former students that have graduated. The third type of user is the alumni officer. At least one alumni officer must exist that is in charge of maintaining and modifying the web site. 2.1.4.2 Functionalities The users which are not members of the alumni association can only have access to some links that are concerned with the services and benefits of being a member of the online community. Furthermore, they have access to the news and events that have occurred and
16
the events that will occur in the future. Furthermore, they can register if they have graduated on the University f Harvard. The members of the alumni association, the former graduated students have access to all of the functionalities and services that the alumni web site offers. The typical functionalities that the online community offers are viewing and updating your profile, finding another member of the alumni web site and sending and receiving e-mail. Furthermore, extra functionalities that can be found very useful are e-mail forwarding and joining a Harvard group. It is very useful that the web site has a discussion link. The discussion link is a forum where the members can open any topic for discussion that is connected to a persons field of studies. The alumni officers probably have access to everything that the site offers. They are responsible for modifying and maintaining the web site. The only functionalities which can be identified that are used in order to maintain the web site are add news, remove news, add event and remove event. 2.1.4.3 User Interface The interface of Harvards alumni web site is user friendly which means that it is easy to use and to navigate. All the links that are concerned with the alumni web site are located in a frame which is located on the right side of the web site. On the top of the page we can see another frame with links. On this frame useful links can be found such as a link to Harvards home page and to the different departments that Harvard has. On the right side of the web site the log in frame is placed which means that the members or the alumni officers can directly log in when they open the alumni web site. It is important to mention that the site is not overcrowded with many unnecessary links that are not connected to the alumni association or the university.
17
2.1.5.1 Users On the University of Manchester three different types of users can be found. The first type of users is the people that are not members of the online community. The second type of users is the graduated students. Finally, the third type of users is the alumni officers. 2.1.5.2 Functionalities The non-member users have access to the alumni web site. They can view the information about the services and benefits of becoming a member of the online community. Furthermore they can view the events and news that are taking place inside the university. Also they can see some publications that have been added by the alumni officer. In order to become a member non-member users have to graduate on the University of Manchester and register on the web site.
18
The graduated students have access to everything that the non-members users have plus the functionalities that the alumni association offers. The typical functionalities that the web site offers are view and update profile, find another alumnus and send and receive email. Some extra functionalities that can be found useful are subscription to the online magazine and e-mail forwarding. The alumni officers type of users is the people in charge of maintaining the web site. At least one alumni officer must exist in order to maintain the web site. The functionalities that can be identified and are used to maintain and modify the web site are add and remove news, add and remove event and upload magazine. 2.1.5.3 User interface The interface of the web site is user friendly which means that it is easy to use and to navigate. Furthermore, the web site is not overcrowded with links. However there are some unnecessary links such inside the alumni website such as links to restaurants and hotels which are near the university. This is useful for the prospective students and not for the former students because of the fact that they already have knowledge about these issues. 2.1.6 Summary Conducting a literature review about similar works is very important. The reason why it is important is that a person can better understand what an alumni community is and why it is useful. First of all, after the literature review about similar works has been completed, the main functionalities that an online alumni community must offer were identified. The main functionalities are viewing and updating the personal profile, view news, view events and find a member. Also, one extra functionality that has not been requested by the client and can be found very useful for the alumni officer was identified. This extra functionality is broadcast e-mail which is used to send e-mail to all the members of the online community. Second of all, after the similar works have been covered, an idea was gained of how the user interface should look in order to be easy to use and navigate. Making a user friendly interface that is not going to be overpopulated with any unnecessary links was the only nonfunctional requirement that was requested by the client.
19
3. Project Management
3.1 Software Development Process
A software development process is a set of stages which is imposed to the development of a software product [1]. There are many different software development processes and all of them can be applied on any type of software. The best suited process for a software depends on many issues such as the size and complexity of the software, whether the software might be imposed to some changes, whether the functional requirements are clear etc. Each software development process includes different steps that form the softwares lifecycle. The software development process model that was used to create CITYs alumni web site is the Waterfall model. The Waterfall model is a linear and sequential software development process, meaning that the different phases are done one after the other in a sequential manner. The Waterfall model is divided in five different phases: Analysis (Requirements Elicitation), Design, Implementation, Testing (Validation) and Maintenance [2]. There are many advantages of using the Waterfall model. First of all, each phase of the software development lifecycle has its own start and end time. This will lead to customer satisfaction because the work done can be presented to the client at any point. Furthermore, the requirement specification is described in detail at the early stage of the software development process, which means that the implementation and testing phase will be made easier if the requirements will not go through some changes. The main disadvantage of the Waterfall model is that the requirements are frozen, meaning that they can not be easily changed. If something has to be changed in the implementation phase, the analysis and design have to be reviewed and changed. This leads to great complexity and confusion.
Furthermore, the Waterfall model is use-case driven, which means that use-cases are used in order to capture the functional requirements. The use-cases are also used to create
20
test scenarios which are very useful for testing. The reason why the Waterfall model was chosen for building CITYs alumni web site is to simplify the development process of the application. Because the functional requirements were very clear, the Waterfall model was found to be the most suitable choice for building the alumni web site. There was no room left for changes in the functionalities in the system and no changes occurred.
21
After the user requirements were captured and after the software development process that was followed was selected, a detailed plan of how the work should progress had to be created. All the different steps that were necessary to be taken in each stage of the Waterfall model were identified. Taking into consideration that the deadline for the submission was in seven months, enough time was allocated to each phase of the software development process. The project plan is presented using a Gantt chart. The chart presents the amount of days that were allocated to every objective. The first objective identified was to conduct a literature survey about related work and the technologies. The literature review was identified as very important in order to better understand what the task of an alumni web site really is. The literature review related to similar work was also identified as important because some extra functionalities could be identified which could be very useful. The literature review about the technologies was planed to be finished at the very beginning of the project in order to choose which technology is going to be used for implementing the alumni web site. If the technology is chosen at the start of the project, adequate time for familiarizing with the selected technology would be available. The time allocated to finish the literature review was 35 days.
After the complete literature survey is finished, detailed analysis of the system should be prepared. The time given for analyzing the system was 5 days. The steps which were identified as compulsory were creating a use case diagram, defining the non-formal specification of the user requirements and developing use cases. The use case diagram illustrates which type of user has access to which functionality that the web site will offer. One day was allocated to the use case diagram. The remaining four days were reserved for creating the use cases and the non-formal specification of the user requirements.
Right after the analysis has been finished, a possible solution for the design of the database and the architecture of the application had to be offered. In order to design the database that the alumni web site will be connected to, the tasks identified were creating an Entity Relationship Diagram, which will identify the appropriate entities, together with the attributes and relations, creating a Relational Schema, which is used to identify which attributes should be added to which entities in order to hold a relation to another entity and the proposed ERD should have been justified. The time given to complete the design was 5 days. Once the analysis and the design phase of the Waterfall model have been finished, 45 days were allocated for familiarizing with the selected technology. The reason why a longer period of time was allocated to familiarizing with the selected technology is because the technology selected was going to be used for the very first time.
22
After my skills and knowledge in the selected technology would have been increased, the implementation of the system was supposed to be started. The time allocated for the implementation phase was 30 days. After the implementation phase would be finished, the application needs to be carefully tested in order to ensure that the application does not have any bugs. The time allocated for the testing phase was 15 days. 7 days were allocated for testing each class independently and then another 8 days for testing the application as a whole. Once the application has been implemented and fully tested, it was identified that the process selected and the final version of the system should be evaluated. The process evaluation is concerned with how the process selected was followed and whether the selected process was suitable for building CITYs alumni web site. 3 days were allocated for evaluation. Finally, after everything would have been finished, 15 days were allocated for review. The review is necessary in order to improve the code that has been implemented and to correct and mistakes that could have been made in each phase of the Waterfall model.
23
4. Analysis
4.1 Current Situation at CITY
Currently CITY has an alumni office however all the procedures are handled manually. The information about the graduated students is kept on paper. Because everything is done manually it is very difficult for CITY College to keep track of the careers of their former students. Furthermore, it is almost impossible for the graduated students to find information about other former students, which means that they might eventually lose contact. If a person wants to find some information concerning a former student for any reason, s/he will have to contact the head of the alumni office and the head of the alumni office will have to find the proper document manually. Furthermore, if an alumni student wants to update his/her profile, s/he will have to contact the alumni office by telephone and tell the alumni officer to manually modify the profile. This is very impractical and time consuming. Additionally, it is very difficult for CITY College to offer services and benefits for the graduated students which is a crucial issue for every university. The above stated issues can be taken care of by building an online alumni community. Thats why it is crucial for CITY College to have a functional alumni web site as soon as possible.
24
The following table presents the different types of user together with the functionalities that they can access. The functionalities will be described in detail in the next section.
User Non-member -
Functionality view news view events view alumnus of the month register view news view events view alumnus of the month log in view personal profile find member update profile view news view events view alumnus of the month log in find member add/modify/remove news add/modify/remove event add alumnus of the month broadcast e-mail view news view events view alumnus of the month log in find member add/modify/remove news add/modify/remove event add alumnus of the month broadcast e-mail add alumni officer
Member
Alumni officer
Administrator
25
26
4.2.2.1 Register
Use Case: Register Non-member Actors The user should not already be a member and the user should have graduated on CITY Preconditions College. Postconditions A new member is registered and his/her profile is created. A new member of the online alumni community is created together with his/her profile. Description Action Num. User System Main Success Scenario Inserts name. 1. Inserts department 2. Inserts year of graduation 3. Insert username. 4. Insert password. 5. Submit to the system. 6. Checks if the combination of the name 7. and the fathers name exists in the database where information about the former students are stored. Checks if the combination of the 8. username and password are already taken by another member. Creates a new profile which is empty. 9. Retrieves name, birth date, department, 10. year of graduation and degree from the database of former students and adds them to the profile. Saves the profile to the database together 11. with the username and password. Sends a confirmation message back to the 12. new member. Extension The combination of the name and id does 7a not exist in the database Informs the user that s/he can not become 7a.1 a user. The combination of the username and 8a password already exists in the system. Notifies the user. 8a.1 Inserts new username. 8a.2 Inserts new password. 8a.3 Submits the new username and password to 8a.4 the system. High Priority Critical Risk Use Case Table 4.1 Register
27
Every person that has graduated on CITY College can become a member of the online community. In order to become a member a person needs to fill in the new member form. The person will have to insert his/her name, department, year of graduation, user name and password. First of all, the system will check if the combination of the name, department and year of graduation exist in the database of former students. If the combination does not exist the system will notify the user that s/he can not become a member of the alumni web site. Second of all, the system will check if the combination of the username and password are already taken by another person. If the combination of the username and password is not available, the system will notify the user and the user will choose a different username or password. Otherwise, a new member will be created together with his/her profile. When the profile is created, the system will automatically add the name, department and year of graduation. The other attributes of the profile will be empty when the profile is created. In order to fill all the necessary information the member will have to use the update profile functionality. 4.2.2.2 Log In
Use Case: Log In Administrator, Alumni officer, member The user should not be already logged in the system The user logs in to the system. The users can log in the system in order to use the functionalities that the online community offers. User System Main Success Scenario Insert username. Insert password. Submits username and password Checks weather the combination of the username and password exists in the database. Extension The combination of the username and password that were inputted do not exist. Confirmation message is sent back to the user. Inserts username Insert password Submit to the system. High Critical
28
The members of the alumni web site, the alumni officers and the administrator of the system can log in, in order to use the functionalities that the application will offer. They can log in by inputting their user name and password. The system will check if the combination of the username and password is valid. If it is not valid, the user will be notified and s/he will be able to try to log in again. If the username and password are valid, a person will be logged in. 4.2.2.3 Add News
Use Case: Add news Alumni officer, Administrator Actors The alumni officer or the administrator must be logged in. Preconditions Postconditions News is added to a list of local or non-local news. The alumni officer or the administrator adds some news to the web site. Description Action Num. User System Main Success Scenario Select the type of news. 1. Insert title. 2. Insert description. 3. Submit to the system. 4. Indexes the news. 5. Adds the news to the list of local on non6. local news depending on the choice of the user. Confirmation message is sent back to the 7. user. High Priority Critical Risk Use Case Table 4.3 Add news
The alumni officers and the administrator of the system will be able to add news. There are two types of news, local and non-local.. News is consisted of a title and a description. After the type of news has been selected, the title and a short description should be added and submitted to the system. The system will index the news and it will add the news to the list of local or non-local news, depending on the choice that the alumni officer or the administrator will make and it will notify the user. The index will be a number which is derived from the number of events in the list plus one. It is used for ordering the news in the list.
29
The alumni officers and the administrator of the system will be able to modify the news. First of all, the view news link should be selected and the system will generate a list of news and send it back to the person that had this request. Next to every news in the list, modify and a remove link will be located. The modify link has to be selected next to the news that needs to be modified. After that, the alumni officer or the administrator will input a new title or a new description. The new information will be submitted to the system. The system will update the selected news and will send back a confirmation message back to the user. 4.2.2.5 Remove news
Use Case: Remove news Alumni officer, Administrator Actors Preconditions The administrator or the alumni officer must be logged in. Postconditions The selected news are removed from the database The alumni officers or the administrator can remove news from the web site Description Action Num. User System Main Success Scenario Select the remove link next to the news 1. that needs to be modified. Removes the selected news from the 2. database. Confirmation message is sent back to the 3.
30
user. Priority Risk Medium Medium Use Case Table 4.5 Remove News
The alumni officers and the administrator of the system will be able to remove news. The view news link should be selected and the system will generate a list of news. Next to every news, modify and remove link will be located. The user will select the remove link next to the news that needs to be removed. After that the system will remove the selected news from the database and it will send a confirmation message back to the person that had this request. 4.2.2.6 View News
Use Case: View news Non-member, Member, Alumni officer, Administrator Actors Preconditions At least one news must exist in the database Postconditions A list of news is generated. The users can view all the news that has been added by the alumni officer. Description Action Num. User System Main Success Scenario Selects the News link. 1. Checks whether news exists in the list of 2. news. Generates the list of news and orders the 3. news according to the index Sends the list of news back to the user. 4. Extension The list of news is empty 2a Confirmation message is send back to the 2a.1 user telling him/her that the list of news is empty. High Priority Critical Risk Use Case Table 4.6 View News
Each type of user can view both the local and non-local news that has been added by an alumni officer or the administrator. The user will select the view news link and then the system will generate a list of news and send it back to the user. The order of the news in the list will be arranged according to the index that is stored when the news has been added. The last news that has been added will be the first one in the list and the first news that has been added will be the last one in the list. Furthermore, the user will be able to choose whether to see all news, only the local news or only non-local news.
31
4.2.2.7 Add Event The alumni officers and the administrator of the system will be able to add an event. There are two types of events, local and non-local. An event is consisted of a title, description, date and time. The alumni officer or the administrator will select the type of event and then input the necessary information and submit them to the system. The system will add a new event in the list of events and send back a confirmation message to the user. 4.2.2.8 Modify event The alumni officers and the administrator of the system will be able to modify the events. First of all, the view events link should be selected and the system will generate a list of events and send it back to the person that had this request. Next to every event in the list, modify and a remove link will be located. The modify link has to be selected next to the event that needs to be modified. After that, the alumni officer or the administrator will input a new title, description, date or time. The new information will be submitted to the system. The system will update the selected event and will send back a confirmation message to the user.
4.2.2.9 Remove event The alumni officers and the administrator of the system will be able to remove events. The events link should be selected and the system will generate a list of events. Next to every event, modify and remove link will be located. The user will select the remove link next to the event that needs to be removed. After that the system will remove the selected event from the database and it will send a confirmation message back to the person that had this request.
4.2.2.10 View event Each type of users can view both the local and the non-local events that have been added by the alumni officer or by the administrator. The user will select the events link. The system will check the list of the selected type of events. If the list is empty, the user will be notified. Otherwise, the system will generate a list of all events. The event will be ordered in the list by the time that they will occur. An event that is earliest will be the first one in the list and an event that has the latest time will be the last one in the list.
32
Use Case: View profile Member Actors Preconditions The member needs to be logged in the system. Postconditions The information of the profile are retrieved from the database The users can view their personal profiles. Description Action Num. User System Main Success Scenario Selects my profile link. 1. Retrieves the information of the profile 2. from the database. Send the profile back to the person that 3. had this request. High Priority Critical Risk Use Case Table 4.7 View Profile
The members of the alumni web site can view their personal profiles. A member needs to select the my_profile link. The system will retrieve the information of the profile from the database and return them back to the user. 4.2.2.12 Update Profile
Use Case: Update Profile Member Actors Preconditions The member must be logged in. Postconditions The profile of a member is updated. The members can update some of the information in their profile. Description Action Num. User System Main Success Scenario Inserts date of birth(optional) 1. Inserts occupation (optional). 2. Inserts former employment (optional). 3. Inserts current employment (optional). 4. Insert e-mail address (optional) 5. Inserts telephone (optional). 6. Inserts address (optional). 7. Submits information to the system. 8. Updates the profile with the new 9. information. Sends a confirmation message back to 10. the user. High Priority Critical Risk Use Case Table 4.8 Update Profile
33
The members of the online community can update their profile. They should be able to modify the date of birth, former employment, current employment, occupation, telephone, email and address. The user will input the information that need to be change and submit them to the system. The system will update the profile and send a confirmation message back to the member. 4.2.2.13 Find member
Use Case: Find Member Member, Alumni Officer, Administrator Actors The user needs to be logged in to the system. Preconditions Postconditions A list of names matching the criteria is generated. A member, alumni officer or the administrator can search for another member of the Description alumni community and see the information of his/her profile that are public. Action Num. User System Main Success Scenario Insert name (optional) 1. Insert department (optional). 2. Insert year of graduation (optional). 3. Submit to the system. 4. Searches for the people in the database 5. that will match the inputted criteria Sends a list of all people together with the 6. information of the profile that match the inputted criteria back to the user Extension There isnt any person that matches the 5a criteria. Confirmation message is send back to the 5a.1 user telling him/her that there are no people that match the inputted criteria. High Priority Critical Risk Use Case Table 4.9 Find Member
The members of the alumni web site, the alumni officers and the administrator of the system can search for a member of the web site. They need to be able to view the profile of the person that they are searching for. The person that searches for a member of the alumni web site will insert the name, department or the year of graduation and s/he will submit to the system. The system will search in the database if people exist that will match the inputted criteria. If no people exist the user will be notified. Otherwise, the system will generate a list of all people that match the criteria and the list would be sent back to the person that had sent the request (see Appendix C Figure C8).
34
4.2.2.14 Add Alumnus of the Month The alumni officer and the administrator of the system should be able to add the alumnus of the month. The alumnus of the month is consisted of a picture of that person (optional), name, department, year of graduation, month, year and a description of why has that person been selected to be the alumnus of the month. The alumni officer or the administrator should input all the necessary information.
4.2.2.15 View Alumnus of the Month Each type of users will have access to this functionality. They should be able to see the name of the alumnus, picture, department, year of graduation, month, year and description of the reason why this person was selected to be the alumnus of the month. When the alumnus of the month link is selected the system will send the alumnus students of each month back to the user.
Use Case: Broadcast e-mail Alumni officer, Administrator Actors The alumni officer or the administrator must be logged in Preconditions Postconditions An e-mail is sent to each member of the system. The alumni officer or the administrator can send an e-mail to all the members of the web Description site. Action Num. User System Main Success Scenario Select the broadcast e-mail link. 1. Insert subject. 2. Insert message. 3. Submit to the system. 4. Retrieve all the e-mails of all members of 5. the system. Sends e-mail to each e-mail address that 6. was retrieved from the database. Confirmation message is sent back to the 7. user. Low Priority Low Risk Use Case Table 4.10 Broadcast Email
35
The alumni officers and the administrator of the system need to be able to send e-mail to every member of the alumni web site. It is impossible to send e-mail to every member of the alumni web site at the same time if the system does not offer broadcast e-mail functionality. When this functionality is used, the system will retrieve the e-mails of all the members from the database and an e-mail will be sent to all of them. 4.2.2.17 Add Alumni Officer
Use Case: Add Alumni Officer Administrator Actors Preconditions The administrator must be logged in. Postconditions An alumni officer is added to the system. The administrator will be able to add an alumni officer. The alumni officer will be the Description person responsible for maintaining the web site. Action Num. User System Main Success Scenario Inserts name 1. Insert username. 2. Inserts password. 3. Submits to the system 4. Check weather the combination of the 5. username and password already exist in the database. Checks whether the username is already 6. taken by another alumni officer. Creates the new alumni officer. 7. Send a confirmation message back to the 8. administrator Extension The combination of the username and 5a password already exist in the database Notifies the administrator. 5a.1 Insert new username. 5a.2 Insert new password. 5a.3 Submits to the system. 5a.4 High Priority Critical Risk Use Case Table 4.11 Add Alumni Officer
The administrator should be able to create an alumni officer. The alumni officer is the person which is in charge of maintaining the web site. The administrator will add the name, user name and password of the alumni officer. The system will check in the database if the combination of the username and password are already taken by another member. If the username and password are not available the system will notify the administrator to input another username or password. Otherwise, an alumni officer will be created and a confirmation message will be sent to the administrator.
36
5. Design
5.1 Design of the database
5.1.1 Entity Relationship Diagram (ERD)
37
The EVENT entity contains all the information that forms an event. The attributes of the EVENT entity are: index, which is also the primary key, type, description, title, and a compound attribute time. The time has four attributes: Hour, Minutes, Month and Day. The EVENT entity does not have a relation to any other entity of the database. 5.1.2.2 The NEWS Entity
38
A NEWS entity should be created in the database because all the information that forms the news will be stored in this entity. The NEWS entity has four different attributes: The Id, ehich is also the primary key of this entity, title, description and type. The NEWS entity does not have a relation to any other entity in the database.
The USER entity will be used to store some information of the different types of users of the system. This entity has five attributes: Id, which is the primary key, password, username, type and name. The USER entity contains on relation. It is related to the MEMBER entity because the user of the system can be a member of the online community. 5.1.2.4 The MEMBER Entity
39
The reason why the MEMBER entity is identified is because this entity will hold all the information of the profiles of the members, except for the username and password which is stored in the USER entity. The MEMBER entity contains the following attributes: Id, which is the primary key, name year of graduation, address, telephone, e-mail, employment, former employment, occupation, department and a compound attribute birth date. The birth day attribute contains three attributes: day, month and year. The MEMBER entity has one relation. It is related to the ALUMNUS OF THE MONTH entity because a member of the system will be the alumnus of the month. 5.1.2.5 The ALUMNUS OF THE MONTH Entity
The ALUMNUS OF THE MONTH entity is identified because the information concerning the alumnus of the month will be stored here. The ALUMNUS OF THE MONTH entity contains eight attributes: Index, which is the primary key of the entity, name, department, year of graduation, month, year, photo and description. This entity has on relation. It is related to the MEMBER entity because a member is the alumnus of the month.
40
the MEMBER entity that will serve as a secondary key to the ALUMNUS OF THE MONTH entity.
41
The CITYs alumni web site will be installed on CITYs Web server. A client of the web site can be every person that has an internet connection. The clients will access the web server through CITYs firewall. They will send requests to the firewall and the firewall will access the web server where the system will be stored. Furthermore, CITYs alumni web site will be connected to the MySQL Relational Database where all the related information that is needed will be added and stored. So, a client sends request to the firewall, the firewall contacts the web server where the web site is installed and adds or accesses the information which are stored in the database.
42
6. Implementation
The following chapter is mainly concerned with the implementation of the application. The technologies and tools that were used for the implementation will be briefly discussed and the reason why they were chosen will be justified. Furthermore, the implementation flow and decisions and the development process will be described in detail.
The disadvantages of PHP are: 6.1.2 Active Server Pages (ASP) ASP is a server-side scripting platform which is developed by Microsoft. The default scripting language is VBScript, however many other languages can be used, for example JavaScript. ASP is a technology for developing dynamic and interactive web pages. Active The security holes are well known so if the developer does not take some steps to close these holes, the web site can be easily attacked. It is not a 100% Object oriented scripting language, meaning that object oriented programming with PHP is difficult to achieve.
43
Server Pages is a technology that allows for the programmatic construction of HTML pages just before they are delivered to the browser [4]. The advantages of ASP are: It is fast and reliable. It offers many levels of security which means that it is protected from attacks. It can be connected to many database management systems such as Oracle, MySQL, etc. The technology is regularly updated.
The disadvantages of ASP are: The syntax of the scripting languages that can be used is difficult and also it is difficult to understand it. Recovering from a bad ASP selection decision can be expensive and time consuming.
6.1.3 Java Server Pages (JSP) JSP is a scripting technology that allows rapid web development that is dynamic and easily maintainable [5]. JSP is an extension of the Java Servlet technology. JSP controls the appearance of a web site using servlets, which are small programs that run on a web server. These programs modify a web site before it is sent to some user. The syntax of JSP is a combination of HTML and XML syntax. The advantages of JSP are: It is fast and reliable. Very big application can easily be developed. It can easily be connected to many database management systems. It is secure which means that it has a protection from attacks.
The disadvantages of JSP are: JSP sites require almost the double amount of memory than other scripting languages such as PHP or ASP in order to hold a page. A person must have knowledge in java in order to understand JSP. JSP pages are compiled on a server when they are first accessed which means that the pages will take a while to load when they are used for the first time.
44
6.1.4 Ajax Ajax is scripting language which is derived from grouping of more different technologies and it is used to create interactive web applications [6]. Ajax is also known as asynchronous JavaScript and XML. In order to use Ajax technology, a person must possess great knowledge in JavaScript and XML. Unlike other technologies, Ajax lowers the times that a computer needs to connect to the server, because scripts need to be requested only one time. The advantages of using Ajax are: Reduces required bandwidth The time required to load a page is really low. Can be easily connected to many database management systems.
The disadvantages of using Ajax are: Some older browsers do not support Ajax. Ajax developed applications can not be accessed by all browsers because each browser has different implementation of the XMLHttpRequest object. It is sometimes difficult to test because standards for Ajax programming have not been still have not been accepted.
6.1.5 Summary
As I mentioned above all of the most commonly used technologies can be used to develop Citys alumni web site. The best choice for building the alumni web site is Hypertext Preprocessor (PHP). There are many reasons why PHP is the most suited technology for the alumni web site. First of all, ASP is not a good choice because recovering form a bad ASP decision is found to be very difficult. Second of all, JSP is not a good choice because it requires double the amount of memory in order to load a page that other scripting languages such as PHP or ASP. Third of all, Ajax is not the best choice because Ajax built application can not be accessed by all browsers and because standards for programming do not exists for this technology. Furthermore, PHP is fast and stable. The language is very simple which means that it is very easy to use it and understand it. It is of great advantage that PHP has an online community that offers support. If some problems or difficulties are faced, help can be asked on the forum of the community. However, it is very important to take security measurements in each phase of the software development life cycle in order to avoid the security pitfalls, because the security holes in PHP are very well known.
45
46
47
After the interface of the web site was finalized, each functionality that the system should offer was implemented following the use cases and the informal specifications that were covered in the Analysis chapter. After the complete functionality set had been implemented, all the parts were integrated together in order to create the final complete version of the alumni web site.
The connectDatabase page is created in order to establish a connection to the server and to select the database where all the information related to the alumni web site will be stored. A connection to the mySql server is opened using the built in function of PHP mysql_connect(), which accepts as parameters the location of the mysql server and the username and password of a user of the database. After an connection to the mysql server has been established, the database is selected using the built in function mysql_select_db(), which accepts as parameter the name of the database and the database server reference. The connectDatabase.php file is used by any function where a connection to the database is required. The code of the file is added to the pages that need to establish a connection to the database using the built in function require(). The require() function accepts one parameter, which is the name of the file that needs to be added.
48
6.3.2 Register The register.php page is used in order for a person to become a member of the system. After the user inputs the requested information, the page is redirected to another function called register.php. This function does all the work. First, a connection is established to the database where the information concerning the former students of CITY are stored. The system gets the input from the user using the built in function $_POST[], which accepts as parameter the name of an input fields and searches the database of former students. If the inputted information are found in the database of former students, they will be added to the alumni database using the INSERT INTO query. PHP contains a built in function mysql_query(), which accepts as a parameter an Sql query and is used to insert or retrieve data from or to any table identified in the database. The name, department and year of graduation will be added to the member table, together with the id of the member which is automatically added. After that, the inserted username and password will be added to the user table together with the name and id of the member, which will serve as a reference to the member. The value of the id attribute of the member table will always be equal to the memberID attribute from the user table. Furthermore, the type of user will be automatically set to former student when the information are stored in the user table. If the user registers, s/he will be redirected to the login.php page. Otherwise, an message will appear stating that the user is not able to register and s/he will be redirected to the register.php page again, using the built in function header() which accepts as parameters a command and an URL or a path. In our case, the command will be Location: (see full code - Appendix C C1 register.php).
<?php $result = mysql_query("Select * From students WHERE name = '$name' && department = '$department' && yearofgraduation = '$year'"); $num=mysql_numrows($result); if($num!=0) { $nname = mysql_result($result,$i,"Name"); $ddepartment = mysql_result($result,$i,"Department"); $yyear = mysql_result($result,$i,"YearOfGraduation"); $dhost="localhost"; $duser="root"; $dpass=""; $ddatabase=mysql_connect($dhost,$duser,$dpass); $db=mysql_select_db("database", $ddatabase); mysql_query("INSERT INTO member (name, department, yearofgraduation) VALUES ('$nname','$ddepartment','$yyear')"); $result = mysql_query("SELECT * FROM member WHERE name='$nname' && department='$department' "); $row = mysql_fetch_array($result); $memberid = $row['ID']; mysql_query("INSERT INTO user (memberID, type, username, password, name) VALUES ('$memberid', 'formerstudent','$username','$password','$nname')"); mysql_close($ddatabase); header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/loggin.php'); }
49
?>
6.3.3 Log In The login.php page is used in order for the users to be able to log into the system and be able to use the functionalities that the online community offers. After a user inserts username and password, the page is redirected to select.php. In the select.php file, the first thing that it is done is the username and password inputted by the user are retrieved. After that, the system checks to see if there is a row in the user table that matches the input given by the user. If a user with the inserted username and password exists, the id of the user will be saved until the user decides to log off. In order to save the id of the user until s/he logs off, the $_SESSION[] function was used, that accepts as a parameter a string. In order to save the value of the id, the value has to be set to the $_SESSION[] function ($_SESSION[id] = row[ID]). After the id of the user that logged in has been saved, the page will be redirected depending on the type of the user. The reason why the type of user affects which page should be redirected is because the users dont have access to all the functionalities that the system offers. For example, if the type of user is member, the page will be redirected to homeMember.php, where some links will be found that lead to the functionalities that can be accessed by the member user. The links that lead to functionalities that can not be accessed by the member user will not appear on the web site. If the user is alumni officer or administrator, different links will be displayed. In this way, the access restriction for the different type of users of the application is solved. (see full code - Appendix C C-2 logIn.php)
<?php session_start(); require("1.php"); db_connect(); $user=$_POST['user']; $pass=$_POST['pass']; $sql = "SELECT * FROM user WHERE username LIKE '$user' AND password LIKE '$pass'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $id=$row['ID']; $type=$row['Type']; $_SESSION['id']=$row['ID']; if($type=='formerstudent') { header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/homeMeber.php'); exit; } else if($type=='alumniOfficer') { header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/homeAlumniOfficer.php'); exit; } else {
50
6.4.4 Find Member The findMember.php page is used to find information about a former student which is a member of the web site. First of all, the user should input the name, department and/or year of graduation. All fields are optional. After the user inputs data, the system will retrieve the inputted information and it will make a search in the member table to see if there are any members that match the inputted criteria. The search is done using the SELECT Sql statement. If a person that matches the inputted criteria is not found, the user will be notified that no such person exists in the database. Otherwise, the system will output all the people that match the criteria. All members that match the criteria are printed using a while loop, in order to go through all the rows. Another reason why the while loop was necessary is in order to temporarily store the id of the members that matched the criteria. The id is required in order to be able to retrieve all the information of the profile of a user. If the user wants to see all the information that are found in the profile of the member, the view profile link which is located next to each person needs to be accessed. When the view profile link next to a member is selected, the page will be redirected to viewProfile.php and a value for the index will be sent. The page viewProfile.php page will retrieve the id which was passed by the findMember.php function. The value of the id is used to retrieve all the information of the selected members profile. Finally, all the information of the profile of the selected member are outputted to the user. (see full code - Appendix C C-3 findMember.php)
<?php require(connectDatabase.php); $name=$_POST['name']; $department=$_POST['department']; $year=$_POST['year']; $result= mysql_query("SELECT * FROM member WHERE name LIKE '%$name%' && department='$department' && yearofgraduation='$year'"); $num=mysql_numrows($result); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $nname=mysql_result($result,$i,"Name"); $department=mysql_result($result,$i,"Department"); $yearofgraduation=mysql_result($result,$i,"YearOfGraduation"); echo "Name:<b>$nname <br> Department: $department<br> Year of Graduation: $yearofgraduation <br> <a href=viewProfile.php?id=$id>view profile</a> <br><br>"; $i++; } ?>
51
6.4.5 View Personal Profile The viewPersonalProfile.php page is used by a member in order to see his/her profile. The id of the member needs to be found in order to access the correct row in the member table. In order to find the id of the member, the id of the user which is stored in the $_SESSION[] function is retrieved and stored in a variable. After that, the user id is used to select the corresponding member id from the user table. When the member id is retrieved, the following query is passed to the database Select * FROM member WHERE id = memberid. This query selects everything from the member table where the id attribute is equal to the member id.
<?php session_start(); $id=$_SESSION[id]; require("1.php"); db_connect(); $query = mysql_query("SELECT * FROM user WHERE id = '$id'"); $roww = mysql_fetch_array($query); $memberid=$roww['MemberID']; $result = mysql_query("SELECT * FROM member WHERE id = '$memberid'"); $row = mysql_fetch_array($result); $name=$row['Name']; $department=$row['Department']; $yeargr=$row['YearOfGraduation']; $day=$row['Day']; $month=$row['Month']; $year=$row['Year']; $occupation=$row['Occupation']; $employment=$row['Employment']; $former=$row['Former Employment']; $address=$row['Address']; $email=$row['Email']; $telephone=$row['Telephone']; echo "Name:<b>$name <br> Department: $department<br> Year of Graduation: $yeargr <br> Birth date: $day $month $year <br> Occupation: $occupation <br> Employment: $employment <br> Former Employment: $former <br> Address: $address <br> E-mail: $email <br> Telephone: $telephone"; ?>
6.4.6 Update Profile The updateProfile.php is used by a member in order to update the information of his/her personal profile. The id of the user is stored using the $_SESSION function. In order for the member to be able to update his/her profile the value of the session is retrieved and stored in a variable. The value of the id in session is used to retrieve the member id which is located in the user table. After the member id has been found, it is used in order to set a condition for which row of the member table to be retrieved. The information that are found
52
will be displayed in the corresponding html input fields. After, the user can change the information that are found in the fields and submit them to the system. The system will then update the member table where the attribute id is equal to the member id which was found in the user table. (see full code - Appendix C C-4 updateProfile.php)
<?php session_start(); require("1.php"); $idd = $_SESSION['id']; db_connect(); $result = mysql_query("SELECT * FROM user WHERE ID = '$idd'"); $row = mysql_fetch_array($result); $memberId = $row['MemberID']; $result = mysql_query("SELECT * FROM member WHERE ID = '$memberId'"); $num = mysql_numrows($result); $row = mysql_fetch_array($result); if(isset($_GET['action']) && $_GET['action'] == "update") { $day=$_POST['day']; $month=$_POST['month']; $year=$_POST['year']; $occupation=$_POST['occupation']; $employment=$_POST['employment']; $formeremployment=$_POST['formeremployment']; $address=$_POST['address']; $email = $_POST['email']; $telephone = $_POST['telephone']; $sql = "UPDATE member SET Day='$day', Month = '$month', Year = '$year', Occupation = '$occupation', Employment = '$employment', `Former Employment` = '$formeremployment', Address = '$address', Email = '$email', Telephone = '$telephone' WHERE ID = '$memberId';"; $result = mysql_query($sql); <?php
6.4.7 Add alumni officer The addAlumniOficer.php is used by the administrator in order to create an alumni officer that is going to be in charge of maintaining and modifying the web site. The administrator should add the name of the alumni officer and the username and password. The system will then check if the username and password are already taken by another user of the system. If the username and password are already taken, the administrator would be asked to enter a new username and password. Otherwise a new user will be added in the user table and the type would be automatically set to alumni officer. After the alumni officer has been created, the administrator will be redirected to the homeAdmin.php page.
<?php require(connectDatabase.php); $user=$_POST['user']; $pass=$_POST['pass']; $name=$_POST['name'];
53
mysql_query("INSERT INTO user (type, username, password, name) VALUES ('alumniOfficer','$user','$pass','$name')"); ?>
6.4.8 Broadcast e-mail The broadcatEmail.php page will be used in order to send an e-mail message to all the members of the alumni web site. The user of this functionality needs to input only the subject of the message and the actual message. The input by the user will then be temporarily stored by the system In order to make this functionality work, the built in mail() function was used. The mail() function accepts four parameters: the recipient e-mail address, the subject, the message and possibly header, which contains information such as the format of the e-mail. The input inserted by the user will be passed to the mail() function to satisfy the second and the third parameter. Finally, all the e-mail addresses are retrieved from the member table and are added to the mail() function as the first parameter.
<?php require("1.php"); db_connect(); $message = $_POST['message']; $message = wordwrap($message, 70); $title = $_POST['title']; $from = 'Alumni Officer'; $sql = "SELECT * FROM member"; $res = mysql_query($sql) or die(mysql_error()); $to = ''; while($row = mysql_fetch_array($res)) { $to = $row['Email']; mail($to,$title,$message); } ?>
6.4.9 View events Different page will be accessed depending of the type of the user that is logged in. This means that the member user has a different view than the alumni officer or the administrator. If the type is member or non-member, when the view events link is chosen, all the events will be outputted unless the events table is empty. The events are selected from the events table using the SELECT Sql statement and are outputted using a while loop, in order to go through and print every event and to store the id of the event in the case when the type of user will be alumni officer or administrator. The events will be ordered by the date and time on which they are going to occur. If the type of user is administrator or alumni officer, a modify and a remove link will be located next to every event. The view news and view alumnus of the month functionality are based on this very same method.
<?php
54
require("connectDatabase.php"); $query="SELECT * FROM event"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; while ($i < $num) { $title=mysql_result($result,$i,"title"); $hour=mysql_result($result,$i,"hour"); $minute=mysql_result($result,$i,"minute"); $day=mysql_result($result,$i,"day"); $month=mysql_result($result,$i,"month"); $description=mysql_result($result,$i,"description"); echo "Title:<b>$title <br> Time:$hour : $minute<br>Date: $day $month<br>Description: $description<br>"; echo"<a href=deleteEvent.php?index=$index>delete</a> <br>"; echo "<a href=modifyEvents.php?cmd=modify&&index=$index>modify</a> <br>"; $i++; } ?>
6.4.10. Add event The addEvent.php page will be used to add a new event to the event table. The user must input all the required information. The system will retrieve the inputted information from the input fields using the $_POST[] built in function of PHP and it will create and insert a new event in the events table. The add news and add alumnus of the month functionality are based on the same principal. (see full code - Appendix C C-5 addEvent.php)
<?php require("connectDatabase.php"); $type=$_POST['type']; $title=$_POST['title']; $hour=$_POST['hour']; $minutes=$_POST['minutes']; $day=$_POST['day']; $month=$_POST['month']; $description=$_POST['description']; mysql_query("INSERT INTO event (type, title, hour, minute, day, month, description) VALUES ('$type','$title', '$hour', '$minutes', '$day','$month', '$description')"); ?>
6.4.11. Modify event In order for the alumni officer or the administrator to modify some events, they have to select the link that leads to viewEventsAdmin.php page. By selecting this link, all the events are outputted and a modify and remove link is placed next to every event. As mentioned in the View Events section, a while loop is used in order to print and to store the index of each news. The modify link has to be selected next to the event that needs to be changed. By selecting the modify link, the appropriate index is sent to the modifyEvent.php page. First of all, the information concerning the selected event will appear on the html input fields. If the user changes the information, the selected event will be modified using the UPDATE Sql statement. Finally, the page will be redirected back to the
55
viewEventsAdmin.php page. The modify news functionality is implemented on the very same way. (see full code - Appendix C C-6 modifyEvent.php)
<?php require("connectDatabase.php"); $type=$_POST['type']; $title=$_POST['title']; $hour=$_POST['hour']; $minutes=$_POST['minutes']; $day=$_POST['day']; $month=$_POST['month']; $description=$_POST['description']; $index = $_GET['index']; $sql = "UPDATE member SET Day='$day', Month = '$month', Year = '$year', Occupation = '$occupation', Employment = '$employment', `Former Employment` = '$formeremployment', Address = '$address', Email = '$email', Telephone = '$telephone'WHERE ID = '$memberId';"; $result = mysql_query($sql); ?>
6.4.12 Remove event As for the modify event functionality, the remove functionality is implemented on a similar manner. First of all, the viewEventsAdmin.php should be selected. After that, the remove link next to the event that needs to be removed should be selected. By selecting this link, the corresponding index will be passed to the removeEvents.php function. This function removes from the table events where the index is equal to the index that was received. After the event has been deleted, the user will be redirected back to the viewEventsAdmin.php page. The remove news and the remove alumnus of the month functionality are based on the same method.
<?php if(isset( $_GET['index'])) { require("connectDatabase.php"); $index = $_GET['index']; mysql_query("DELETE FROM `database`.`event` WHERE `event`.`Index` = $index LIMIT 1 ") or die(mysql_error()); mysql_close($database); } ?>
56
7. Testing
This chapter is concerned with the testing phase of the software. The techniques used to test the application are presented and described. Both White Box and Black box testing techniques have been used.
57
After the inputs have been identified together with the desired outputs, the Integration testing was started. The predetermined inputs were passed to the system and the outputs which were received were compared to the outputs that were previously determined. Some bugs were identified and have been taken care of at once using the Integration testing technique.
58
8. Evaluation
8.1 Process and plan evaluation
This section is mainly focused on the evaluation of the Waterfall model which was applied for the development of the application. Furthermore, some information about whether the guidelines of the project plan which was created at the beginning of the development process were followed.
59
system did not change at any point, no major problems and difficulties were faced. The Waterfall model was identified to be the simplest and most efficient software development process that could be applied to the alumni web site project. Another reason why the Waterfall model turned out to be the most suitable software development process for the development of the alumni web site is because the Waterfall model is sequential, meaning that each phase has its own life time and one phase can not be started before the phases that come before have been finished. This means that before the actual implementation was started, the analysis and design of the project were finalized and described in detail. This was proved to be very useful because the requirements and the design of the database were clear, which lead to simplification of the implementation phase.
60
61
Separate forums must be created for each department. The forum could also be used to ask some question. 9.1.4 Setting personal information private or public Some people would not like the idea that their information could be seen by everybody that is a member of the alumni web site. That is why it would be useful to be able to set some information, such as the contact details as private or public. This could be done very easy with the use of radio buttons.
9.2 Summary
The development of the web site started with the interview with the alumni officer of City College. After the user requirements were captured, literature review was conducted about related work in order to better understand the role of an alumni web site and to get some ideas concerning how the interface should look like. Further on, the software development process selected for developing the alumni web site was the Waterfall model. The tasks that had to be completed in each phase of the Waterfall model were identified right after the process has been selected. The analysis of the system identifies the different type of users and their access to the functionalities and presents a detailed picture of the functionalities by developing the non-formal specifications for the user requirements and by developing use cases. The design of the application mainly focuses on the design of the database and also briefly describes the architecture of the web based application. Further on, the implementation chapter contains information about the tools and technologies that were used and are required in order for the application to run. The implementation process is then described and some essential code was presented. After the application has been implemented, it was tested in order to find some bugs and repair them. Three different testing techniques were used: Unit testing, Integration testing and System testing. Finally, after each phase of the waterfall model was completed, the system and the software engineering process which was chosen are evaluated.
62
10. Bibliography
[1] Software Development Process, Software Development Life Cycle , Innotechor, 2008 http://www.innotechor.com/software.php [2] Waterfall model, One stop testing 2003 2009 http://www.onestoptesting.com/sdlc-models/waterfall-model/ [3] PHP: What can PHP do?, What is PHP http://www.php.net/manual/en/intro-whatcando.php Last updated: Fri, 29 May 2009 [4] Dynamic web pages and ASP[ASP3wiki], Active Server Pages 3.0Wiki, 2003 http://asp3wiki.wrox.com/wiki/1-1-3-dynamic-web-pages-and-asp Last updated: 12 June 2003 [5] JavaServer Pages Overview Sun Developer Network (SDN), 2009 http://java.sun.com/products/jsp/overview.html [6] Moore, John (2008-07-07). "What is Ajax?". RIAspot.com. http://www.riaspot.com/articles/entry/What-is-Ajax-. Retrieved on 2008-07-07. [7] Bert Bos, Cascading style shits, W3C http://www.w3.org/Style/CSS/ Last updated $Date: 2009/04/24 [8] Charles Babcock "Sun Locks Up MySQL, Looks To Future Web Development". Information week http://www.informationweek.com/news/showArticle.jhtml?articleID=206900327. Retrieved on 2008-02-27. [9] The apache Software Fundation 2009 http://www.apache.org/ [10] Kolawa, Adam; Huizinga, Dorota (2007). automated Defect Prevention: Best Practices in Software Management. Wiley-IEEE Computer Society Press. p. 75. ISBN 0470042125. [11] What is Integration Testing? a Definition from WhatIs.com 2006 - 2009 http://searchsoftwarequality.techtarget.com/sDefinition/0,,sid92_gci1243430,00.html
63
Appendix A Interview
1. What does the Alumni web site currently offer? 2. What are the current problems than need to be solved? 3. What functionalities should the web site offer? 4. What are the different types of users of the system? 5. Which user has access to which functionalities? 6. How can the graduated students become members of the alumni? Automatically / Manually? 7. Do you have any specific ideas concerning the interface of the web site? 8. Should the web site offer different views for the different users? 9. What should a users profile consist of? 10. Does the site need to have some links not connected to the alumni? 11. If yes, what links should be added? 12. Should I interview someone except for some former students? 13. Is there something important that you would like to add that I have not asked?
64
Use Case: Add event Alumni officer, Administrator Actors Preconditions The alumni officer or the administrator should be logged in. Postconditions An event is added to the list of local or non-local events. A new event is added to the website. Description Action Num. User Main Success Scenario Select type of event. 1. Insert title. 2. Insert description. 3. Insert date. 4. Insert time. 5.
System
65
6. 7.
Submit to the system. Adds the event to the list of events Confirmation message is sent back to the user. High Critical Use Case Table B.2 Add Event
Priority Risk
B.3 Modify Event Use Case: Modify event Alumni officer, Administrator Actors Preconditions The administrator or the alumni officer must log in. Postconditions The selected event is modified The alumni officer or the administrator can modify the events Description Action Num. User System Main Success Scenario Select the modify link next to the event 1. that need to be modified. Insert title (optional) 2. Insert description (optional) 3. Insert date (optional) 4. Insert time (optional) 5. Submit to the system. Updates the title, the description, the date 6. and/or the time of the selected event Confirmation message is sent back to the 7. user. Low Priority Low Risk Use Case Table B.3 Modify Event
B.4 Remove Event Use Case: Remove event Alumni officer, Administrator Actors Preconditions The administrator or the alumni officer must be logged in Postconditions The selected event is removed from the database. The alumni officers or the administrator can remove event from the web site Description Action Num. User System Main Success Scenario Select the remove link next to the event 1. that needs to be removed. Removes the selected event from the 2. database. Confirmation message is sent back to the 3.
66
user. Priority Risk Medium Medium Use Case Table B.4 Remove Event
Use Case : View events Actors Preconditions Postconditions Description Action Num. 1. 2. Non-member, Member, Alumni officer, Administrator At least one event must exist in the list of events A list of events is generated. The users can view all the events that have been added by the alumni officer. User Main Success Scenario Selects events link Retrives the events from the database and sends them back to the user. Extension Priority Risk High Critical Use Case Table B.5 View Events System
67
C-1 register.php
<?php require("connectDatabase.php"); $name=$_POST['name']; $department=$_POST['department']; $year=$_POST['year']; $username=$_POST['username']; $password=$_POST['password']; if($name!=null && $department!=null && $year!=null && $username!=null && $password!=null) { $result = mysql_query("Select * From students WHERE name = '$name' && department = '$department' && yearofgraduation = '$year'"); $num=mysql_numrows($result); if($num!=0) { if($name!=null && $department!=null && $year!=null) { $nname = mysql_result($result,$i,"Name"); $ddepartment = mysql_result($result,$i,"Department"); $yyear = mysql_result($result,$i,"YearOfGraduation"); $dhost="localhost"; $duser="root"; $dpass=""; $ddatabase=mysql_connect($dhost,$duser,$dpass) or die(mysql_error()); $db=mysql_select_db("database", $ddatabase)or die(mysql_error()); mysql_query("INSERT INTO member (name, department, yearofgraduation) VALUES ('$nname','$ddepartment','$yyear')"); $result = mysql_query("SELECT * FROM member WHERE name='$nname' && department='$department' "); $row = mysql_fetch_array($result); $memberid = $row['ID']; mysql_query("INSERT INTO user (memberID, type, username, password, name) VALUES ('$memberid', 'formerstudent','$username','$password','$nname')"); mysql_close($ddatabase); header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/loggin.php'); } } else { header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/register.php'); echo "You have not graduated on CITY College";
68
} } else { if($name == null || $department == null || $year == null || $username == null || $password == null) { header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/register.php'); echo "Pleese fill in all the fields"; } } mysql_close($database); ?>
C-2 logIn.php
<?php session_start(); require("1.php"); db_connect(); $user=$_POST['user']; $pass=$_POST['pass']; $sql = "SELECT * FROM user WHERE username LIKE '$user' AND password LIKE '$pass'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $id=$row['ID']; $type=$row['Type']; $num = mysql_numrows($result); if(($user==null || $pass==null) || $num==0) { header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/loggin.php'); exit; } else if ($num != 0) { $_SESSION['id']=$row['ID']; if($type=='formerstudent') { header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/myProfile.php'); exit; } else if($type=='alumniOfficer') { header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/func/viewNews.php'); exit; } else { header('Location: '.$_SERVER['ROOT_DOCUMENT'].'/func/viewNewsAdmin.php'); exit; } } else {
69
C-3 findMember.php
<html> <body> <form action+"findMember.php" method=POST> Name: <input type=text name=name><br> Department: <input type=text name=department><br> Year of Graduation: <input type=text name=year> <br> <input type=submit value="Search"><p> </form> <?php require(connectDatabase.php); $name=$_POST['name']; $department=$_POST['department']; $year=$_POST['year']; if($name!=null && $department==null && $year==null) { $result= mysql_query("SELECT * FROM member WHERE name LIKE '%$name%'"); $num=mysql_numrows($result); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $nname=mysql_result($result,$i,"Name"); $department=mysql_result($result,$i,"Department"); $yearofgraduation=mysql_result($result,$i,"YearOfGraduation"); echo "Name:<b>$nname <br> Department: $department<br> Year of Graduation: $yearofgraduation <br> <a href=viewProfile.php?id=$id>view profile</a> <br><br>"; $i++; } } else if($name==null && $department!=null && $year==null) { $result= mysql_query("SELECT * FROM member WHERE department = '$department'"); $num=mysql_numrows($result); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $nname=mysql_result($result,$i,"Name"); $department=mysql_result($result,$i,"Department"); $yearofgraduation=mysql_result($result,$i,"YearOfGraduation"); echo "Name:<b>$nname <br> Department: $department<br> Year of Graduation: $yearofgraduation <br> <a href=viewProfile.php?id=$id>view profile</a> <br><br>"; $i++; } } else if($name==null && $department==null && $year!=null)
70
{ $result= mysql_query("SELECT * FROM member WHERE yearofgraduation = '$year'"); $num=mysql_numrows($result); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $nname=mysql_result($result,$i,"Name"); $department=mysql_result($result,$i,"Department"); $yearofgraduation=mysql_result($result,$i,"YearOfGraduation"); echo "Name:<b>$nname <br> Department: $department<br> Year of Graduation: $yearofgraduation <br> <a href=viewProfile.php?id=$id>view profile</a> <br><br>"; $i++; } } else if($name!=null && $department!=null && $year==null) { $result= mysql_query("SELECT * FROM member WHERE name LIKE '%$name%' && department='$department'"); $num=mysql_numrows($result); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $nname=mysql_result($result,$i,"Name"); $department=mysql_result($result,$i,"Department"); $yearofgraduation=mysql_result($result,$i,"YearOfGraduation"); echo "Name:<b>$nname <br> Department: $department<br> Year of Graduation: $yearofgraduation <br> <a href=viewProfile.php?id=$id>view profile</a> <br><br>"; $i++; } } else if($name!=null && $department==null && $year!=null) { $result= mysql_query("SELECT * FROM member WHERE name LIKE '%$name%' && yearofgraduation='$year'"); $num=mysql_numrows($result); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $nname=mysql_result($result,$i,"Name"); $department=mysql_result($result,$i,"Department"); $yearofgraduation=mysql_result($result,$i,"YearOfGraduation"); echo "Name:<b>$nname <br> Department: $department<br> Year of Graduation: $yearofgraduation <br> <a href=viewProfile.php?id=$id>view profile</a> <br><br>"; $i++; } } else if($name==null && $department!=null && $year!=null) { $result= mysql_query("SELECT * FROM member WHERE department='$department' && yearofgraduation='$year'"); $num=mysql_numrows($result);
71
$i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $nname=mysql_result($result,$i,"Name"); $department=mysql_result($result,$i,"Department"); $yearofgraduation=mysql_result($result,$i,"YearOfGraduation"); echo "Name:<b>$nname <br> Department: $department<br> Year of Graduation: $yearofgraduation <br> <a href=viewProfile.php?id=$id>view profile</a> <br><br>"; $i++; } } else if($name!=null && $department!=null && $year!=null) { $result= mysql_query("SELECT * FROM member WHERE name LIKE '%$name%' && department='$department' && yearofgraduation='$year'"); $num=mysql_numrows($result); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"ID"); $nname=mysql_result($result,$i,"Name"); $department=mysql_result($result,$i,"Department"); $yearofgraduation=mysql_result($result,$i,"YearOfGraduation"); echo "Name:<b>$nname <br> Department: $department<br> Year of Graduation: $yearofgraduation <br> <a href=viewProfile.php?id=$id>view profile</a> <br><br>"; $i++; } } mysql_close($database); ?> </body> </html>
C-4 updateProfile.php
<?php session_start(); require("1.php"); $idd = $_SESSION['id']; db_connect(); $result = mysql_query("SELECT * FROM user WHERE ID = '$idd'"); $row = mysql_fetch_array($result); $memberId = $row['MemberID']; $result = mysql_query("SELECT * FROM member WHERE ID = '$memberId'"); $num = mysql_numrows($result); $row = mysql_fetch_array($result); if(isset($_GET['action']) && $_GET['action'] == "update") { $day=$_POST['day']; $month=$_POST['month']; $year=$_POST['year']; $occupation=$_POST['occupation'];
72
$employment=$_POST['employment']; $formeremployment=$_POST['formeremployment']; $address=$_POST['address']; $email = $_POST['email']; $telephone = $_POST['telephone']; $sql = "UPDATE member SET Day='$day', Month = '$month', Year = '$year', Occupation = '$occupation', Employment = '$employment', `Former Employment` = '$formeremployment', Address = '$address',Email = '$email', Telephone = '$telephone' WHERE ID = '$memberId';"; $result = mysql_query($sql); if($result) header("Location:".$_SERVER['ROOT_DOCUMENT']."/myProfile.php"); else echo mysql_error(); } ?> <html> <body> <b><center>Update Profile</center></b><br><br> <table align=center> <form action="<?php echo $_SERVER['ROOT_DOCUMENT'] ?>/func/updateProfile2.php?action=update" method=POST> <tr><td><b>Date of Birth:</b></td><td align=right><input type=text size=2 name=day value=<?php echo $row['Day'];?>>   <select name=month> <option value="<?php echo $row['Month'];?>" ><?php echo $row['Month'];?></option> <option value="January">January</option> <option value="February">February</option> <option value="March">March</option> <option value="April">April</option> <option value="May">May</option> <option value="June">June</option> <option value="July">July</option> <option value="August">August</option> <option value="September">September</option> <option value="Octomber">Octomber</option> <option value="Novermber">November</option> <option value="December">December</option> </select></td></tr> <tr><td><b>Year:</b></td><td align=right><input type=text name=year value=<?php echo $row['Year'];?>> </td></tr> <tr><td><b>Occupation: </b></td><td align=right><input type=text name=occupation value=<?php echo $row['Occupation'];?>></td></tr> <tr><td><b>Employment: </b></td><td align=right><input type=text name=employment value=<?php echo $row['Employment'];?>></td></tr> <tr><td><b>Former Employment:</b></td><td align=right> <input type=text name=formeremployment value=<?php echo $row['Former Employment'];?>></td></tr> <tr><td><b>Address:</b></td><td align=right> <input type=text name=address value=<?php echo $row['Address'];?>></td></tr> <tr><td><b>E-mail:</b></td><td align=right> <input type=text name=email value=<?php echo $row['Email'];?>></td></tr> <tr><td><b>Telephone: </b></td><td align=right><input type=text name=telephone value=<?php echo $row['Telephone'];?>></td></tr> <tr><td></td> <td align=right><input type=submit value="Submit"></td></tr> </form> </table> <?php
73
C-5 addEvent.php
<html> <body> <form action+"login.php" method=POST> Type: <select name=type> <option value="local">Local</option> <option value="non-local">Non-local</option> </select><br> Title: <input type=text name=title><br> Time: <input type=text name=hour size=5>: <input type=text name=minutes><br> Date: <input type=text name=day> <select name=month> <option value="January">January</option> <option value="February">February</option> <option value="March">March</option> <option value="April">April</option> <option value="May">May</option> <option value="June">June</option> <option value="July">July</option> <option value="August">August</option> <option value="September">September</option> <option value="Octomber">Octomber</option> <option value="Novermber">November</option> <option value="December">December</option> </select><br> Description: <textarea rows="5" cols="10" name=description> </textarea> <input type=submit value="Submit"><p> </form> <?php require("connectDatabase.php"); $type=$_POST['type']; $title=$_POST['title']; $hour=$_POST['hour']; $minutes=$_POST['minutes']; $day=$_POST['day']; $month=$_POST['month']; $description=$_POST['description']; if ($title!=null){ mysql_query("INSERT INTO event (type, title, hour, minute, day, month, description) VALUES ('$type','$title', '$hour', '$minutes', '$day','$month', '$description')"); } mysql_close($database); ?> </body> </html>
74
C-6 modifyEvent.php
<html> <body> <form action+"addEvent.php" method=POST> Type: <select name=type> <option value="local">Local</option> <option value="non-local">Non-local</option> </select><br> Title: <input type=text name=title><br> Time: <input type=text name=hour size=5>: <input type=text name=minutes><br> Date: <input type=text name=day> <select name=month> <option value="January">January</option> <option value="February">February</option> <option value="March">March</option> <option value="April">April</option> <option value="May">May</option> <option value="June">June</option> <option value="July">July</option> <option value="August">August</option> <option value="September">September</option> <option value="Octomber">Octomber</option> <option value="Novermber">November</option> <option value="December">December</option> </select><br> Description: <textarea rows="2" cols="20" name=description> </textarea> <input type=submit value="Submit"><p> </form> <?php require("connectDatabase.php"); $type=$_POST['type']; $title=$_POST['title']; $hour=$_POST['hour']; $minutes=$_POST['minutes']; $day=$_POST['day']; $month=$_POST['month']; $description=$_POST['description']; $index = $_GET['index']; $ttype=mysql_query("SELECT 'Type' FROM 'database'.'event' WHERE 'index'='$index'"); $mmonth =mysql_query("SELECT 'Month' FROM 'database'.'event' WHERE 'index'='$index'"); if($_GET["cmd"]=="modify") { if ($type!=$ttype) { $query1= "UPDATE `database`.`event` SET `Type` = '$type' WHERE `event`.`Index` ='$index' LIMIT 1"; mysql_query($query1) or die(mysql_error()); } if ($title!=null) { $query2= "UPDATE `database`.`event` SET `Title` = '$title' WHERE `event`.`Index` ='$index' LIMIT 1";
75
mysql_query($query2) or die(mysql_error()); } if ($hour!=null) { $query3= "UPDATE `database`.`event` SET `Hour` = '$hour' WHERE `event`.`Index` ='$index' LIMIT 1"; mysql_query($query3) or die(mysql_error()); } if ($minutes!=null) { $query4= "UPDATE `database`.`event` SET `Minute` = '$minutes' WHERE `event`.`Index` ='$index' LIMIT 1"; mysql_query($query4) or die(mysql_error()); } if ($day!=null) { $query5= "UPDATE `database`.`event` SET `Day` = '$day' WHERE `event`.`Index` ='$index' LIMIT 1"; mysql_query($query5) or die(mysql_error()); } if ($month!=$mmonth && $month!=null) { $query6= "UPDATE `database`.`event` SET `Month` = '$month' WHERE `event`.`Index` ='$index' LIMIT 1"; mysql_query($query6) or die(mysql_error()); } if ($description!=null) { $query7= "UPDATE `database`.`event` SET `Description` = '$description' WHERE `event`.`Index` ='$index' LIMIT 1"; mysql_query($query7) or die(mysql_error()); } } mysql_close($database); ?> </body> </html>
76
Appendix D Poster
77