Académique Documents
Professionnel Documents
Culture Documents
by:
Supervisor:
Mr Alargam Alryah
September 2009
Abstract
1
1.1 Introduction:
The Science department at Khartoum International Community School (KICS) has a large amount
of equipment and chemicals in its stores and laboratories. Managing these items properly is a
challenging task. One issue is correct storage. The items are categorized into different groups, some
of which have special storage requirements, for example, acids, flammables and living specimens. A
management system must alert users to such requirements. Another tough task is ensuring that the
process of ordering various items for use during science practicals and lessons is straightforward.
The system must allow a teacher to indicate items and quantities required, when they are needed
and for how long. It must also immediately alert the teacher if someone else has requested the same
equipment. The technician has access to the teachers' orders and is responsible for making sure that
sufficient quantities of ordered items are present in the store, preparing these orders and delivering
them prior to each lesson.
2
1.2 Literature Review
This chapter is going to explain relevant theory and research on Web-based Information System
Development, which will be applied to the development of KICS inventory and order management
system. The following issues will be presented:
1. Internet technologies
2. Database and database management
3. Web database concepts
4. PHP programming language
5. MySQL
6. Structured Query Language (SQL)
7. Web applications
8. Other relevant research
3
12. An intranet is an internet-like computer network. Intranet technology is similar to internet
technology. It supports web authoring and browsing via a web browser. Intranet technology
is now very popular, its growth-rate is extremely high as it is supported by many
manufacturers.
4
1.2.3 Web database concepts
Web-technology could be defined as hardware and software built specifically for use with the world
wide web and therefore able to share and access the standard media found on the web such as text
documents, images, sound and videos. Web developers use a language called HTML (Hypertext
Markup Language) to create web documents that web browsers can interpret.
Information exchange is based on so-called client-server architecture. The clients, which are
'remote' from the server make information requests to the web server using correct protocol. A
programme called a web-browser translates text or mouse clicks into this protocol. The server
receives requests, finds information and sends it to the client web-browser where it is displayed.
5
information exchanged during one website visit, for example, by using cookies. Sun Microsystems
developed Java; an object oriented programming language. Java enables a developer to create
dynamic web pages and has become a famous web programming language. However, all web-
programming languages must provide an Application Programming Interface (API) to access the
database server, so that the developed program would gain the benefits of the web database
environment.
Server-Side Script: The script is stored and executed at the web server. Examples are Java server
pages, PHP and ASP .
Client-Side Script: The script is sent to the web browser. It will be executed, and processed by the
web browser. Exmples are Java Script and VB Script (4).
However, PHP could connect to several services protocols such as IMAP, SNMP, NNTP, POP3 and
HTTP. Socket software using PHP could also be developed.
1.2.5 MySQL
6
the client. Server processes would manage the logical database management, taking care of how the
data is stored and organized. Client processes would be described as processes that access the server
in order to store, retrieve, update and alter the database.
7
1.2.7 Web Applications:
In software engineering, a web application or webapp is an application that is accessed via a web
browser over a network such as the internet or an Intranet. It is also a computer software application
that is coded in a browser-supported language (such as HTML, JavaScript,Java, etc.) and reliant on
a common web browser to render the application executable (5).
Web applications are popular due to the ubiquity of web browsers, and the convenience of using a
web browser as a client, sometimes called a thin client. The ability to update and maintain web
applications without distributing and installing software on potentially thousands of client
computers is a key reason for their popularity, as is the inherent support for cross-platform
compatibility. Common web applications include webmail, online retail sales, online auctions, wikis
and many other functions (5).
1.2.7.1 History
In earlier types of client-server computing, each application had its own client program which
served as its user interface and had to be separately installed on each user's personal computer. An
upgrade to the server part of the application would typically require an upgrade to the clients
installed on each user workstation, adding to the support cost and decreasing productivity.
In contrast, web applications use web documents written in a standard format such as HTML (and
more recently XHTML), which are supported by a variety of web browsers.
Generally, each individual web page is delivered to the client as a static document, but a sequence
of pages can provide an interactive experience, as user input is returned through web form elements
embedded in the page markup. During the session, the web browser interprets and displays the
pages, and acts as the universal client for any web application.
In 1995, Netscape introduced a client-side scripting called JavaScript, which allowed programmers
to add some dynamic elements to the user interface that ran on the client side. Until then, all the
data had to be sent to the server for processing, and the results were delivered through static HTML
pages sent back to the client.
In 1996, Macromedia introduced Flash, a vector animation player that could be added to browsers
as a plug-in to embed animations on the web pages. It allowed the use of a scripting language to
program interactions on the client side with no need to communicate with the server.
In 1999, the "web application" concept was introduced in the Java language in the Servlet
Specification version 2.2. At that time both JavaScript and XML had already been developed, but
AJAX had still not yet been coined and the XMLHttpRequest object had only been recently
introduced on Internet Explorer 5 as an ActiveX object.
In 2005, AJAX was coined, and applications like Gmail started to make their client sides more and
more interactive.
1.2.7.2 Interface
The web interface places very few limits on client functionality. Through Java, JavaScript,
DHTML, Flash and other technologies, application-specific methods such as drawing on the screen,
playing audio, and access to the keyboard and mouse are all possible. Many services have worked
to combine all of these into a more familiar interface that adopts the appearance of an operating
system. General purpose techniques such as drag and drop are also supported by these technologies.
8
Web developers often use client-side scripting to add functionality, especially to create an
interactive experience that does not require page reloading. Recently, technologies have been
developed to coordinate client-side scripting with server-side technologies such as PHP. AJAX, a
web development technique using a combination of various technologies, is an example of
technology which creates a more interactive experience.
1.2.7.3 Structure
Applications are usually broken into logical chunks called "tiers" and every tier is assigned a role.
Traditional applications consist only of 1 tier, which resides on the client machine, but web
applications lend themselves to an n-tiered approach by nature. Though many variations are
possible, the most common structure is the three-tiered application. In its most common form, the
three tiers are called presentation, application and storage, in this order. A web browser is the first
tier (presentation), an engine using some dynamic Web content technology (such as ASP, ASP.NET,
CGI, ColdFusion, JSP/Java, PHP, Perl, Python, Ruby on Rails or Struts2) is the middle tier
(application logic), and a database is the third tier (storage). The web browser sends requests to the
middle tier, which services them by making queries and updates against the database and generates
a user interface.
For more complex applications, a 3-tier solution may fall short, and you may need a n-tiered
approach, where the greatest benefit is breaking the business logic, which resides on the application
tier, into a more fine-grained model. For example, creating a separate business logic tier. Or adding
an integration tier that separates the data tier from the rest of tiers by providing an easy-to-use
interface to access the data. For example, you would access the client data by calling a
"list_clients()" function instead of making a SQL query directly against the client table on the
database. That allows you to replace the underlying database without changing the other tiers.
There are some who view a web application as a two-tier architecture. This can be a "smart" client
that performs all the work and queries a "dumb" server, or a "dumb" client that relies on a "smart"
server. The client would handle the presentation tier, the server would have the database (storage
tier, and the business logic (application tier) would be on one of them or on both. While this
increases the scalability of the applications and separates the display and the database, it still doesn't
allow for true specialization of layers, so most applications will outgrow this model.
The use of web application frameworks can often reduce the number of errors in a program, both by
making the code simpler, and by allowing one team to concentrate just on the framework. In
9
applications which are exposed to constant hacking attempts on the Internet, security-related
problems caused by errors in the program are a big issue. Frameworks may also promote the use of
best practices such as GET after POST.
1.2.7.6 Applications
Browser applications typically include simple office software (word processors, online
spreadsheets, and presentation tools), with Google Docs being the most notable example, and can
also include more advanced applications such as project management, computer-aided design, video
editing and point-of-sale.
1.2.7.7 Benefits
Browser applications typically require little or no disk space on the client, upgrade automatically
with new features and integrate easily into other web procedures, such as email and searching. They
also provide cross-platform compatibility (i.e. Windows, Mac, Linux) because they operate within a
web browser window.
1.2.7.8 Drawbacks
Browser applications rely on application files accessed on remote servers through the Internet.
Therefore, when the connection is interrupted, the application is no longer usable. Google Gears is a
platform to ameliorate this issue and improve the usability of browser applications (5).
10
Chapter 2 : Analysis
11
2.1 The organization:
Khartoum International Community School (KICS) was founded by the DAL group in 2004. KICS
is a non-profit organization that aims to offer an outstanding English-medium education to
Khartoum's community. The syllabus is based on that developed by the International Baccalaureate
Organization (IBO).
2.2 Organization Structure:
12
Figure 2.2. Shows the functional chart of KICS.
13
2.4 Description of the Current System:
The Science department at Khartoum International Community School (KICS) has a large amount
of equipment and chemicals in its stores and laboratories. Managing these items properly is a
challenging task. One issue is correct storage. The items are categorized into different groups, some
of which have special storage requirements, for example, acids, flammables and living specimens. A
management system must alert users to such requirements. Another tough task is ensuring that the
process of ordering various items for use during science practicals and lessons is straightforward.
The system must allow a teacher to indicate items and quantities required, when they are needed
and for how long. It must also immediately alert the teacher if someone else has requested the same
equipment. The technician has access to the teachers' orders and is responsible for making sure that
sufficient quantities of ordered items are present in the store, preparing these orders and delivering
them prior to each lesson.
In this model we assume that the system shall provide reports that enable the managers to decide the
proper disposal/utilization plan of the items in the inventory according to their consumption and
other criteria such as their expiry dates.
14
Chapter 3 : Design
15
Chapter 3 Design:
3.1 Data Flow Chart Diagrams:
16
3.1.2. Data Flow Diagram Level 1:
Figure 3.2 shows the data flow diagram (Level.1) of the whole inventory management processes.
17
3.1.3. Storing (entering items in the inventory):
The technician enters the specifications of the item and chooses where the item should be stored
accordingly (e.g. flammable chemicals has to be stored in a flammable cupboard).
Figure 3.3 shows the data flow in the storing new items process (level 1.1).
18
3.1.4. storing new items, detailed:
Figure 3.4 shows detailed data flow in the storing new items process (level 1.1).
19
3.1.5. Checking the availability of an item:
The technician or teacher checks whether an item is available (it's presence and reservation status)
and if it is reserved for another teacher, what time it will be available.
Figure 3.5 shows the data flow in the checking process (level 1.1).
Figure 3.6 shows the data flow in reservation process (level 1.1).
20
3.1.7. Annual reports:
The technician or the teacher can request an annual report showing how many times an item has
been requested, how much of it has been consumed (if it is a consumable item) during the academic
year and how much is left for next year.
Figure 3.7 shows the data flow in the report process (level 1.1).
21
3.2 Database Design:
3.2.1 Entity Relationships Diagram:
22
3.2.2 ER diagram1:
items
Table comments: holds information about stored items, it's the main table;
Field Type Null Default Links to Comments
id int(10) No primary key of the table
shows the type of the item, it is a foreign key
type_id int(10) No types -> id
to "types" table
building_id char(10) No buildings - shows the building's id as a foreign key which
23
help in bringing all the needed information
> id
about the building from "buildings" table
shows the store's id as a foreign key which
stores -> help in bringing all the needed information
store_id char(10) No
id about where each item is stored from "stores"
table
name varchar(100) No the name of the exact item in the inventory
any comments or observation can by entered
comments text Yes NULL either when the item first catalogued or at any
time when it is in the store
the unit of measurement of the item i.e. gram,
unit varchar(10) Yes gram
kilo, box, .. etc
quantity double No 1 the quantity of the item in the store
consumptio
double Yes 0 how much got consumed of the item
n
vendor varchar(50) Yes NULL vendor's information
catno varchar(50) Yes NULL catalogue's no in the vendors catalogue
arrived date Yes NULL when did the item arrived
expires date Yes NULL the expiry date of the item
order_detail
Table comments: displays the ordered items in each order; (`order_id`) REF
Field Type Null Default Links to Comments
id int(10) No primary key of the table
foreign key to "orders" table shows that this
order_id int(10) No orders -> id
item is ordered for that certain order
item_id int(10) No items -> id the item which is orderd
quantity double No the required quantity of the item
measurment of that quantity like gram, kilo,
unit varchar(10) No
unit ... etc
concentratio if it's something to be prepared, at which
varchar(25) Yes NULL
n concentration
note text Yes NULL special note about this special item
building_id char(10) No the building at which the item is stored
the exact store or cupboard at which the item
store_id char(10) No
is stored
the name of the teacher who ordered the items
teacher varchar(50) No
for his/her practical
orders
Table comments: holds information about orders for practicals;
Field Type Null Default Links to Comments
24
id int(10) No auto incremented primary key for the table
lesson tinyint(4) No the number of the lesson 1 to 6
buildings -> the room where the ordred item should be
room char(10) No
id delivered
current
autogenerated timestamp when the order
order_date timestamp No _time
created
stamp
request_dat the day at which the ordered items are
date No
e neede
the day at which the ordered items will be
return_date date No
returned to the system
useraccounts - the name of the teacher who ordered the
teacher varchar(50) No
> username items for his/her practical
any special note about the order or the
note text Yes NULL
practical
stores
Table comments: cupboards and special stores inside science buildings;
Field Type Null Default Links to Comments
id char(10) No primary key of the table
name varchar(25) No the name of the store or the cupboard
the lock number which matches it's key for
lock_no varchar(10) Yes NULL
security and safety isues
building_id char(4) No buildings -> id the building at which the store is located
types
Table comments: indicates the types of items which are stored in the system;
Field Type Null Default Comments
id int(10) No primary key of the table
the name of the type that can be used to describe the items and
name varchar(45) No
clssify them accordingly, it help also in choosing the right store
useraccounts
Table comments: users of the system, and their privileges;
Field Type Null Default Comments
username varchar(50) No the user name of the system, including teachers
password which used for login to the system. It uses md5
password varchar(35) No
encryption
manages the prvileges levels of the system, who can see
userlevel int(10) No 7
and who can edit what
email varchar(50) No user's e-mail address
25
whether the user's acount is enabled or disabled from using
active int(10) No 0
the system
26
3.3 Conceptual design:
3.3.1 Inventory Control:
Figure 3.10 shows the inventory control, where the processes of storage management take place.
27
3.3.2 Order management:
Figure 3.11 shows order management where the processes of teachers orders take place.
28
Chapter 4 : Implementation
29
4.1 System Interfaces:
After designing the web application the researcher has implemented the application using
phpMyAdmin for database data definition. The researcher has then generated the PHP scripts using
PHPMaker v.6, a program which writes simple PHP scripts for data manipulation of database tables.
These scripts were then revised and reedited using text editors and Adobe Dreamweaver, a program
for web development. These simple codes were then inserted in a ready made HTML/CSS template
to give the application an attractive and more usable appearance. This step was also done using
Adobe Dreamweaver.
The interface is built in a way that enables the user to easily navigate to any part of the web
application through a horizontal menu. Some of the site's contents and operations are only available
for those who have a user name and a password to get into the system and even those users have
different privileges depending on their user level.
Some AJAX capabilities were added to the project, e.g. chained select boxes: when a user selects a
building the field of stores is automatically only those that exist in that specific building. Also when
adding an order or order details the teacher's name is automatically fed from his/her login.
Below are some examples of the interfaces from the web pages themselves. These and all others are
online at: kicsinv.cc.co, Not all pages will be described here as some act in similar ways. For
example, a user follows the same procedures for inserting, deleting or searching for records in the
stores, buildings or items pages. So here are some of the web pages:
Figure 4.1 shows the login page of the web application. On this page you can reclaim your forgotten
password, or register if you are a new user, the page also can save the user name for further logins
and save cookies for auto login.
30
Figure 4.2 shows the registration page, but note that only an administrator can control the user
levels.
Figure 4.3 shows the orders list page, as being viewed by an administrator (who can see and change
any user's orders)
31
Figure 4.4 shows the page for adding orders which only privileged users can access. The user's
name is automatically inserted into the orders that he/she makes, a time stamp also is generated for
each item added to the order.
Figure 4.5 shows the page used to delete orders. Note that deleting orders requires confirmation to
prevent accidental deletes.
32
Figure 4.6 shows the page used for editting the orders.
Figure 4.7 shows the page produced if a user wants to export a print view of orders.
Figure 4.8 shows the page produced if a user wants to export an html view of orders.
33
Figure 4.9 shows the same view as 5.7 but for a single order.
Figure 4.10 shows the same view as 5.8 but for a single order.
34
Figure 4.11 shows the “search result view of orders” page.
Figure 4.12 shows the “grid edit of orders” page, including multiple record editing.
35
Figure 4.13 shows the “ view of order” page when displaying a single order.
Figure 4.14 shows the “list view of ordered details (items)" in a single order.
36
Figure 4.15 shows the “list view of buildings table” page, displays single order.
Figure 4.16 shows the “list view of order details table” page, displaying multiple orders.
37
Figure 4.17 shows the "items list" page.
38
Figure 4.18 shows “add item”page. It has additional links to add a store record or type record if not
found in the drop-down list.
39
Figure 4.19 shows the "list view of Types" table. There is a link to find all the items of each type.
Figure 4.20 shows the "list view of Stores" table. There is a link to find all the items in each store,
cupboard or room.
40
Conclusion:
The researcher was very satisfied with the results and the system is now running on-line at
www.kicsinv.co.cc as well as being installed as part of the intranet at KICS. In order to increase the
possible audience for the project the webapp has been published on www.sourceforge.net which is a
large collection of open source applications. The link is www.sciencelabinv.sf.net or
www.sciencelabinv.sourceforge.net
Recommendations:
The researcher recommended continued development of the system including adding new features
like being able to hold more than one school's database and adding a feature of automatic locking of
users from ordering equipment if already booked by another user.
41
References:
42
Appendices:
1. sql to create the tables:
--
-- Table structure for table `buildings`
--
CREATE TABLE IF NOT EXISTS `buildings` (
`id` char(10) NOT NULL,
`name` varchar(25) NOT NULL,
`description` varchar(50) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `items`
--
CREATE TABLE IF NOT EXISTS `items` (
`id` int(10) NOT NULL auto_increment,
`type_id` int(10) NOT NULL,
`building_id` char(10) NOT NULL,
`store_id` char(10) NOT NULL,
`name` varchar(100) NOT NULL,
`comments` text,
`quantity` double NOT NULL default '1',
`consumption` double default '0',
`vendor` varchar(50) default NULL,
`catno` varchar(50) default NULL,
`arrived` date default NULL,
`expires` date default NULL,
PRIMARY KEY (`id`),
KEY `item_type_id` (`type_id`),
KEY `item_store_id` (`store_id`),
KEY `building_id` (`building_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE IF NOT EXISTS `orders` (
`id` int(10) NOT NULL auto_increment,
`lesson` tinyint(4) NOT NULL,
`room` char(10) NOT NULL,
`order_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,
`return_date` date NOT NULL,
`teacher` varchar(50) NOT NULL,
`note` text,
PRIMARY KEY (`id`),
KEY `user_id` (`teacher`),
KEY `room` (`room`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `order_detail`
--
CREATE TABLE IF NOT EXISTS `order_detail` (
`id` int(10) NOT NULL auto_increment,
`order_id` int(10) NOT NULL,
`item_id` int(10) NOT NULL,
`quantity` double NOT NULL,
`unit` varchar(10) NOT NULL,
`concentration` varchar(25) default NULL,
43
`note` text,
`building_id` char(10) NOT NULL,
`store_id` char(10) NOT NULL,
`teacher` varchar(50) NOT NULL,
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`),
KEY `item_id` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `stores`
--
CREATE TABLE IF NOT EXISTS `stores` (
`id` char(10) NOT NULL,
`name` varchar(25) NOT NULL,
`lock_no` varchar(10) default NULL,
`building_id` char(4) NOT NULL,
PRIMARY KEY (`id`),
KEY `building_id` (`building_id`)
) ENGINE=InnoDB DEFAULT CHARSET= utf8;
-- --------------------------------------------------------
44