Census Management System - Documentation FINAL
Census Management System - Documentation FINAL
ABSTRACT
The main aim of developing the census management system is to allow easier coordination of activities from the beginning of the census process up to the end of the process. This is by automating the whole process, allowing the Ministry of Planning to monitor the population statistics online. It is meant also to facilitate the management of population via the web for enhanced management and efficiency.
PREFACE
This document is useful for everyone and anyone who intends to interact with a new automated census management system. In this document one will be able to know the problems that existed in the old system and the challenges the organization faced while using the system. This booklet provides extensive information on how the new system was developed and also provides a user manual.
ACKNOWLEDGEMENT
This work would not be possible without the co-operation and assistance of very many people. To them I owe my gratitude. I want to pay particular tribute to the following people. Mr. Samuel Kiara (Supervisor Kiambaa region census) for providing all the information that was required in order to come up with the new automated system. Mr. Kuria for all the guidance, advice and tolerance throughout the project, also: My lecturer: Mr. J. Alila who took the role of project supervisor My fellow Students: Nahshon Ngao, John Kayeri and Mutinda Mummu and all my other classmates for their useful and constructive comments on the draft of this work My parents, for emotionally supporting me and sponsoring me financially to pursue the course in Computer Technology and providing the stationery and other essentials needed.
I most of all I give thanks and dedicate this project to God who has helped me right from the beginning to the completion of this project. He has guided me through the many ups and downs while I went about this project and gave me hope, Patience and confidence. May his name be Held up High!
DEDICATIONS
To my family: Dad, Mum and Sisters. Special thanks to them for all their support and encouragement and for their useful and constructive comments on the draft of this work and for all the financial support they offered me. To the Almighty God for enabling me complete my project.
DECLARATION
I hereby declare that this project is my original work and has not been presented for any award in any other institution of high learning before. Where material has been used from other sources it has been properly acknowledged in accordance with the institutes regulations. Student Signature: .. Student Name: Kenneth K. Mwiti
Date
Contents
ABSTRACT.....................................................................................................................................1 PREFACE........................................................................................................................................2 ACKNOWLEDGEMENT...............................................................................................................3 DEDICATIONS...............................................................................................................................4 DECLARATION.............................................................................................................................5 Contents...........................................................................................................................................6 CHAPTER 1..................................................................................................................................12 1. INTRODUCTION.....................................................................................................................12 1.2 PROPOSED SOLUTIONS.................................................................................................14 1.3 OBJECTIVES......................................................................................................................15 1.3.1 Personal Objectives..........................................................................................................15 1.4 JUSTIFICATION................................................................................................................15 1.5 REQUIRED RESOURCES.................................................................................................16 1.5.1 Software requirements:.................................................................................................16 1.5.2 Hardware requirements:...............................................................................................16 1.6 RISKS..................................................................................................................................16 1.7 INVESTIGATION PLAN...................................................................................................17 1.8 PROJECT DEVELOPMENT PLAN..................................................................................17 CHAPTER 2..................................................................................................................................18 2. LITERATURE REVIEW..........................................................................................................18 2.1 INTRODUCTION...............................................................................................................18 2.1.1 TOP IMAGE SYSTEM...............................................................................................18 2.1.2 LOCKHEED MARTIN Census Systems ...................................................................19 2.1.3 AUTOMATED CENSUS MAPPING SYSTEM........................................................20 2.1.4 CENSUS INFORMATION SYSTEM.........................................................................21 CHAPTER 3..................................................................................................................................22 3. INTRODUCTION.....................................................................................................................22 3.0.1 Purpose..............................................................................................................................22 3.0.2 Project Scope....................................................................................................................23 3.0.3 Intended Audience and reading suggestions....................................................................23 3.1 DATA COLLECTION METHODOLOGY.......................................................................23 3.1.1 Requirements Determination.......................................................................................23 3.1.2 Interviews....................................................................................................................24 3.1.3 Secondary sources.......................................................................................................24 3.2 DATA ANALYSIS.............................................................................................................24 3.3 DEVELOPMENT METHODOLOGY...............................................................................25 6
3.3.0 METHODOLOGY REVIEW.....................................................................................25 3.3.1 WATERFALL MODEL...................................................................................................25 3.4 GENERAL DESCRIPTION...............................................................................................26 3.4.1 Product perspective......................................................................................................26 3.4.2 Product Functionality...................................................................................................26 3.4.3 User characteristics.......................................................................................................27 3.4.4 Assumptions ................................................................................................................27 3.5 SPECIFIC REQUIREMENTS............................................................................................28 3.5.1 Functional requirements:..............................................................................................28 3.5.2 Nonfunctional requirements.........................................................................................28 3.5.3 Operational Requirements............................................................................................28 3.5.4 Training.........................................................................................................................29 3.5.5 User Interface Design...................................................................................................29 3.6 SYSTEM FEATURES........................................................................................................29 3.6.1 Security.........................................................................................................................29 3.6.1.1 Description and priority............................................................................................29 3.6.1.2 Stimulus/response sequences....................................................................................30 3.6.1.3 Functional requirement.............................................................................................30 3.7 External Interface Requirements.........................................................................................30 3.7.1 User interface................................................................................................................30 3.7.2 Hardware Interfaces.....................................................................................................30 3.8 Software Interfaces..............................................................................................................31 3.9 Communication Interfaces...................................................................................................31 3.9.1 Other Nonfunctional Requirements.............................................................................31 3.9.1.1 Performance Requirement.........................................................................................31 3.9.1.2 Safety Requirements..................................................................................................31 3.9.1.3 Security Requirements..............................................................................................32 3.9.2 Software Quality Attributes.........................................................................................32 1. Maintainability...................................................................................................................32 2. Reliability .........................................................................................................................32 3. Documentation...................................................................................................................33 3.9.3 CONCLUSION............................................................................................................33 CHAPTER 4..................................................................................................................................33 4. INTRODUCTION.....................................................................................................................33 4.1.1 PURPOSE.........................................................................................................................33 Systems design is the process or art of defining the architecture, components, modules, interfaces and data for a system to satisfy specified requirements. One could see it as the application of systems theory to product theory...................................................................33 7
4.1.2 SCOPE OF THE DOCUMENT.......................................................................................34 4.1.3 INTENDED AUDIENCE................................................................................................34 4.2 SYSTEM ENVIRONMENT...................................................................................................35 4.3 DESIGN REQUIREMENT LIST...........................................................................................35 4.4 THE SYSTEM OVERVIEW..................................................................................................36 4.4.1 DESIGN TOOLS..............................................................................................................36 4.4.1.1 HARDWARE TOOLS .............................................................................................36 4.4.1.2 SOFTWARE TOOLS...............................................................................................36 4.5 TECHNICAL CONSTRAINTS..............................................................................................37 4.6 SYSTEM ARCHITECTURE..................................................................................................38 4.6.1 Use Case Diagram............................................................................................................38 4.7 SEQUENCE DIAGRAM........................................................................................................39 4.8 ACTIVITY DIAGRAM.........................................................................................................40 4.9 CLASS DIAGRAM.................................................................................................................41 4.10 DATABASE DESIGN..........................................................................................................42 4.10.1 SCHEMA DESIGN.......................................................................................................42 7.2 NORMALIZATION...........................................................................................................42 4.10.2 ENTITY RELATIONSHIP DIAGRAM......................................................................43 4.10.3 TABLE SCHEMA.........................................................................................................44 4.10.4 DATA DICTIONARY...................................................................................................45 4.10.5 MODELING..................................................................................................................47 4.10.5.1 INTERFACE DESIGN...........................................................................................47 4.10.6 LOGIN FORM...............................................................................................................47 4.10.7 Login fail page form.......................................................................................................47 4.10.8 ENUMERATOR PAGE FORM....................................................................................48 4.10.9 SUPERVISOR PAGE FORM........................................................................................49 4.10.10 Population and Housing...............................................................................................50 4.10.11 Information of Female aged 12years and above form.................................................51 4.10.12 Information of Female aged 3years and above form...................................................51 4.10.13 Housing Condition and Amenities Form.....................................................................52 4.10.14 Information about hotel, prison, hospital in-patient citizens form..............................52 4.10.15 PHYSICAL DESIGN:......................................................................................................53 4.10.15.1 Software requirements...............................................................................................53 4.10.15.2 Hardware Requirements............................................................................................53 4.10.16 CONCLUSION:...............................................................................................................53 CHAPTER 5..................................................................................................................................54 5.0: SYTEM TESTING ................................................................................................................54 8
5.1: INTRODUCTION..............................................................................................................54 5.2 Goals and objectives............................................................................................................54 5.3 Statement of scope...............................................................................................................55 5.4 Major constraints.................................................................................................................56 5.5 TEST PLAN........................................................................................................................56 5.5.1 Software to be tested....................................................................................................56 5.5.2 Testing strategy............................................................................................................56 5.5.3 Component/unit testing................................................................................................57 5.5.4 Integration testing.........................................................................................................58 5.5.5 Validation testing..........................................................................................................58 5.6 System testing......................................................................................................................60 5.6.1 Testing resources and staffing......................................................................................60 5.6.2 Test Work Products......................................................................................................60 5.7 Test Record Keeping...........................................................................................................61 5.8 Test Metrics.........................................................................................................................61 5.8.1Testing tools and environment......................................................................................61 5.9 Test procedure.....................................................................................................................61 5.9.1 Software to be tested....................................................................................................61 5.9.2 Testing procedure.........................................................................................................62 5.9.3 Unit test cases...............................................................................................................62 5.9.3.1 Stubs and/or drivers for component: Interface Level Editor....................................62 5.9.3.2 Test cases component: Interface..............................................................................62 5.9.3.3 Purpose of tests for component.................................................................................62 5.9.3.4 Expected results for component................................................................................62 5.9.3.5 Stubs and/or drivers for component: Interface Level Editor....................................62 5.9.3.6 Test cases component: Database..............................................................................62 5.9.3.7 Purpose of tests for component.................................................................................62 5.9.3.8 Expected results for component................................................................................62 5.9.4 Integration testing.........................................................................................................62 5.9.5 Test procedures for integration........................................................................................63 5.9.5.1 Stubs and drivers required.........................................................................................63 5.9.5.2 Test cases and their purpose......................................................................................63 5.9.5.3 Expected results.........................................................................................................63 5.9.6 Validation testing..............................................................................................................63 5.9.6.1 Testing procedure for validation...............................................................................63 5.9.6.2 Expected results.........................................................................................................63 5.9.6.3 Pass/fail criterion for all validation tests...................................................................63 9
5.9.7 High order testing (System testing)..................................................................................64 5.9.7.1 Recovery testing........................................................................................................64 5.9.7.2 Security testing..........................................................................................................64 5.9.7.3 Regression testing......................................................................................................64 5.9.7.4 Stress testing..............................................................................................................64 5.9.7.5 Path Testing...............................................................................................................65 5.9.7.6 Performance testing...................................................................................................65 5.9.7.7 Alpha/beta testing......................................................................................................65 5.9.7.8 Documentation testing...............................................................................................65 5.9.7.9 Testing resources and staffing...................................................................................66 5.9.8 Test work products ..........................................................................................................66 5.9.9 Test record keeping and test log.......................................................................................66 5.9.10 Conclusion......................................................................................................................66 CHAPTER 6..................................................................................................................................67 6.0 IMPLEMENTATION STRATEGY.......................................................................................67 6.1 Introduction..........................................................................................................................67 6.2 Purpose.................................................................................................................................67 6.3 Implementation Overview...................................................................................................67 6.3.1 Installation....................................................................................................................67 6.3.2 Training.........................................................................................................................67 6.3.3 Execution......................................................................................................................67 6.3.4 Conversion Plan............................................................................................................68 6.3.5 Hardware Installation...................................................................................................68 6.3.6 Software Installation ....................................................................................................68 6.3.7 Front-End-Implementation...........................................................................................68 6.3.8 Review.........................................................................................................................68 6.3.9 Data Conversion...........................................................................................................68 6.4 Justification for the Changeover Method............................................................................68 6.4.1 Reasons for Using Parallel Changeover......................................................................69 6.5 Actual Implementation........................................................................................................69 6.6 Implementation Schedule....................................................................................................70 6.7 Conclusions .........................................................................................................................71 CHAPTER 7..................................................................................................................................72 7.1 Conclusions .........................................................................................................................72 7.2 ACHIEVEMENTS..............................................................................................................72 7.3 SHORTCOMINGS..............................................................................................................72 7.4 THE WAY FORWARD......................................................................................................72 10
BIBLIOGRAPHY..........................................................................................................................73 APPENDICES...............................................................................................................................74 APPENDIX A: INTERVIEW QUESTIONS............................................................................74 APPENDIX B: USER MANUAL.............................................................................................74 1. INTRODUCTION....................................................................................................................74 1.1 Objectives:...........................................................................................................................74 2.0 HARDWARE AND SOFTWARE REQUIREMENTS.........................................................75 3.0 UPLOADING FILES..............................................................................................................75 3.1 RUNNING THE APPLICATION......................................................................................75 3.2 Security Page.......................................................................................................................78 3.3 Enumerator page..................................................................................................................78 3.4 Supervisor Details................................................................................................................79 3.5 Home page...........................................................................................................................79 3.6 Livestock form.....................................................................................................................80 3.7 Location Form.....................................................................................................................80 3.8 Disability Form....................................................................................................................81 3.9 Female Aged 12 years and above Form..............................................................................81 4.0 Deaths in the Household Form............................................................................................82 4.1 Hotel/Lodges/Hospital/Prison Residents Form...................................................................82 4.2 Recruitment Form................................................................................................................83 4.3 Amenities Form...................................................................................................................83 4.4 Information Regarding All Persons.....................................................................................84 4.5 Search form..........................................................................................................................84 5.0 APPENDIX C: CODE.............................................................................................................85
11
CHAPTER 1 1. INTRODUCTION
The Kenya National Bureau of Statistics has a mandate to deliver efficient, reliable and accurate statistics of the Countrys population. The importance of this process is to help the Government to analyze and disseminate social economic statistics needed for planning, allocation of resources in various constituencies within the country and policy formulation for the country. The Service Charter in the public declaration of the Ministry of State for Planning National Development and vision 2030 to achieving targeted, effective and ethical results for Kenyans in the area mandate. Through this charter it also aims to enhance the level of awareness of the Ministrys role in the overall facilitation and coordination of the national development planning process within the overall structure of the Government of Kenya. Census is the procedure of systematically acquiring and recording information about the members of a given population. It is a regularly occurring and official count of a particular population. The term is used mostly in connection with national 'population and door to door censuses' (to be taken every 10 years according to United Nations recommendations), agriculture, and business censuses. Since late 1980s upto early 2000, the capacity of Kenyas National Statistical System (NSS) to produce timely, high quality and relevant statistical information had deteriorated. Reasons for this included declining financial outlays to produce and disseminate statistics, inadequate professional staff at the senior management levels, and poor management. Until very recently, surveys were conducted but not analyzed, or when analyzed, the results were not released to the public in time. Several statistical products such as the Economic Survey and the Statistical Abstract were produced without release calendars, leading to delays in making information available to the public. Production of other statistical products such as the Statistical Digest, the Annual Trade Statistics, and the Annual Education Statistics ceased. Household surveys and industrial production surveys were conducted sporadically, depending on the availability of donor funding, since Government allocations to the former Central Bureau of Statistics (CBS) were inadequate to finance them. The countrys input/output tables and the social accounting matrix were last produced in 1976, while the system of national accounts used in the compilation of national accounts aggregates had not been fully revised to reflect the guidelines of the United Nations System of National Accounts 1993 (SNA93). Results of the surveys which the CBS managed to conduct were released so late that they were often irrelevant in an ever changing 12
environment. The production of statistics through the routine data systems in the line ministries also declined over time. Moreover, production of statistics by various agencies was not well coordinated, resulting in duplication of data collection efforts. In addition, annual symposiums for data users and producers, which used to be held in the 1980s to ensure that data users and data producers maintained an active dialogue, were not held. Meanwhile, demand for statistics to benchmark and track implementation progress of national development initiatives and programs substantially increased. The opening up of democratic space in Kenya in the recent years, coupled with increased media freedom and coverage of economic and social issues, raised public awareness of the value of accurate and timely statistical information. Government has alsoincreasingly come to appreciate the usefulness of good statistics for evidencebased policymaking in guiding major Government policies and in monitoring development programs and the Millennium Developments Goals.
bulky and occupy much space. This makes it tedious during the process of retrieval and analyses of data collected from the field. MIS-PLACEMENT OF RECORDS. This problem occurs in areas where there are security lapses. Clerks often lose the data they have collected as a result of sabotage by criminals; this problem mostly arises because this process is often conducted during the night when all persons are expected to be in their homestead. PAPER WORK. There is a lot of paper work which is done right from the estimation period of an area when a rough calculation is done till when the actual census is carried out. This also increases the cost incurred during this process.
14
teach or record peoples details. Also paper work will be reduced and in turn cut down the cost of purchasing papers.
1.3 OBJECTIVES
The system should be able to provide high security and anyone who wants to access it should have proper authorization. The system should reduce the workload of conducting the census and hence increase efficiency. The system should reduce the storage requirements and be able to store all the details. The system should be able to deal with data redundancy within the database. To investigate the current system that is in use within the organization. Reduce the time taken by management in coming up with concrete decisions. Help in efficient collection, storing, processing and analysis of data for ease in manipulation.
1.4 JUSTIFICATION
Some of the justification to carrying out the project is: The project will enable me to use both my project management and programming skills that I have acquired during my study. The project will also see that misplacement of peoples records when conducting census is totally eradicated. The project will produce a system that will eliminate redundancy and enhance efficiency. 15
Upon completion and implementation of the project it will enable the Supervisor to generate a report about the census in all constituencies. Coming up with a project is an essential requirement of Bachelors in Information Technology and thus I would like to implement an information system to the organization.
1.6 RISKS
The following are risks that one may encounter while doing the project and the counter measures that one can take in case of anything: 1) Inadequate financial support to ensure the completion of the project. Remedy: I have already saved up money in case of any influx on my budgeted costs. 2) Inadequate information for the available papers in the library. Remedy: I will visit various websites which are related to my project so as to get more detailed information. 3) Power failure: Remedy: with Generators and or UPS support installed data cannot be lost through power failure 16
4) Virus attacks Remedy: Making sure that up-to-date software is installed frequently to avoid any attacks.
17
2.1 INTRODUCTION
Provided one easy-to-use design tool to design all applications, workflows and processing stations
19
Lockheed Martins Census Business Practice represents technology expertise that make census taking highly accurate, more automated and efficient, and easier for citizens as well as for governments to use. Reference (http://www.lockheedmartin.com/products/census-systems/index.html)
originally meant to represent urban areas. The population density of the "all shi" was consequently lowered, and the term "all shi" lost its original sense of urbanity. It was then felt that the statistical data of DIDs were becoming increasingly inappropriate. Under such circumstances, the Statistics Bureau introduced a new definition of boundaries that would clearly represent urban areas in the 1960 population census. As a result, statistical data that were the accurate representation of the actual state of urban population were provided. These data are now widely used as a criterion for calculating local allocation taxes, and as a valuable source for establishing such administrative policies as town planning, regional development programs, urban redevelopment programs, industrial location planning, transport planning, public health policies and crime and disaster prevention policies, as well as being applied in diverse academic and private marketing fields. At the operational level, however, the demarcation of DIDs took more than seven months by manual operation. To overcome this problem, the procedures for demarcating DIDs were redesigned by grouping a number of districts evaluated as contiguous on the basis of population and population density (as well as household density) of a certain level. To computerize the new demarcation procedures, experimental studies on system development started in June 1992 based on Arc Info, and the development of a prototype system started in February 1993 utilizing the CMS data collected in 1990. This was followed by a series of verification studies that started in September 1993, which led to the modification of the prototype system in September 1994. Furthermore, AML was implemented to suit the new conditions in May 1995, for the purpose of demarcating DIDs in the population census of the same year. Today, the results of all these efforts are realized in the Automated Census System for Densely Inhabited District at the Statistics Bureau of the Management and Coordination Agency of Japan. Reference (http://proceedings.esri.com/library/userconf/proc98/proceed/to400/pap355/p355.htm)
providing Census-related statistics with increased accuracy at a reduced cost. Through the MAF/TIGER Accuracy Improvement Project (MTAIP), Harris has designed, developed, and implemented an integrated production environment, and all necessary systems to improve existing geocoded boundary data for street center-lines, lakes, rivers, housing units, and other geographic entities to 7.6 meters of accuracy. MTAIP is a major milestone in the partnership between the U.S. Census Bureau and Harris Corporation. MTAIP will help ensure that Census takers can quickly and accurately arrive at the door of the over 115 million residents across the nation. The U.S. Census Bureau Field Data Collection Automation (FDCA) program will provide advanced, automated systems that deliver data to the Census Bureaus computing systems in near real-time for integration with other data sources.
CHAPTER 3 3. INTRODUCTION
The goal and principle of the system requirement specification is to prepare the scope of the document, the designers view of the clients needs and requirements before the actual system is designed. It serves like the evidence tool that implies both client and designer have accepted to introduce the new system. The system is first evaluated to verify how it operates, view the problems of the current system, its specifications and additional technological options. Measures the weakness and strength that the system is bound to get.
3.0.1 Purpose
To determine and fully document how the system under development would work better to support the institution needs. To describe the new systems functionality and the change its intended to bring to the institution as a whole. Define all the functional and non functional requirements of the system. Aid budget estimations for the systems undertaking i.e. facilitate the estimation or calculation of the necessities and this could be in terms of actual cost and time to be taken to develop the system. 22
Guide in defining all the tools required for the development of the system i.e. Help in identifying the system scope and the tools that are to be used for the system development.
Clearly outline the roles and responsibilities of all the parties involved in the development process of this system. (enumerators, supervisor)
23
Interviews: A planned meeting during which the interviewer obtains information from the interviewee. Document review: Reviewing the existing system documentation to understand how the system is supposed to work. Observation: Observing the current/available system under operation to understand it better. The methodologies applied in this case are interviews and observation
3.1.2 Interviews
The interviews were done for the following reasons: They allow more detailed questions to be asked Interviews usually achieve a high response rate. Ambiguities can be clarified and incomplete answers followed up Precise wording can be tailored to respondent and precise meaning of questions clarified Interviewees are not influenced by others in the group The persons interviewed were: o Clerks at the field who carry out data collection. o Supervisor at the main office who Coordinate overall supervision. o General public so as to get their view about the process.
24
Depending on the type of data in question, this might include application of statistical methods, selecting or discarding certain subsets based on specific criteria, or other techniques. During this process the researcher is required to involve all stakeholders who will guide him on what is of importance and what is not, in the proposed system. The developer lists all that is required and with this final result is what he will use to build the system. After all data had been analyzed the users finally convinced the Coordinator that starting up this project that would help them overcome all their problems as they had stated.
2. When developing the system using this model, it is not guaranteed that one phase of the model is perfect before one moves to the next phase and this may lead to the system been resisted by the user. 3. It is not suitable for developing intended system as it involves review and testing after each phase which is time consuming and may lead the project been completed late. A diagram showing all phases in a waterfall model Requirement specification System design Detailed design Coding and testing Integration and maintenance
Monitoring. The system will be able to monitor some destructive activities like when deleting of any record. It will also inform the users of information such as record updated and so on.
Control. The system will be able to provide some useful controls such as navigating from one user to the next or previous. It will also provide the last and first options. Any user who is to access the system will be required to log into the system using a valid password and username.
3.4.4 Assumptions
The system assumptions that relate to the requirements here are; That the sample interviewed and respondents of the questionnaires adequately represent the entire population and that the computer systems shall fully support the application. That the systems are meant only for users running the windows operating systems and the users shall keep to the domain scope and not traverse it. The system is not supposed to exceed the stated budget since this may lead to omission of some necessary requirements that are stated in this project. The system will be fully integrated with the University website.
27
The system should allow the user to view their full report. The system should allow Clerks to update all peoples details. The system should allow the Clerks to record peoples details. Security should be enhanced by the system. The system should allow the user to cancel an entry that they had previously placed. The system should collect and store the detailed information provided by the user.
Computer with 533Mhz processor speed or above and at least 128MB memory Windows 2000 operating systems or higher versions with a web browser (at least
Database management staff. Connection to the Internet directly or through a network. Database management software preferably MySQL.
28
3.5.4 Training
The staff will need to be equipped with the necessary skills that will enable them to discharge their obligations according to the wishes of the clients.
29
30
posture while using the computer. Eye strain resulting in visual fatigue, burning and watering eyes, headaches and frequent changes in prescription glasses. Precautions to be undertaken to avoid the problem: Taking regular breaks from the working area. Positioning mouse and keyboard at same level. Adjusting your monitor brightness.
2. Reliability
The system shall be available to the users at all time and it should provide the expected results. In case of any failure, system down time should be very minimal. Backups shall also be done on a daily basis so as to provide recovery means in case of any system failure. Having put mechanisms in place will see to it that failure of the system is kept to the minimum.
32
3. Documentation
The system shall have its relative documentation on how to install, operate and trouble shoot it in case of any problems. This will also assist in case new users are brought into the system and also when programmers change.
3.9.3 CONCLUSION.
This project is aimed at developing an information system for the institution to help them in the storage and retrieval of their data. System Requirement Specification (SRS) helps to prepare the scope and purpose of the document, the designers view of the clients needs and requirements before the actual system is designed. With all the information about the system having been obtained the design of the system can now begin and the data collected will help me design a system that will run and perform the needed tasks.
CHAPTER 4 4. INTRODUCTION
It is a description of the structure of the software to be implemented, the data which is part of the system, the interface between system component and the algorithms used. The objective of this document is to detail the operation of the information system. The design document will hence help in the final design of the system. Graphical representation will be used to create a clear understanding and expected graphical user interface.
4.1.1 PURPOSE
Systems design is the process or art of defining the architecture, components, modules, interfaces and data for a system to satisfy specified requirements. One could see it as the application of systems theory to product theory. Software Design Specification Document contains design level statements regarding the system to be developed. This document a detailed description of the systems design for the online human population census system. i.e. the modules in the system and how they integrate and 33
relate to each other. It is going to act as a guide for the system developer for it describes how system requirements contained in the requirement specification document are carried out or implemented in the system. The document would also show how users would visualize the system and detailed descriptions of the inputs, processes and anticipated outputs of specific subparts of the system. System Design Specification (SDS) is a description of how the anticipated functional and non-functional system requirements specified in the Software Requirements Specifications (SRS) are achieved in the system. This document generally includes the design of usecase, sequence, activity diagrams.
34
the system administrators will also use it to make any updates required to ensure that they do not lose track of the of the system performance.
Data Organization: the system is supposed to gather the data entered into files. This will ensure that all the information is well updated in all the required tables. Information Retrieval: the system will allow users to access existing information for modifications necessary and for general view. It will ensure updates are made so that all those who are assessed several times, their records are clearly updated. The system will be able to store all the data/information and their retrieval will be easy to manage. Information Storage: the system shall consist of database which will store all details
Windows 2000 operating systems or higher versions with a web browser (at least Internet Explorer 6, Opera Browser 8.0, Netscape 2.1, or higher versions)
Database management software preferably MySQL. PHP provided under the package which comes with Apache web server.
37
Senior Supervisor
Assigns a unique code to area of visitation Enumerator Deputy Supervisor Verify the details
Return the forms to senior supervisor IT Clerk Generates a final report Record in database
38
:Database
: Senior supervisor : Enumerator : Deputy Supervisor
3: Assess details
: IT Clerk
2: Fills in details()
5: update()
4: Reject if incorrect()
7: Query ()
8: Generates
39
Conducts Training
40
Supervisor
Supervisor ID Supervisor name Address Email Phone Number
Address Email
Enter population details () Assigns code ()
1.........*
Census form Household number Location Address Age Religion Marital Status Birth Place Orphan hood Issued () Filled ()
1.........*
41
3NF
SUPERVISOR ID SUPERVISOR NAME
the tables. The objective is to isolate data so that additions, deletions, and modifications of a Household number Location field can be made in just one table and then propagated through the rest of the database via the Address defined relationship. Age UNF Religion 2NF SUPERVISOR NAME Marital Status 7.2 NORMALIZATION SUPERVISOR ID SUPERVISOR ID 1NF Birth Place SUPERVISOR NAME F_NAME SUPERVISOR ID Orphan hood NAME L_NAME
ADDRESS EMAIL PHONE NUMBER PASSWORD
ENUMERATOR NAME ENUMERATOR ID SUPERVISOR NAME
F_NAME L_NAME ADDRESS In relational database design, this is the process of organizing data to minimize duplication. EMAIL Normalization involves dividing a database into more tables and defining relationship between PHONE NUMBER PASSWORD
Household number
Location Address Age Religion Marital Status Birth Place Orphan hood
Previous Residence Duration of residence Tribe/Nationality Livestock Exotic Cattle Indigenous cattle Sheep Goat Camels Donkeys Pigs Chicken Assets Household Radio Television Car Landline
F_NAME L_NAME ADDRESS EMAIL PHONE NUMBER PASSWORD ENUMERATOR NAME ENUMERATOR ID F_NAME L_NAME ADDRESS EMAIL PHONE NUMBER PASSWORD
Household number
Household number
Location Address Age Religion Marital Status Birth Place Orphan hood
Previous Residence Duration of residence Tribe/Nationality Livestock Exotic Cattle Indigenous cattle Sheep Goat Camels Donkeys Pigs Chicken Assets Household Radio Television Car Landline
Location Address Age Religion Marital Status Birth Place Orphan hood
Previous Residence Duration of residence Tribe/Nationality Livestock Exotic Cattle Indigenous cattle Sheep Goat Camels Donkeys Pigs Chicken Assets Household Radio Television Car Landline
Previous Residence Duration of residence Tribe/Nationality Livestock Exotic Cattle Indigenous cattle Sheep Goat Camels Donkeys Pigs Chicken Assets Household Radio Television Car Landline
42
Enumerator
IT clerk
System
Key
Entity Data Store Data Flow Process
43
Data type Varchar Number Text Text Int Text Int Varchar Data type Varchar Number Text Date time Date time Text Int Varchar Data type Number Number Number Number Number Data type Varchar Int Varchar Varchar Varchar Varchar Data type Varchar Int Varchar
44
Holds the First name of the Enumerator Holds other names of the Enumerator
Field for identifier of the Enumerator Holds the contact of the Enumerator Highlights the email of the Enumerator Fields holds phone number of the Enumerator
45
Household details Table Location Address Age Religion Marital Status Birth Place Orphan hood
Previous Residence
Duration of residence
Indicates the location for household Indicates the Address for household Indicates the age of residents Indicates the religion of residents Indicates the marital status of residents Indicates the birth place of residence Indicates the orphan in the residence Indicates the previous residence of residents Indicates the location for household Indicates the tribe of residents
Tribe/Nationality
Livestock Table Enumerator Name Cattle Goats Pigs Field containing Enumerator Name Indicate the number of cattle one posses Indicate the number of goats one posses Indicate the number of pigs one posses
46
4.10.5 MODELING
LOGIN If you are a member please login below: User Name: Password: If you are not a member please register here;
Login
Your password is incorrect If you are a member please login below: User Name: Password: If you are not a member please register here;
Login
47
ENUMERATOR
Please fill in the Enumerator form with all the details specified (*)
ENUMERATOR NAME:
ENUMERATOR ID:
FIRST NAME: LAST NAME: ADDRESS: EMAIL: PHONE NO: PASSWORD: Register Clear details
48
Supervisor
Please fill in the Supervisor form with all the details specified (*)
SUPERVISOR NAME:
SUPERVISOR ID:
FIRST NAME: LAST NAME: ADDRESS: EMAIL: PHONE NO: PASSWORD: Register Clear details
49
Information of Figure 5: Register page form Female aged 12years and above form Please enter all details:
Children ever born alive: Children born alive and in the household: Children born alive and not in the household: Children born alive but have died: When was your last child born? If date of birth is not known code 99 and 9999 Was this Birth notified? Was the child (twin use 2?) Is the child still alive?
SEND
CLEAR DETAILS
52
4.10.16 CONCLUSION:
This project is aimed at developing a census system for the institution to help them in the storage and retrieval of their data of the entire country population. System Requirement Specification (SRS) helps to prepare the scope and purpose of the document, the designers view of the clients needs and requirements before the actual system is designed. With all the information about the system having been obtained the design of the system can now begin and the data collected will help me design a system that will run and perform the needed tasks.
53
54
Maximize bug count: The distinction between this and find defects is that total number of bugs is more important than coverage. Minimize technical support costs: Working in conjunction with a technical support or help desk group, the test team will identifies the issues that lead to calls for support. These are often peripherally related to the product under test for example, getting the product to work with a specific printer or to import data successfully from a third party database might prevent more calls than a low-frequency, data corrupting crash.
Assess conformance to specification: Any claim made in the specification is checked. Program characteristics not addressed in the specification are not (as part of this objective) checked.
Conform to regulations: If a regulation specifies a certain type of coverage (such as, at least one test for every claim made about the product), the team creates the appropriate tests. If the regulation specifies a style for the specifications or other documentation, the test team probably checks the style. In general, the test group is focusing on anything covered by regulation nothing that is not covered by regulation.
Minimize safety-related lawsuit risk: Any error that could lead to an accident or injury is of primary interest. Errors that lead to loss of time or data or corrupt data are checked.
55
Unit test
Integration test
System test
56
UNIT TESTING
USER NAME e.g. admin PASSWORD e.g. lisa TEXT FIELDS e.g. eryt56
57
problem.
Layout
It was successful
It worked well
It was successful
It worked well
58
Navigation Testing
Navigation Testing
Hardware Testing
Database Testing
navigator. Links to various Navigation All pages are It was It pages linked and successful worked there is a well simple and easy way to navigate. Links to various Navigation All pages It was It pages are linked successful worked and there well is a simple and easy way to navigate. Communication Communication The web It was It of the Web browser and successful worked browser and the local well local server server should communicate effectively without any interfering problems Ease of filling Validation Error It was It the forms and message successful worked the appear when well functionality of an error data been process recorded in the occurs. database Ease of Output The reports It was It producing should be successful worked reports in a easily well clear format produced as the user wants and should convey the information the user needs. Correct storage Storage The It was It of information information successful worked entered by well the user should be stored correctly in the database. 59
60
63
separate terminals. The stress testing continuous this test beyond the maximum design load of the system until the system fails. It will be used for two functions; It will test the failure behavior of the system. This may arise due to unexpected combination of events where the load placed on the system exceeds. It will stress the system and may cause the defects to come into light that would not have been discovered.
Alpha testing: is simulated or actual operational testing by potential users/customers or an independent test team at the developers' site. It is often employed for off-the-shelf software as a form of internal acceptance testing, before the software goes to beta testing.
Beta testing: comes after alpha testing. They are released to a limited audience outside of the programming team. The software is released to groups of people so that further testing can ensure the product has few faults or bugs. It will be made available to the open public to increase the feedback field to a maximal number of future users.
65
5.9.10 Conclusion
The document will enhance and facilitate proper testing for the new software and will assist in recognizing where the errors are and rectify them before the final system implementation. The system will demonstrate to the developer and the customer that the software meets its requirements.
66
6.2 Purpose
The significance of implementation is to introduce the system to the organization. This will be aimed at training the users on how to use the system. The programmers will perform their own test at the system then the users will test the system after it passes the acceptance test then it will be implemented.
6.3.1 Installation
It will involve both hardware and software installation and will be carried out by the team.
6.3.2 Training
The training phase of implementation will involve introducing the staff at the organization to the system and its functionality. The training will be delivered through workshop case study, tutorials or practice.
6.3.3 Execution
It will involve the actual operation of the system in parallel with the manual system the organization management team will perform the execution phase so that they can confirm that the system is performing as required by the users. 67
6.3.7 Front-End-Implementation
The front-end of this system was implemented using HTML (Hypertext Mark-up Language), Cascading Style Sheets (CSS) and Personal Home Pages (PHP).
6.3.8 Review
During the review phase the system developer, a moderator and related stake holders who will analyze, inspect the system, compare the manual system to the automated system and draw conclusions on the changeover.
Parallel running is likely to be expensive since it involves doing the work twice for a period of time, however it is the safest.
Phase 2
iii.
Phase 3 69
iv.
Collect processing, performance and output results of the new system. Monitor and review system performance and problems. Compare the result of the new system with the current system. Evaluation of both systems. Stopping the operation of the old system and putting the new secure computerized information system
Phase 4
18/11/2009 20/11/2009
70
6.7 Conclusions
The users will be able to learn the new system step by step and still be able to carry out the normal operations until they are comfortable with the new system. This will ensure that the developer watches over the system as the users are engaging in their day to day operations to ensure that they are comfortable with the system. The system will help the users in fast retrieval of information and research of existence of records, security and updated records.
71
CHAPTER 7
7.1 Conclusions
The users will be able to learn the new system step by step and still be able to carry out the normal operations until they are comfortable with the new system. This will ensure that the developer watches over the system as the users are engaging in their day to day operations to ensure that they are comfortable with the system. The system will help the users in fast retrieval of information and research of existence of records, security and updated records.
7.2 ACHIEVEMENTS
By completing this project, I have been able to achieve my objectives set earlier at the beginning. I have also learnt that census management is a very wide and important area of concern for all learning institutions that consider their data to be of importance.
7.3 SHORTCOMINGS
Though I was able to implement the census management system to a certain acceptable level, I still feel that more should be done to ensure both the recruitment process should be entirely online to avoid favourism.
72
BIBLIOGRAPHY
1)
Allen, Julia H. (2001). The CERT Guide to System and Network Security Practices. Boston, MA: Addison-Wesley. 0-201-73723-X.
2)
Krutz, Ronald L.; Russell Dean Vines (2003). The CISSP Prep Guide, Gold Edition, Indianapolis, IN: Wiley. 0-471-26802-X.
3)
Layton, 7087-8.
Timothy
P.
(2007).
Information
Security:
Design,
Implementation,
4)
McNab, Chris (2004). Network Security Assessment. Sebastopol, CA: O'Reilly. 0-59600611-X.
5)
Peltier, Thomas R. (2001). Information Security Risk Analysis. Boca Raton, FL: Auerbach publications. 0-8493-0880-1.
6)
Peltier, Thomas R. (2002). Information Security Policies, Procedures, and Standards: guidelines for effective information security management. Boca Raton, FL: Auerbach publications. 0-8493-1137-3.
7)
White, Gregory (2003). All-in-one Security+ Certification Exam Guide. Emeryville, CA: McGraw-Hill/Osborne. 0-07-222633-1.
8) http://www.e-citizen.gov.uk/NP/rr/pdf/Literature_Review_survey.pdf 9) Software Engineering by Pressman, Somerville, and Van Vliet. 10) Object-Oriented Development by Booch, Rumbaugh, Berard, and Wirfs-Brock. 11) http://www.sorwar-engine.com 12) Julie C. Melon(2003)PHP essentials, 2nd edition. 13) David Power(2005) Foundation PHP for dreamweaver8. 14) McGraw Hill(1997)Software Engineering A Practitioners Approach,Roger S.pressman.
73
APPENDICES
APPENDIX A: INTERVIEW QUESTIONS
The questions asked include: What system is currently being used in carrying out the census program? What are the shortcomings associated with the current system? What are some of the main activities that you would like to automate? What benefits do you expect to get from automating the activities? What are the planned future needs in terms of embracing the new proposed system? Which systems use the proposed system? The financial resources the management is willing to commit for the system Data collection, analysis, storage and reporting techniques that is currently in use.
1. INTRODUCTION
A system user manual is a documented guide that will help the user to operate the system with ease. The purpose of this document is to provide an interface between the system and the user. It helps the users to understand all the procedures involved in operating the system. The document also gives the overall details of the system
1.1 Objectives:
The documentation of how to operate the system will help the end users to learn the new system with much ease and guide them in troubleshooting the system.
74
75
5. Select phpMyAdmin under the tools option to establish the connection. 6. PhpMyAdmin webpage displays
76
9.
Open the system folder>home.php.>on the right hand side click on Application tab>then database>click on the (+) sign>mySql>to connect.
77
78
79
80
81
82
83
84
$GLOBALS['MM_Username'] = $loginUsername; $GLOBALS['MM_UserGroup'] = $loginStrGroup; //register the session variables session_register("MM_Username"); session_register("MM_UserGroup"); if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-.style1 {font-size: 36px} .style2 {font-size: 18px; } body { background-color: #00FF00; } --> </style> </head>
86
<body> <p align="right">KNBS</p> <form name="form1" method="POST" action="<?php echo $loginFormAction; ?>"> <p align="center" class="style1"><strong>Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census </strong></p> <p align="center" class="style1"><strong>Please enter your details below:</strong></p> <p align="center">Username: <input type="text" name="textfield"> </p> <p align="center">passward: <input type="password" name="textfield"> </p> <p align="center" class="style2"> <input type="submit" name="Submit" value="login"> <input type="reset" name="Reset" value="Reset"> </p> <p align="center" class="style2">if you are unregistered please enter the following information:</p> <p align="center" class="style2">For <a href="supervisor.php">Supervisor</a></p> <p align="center" class="style2">For <a href="enumerator.php">Enumerator</a> </p> </form> <p align="center" class="style1"> </p> </body> </html> Home Page Form <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-.style1 {font-size: 36px} 87
body { background-color: #00FFCC; } .style2 {font-size: 14px} body,td,th { color: #660000; } --> </style> </head> <body> <form name="form1" method="post" action=""> <p align="right" class="style1">KNBS</p> <p align="center" class="style1"><strong><img src="MTP2008_2012cOVER.jpg" width="100" height="120" align="left">Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census</strong></p> <table width="200" height="414" border="1" align="left"> <tr> <td><a href="amenities.php">AMENETIES</a></td> </tr> <tr> <td><a href="assets.php">ASSETS</a></td> </tr> <tr> <td><a href="education.php">EDUCATION</a></td> </tr> <tr> <td><a href="females.php">FEMALES</a></td> </tr> <tr> <td><a href="all%20person.php">GENERAL INFORMATION</a> </td> </tr> <tr> 88
<td><a href="disability.php">DISABILITY</a></td> </tr> <tr> <td><a href="ict.php">ICT</a></td> </tr> <tr> <td><a href="labour.php">LABOUR</a></td> </tr> <tr> <td><a href="livestock.php">LIVESTOCK</a></td> </tr> <tr> <td><a href="orphanhood.php">ORPHANHOOD</a></td> </tr> <tr> <td><a href="outdoors.php">OUTDOORS</a></td> </tr> <tr> <td><a href="location.php">KNBS</a></td> </tr> <tr> <td><a href="recruitment.php">RECRUITMENT</a></td> </tr> </table> <p align="center" class="style1"><span class="style2"><strong><a href="account.php"><img src="email.gif" width="55" height="60" align="baseline"></a></strong></span></p> <p align="center" class="style1"><span class="style2"><strong>VISION</strong><br> <br> National Development Planning to Create a Better Quality of Life for all Kenyans </span></p> <p align="center" class="style2"><strong> MISSION</strong><br> <br> To provide leadership in policy formulation, provision of quality information and </p>
89
<p align="center" class="style2"> statistical data and co-ordinating sound economic policies for sustainable development.<br> <br> <strong>GOAL</strong><br> <br> Enhanced capacity in national planning and policy management for improved living standards of Kenyans </p> <p align="center" class="style2"> Our Core Functions </p> <div align="center"> <table cellpadding="0"> <tr> <td width="742" valign="top" class="style2"><ul> <li> The coordination of government economic policies, including regional and international cooperation policies; </li> <li><br> The coordination and preparation of the planning components of the Medium Term Expenditure Framework(MTEF); the Fiscal Strategy Paper and the requisite budget documents; </li> <li><br> The provision of leadership and coordination in the preparation of the main National Development Plan documents, including the District Development Plans; National Development Plans, and specific socio-economic programmes and plans; </li> <li><br> The coordination and management of population, economic and national statistical services within government; and </li> <li><br> The Coordination and provision of leadership in the national Monitoring and Evaluation (M&E) framework. </li> </ul> <table cellpadding="0"> <tr> <td></td> </tr> </table></td> 90
</tr> </table> </div> <p align="center"><a href="account.php">LOG OUT</a> </p> </form> </body> </html> Assets Page Form <?php require_once('Connections/censusconnect.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } 91
return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO assets (Radio, TV, Phone, Landline, Computer, Bicycle, `Motor Cycle`, Car, Lorry, Refrigerator, Boat, Cart, Canoes, `Tuk tuk`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['Radio'], "int"), GetSQLValueString($_POST['TV'], "int"), GetSQLValueString($_POST['Phone'], "int"), GetSQLValueString($_POST['Landline'], "int"), GetSQLValueString($_POST['Computer'], "int"), GetSQLValueString($_POST['Bicycle'], "int"), GetSQLValueString($_POST['Motor_Cycle'], "int"), GetSQLValueString($_POST['Car'], "int"), GetSQLValueString($_POST['Lorry'], "int"), GetSQLValueString($_POST['Refrigerator'], "int"), GetSQLValueString($_POST['Boat'], "int"), GetSQLValueString($_POST['Cart'], "int"), GetSQLValueString($_POST['Canoes'], "int"), GetSQLValueString($_POST['Tuk_tuk'], "int")); mysql_select_db($database_censusconnect, $censusconnect); $Result1 = mysql_query($insertSQL, $censusconnect) or die(mysql_error()); $insertGoTo = "home.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; 92
} header(sprintf("Location: %s", $insertGoTo)); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-.style1 {font-size: 36px} body { background-color: #3333FF; } --> </style> </head> <body> <form name="form1" method="post" action=""> <p align="right">KNBS</p> <p align="center" class="style1"><strong>Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census </strong></p> <p align="center" class="style1"><strong>Please Fill in the Household Assets Form:</strong></p> </form> <form method="post" name="form2" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">Radio:</td> <td><input type="text" name="Radio" value="" size="32"></td> 93
</tr> <tr valign="baseline"> <td nowrap align="right">TV:</td> <td><input type="text" name="TV" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Phone:</td> <td><input type="text" name="Phone" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Landline:</td> <td><input type="text" name="Landline" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Computer:</td> <td><input type="text" name="Computer" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Bicycle:</td> <td><input type="text" name="Bicycle" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Motor Cycle:</td> <td><input type="text" name="Motor_Cycle" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Car:</td> <td><input type="text" name="Car" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Lorry:</td> <td><input type="text" name="Lorry" value="" size="32"></td> </tr> <tr valign="baseline"> 94
<td nowrap align="right">Refrigerator:</td> <td><input type="text" name="Refrigerator" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Boat:</td> <td><input type="text" name="Boat" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Cart:</td> <td><input type="text" name="Cart" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Canoes:</td> <td><input type="text" name="Canoes" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Tuk tuk:</td> <td><input type="text" name="Tuk_tuk" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insert record"> <input type="reset" name="Reset" value="Reset"></td> </tr> </table> <input type="hidden" name="MM_insert" value="form2"> </form> <p> </p> </body> </html> Search page Form <?php require_once('Connections/censusconnect.php'); ?> <?php $colname_Recordset1 = "1"; 95
if (isset($_POST['name'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_POST['name'] : addslashes($_POST['name']); } mysql_select_db($database_censusconnect, $censusconnect); $query_Recordset1 = sprintf("SELECT * FROM information WHERE name = '%s'", $colname_Recordset1); $Recordset1 = mysql_query($query_Recordset1, $censusconnect) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-body { background-color: #CCFF33; } --> </style><head> <p align="right">KNBS</p> <p align="center" class="style1"><strong>Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census Search Details </strong></p></head> <body> <table width="996" height="223" border="1"> <tr> <th scope="col">Name</th> <th scope="col"> </th> <th scope="col"> </th> 96
<th scope="col"> </th> <th scope="col"> </th> <th scope="col"> </th> <th scope="col"> </th> <th scope="col"> </th> <th scope="col"> </th> <th scope="col"> </th> <th scope="col"> </th> <th scope="col"> </th> <th scope="col"> </th> </tr> <?php do { ?> <tr> <td><?php echo $row_Recordset1['name']; ?></td> <td><?php echo $row_Recordset1['Relationship']; ?></td> <td><?php echo $row_Recordset1['sex']; ?></td> <td><?php echo $row_Recordset1['Age']; ?></td> <td><?php echo $row_Recordset1['No. of Mother']; ?></td> <td><?php echo $row_Recordset1['Household No']; ?></td> <td><?php echo $row_Recordset1['Nationality']; ?></td> <td><?php echo $row_Recordset1['Religion']; ?></td> <td><?php echo $row_Recordset1['Marital Status']; ?></td> <td><?php echo $row_Recordset1['Previous Residence']; ?></td> <td><?php echo $row_Recordset1['Duration of residence']; ?></td> <td><?php echo $row_Recordset1['is father alive']; ?></td> <td><?php echo $row_Recordset1['is mother alive']; ?></td> </tr> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </table> </body> </html> <?php mysql_free_result($Recordset1); ?> 97
Supervisor Form <?php require_once('Connections/censusconnect.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); }
98
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO supervisor (Name, Fname, Lname, id, Address, Email, password) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['Name'], "text"), GetSQLValueString($_POST['Fname'], "text"), GetSQLValueString($_POST['Lname'], "text"), GetSQLValueString($_POST['id'], "int"), GetSQLValueString($_POST['Address'], "int"), GetSQLValueString($_POST['Email'], "text"), GetSQLValueString($_POST['Phone_no'], "int")); mysql_select_db($database_censusconnect, $censusconnect); $Result1 = mysql_query($insertSQL, $censusconnect) or die(mysql_error()); $insertGoTo = "account.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-.style1 {font-size: 36px} body { background-color: #009966; } 99
--> </style> </head> <body> <form name="form1" method="post" action=""> <p align="right">KNBS</p> <p align="center" class="style1"><strong>Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census </strong></p> <p align="center" class="style1"><strong>Please Fill in the Supervisors Details:</strong></p> </form> <form method="post" name="form2" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">Name:</td> <td><input type="text" name="Name" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Fname:</td> <td><input type="text" name="Fname" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Lname:</td> <td><input type="text" name="Lname" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Id:</td> <td><input type="text" name="id" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Address:</td> <td><input type="text" name="Address" value="" size="32"></td> 100
</tr> <tr valign="baseline"> <td nowrap align="right">Email:</td> <td><input type="text" name="Email" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Phone no.:</td> <td><input type="text" name="Phone_no" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Password:</td> <td><input type="text" name="password" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insert record"> <input type="reset" name="Reset" value="Clear"></td> </tr> </table> <input type="hidden" name="MM_insert" value="form2"> </form> <p> </p> </body> </html> Enumerator Form <?php require_once('Connections/censusconnect.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": 101
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO enumerator (Name, Fname, Lname, id, Email, password) VALUES (%s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['Name'], "text"), GetSQLValueString($_POST['Fname'], "text"), GetSQLValueString($_POST['Lname'], "text"), GetSQLValueString($_POST['id'], "int"), GetSQLValueString($_POST['Email'], "text"), GetSQLValueString($_POST['password'], "text"));
102
mysql_select_db($database_censusconnect, $censusconnect); $Result1 = mysql_query($insertSQL, $censusconnect) or die(mysql_error()); $insertGoTo = "account.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-.style1 {font-size: 36px} body { background-color: #00FF99; } --> </style> </head> <body> <form name="form1" method="post" action=""> <p align="right">KNBS</p> <p align="center" class="style1"><strong>Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census </strong></p> <p align="center" class="style1"><strong>Please Fill in the Enumerators Details:</strong></p> 103
</form> <form method="post" name="form2" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">Name:</td> <td><input type="text" name="Name" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Fname:</td> <td><input type="text" name="Fname" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Lname:</td> <td><input type="text" name="Lname" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Id:</td> <td><input type="text" name="id" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Email:</td> <td><input type="text" name="Email" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Password:</td> <td><input type="text" name="password" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Phone no.:</td> <td><input type="text" name="Phone_no" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> 104
<td><input type="submit" value="Insert record"> <input type="reset" name="Reset" value="Clear"></td> </tr> </table> <input type="hidden" name="MM_insert" value="form2"> </form> <p> </p> </body> </html> Orphanhood Page <?php require_once('Connections/censusconnect.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; 105
} return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO orphanhhod (`How many live birth occured in this household during dates state`, `how many deaths occured in this household between stated dates`, `Name of the household member who died`, `Was this death notified`, `How old was the person`, male/female) VALUES (%s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['How_many_live_birth_occured_in_this_househol d_during_dates_state'], "int"), GetSQLValueString($_POST['how_many_deaths_occured_in_this_household_b etween_stated_dates'], "int"), GetSQLValueString($_POST['Name_of_the_household_member_who_died'], "int"), GetSQLValueString($_POST['Was_this_death_notified'], "int"), GetSQLValueString($_POST['How_old_was_the_person'], "int"), GetSQLValueString($_POST['malefemale'], "int")); mysql_select_db($database_censusconnect, $censusconnect); $Result1 = mysql_query($insertSQL, $censusconnect) or die(mysql_error()); $insertGoTo = "home.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } 106
?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-.style1 {font-size: 36px} body { background-color: #00FFFF; } --> </style> </head> <body> <form name="form1" method="post" action=""> <p align="right">KNBS</p> <p align="center" class="style1"><strong>Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census </strong></p> <p align="center" class="style1"><strong>Please Fill in the information About Deaths in the Household Form:</strong></p> </form> <form method="post" name="form2" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">How many live birth occured in this household during dates state:</td> <td><input type="text" name="How_many_live_birth_occured_in_this_household_during_dates_state" value="" size="32"></td> 107
</tr> <tr valign="baseline"> <td nowrap align="right">How many deaths occured in this household between stated dates:</td> <td><input type="text" name="how_many_deaths_occured_in_this_household_between_stated_dates" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Name of the household member who died:</td> <td><input type="text" name="Name_of_the_household_member_who_died" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Was this death notified:</td> <td><input type="text" name="Was_this_death_notified" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">How old was the person:</td> <td><input type="text" name="How_old_was_the_person" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Male/female:</td> <td><input type="text" name="malefemale" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insert record"> <input type="reset" name="Reset" value="Clear"></td> </tr> </table> <input type="hidden" name="MM_insert" value="form2"> </form> <p> </p> 108
</body> </html> Livestock page form <?php require_once('Connections/censusconnect.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); 109
} if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO livestock (`Exotic Cattle`, `Indigenous cattle`, Sheep, Goat, Camels, Pigs, `Indigenous chicken`, `Chicken commercial`, `Bee Hives`, Other) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['Exotic_Cattle'], "int"), GetSQLValueString($_POST['Indigenous_cattle'], "int"), GetSQLValueString($_POST['Sheep'], "int"), GetSQLValueString($_POST['Goat'], "int"), GetSQLValueString($_POST['Camels'], "int"), GetSQLValueString($_POST['Pigs'], "int"), GetSQLValueString($_POST['Indigenous_chicken'], "int"), GetSQLValueString($_POST['Chicken_commercial'], "int"), GetSQLValueString($_POST['Bee_Hives'], "int"), GetSQLValueString($_POST['Other'], "int")); mysql_select_db($database_censusconnect, $censusconnect); $Result1 = mysql_query($insertSQL, $censusconnect) or die(mysql_error()); $insertGoTo = "home.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> 110
<style type="text/css"> <!-.style1 {font-size: 36px} body { background-color: #0000CC; } --> </style> </head> <body> <form name="form1" method="post" action=""> <p align="right">KNBS</p> <p align="center" class="style1"><strong>Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census </strong></p> <p align="center" class="style1"><strong>Please Fill in the Livestock Details:</strong></p> </form> <form method="post" name="form2" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">Exotic Cattle:</td> <td><input type="text" name="Exotic_Cattle" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Indigenous cattle:</td> <td><input type="text" name="Indigenous_cattle" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Sheep:</td> <td><input type="text" name="Sheep" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Goat:</td> 111
<td><input type="text" name="Goat" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Camels:</td> <td><input type="text" name="Camels" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Pigs:</td> <td><input type="text" name="Pigs" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Indigenous chicken:</td> <td><input type="text" name="Indigenous_chicken" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Chicken commercial:</td> <td><input type="text" name="Chicken_commercial" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Bee Hives:</td> <td><input type="text" name="Bee_Hives" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Other:</td> <td><input type="text" name="Other" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insert record"> <input type="reset" name="Reset" value="Clear"></td> </tr> </table> <input type="hidden" name="MM_insert" value="form2"> </form> 112
<p> </p> </body> </html> Persons with disability form <?php require_once('Connections/censusconnect.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { 113
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO disability (`What is the type of disability`, `is there any difficulties in the disability`) VALUES (%s, %s)", GetSQLValueString($_POST['What_is_the_type_of_disability'], "int"), GetSQLValueString($_POST['is_there_any_difficulties_in_the_disability'], "int")); mysql_select_db($database_censusconnect, $censusconnect); $Result1 = mysql_query($insertSQL, $censusconnect) or die(mysql_error()); $insertGoTo = "home.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-.style1 {font-size: 36px} body { background-color: #0066FF; } --> 114
</style> </head> <body> <form name="form1" method="post" action=""> <p align="right">KNBS</p> <p align="center" class="style1"><strong>Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census </strong></p> <p align="center" class="style1"><strong>Please Fill in the Disability Form:</strong></p> </form> <form method="post" name="form2" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">What is the type of disability:</td> <td><input type="text" name="What_is_the_type_of_disability" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Is there any difficulties in the disability:</td> <td><input type="text" name="is_there_any_difficulties_in_the_disability" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insert record"> <input type="reset" name="Reset" value="Clear"></td> </tr> </table> <p> </p> <table width="200" border="1"> <caption> Type of disability </caption> <tr> 115
<th width="33" scope="col"><div align="left">1</div></th> <th width="151" scope="col"><div align="left">Visual</div></th> </tr> <tr> <td>2</td> <td>Hearing</td> </tr> <tr> <td>3</td> <td>Speech</td> </tr> <tr> <td>4</td> <td>Physical</td> </tr> <tr> <td>5</td> <td>Mental</td> </tr> <tr> <td>6</td> <td>Selfcare</td> </tr> <tr> <td>7</td> <td>Others</td> </tr> <tr> <td>8</td> <td>None</td> </tr> </table> <table width="200" border="1"> <caption> 116
difficuties if any </caption> <tr> <th width="38" scope="col"><div align="left">1</div></th> <th width="146" scope="col"><div align="left">Yes</div></th> </tr> <tr> <td>2</td> <td>No</td> </tr> <tr> <td>3</td> <td>NA</td> </tr> <tr> <td>4</td> <td>DK</td> </tr> </table> <p> </p> <p> <input type="hidden" name="MM_insert" value="form2"> </p> </form> <p> </p> </body> </html> General Information Page <?php require_once('Connections/censusconnect.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; 117
switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO info (name, Relationship, sex, Age, `No. of Mother`, `Household No`, Nationality, Religion, `Marital Status`, `Previous Residence`, `Duration of residence`, `is father alive`, `is mother alive`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['Relationship'], "int"), 118
GetSQLValueString($_POST['sex'], "int"), GetSQLValueString($_POST['Age'], "int"), GetSQLValueString($_POST['No_of_Mother'], "int"), GetSQLValueString($_POST['Household_No'], "int"), GetSQLValueString($_POST['Nationality'], "int"), GetSQLValueString($_POST['Religion'], "int"), GetSQLValueString($_POST['Marital_Status'], "int"), GetSQLValueString($_POST['Previous_Residence'], "int"), GetSQLValueString($_POST['Duration_of_residence'], "int"), GetSQLValueString($_POST['is_father_alive'], "int"), GetSQLValueString($_POST['is_mother_alive'], "int")); mysql_select_db($database_censusconnect, $censusconnect); $Result1 = mysql_query($insertSQL, $censusconnect) or die(mysql_error()); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-.style1 {font-size: 36px} body { background-color: #660099; } --> </style> </head> <body> <form name="form1" method="post" action=""> 119
<p align="right">KNBS</p> <p align="center" class="style1"><strong>Republic of Kenya </strong></p> <p align="center" class="style1"><strong>Population and Housing Census </strong></p> <p align="center" class="style1"><strong>Please Fill in the information Regarding All Persons:</strong></p> </form> <form method="post" name="form2" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">Name:</td> <td><input type="text" name="name" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Relationship:</td> <td><input type="text" name="Relationship" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Sex:</td> <td><input type="text" name="sex" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Age:</td> <td><input type="text" name="Age" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">No. of Mother:</td> <td><input type="text" name="No_of_Mother" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Household No:</td> <td><input type="text" name="Household_No" value="" size="32"></td> </tr> <tr valign="baseline"> 120
<td nowrap align="right">Nationality:</td> <td><input type="text" name="Nationality" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Religion:</td> <td><input type="text" name="Religion" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Marital Status:</td> <td><input type="text" name="Marital_Status" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Previous Residence:</td> <td><input type="text" name="Previous_Residence" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Duration of residence:</td> <td><input type="text" name="Duration_of_residence" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Is father alive:</td> <td><input type="text" name="is_father_alive" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Is mother alive:</td> <td><input type="text" name="is_mother_alive" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insert record"> <input type="reset" name="Reset" value="Clear"></td> </tr> </table> 121
<p> </p> <table width="200" border="1" align="right"> <caption> Relationship </caption> <tr> <th width="49" scope="col"><div align="left">1</div></th> <th width="135" scope="col"><div align="left">Head</div></th> </tr> <tr> <td>2</td> <td>Spouse</td> </tr> <tr> <td>3</td> <td>Son/Daughter</td> </tr> <tr> <td>4</td> <td>Grandchild</td> </tr> <tr> <td>5</td> <td>Brother/Sister</td> </tr> <tr> <td>6</td> <td>Father/Mother</td> </tr> <tr> <td>7</td> <td>Nephew/Niece</td> </tr> <tr> 122
<td>8</td> <td>In Law </td> </tr> <tr> <td>9</td> <td>Grandparent</td> </tr> <tr> <td>10</td> <td>Other relative </td> </tr> <tr> <td>11</td> <td>Non relative </td> </tr> </table> <table width="200" border="1" align="left"> <caption> Religion </caption> <tr> <th width="49" scope="col"><div align="left">1</div></th> <th width="135" scope="col"><div align="left">Catholic</div></th> </tr> <tr> <td>2</td> <td>Protestant</td> </tr> <tr> <td>3</td> <td>Other Christian </td> </tr> <tr> <td>4</td> 123
<td>Muslim</td> </tr> <tr> <td>5</td> <td>Hindu</td> </tr> <tr> <td>6</td> <td>Traditionalist</td> </tr> <tr> <td>7</td> <td>Other religion </td> </tr> <tr> <td>8</td> <td>No religion </td> </tr> <tr> <td>9</td> <td>DK</td> </tr> </table> <table width="200" border="1"> <caption> Marital Status </caption> <tr> <th width="33" scope="col"><div align="left">1</div></th> <th width="151" scope="col"><div align="left">Never married </div></th> </tr> <tr> <td>2</td> <td>Married monogamous </td> 124
</tr> <tr> <td>3</td> <td>Married polygamous </td> </tr> <tr> <td>4</td> <td>Widowed</td> </tr> <tr> <td>5</td> <td>Divorced</td> </tr> <tr> <td>6</td> <td>Separated</td> </tr> <tr> <td>7</td> <td>Dk</td> </tr> </table> <p> <input type="hidden" name="MM_insert" value="form2"> </p> <p> </p> <p> </p> </form> <form name="form3" method="post" action="results.php"> <input type="text" name="name"> <input type="submit" name="Submit" value="search"> </form> <p> </p> </body> 125
</html>
126