0% found this document useful (0 votes)
3K views69 pages

Digital Gram Panchayat-1

This document provides an overview and requirements for a Digital Gram Panchayat system. The system will allow volunteers to collaborate on rural development projects like education, health, and infrastructure. Key features include messaging, photo sharing, tracking member activities, and generating exportable reports. The system will be developed using PHP for the front end, MySQL for the back end, and will run on a Windows 10 machine with at least 4GB of RAM and 1TB of storage. Modules will include admin, volunteer, and donor modules to classify functionality.

Uploaded by

Swetha K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3K views69 pages

Digital Gram Panchayat-1

This document provides an overview and requirements for a Digital Gram Panchayat system. The system will allow volunteers to collaborate on rural development projects like education, health, and infrastructure. Key features include messaging, photo sharing, tracking member activities, and generating exportable reports. The system will be developed using PHP for the front end, MySQL for the back end, and will run on a Windows 10 machine with at least 4GB of RAM and 1TB of storage. Modules will include admin, volunteer, and donor modules to classify functionality.

Uploaded by

Swetha K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 69

`

PROJECT WORK

DIGITAL GRAMA PANCHAYAT

Bonafide Work Done by


VARSHA A
19UCOT054

A project report submitted in partial


fulfillment of the requirements for the award of
BACHELOR OF SCIENCE IN COMPUTER
TECHNOLOGY

Under the guidance of


Mrs. S.SADHANAYAKI M.Sc. (CS)., M.Phil., SET., NET.,
AssistantProfessor

Department of Computer Technology and Information Technology


KONGU ARTS AND SCIENCE COLLEGE
(An Autonomous Institution Affiliated to Bharathiar University, Coimbatore)

ERODE – 638 107

MAY 2022
`
KONGU ARTS AND SCIENCE COLLEGE
(An Autonomous Institution Affiliated to Bharathiar University, Coimbatore)

ERODE-638 107
Department of Computer Technology and Information Technology

PROJECT WORK

DIGITAL GRAMA PANCHAYAT

Bonafide Work Done by


VARSHA A
19UCOT054

A project report submitted in partial


fulfilment of the requirements for the award of
Bachelor of Science in Computer Technology

Guide Head of the Department

Submitted for the Viva-Voce Examination held on _______________

Internal Examiner External Examiner


`
ACKNOWLEDGEMENT

First, I would like to thank the Almighty for all the blessings which are endowed upon me.
With profound sense of indebtedness, I thank my parents for their immense love and support
to do the project.

I am grateful to thank our Correspondent Thiru K.PALANISAMY B.E., M.B.A., M.S.,


Kongu Arts and Science College(Autonomous), Erode for giving me an opportunity to study
in our esteemed institution.

I sincerely thank Dr. N.RAMAN M.B.A., M.Com., M.Phil., B.Ed., PGDCA., Ph.D.,
Principal, Kongu Arts and Science College(Autonomous), Erode for his inspiration and
permission to undergo the project.

I render my sincere thanks to Mr. S.MURUGANANTHAM M.Sc., M.Phil.,


Assistant Professor and Head, Department of Computer Technology and Information
Technology, Kongu Arts and Science College(Autonomous), Erode for his overwhelming
encouragement and valuable support throughout the course of my study.

My humble gratitude and thanks to my guide, Mrs. S.SADHANAYAKI M.Sc. (CS).,

M.Phil., SET., NET., Assistant Professor, Department of Computer Technology and


Information Technology, Kongu Arts and Science College(Autonomous), who has supported
and helped me to complete the project successfully. I am happy to thank my friends for
leading me by their valuable tips and co-operation throughout my project work.
`
CONTEN
TS
CHAPTE TITLE PAGE
R NO NO
ACKNOWLEDGEMENT i
SYNOPSIS i
i
1. INTRODUCTION 1
1.1 ABOUT THE PROJECT 1
1.2 SYSTEM SPECIFICATION 2
1.2.1 HARDWARE CONFIGURATION 2
1.2.2 SOFTWARE SPECIFICATION 2
1.2.3 SOFTWARE DESCRIPTION 3
2. SYSTEM STUDY 8
2.1 EXISTING SYSTEM 8
2.1.1 DRAWBACKS 8
2.2 PROPOSED SYSTEM 9
2.2.1 FEATURES 9
3. SYSTEM DESIGN AND DEVELOPMENT 10
3.1 INPUT DESIGN 10
3.2 OUTPUT DESIGN 11
3.3 DATABASE DESIGN 12
3.4 SYSTEM DEVELOPMENT 12
3.4.1 DESCRIPTION OF MODULES 13

4. SYSTEM TESTING AND 15


IMPLEMENTATION
5. CONCLUSION 18
BIBLIOGRAPHY 20
APPENDICES 21
DATA FLOW DIAGRAM 22
TABLE STRUCTURE 25
SAMPLE CODING 29
SAMPLE INPUT AND OUTPUT 44
`
SYNOPSIS

Digital Gram Panchayat is a charity group of professionals those want to voluntarily


contribute in their village/town’s development. Issues like Primary education, people’s health,
government policies awareness and availability of basic facilities/infrastructure are on main
focus among others.

Through the website group want to help their members collaborate, to plan, assess and
implement different activities and learn with others experience/feedbacks/suggestions. Group
also wants to encourage others to join their initiatives and recognize their contributions. The
information sharing to the Volunteers, Group members, etc. is through mailing feature only.
The information storage and maintenance is more critical in this system.

Tracking the member’s activities and progress of the work is a tedious job here This
system also providing the features like Chatting, Mailing between the members; Images Upload
and Download via the web site; updating the process status in centralized location; generated
reports can also be exporting to the applications like MS-Excel, PDF format, etc. In this new
system, the members like Donors can give their valuable feedback to the Volunteers so that the
Volunteers can check their progress of the tasks.
`

CHAPTER 1

INTRODUCTION

1.1 ABOUT THE PROJECT

The main objective of this project preparing this document is to give a general insight
into the analysis and requirements of the existing system or situation and for determining the
operating characteristics of the system. This Document plays a vital role in the development life
cycle and it describes the complete requirement of the system. It is meant for use by the
developers and will be the basic during testing phase. Any changes made to the requirements in
the future will have to go through formal change approval process.

This system also providing the features like Chatting, Mailing between the members;
Images Upload and Download via the web site, updating the process status in centralized
location; generated reports can also be exporting to the applications like MS-Excel, PDF
format, etc. In this new system, the members like Donors can give their valuable feedback to
the Volunteers so that the Volunteers can check their progress of the tasks. The entire process
categorized as different modules like Admin module, Volunteer module, etc. at where we can
classify the functionality as an individual process.

1
`
1.2 SYSTEM SPECIFICATION

1.2.1 HARDWARE CONFIGURATION

This section gives the details and specification of the hardware on which the system is
expected to work.

Processor : i3

RAM : 4GB

Hard disk : 1 TB

Monitor : VGA/SVGA

Keyboard : Logitech

Mouse : Logitech (3 Buttons)

1.2.2 SOFTWARE SPECIFICATION

This section gives the details and specification of the software that are used for the
development.

Operating System : Windows 10

Front end : PHP

Back end : MYSQL

2
`
1.2.3 SOFTWARE DESCRIPTION

PHP is the web development language written by and for web developers. PHP stands
for PHP: Hypertext Pre-processor. The product was originally named Personal Home Page
Tools, and many people still think that’s what the acronym stands for, but as it expanded in
scope, a new and more appropriate name was selected by community vote. PHP is currently in
its sixth major rewrite, called PHP6 or just plain PHP.

INTRODUCTION OF PHP

PHP is a server-side scripting language, usually used to create web applications in


combination with a web server, such as Apache. PHP can also be used to create command-line
scripts akin to Perl or shell scripts, but such use is much less common than PHP’s use as a web
language. Strictly speaking, PHP has nothing to do with layout, events, on-the-fly Document
Object Model (DOM) manipulation, or really anything about the look and feel of a web page.
In fact, most of what PHP does is invisible to the end user. Someone looking at a PHP page will
not necessarily be able to tell that it was not written purely in Hypertext Markup Language
(HTML), because the result of PHP is usually HTML

When compared to many other programming languages, PHP makes it easy to develop
powerful web application quickly (this is a blessing and a curse). Many of the most useful
specific functions (such as those for opening a connection to an Oracle database or fetching
email from an Internet Message Access Protocol [IMAP] server) are predefined. Most
advanced PHP users (including most of the development team members) are diehard hand
coders.

PHP & MYSQL are also both stable in the sense of feature stability. Their respective
development teams have thus far enjoyed a clear vision of their project and refused to be
distracted by every new fad and ill-through-out user demand that comes along. Much of the
effort goes into incremental performance improvements, communicating with more major
database, or adding better OOP support.

3
`

PHP STRENGTHS

PHP has much strength, including the following:

● Performance
● Scalability
● Interfaces to many different database system
● Build-in libraries for many common web tasks
● Low cost
● Ease of learning and use
● Strong object oriented support
● Portability
● Flexibility of development approach
● Availability of source code
● Availability of support and documentation

NEW IN PHP

Major new features in PHP are as follows:

● Better object oriented support build around a completely new object model
● Exception for scalable, maintainable error handling
● Simple XML for easy handling of XML data

USES OF PHP

PHP is a general-purpose scripting language that is especially suited to server-side web


development, in which case PHP generally runs on a web server. Any PHP code in a requested
file is executed by the PHP runtime, usually to create dynamic web page content or dynamic
images used on websites or elsewhere.

4
`
FEATURES IN PHP CLASSIFIEDS

TOP FEATURES 

● Open Source (Only one file encrypted)


● Nice layout from start.
● Unlimited level of categories.
● Unique Extra Fields that is also sort able.
● Large user community.
● Regions Module is included (using Ajax).

ADMIN AREA

● Unlimited extra field’s creation.


● Over 300 different settings in settings-area.
● User friendly installer
● Set up searchable fields from admin area
● Backup tool

GENERAL FEATURES

● Print functionality removes navigation.


● Picture gallery with only one image per user.
● Sort on all columns.
● Easy renew function
● Advanced search, different search-page for different categories (template fields)
● Translated to 11 languages

5
`
INTRODUCTION TO MYSQL

MYSQL is an open source, SQL relational database management system (RDBMS) that
is free for many uses (more detail on that later). Each in its history, MYSQL occasionally faced
opposition because of its lack of support for some core SQL constructs such as sub selects and
foreign keys. Ultimately, however MYSQL found a broad, enthusiastic user base for its liberal
licensing terms, perky performance, and ease of use. Its acceptance was aided in part by the
wide variety of other technologies such as PHP, Perl, Python, and the like that have encouraged
its use through stable, well-documented modules and extensions. Databases are generally
useful, perhaps the most consistently useful family of software products (the “killer product”)
in modern computing. Like many competing products, both free and commercial, MYSQL isn’t
a database until give it some structure and form.

MYSQL STRENGTHS

MYSQL has much strength, including the following

● High performance
● Low cost
● Ease of configuring and learning
● Portability
● Availability of source code
● Availability of support

NEW IN MYSQL

Major changes introduced for MYSQL includes

● View
● Stored procedures
● Basic trigger support
● Cursor support

6
`
USES OF PHP AND MYSQL

When setting out to build a website and has different products

● Hardware for the web server


● An operating system
● A database management system
● A programming or scripting language

Some of these are dependent on the other, for example not all operating system run on all
hardware not all web servers support all programming language.

The majority of PHP code can be written to be portable between operating system and web
servers there are some PHP functions that specifically relate to the file system there are
operating system dependent.

7
`
CHAPTER 2

SYSTEM STUDY

2.1 EXISTING SYSTEM

The existing system is a semi-automated at where the information is stored in the form
of excel sheets in disk drives. The information sharing to the Volunteers, Group members, etc.
is through mailing feature only. The information storage and maintenance is more critical in
this system. Tracking the member’s activities and progress of the work is a tedious job here.
This system cannot provide the information sharing by 24x7 days.

2.1.1 DRAWBACKS

● Information’s are maintained only MS-Excel and disk drives.


● Less security.
● Tracking the member’s activities and progress of the work is a tedious job here.
● This system cannot provide the information sharing.
● It Can’t Upload & Download Images
● Difficult to generate the reports.

8
`
2.2 PROPOSED SYSTEM

The development of this new system objective is to provide the solution to the problems
of the existing system. By using this new system, we can fully automate the entire process of
the current system. The new system would like to make as web-enabled so that the information
can be shared between the members at any time using the respective credentials. To track the
status of an individual process, the status update can be centralized using the new system.
Being a web-enabled system, the process can be accessed across the world over net. This also
providing the features like Chatting, Mailing between the members.

2.2.1 FEATURES

● This system also providing the features like Chatting, Mailing between the
members; Images Upload and Download via the web site; updating the process
status in centralized location;
● In this new system, the members like Donors can give their valuable feedback to the
Volunteers so that the Volunteers can check their progress of the tasks.
● The entire process categorized as different modules like Admin module, Volunteer
module, etc. at where we can classify the functionality as an individual process.
● In the Reports module we can generate reports like Weekly Status Report.

9
`
CHAPTER 3

SYSTEM DESIGN AND DEVELOPMENT

3.1 INPUT DESIGN

Input Design is one of the most expensive phases of the operation of computerized
system and is often the major problem of a system. A large number of problems with a system
can usually be tracked backs to fault input design and method. Needless to say, therefore, that
the input data is the lifeblood of a system and have to be analyzed and designed with at most
case and consideration. The decisions made during the input design are,

● To provide cost effective method of input


● To achieve the highest possible level of accuracy
● To ensure that input is understand by the user.

INPUT STAGES
Several activities have to be carried out as a part of the overall input process. They include

● Data Recording – Collection of data at its source.


● Data Description – Transfer of data to an input form
● Data Conversion – Conversion of the input data to a computer acceptable medium.
● Data Verification – Checking the conversion
● Data Control – Checking the accuracy and controlling the flow of data to the
computer.
● Data Transmission – Transmission or transferring the data to the computer.
● Data Validation – Checking the input data by program when it enters the computer
system.
● Data Correction – Correction the errors that are found at any early stages.

10
`
3.2 OUTPUT DESIGN

Output Design generally refers to the result and information that are generated by the
system for many end-user, output is the main reason for developing the system and the basis on
which they evaluate the usefulness of the application. The objective of a system finds its shape
in terms of the output. The analysis of the objective of a system leads to determination of
output. Output of a system can face various forms. The most common are report, screen
display, printed forms, graphical drawing etc., the output also vary in terms of their contents
frequency, timing & format. The output design is an on going activity almost from the
beginning of the project, and follows the principles of form design. Effects and well define an
output design improves the relationship of system and the user, thus facilitating decision-
making.

The Types of output used in the system are: -

Internal outputs

Whose destination is within the organization and is the user’s main interface with the
computer.

Interactive outputs

Interactive outputs involves the user in communicating directly with the computer.

External outputs

External outputs, whose destination is outside the organization and which require
special attention since they project the image of the organization

11
`

3.3 DATABASE DESIGN

Database design deals with the table structure and organization. The purpose of the
database is to enable easy information for the user. The general theme behind is to handle the
information as an integrated one. The database system is basically computerized record
maintain the informations available.

Database is a collection of interrelated data stored in a format that the user can access
the information easily and quickly while accessing the database. Redundancy should be
avoided to serve many users who use the database efficiently and also to increase the system
performance to attain all these objectives the data should be stored only once.

3.4 SYSTEM DEVELOPMENT

Online gram panchayat is a system used to through public to provide corporation


supports for required area. This project will be done using PHP as front end, and MY SQL as
back end. It can used to report seed area wise rural work details, this project is mainly useful
for public to get help for corporation any street light problem, water problem, etc…. This
system will help to manage all the activities in an all reports using computers. Currently all the
works are done manually, by computerizing all the activities inside a organization can be
managed easily and effectively

12
`

3.4.1 DESCRIPTION OF MODULES

● Web Administration
● Group Member
● Member Communications
● Registration
● Search
● Reports
● Authentication

Web Administration

Administrator is a super user treated as owner of this site. He can have all the
privileges. Administrator can register members directly, and delete the information of a
registered member.

He verifies the information uploads into the system by the members or voluntaries. If any
mismanagement done by the member immediately he can delete the information uploaded
earlier by the member. Basic and advance admin facilities add, update members, backup,
recovery of data, generating various reports etc. The system provides an interface to the admin
to change static web contents. He can track the member activities and progress.

Group Member

User is nothing but a registered member. Through the website group want to help their
members collaborate, to plan, assess and implement different activities and learn with others
experience/feedback/suggestions. With the help of online questionnaires, members need to
access the matureness of primary education, health facilities etc. and based on the assessment
need to categorize and chalk out a plan of actions by choosing from system suggested activities.
Group members arrange online information and face to face meetings with everyone to
motivate them to contribute in this system. Members advised to develop a volunteers group in
the village so that they can monitor, stabilize the change and reports to the members group.
Members need to provide facilitating like communications discussion forum, chat, mail etc. to
the users of this system.

13
`

Anonymous Users

Anonymous users means a normal visitor of this system simply called as guest. By
visiting this site he can get the information about this system, and also he can post his
suggestions, queries, and doubts to the member group after that member need to reply sufficient
response to those queries. If an anonymous users want to became a register person means he
needs to fill the registration form and became a member.

Member Communications

The member group need to collaborate, to plan, assess and implement different
activities and learn with others experience, feedbacks, and suggestions. Here the facilitating
communication means, the system provides discussion forum, chat, mail etc.To find the
assessment of current situation the system provides online questionnaires, members need to
access the matureness of primary education, health facilities etc. Each plan of action would be
shared with other members before execution so that they can share their experiences, feedback
and suggestions.

Registration

The system has a process of registration. Every member need to submit his complete
details in the form of registration. Whenever a user registration completed automatically user
can get a user id and password. By using that user id and password member can log into the
system.

Search

Different kind of search available to users as well as administrator. A user can search
other users for sharing the opinions. Administrator can search the information which are
uploaded into the system by any member.

Reports

● State, Area wise list of adopted villages and their timely progress report
● Activities list and plan of action
● Magazine Subscription statistics
● Member list and their activities
14
`

15
`

CHAPTER 4

SYSTEM TESTING AND IMPLEMENTATIONS

4.1 SYSTEM TESTING

Software testing is a critical element of software quality assurance and represents the
ultimate review of specification, design and coding. In fact, testing is the one step in the
software engineering process that could be viewed as destructive rather than constructive.

A strategy for software testing integrates software test case design methods into a well-
planned series of steps that result in the successful construction of software. Testing is the set of
activities that can be planned in advance and conducted systematically. The underlying
motivation of program testing is to affirm software quality with methods that can economically
and effectively apply to both strategic to both large and small-scale systems.

STRATEGIC APPROACH TO SOFTWARE TESTING

The software engineering process can be viewed as a spiral. Initially system engineering
defines the role of software and leads to software requirement analysis where the information
domain, functions, behavior, performance, constraints and validation criteria for software are
established. Moving inward along the spiral, we come to design and finally to coding. To
develop computer software we spiral in along streamlines that decrease the level of abstraction
on each turn.

A strategy for software testing may also be viewed in the context of the spiral. Unit
testing begins at the vertex of the spiral and concentrates on each unit of the software as
implemented in source code. Testing progress by moving outward along the spiral to
integration testing, where the focus is on the design and the construction of the software
architecture. Talking another turn on outward on the spiral we encounter validation testing
where requirements established as part of software requirements analysis are validated against
the software that has been constructed. Finally we arrive at system testing, where the software
and other system elements are tested as a whole.

16
`
UNIT TESTING

Unit testing focuses verification effort on the smallest unit of software design, the
module. The unit testing we have is white box oriented and some modules the steps are
conducted in parallel.

WHITE BOX TESTING

This type of testing ensures that

● All independent paths have been exercised at least once


● All logical decisions have been exercised on their true and false sides
● All loops are executed at their boundaries and within their operational bounds
● All internal data structures have been exercised to assure their validity.
To follow the concept of white box testing we have tested each form .we have created
independently to verify that Data flow is correct, All conditions are exercised to check their
validity, All loops are executed on their boundaries.

CONDITIONAL TESTING

In this part of the testing each of the conditions were tested to both true and false
aspects. And all the resulting paths were tested. So that each path that may be generate on
particular condition is traced to uncover any possible errors.

DATA FLOW TESTING

This type of testing selects the path of the program according to the location of
definition and use of variables. This kind of testing was used only when some local variable
were declared. The definition-use chain method was used in this type of testing. These were
particularly useful in nested statements.

17
`
4.2 SYSTEM IMPLEMENTATION

The new system may be totally new replacing an existing or automated system, or it
may be a major modification to an existing system. In other case, proper implementation is
essential to provide a reliable system to meet organization requirements. Implementation is the
stage where the theoretical design is turned into a working system.

The most crucial stage is to achieve a new successful system and to make user confident
that the new system will work efficiently and effectively. All information given by user is
successfully stored in a database for future reference. After having the user acceptance of the
new system developed, the implementation phase begins. Implementation is the stage of a
project during which theory is turned into practice. During this phase, all the programs of the
system are loaded onto the user's computer. After loading the system, training of the users starts

18
`
CHAPTER 5

CONCLUSION

It has been a great pleasure for me to work on this exciting and challenging project. This
project proved good for me as it provided practical knowledge of not only programming in PHP
web based application and no some extent Windows Application and MYSQL Server, but also
about all handling procedure related with “DIGITAL GRAMA` PANCHAYAT”. It also
provides knowledge about the latest technology used in developing web enabled application
and client server technology that will be great demand in future. This will provide better
opportunities and guidance in future in developing projects independently.

The project is identified by the merits of the system offered to the user. The merits of
this project are as follows: -

● It’s a web-enabled project.


● This project offers user to enter the data through simple and interactive forms. This is
very helpful for the client to enter the desired information through so much simplicity.
● The user is mainly more concerned about the validity of the data, whatever he is
entering. There are checks on every stages of any new creation, data entry or updation
so that the user cannot enter the invalid data, which can create problems at later date.
● Sometimes the user finds in the later stages of using project that he needs to update
some of the information that he entered earlier. There are options for him by which he
can update the records. Moreover there is restriction for his that he cannot change the
primary data field. This keeps the validity of the data to longer extent.
● User is provided the option of monitoring the records he entered earlier. He can see the
desired records with the variety of options provided by him.
● From every part of the project the user is provided with the links through framing so
that he can go from one option of the project to other as per the requirement. This is
bound to be simple and very friendly as per the user is concerned. That is, we can sat
that the project is user friendly which is one of the primary concerns of any good
project.
● Data storage and retrieval will become faster and easier to maintain because data is
stored in a systematic manner and in a single database.
● Decision making process would be greatly enhanced because of faster processing of
information since data collection from information available on computer takes much
less time then manual system.

19
`
● Allocating of sample results becomes much faster because at a time the user can see the
records of last years.
● Easier and faster data transfer through latest technology associated with the computer
and communication.
● Through these features it will increase the efficiency, accuracy and transparency.

20
`

BIBLIOGRAPHY

Websites Reference:
1. www.w3schools.com
2. www.php.net
3. www.tutorialspoint.com/php
4. www.tizag.com/phpT
5. https://www.codecademy.com/learn/php

Books Reference:
1. PHP Reference: Beginner to Intermediate PHP5, By Mario Lurig
2. Rasmus Lerdorf , “Programming PHP”, Published 2002.
3. PHP : The Complete Reference, By Steven Holzer
4. Pro PHP MVC, By Chris Pitt
5. Rick Dobson, “Programming My-SQL (Core Reference)”, Microsoft Press.

21
`

APPENDICES

A.DATA FLOW DIAGRAM

Login DFD Diagram:

22
`
Admin Details Data Flow:

1st level DFD:

23
`
2nd level DFD for Admin Manage Villages

24
`
Donor Details Data Flow

1st Level DFD

25
`
B.TABLE STRUCTURE

Table Name : admin


Primary Key : username

FIELDNAME DATATYPE SIZE

username Varchar 25

password Varchar 25

Table Name : birth


Primary Key : uid

FIELDNAME DATATYPE SIZE

uid Int 3

babyname Varchar 25

gender Varchar 10

mothername Varchar 25

fathername Varchar 25

bplace Varchar 25

hname Varchar 25

btime time NULL

bdate date

status Varchar 10

remarks Varchar 50

26
`

Table Name : chat


Primary Key : uid

FIELDNAME DATATYPE SIZE

id Int 10

username varchar 100

question text NULL

answer text 8

Table Name : complaint


Primary Key : uid

FIELDNAME DATATYPE SIZE

uid int 3

cdate date NULL

department varchar 25

complaint varchar 250

status varchar 25

remarks varchar 25

27
`

Table Name : postlamp


Primary Key : uid

FIELDNAME DATATYPE SIZE

uid int 10

adate date NULL

wno varchar 10

street varchar 25

pincode int 6

pname varchar 25

fname varchar 25

distance int 10

status varchar 25

remarks varchar 100

28
`
Table Name : users
Primary Key : uid

FIELDNAME DATATYPE SIZE

uid int 10

fullname varchar 25

email varchar 25

mobile bigint 10

gender varchar 10

age int 3

address varchar 25

username varchar 25

password varchar 25

Table Name : water


Primary Key : uid

FIELDNAME DATATYPE SIZE

uid int 10

adate date NULL

wno int 10

street varchar 25

pincode int 6

29
`
pname varchar 25

fname varchar 25

distance int 3

status varchar 25

remarks Text NULL

C. SAMPLE CODING

<?php

session_start();

//error_reporting(0);

30
`
include('include/config.php');

include('include/checklogin.php');

check_login();

if(isset($_GET['cancel']))

mysql_query("update appointment set doctorStatus='0' where id = '".


$_GET['id']."'");

$_SESSION['msg']="Appointment canceled !!";

?>

<!DOCTYPE html>

<html lang="en">

<head>

<title>Doctor | Inbox</title>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-


scalable=0, minimum-scale=1.0, maximum-scale=1.0">

<meta name="apple-mobile-web-app-capable" content="yes">

<meta name="apple-mobile-web-app-status-bar-style" content="black">

<meta content="" name="description" />

<meta content="" name="author" />

<link href="http://fonts.googleapis.com/css?
family=Lato:300,400,400italic,600,700|Raleway:300,400,500,600,700|Crete+Round:400italic"
rel="stylesheet" type="text/css" />

<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">

31
`
<link rel="stylesheet" href="vendor/fontawesome/css/font-awesome.min.css">

<link rel="stylesheet" href="vendor/themify-icons/themify-icons.min.css">

<link href="vendor/animate.css/animate.min.css" rel="stylesheet"


media="screen">

<link href="vendor/perfect-scrollbar/perfect-scrollbar.min.css" rel="stylesheet"


media="screen">

<link href="vendor/switchery/switchery.min.css" rel="stylesheet"


media="screen">

<link href="vendor/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css"
rel="stylesheet" media="screen">

<link href="vendor/select2/select2.min.css" rel="stylesheet" media="screen">

<link href="vendor/bootstrap-datepicker/bootstrap-
datepicker3.standalone.min.css" rel="stylesheet" media="screen">

<link href="vendor/bootstrap-timepicker/bootstrap-timepicker.min.css"
rel="stylesheet" media="screen">

<link rel="stylesheet" href="assets/css/styles.css">

<link rel="stylesheet" href="assets/css/plugins.css">

<link rel="stylesheet" href="assets/css/themes/theme-1.css" id="skin_color" />

</head>

<body>

<div id="app">

<?php include('include/sidebar.php');?>

<div class="app-content">

<?php include('include/header.php');?>

<!-- end: TOP NAVBAR -->

<div class="main-content" >


32
`
<div class="wrap-content container" id="container">

<!-- start: PAGE TITLE -->

<section id="page-title">

<div class="row">

<div class="col-sm-8">

<h1 class="mainTitle">Doctor | Inbox</h1>

</div>

<ol class="breadcrumb">

<li>

<span>Doctor </span>

</li>

<li class="active">

<span>Inbox</span>

</li>

</ol>

</div>

</section>

<!-- end: PAGE TITLE -->

<!-- start: BASIC EXAMPLE -->

<div class="container-fluid container-fullw bg-white">

<div class="row">

<div class="col-md-12">

33
`
<p style="color:red;">

<?php echo htmlentities($_SESSION['msg']);?>

<?php echo htmlentities($_SESSION['msg']="");?></p>

<table class="table table-hover" id="sample-table-1">

<thead>

<tr>

<th class="center">#</th>

<th class="hidden-xs">From</th>

<th class="hidden-xs">Message</th>

<th class="hidden-xs">Date</th>

</tr>

</thead>

<tbody>

<?php

$sql=mysql_query("select * from message where toId='".$_SESSION['id']."'");

$cnt=1;

while($row=mysql_fetch_array($sql))

?>

<tr>

<td class="center"><?php echo $cnt;?>.</td>

<td><?php echo $row['fromId'];?></td>

<td><?php echo $row['message'];?></td>


34
`
<td><?php echo $row['msgdate'];?></td>

</tr>

<!-- start: FOOTER -->

<?php include('include/footer.php');?>

<!-- end: FOOTER -->

<!-- start: SETTINGS -->

<?php include('include/setting.php');?>

<!-- end: SETTINGS -->

</div>

if (isset($_POST['pid'])) {

$pid = $_POST['pid'];

$wasFound = false;

$i = 0;

// If the cart session variable is not set or cart array is empty

if (!isset($_SESSION["cart_array"]) || count($_SESSION["cart_array"]) < 1) {

// RUN IF THE CART IS EMPTY OR NOT SET

35
`
$_SESSION["cart_array"] = array(0 => array("item_id" => $pid, "quantity" =>

1));

} else {

// RUN IF THE CART HAS AT LEAST ONE ITEM IN IT

foreach ($_SESSION["cart_array"] as $each_item) {

$i++;

while (list($key, $value) = each($each_item)) {

if ($key == "item_id" && $value == $pid) {

// That item is in cart already so let's adjust its quantity using array_splice()

array_splice($_SESSION["cart_array"],$i-1, 1, array(array("item_id"

=> $pid, "quantity" => $each_item['quantity'] + 1)));

$wasFound = true;

} // close if condition

} // close while loop

} // close foreach loop

if ($wasFound == false) {

array_push($_SESSION["cart_array"], array("item_id" => $pid,

"quantity" => 1));

36
`
}

header("location: cart.php");

exit();

?>

<?php

Section 2 (if user chooses to empty their shopping cart)

if (isset($_GET['cmd']) && $_GET['cmd'] == "emptycart") {

unset($_SESSION["cart_array"]);

?>

<?php

// Section 3 (if user chooses to adjust item quantity)

if (isset($_POST['item_to_adjust']) && $_POST['item_to_adjust'] != "") {

// execute some code

$item_to_adjust = $_POST['item_to_adjust'];

$quantity = $_POST['quantity'];

37
`
$quantity = preg_replace('#[^0-9]#i', '', $quantity); // filter everything but numbers

if ($quantity >= 100) { $quantity = 99; }

if ($quantity < 1) { $quantity = 1; }

if ($quantity == "") { $quantity = 1; }

$i = 0;

foreach ($_SESSION["cart_array"] as $each_item) {

$i++;

while (list($key, $value) = each($each_item)) {

if ($key == "item_id" && $value == $item_to_adjust) {

// That item is in cart already so let's adjust its quantity using

array_splice()

array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id"

=> $item_to_adjust, "quantity" => $quantity)));

} // close if condition

} // close while loop

} // close foreach loop

?>

<?php

38
`
// Section 4 (if user wants to remove an item from cart)

if (isset($_POST['index_to_remove']) && $_POST['index_to_remove'] != "") {

// Access the array and run code to remove that array index

$key_to_remove = $_POST['index_to_remove'];

if (count($_SESSION["cart_array"]) <= 1) {

unset($_SESSION["cart_array"]);

} else {

unset($_SESSION["cart_array"]["$key_to_remove"]);

sort($_SESSION["cart_array"]);

?>

<?php

// Section 5 (render the cart for the user to view on the page)

$cartOutput = "";

$cartTotal = "";

$pp_checkout_btn = '';

$product_id_array = '';

if (!isset($_SESSION["cart_array"]) || count($_SESSION["cart_array"]) < 1) {


39
`
$cartOutput = "<h2 align='center'>Your shopping cart is empty</h2>";

} else {

// Start PayPal Checkout Button

$pp_checkout_btn .= '<form action="https://www.paypal.com/cgi-bin/webscr"

method="post">

<input type="hidden" name="cmd" value="_cart">

<input type="hidden" name="upload" value="1">

<input type="hidden" name="business" value="you@youremail.com">';

// Start the For Each loop

$i = 0;

foreach ($_SESSION["cart_array"] as $each_item) {

$item_id = $each_item['item_id'];

$sql = mysql_query("SELECT * FROM products WHERE id='$item_id' LIMIT

1");

while ($row = mysql_fetch_array($sql)) {

$product_name = $row["product_name"];

$price = $row["price"];

$details = $row["details"];

40
`
$pricetotal = $price * $each_item['quantity'];

$cartTotal = $pricetotal + $cartTotal;

setlocale(LC_MONETARY, "en_US");

$pricetotal = money_format("%10.2n", $pricetotal);

// Dynamic Checkout Btn Assembly

$x = $i + 1;

$pp_checkout_btn .= '<input type="hidden" name="item_name_' . $x . '"

value="' . $product_name . '">

<input type="hidden" name="amount_' . $x . '" value="' . $price . '">

<input type="hidden" name="quantity_' . $x . '" value="' . $each_item['quantity'] . '"> ';

// Create the product array variable

$product_id_array .= "$item_id-".$each_item['quantity'].",";

// Dynamic table row assembly

$cartOutput .= "<tr>";

$cartOutput .= '<td><a href="product.php?id=' . $item_id . '">' .

$product_name . '</a><br /><img src="inventory_images/' . $item_id . '.jpg" alt="' .

$product_name. '" width="40" height="52" border="1" /></td>';

$cartOutput .= '<td>' . $details . '</td>';

$cartOutput .= '<td>$' . $price . '</td>';

41
`
$cartOutput .= '<td><form action="cart.php" method="post">

<input name="quantity" type="text" value="' . $each_item['quantity'] . '"

size="1" maxlength="2" />

<input name="adjustBtn' . $item_id . '" type="submit" value="change" />

<input name="item_to_adjust" type="hidden" value="' . $item_id . '" />

</form></td>';

//$cartOutput .= '<td>' . $each_item['quantity'] . '</td>';

$cartOutput .= '<td>' . $pricetotal . '</td>';

$cartOutput .= '<td><form action="cart.php" method="post"><input

name="deleteBtn' . $item_id . '" type="submit" value="X" /><input name="index_to_remove"

type="hidden" value="' . $i . '" /></form></td>';

$cartOutput .= '</tr>';

$i++;

setlocale(LC_MONETARY, "en_US");

$cartTotal = money_format("%10.2n", $cartTotal);

$cartTotal = "<div style='font-size:18px; margin-top:12px;' align='right'>Cart Total : ".

$cartTotal." USD</div>";

// Finish the Paypal Checkout Btn

42
`
$pp_checkout_btn .= '<input type="hidden" name="custom" value="' .

$product_id_array . '">

<!-- start: MAIN JAVASCRIPTS -->

<script src="vendor/jquery/jquery.min.js"></script>

<script src="vendor/bootstrap/js/bootstrap.min.js"></script>

<script src="vendor/modernizr/modernizr.js"></script>

<script src="vendor/jquery-cookie/jquery.cookie.js"></script>

<script src="vendor/perfect-scrollbar/perfect-scrollbar.min.js"></script>

<script src="vendor/switchery/switchery.min.js"></script>

<!-- end: MAIN JAVASCRIPTS -->

<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY -->

<script src="vendor/maskedinput/jquery.maskedinput.min.js"></script>

<script src="vendor/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js"></

script>

<script src="vendor/autosize/autosize.min.js"></script>

<script src="vendor/selectFx/classie.js"></script>

<script src="vendor/selectFx/selectFx.js"></script>

<script src="vendor/select2/select2.min.js"></script>

<script src="vendor/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>

43
`
<script

src="vendor/bootstrap-timepicker/bootstrap-timepicker.min.js"></script>

<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY -->

<!-- start: CLIP-TWO JAVASCRIPTS -->

<script src="assets/js/main.js"></script>

<!-- start: JavaScript Event Handlers for this page -->

<script src="assets/js/form-elements.js"></script>

<script>

jQuery(document).ready(function() {

Main.init();

FormElements.init();

});

</script>

<!-- end: JavaScript Event Handlers for this page -->

<!-- end: CLIP-TWO JAVASCRIPTS -->

</body>

</html>

44
`

SAMPLE INPUT AND OUTPUT

45
`

46
`

47
`

48
`

49
`

50
`

51
`

52
`

53
`

54
`

55
`

56
`

57
`

58
`

59
`

60
`

61
`

62
`

63
`

64

You might also like