+ All Categories
Home > Documents > Ovs Final Edit 23 04 12 (1)

Ovs Final Edit 23 04 12 (1)

Date post: 14-Apr-2018
Category:
Upload: surabhi-singh
View: 217 times
Download: 0 times
Share this document with a friend

of 44

Transcript
  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    1/44

    ONVS 1

    Global Institute Of Technology

    Jaipur

    Department Of CSE

    Session: 2011-2012

    Submitted by: Submitted to:

    Surabhi Singh Ms. Nidhi Goyal

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    2/44

    ONVS 2

    Project File

    Of

    CASE Lab

    Project TitleONLINE NATIONAL VOTING

    SYSTEM

    Prepared By:

    Surabhi Singh Shefali Gupta

    Branch CS Branch CS

    2nd year/4th semester 2nd year/4th semester

    Roll no. 10EGJCS059 Roll no. 10EGJCS053

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    3/44

    ONVS 3

    INDEXS No. Software development Phase Date Remarks

    1. Feasibility Study 12-03-12

    2. Software requirementSpecification

    20-03-12

    3. Data Flow Diagrams 27-03-12

    4. ER Diagram 27-03-124. Use Case Diagrams 17-04-125. Coding 24-04-12

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    4/44

    ONVS 4

    Feasibility StudyMotivation:

    The present Voting system, i.e. the system using EVMs (electronic Voting machines) has

    successfully replaced the old system that used paper ballets. Now, as the e-world is

    spreading like a wildfire, time has come to apply the online concept to the present Voting

    System. This would not only increase the percentage of votes cast, but will also bring down

    the cost of conducting elections. Also, people who do not live in their hometowns will be able

    to cast votes, thus further increasing the percentage of votes cast and giving us better or

    more accurate and precise results.

    Input Assumptions:

    All the voters have their Unique ID. All voters are literate. All voters have access to the internet. Voters will need to register using their unique ID before they can vote. All voters will have a secret password, which will be generated at the time of

    registration.

    Problem Definition:

    The conventional voting system using EVMs is easier and safer than ballets, but still itscostlier as Voting centers are formed and people assigned to overlook the entire process

    are given TAs and DAs out of the government reservoir.

    Not all voters can cast vote as many of them live in other towns and cities. People have to travel long distances to cast their votes. The additional cost of counting of votes. The wait and delay in the results. The cost of security provided for the EVMs.

    Objective:

    The online Voting system is a user Friendly online software, where users can register and log

    in to cast their Votes without the hassle of travelling to a voting centre. The main objective is

    to maintain a record of all the voters and conduct online polls during election period.

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    5/44

    ONVS 5

    Maintain records of all the citizens. Keep records of the eligible vote bank of a particular election being conducted at a given

    time.

    Keep a record of the votes cast for all the candidates.

    Keep a record of all the votes cast. Give result as soon as the end of elections. Calculate the percentage of votes cast. An educational tour will be given to all the users at the time of registration. User manuals will be provided several days before elections. One person can vote only once, though they can log in again to see who they cast vote

    for.

    The administrators input all the information about the Candidates before polling opensand can change it after one poll for reuse of the software.

    The administrators have access to all the data input by voters. At the end of elections, the administrators can announce the winners right away. Voters can change their password after they log in.

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    6/44

    ONVS 6

    SOFTWAREREQUIREMENT

    SPECIFICATION

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    7/44

    ONVS 7

    1. Introduction:1.1 Purpose:The purpose of our project is to provide an easy and cheaper way of election system, which

    will ensure secure elections along with bringing down the total cost and increasing the

    percentage of votes cast. This software can also be used by the ruling Government to conduct

    polls and know the general opinion of the people on current issues.

    1.2 Scope:

    IN SCOPE:

    Administrators can keep record of all the candidates. Administrators can input the number of and the basic information of all the

    candidates at the start of elections.

    Administrators can keep record of Voters. Administrators can see and declare the result at the end of poll.

    OUT OF SCOPE:

    People who are illiterate cant vote. People who dont have access to internet will have to go to a nearby online voting

    centre to cast their vote.

    1.3 Definitions:

    Unique ID: A unique identification alphanumeric code assigned to all the citizens at the time

    of census.

    Password: An alphanumeric code that gives you access to the system.

    Voters: Citizens eligible for casting votes at a given time.

    Literate: One who can read write and understand in any language.

    Poll/Elections: Formal decision-making process by which a population chooses an individual

    to hold public office.

    Database: Collection of information in a structured form.

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    8/44

    ONVS 8

    Administrators: People assigned by the Election Commission to oversee the smooth and safe

    elections.

    Server: The computer systems where all the data is stored.

    1.4 Abbreviations:

    DB: Database

    ONVS: Online National Voting System

    SW: Software

    UID: Unique ID

    GUI: Graphic User Interface

    TA: Travel Allowance

    DA: Daily Allowance

    CV: Cast Vote

    1.5 References:

    http://en.wikibooks.org/wiki/PHP_Programming/

    http://www.w3schools.com/php/

    http://www.w3schools.com/sql

    Various books on Software Engineering

    1.6 Overview:

    The rest of the SRS is organized as follows:

    Section 2 gives an overall description of the sw. It determines the level of proficiency whichis expected from user, some general constraints while making this sw and making some

    assumption and dependencies.

    Section 3 gives special requirement which the sw is expected to deliver. Functional

    requirements and some design constraints are also given.

    Section 4 gives some possible future extensions of the system.

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    9/44

    ONVS 9

    2. Overall Description2.1 Product Perspective:

    The online National Voting system is a self contained system that manages all the on goings

    of national or regional elections. From maintaining database to conducting elections in a

    fruitful manner, and then giving results right away. The election commission will appoint the

    authorized body to view, maintain and change the data regarding voters and candidates.

    2.2 Product Functions:

    The sw should support the following use cases:

    Class of use Cases Use Cases Description

    Use case related to

    installation of sw

    Installation Installing the sw

    Use cases related to security UID UID and password required

    by the users and

    administrators.

    Changing Password Admin as well as users can

    change passwords for

    enhanced security.

    Use cases related to details User Details Users can see and edit their

    details change their details

    stored in the Database

    Candidate Details Admin can change and edit

    the Details regardingCandidates as required by

    the election Commission

    Use Case related to casting of

    Votes

    Vote Casting Users can cast their votes via

    one click after logging in to

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    10/44

    ONVS 10

    their accounts

    Use case related to counting

    of Votes and result

    Declaration

    Counting of Votes Votes will be counted

    automatically through the

    coding so that the countincreases every time a user

    casts vote

    Declaration of result The admin can see the result

    as soon as the voting is

    closed along with the

    calculations regarding

    percentage of votes cast.

    2.3 User Characteristics:

    Users must have knowledge about Internet. Users must be literate.

    2.4 Principle Actor:

    Database: Administrators

    Result Declaration and Changing Data Regarding Candidates: Administrators

    Casting of Votes: User

    2.5 General Constraints:

    GUI is only in English and Hindi. Requirement of a Computer System. Requirement of Internet access.

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    11/44

    ONVS 11

    3. Specific Requirements3.1Functional Requirements:

    We describe the functional Requirements using Various Use cases:

    3.1.1 Use Case Name: Voter RegistrationPrimary Actor: Voter

    Pre-Requisite: Internet Connection, A genuine user with his unique ID for Registration.

    Purpose: Registering the Voter to the Database

    Main Scenario:

    Voter enters the system homepage. He clicks the register now button. The system prompts the application form. He fills in the necessary information related with him in the application form. He sends the request for registration by using send button. If the information is correctly entered the system prints a successful message. Otherwise, it prints appropriate error message, redisplays the application form.

    Alternative Scenario: Null

    3.1.2 Use Case name: Update VotersPrimary Actor: Administration

    Pre Requisite: Internet Connection, Updated Database

    Purpose: To update the newly added Voters to Database and remove or edit information

    about existing Voters.

    Main Scenario:

    Admin selects on Update Voters from menu and displays that page Admin click on Update Now button The system checks online voters with respect to upcoming elections voters list

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    12/44

    ONVS 12

    If the voter exists in the list, the system updates the voter with respect to officialvoter information.

    If the voter does not exist in the list, the system deletes that voter fromdatabase.

    Alternative Scenario: Null

    3.1.3 Use Case name: Log In/ Log OutPrimary Actor: User

    Pre Requisite: Internet connection, UID and Password

    Purpose: A voter may log in to see their profile, edit it, change password or cast vote and view

    their vote cast.

    Main Scenario:

    The user enters his login id and password If the login and password is valid,

    The specific page of every user is loaded

    If the login or password is not valid, the login screen is redisplayed with an error messagethe user click on the logout button

    Alternative Scenario: Null

    3.1.4 Use Case name: Change PasswordPrimary Actor: User

    Pre Requisite: Internet connection, UID and Password

    Purpose: The user can change their Password by entering their original password

    Main Scenario:

    User clicks on Update Account. The system opens a new page to enter old password and the new one. The user enters his old password. He then enters his new password User clicks the submit button. If the old password was entered incorrectly, the system will print an error message and

    the form to change password will re-appear.

    If the old password was entered correctly the system changes password and prints asuccess message and redirects to his profile.

    Alternative Scenario: Null

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    13/44

    ONVS 13

    3.1.5 Use Case name: Edit the Candidate InformationPrimary Actor: Admin

    Pre Requisite: Candidate information Submitted by candidate, Internet Connection

    Purpose: Update data about Candidates

    Main Scenario:

    The admin Logs in. There is a button labeled, add a new Candidate or edit Candidate Information The admin puts in new data, clicks on Save.

    Alternative Scenario: Null

    3.1.6 Use Case name: View/Declare ResultPrimary Actor: Admin

    Pre Requisite: Internet Connection

    Purpose: View and Declare result at the end of elections

    Main Scenario:

    The admin opens the result page. He clicks in the Declare result button. The result link is posted in the homepage.

    Alternative Scenario: Null

    3.1.7 Use Case name: Cast votePrimary Actor: Voter

    Pre Requisite: Internet connection, UID and Password

    Purpose: The voter can cast their vote

    Main Scenario:

    Voter logs in on the website. Voter goes to the online ballet page.

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    14/44

    ONVS 14

    Voter clicks on their desired Candidate and press save choice. Redirected to their profile

    Alternative Scenario: Null

    3.2Performance Requirements:a. Requires Internet connection.b. PHP enabled browserc. PHP runtime Environment.d. MS-SQL Server.e. 80 GB Hard Disk at server.f. Minimum 2 GB RAM.

    3.3Design Constraints:a. PHPb. PHP enabled browserc. MS-SQL Server as back-end.

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    15/44

    ONVS 15

    4. Future ExtensionsEarlier EVM system of conducting elections took up a lot of time and resources. Using an

    online system will strive to save both. Some more extensions are -Security: Sensitive data is protected from unwanted access by users. Appropriate

    technology and implementing strict user access-criteria.

    Provide good performance and ability to scale the server: The web application server

    should provide good performance and ability to manage performer technique such as, faster

    and easy access, reliability, etc.

    Centralized database: CD will enable efficient management of data.

    Safety and reliability: By incorporating a robust and proven RDBMS (SQL) into the

    system, reliable, performance and integrity of data is ensured. There must be a power

    backup for server system.

    Voting without having to travel: Voters living outside India who have Indian citizenship

    can also cast their vote.

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    16/44

    ONVS 16

    Data Flow Diagrams

    Flow Chart of Various attributes

    DFD

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    17/44

    ONVS 17

    ER Diagram

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    18/44

    ONVS 18

    Use Case Diagrams

    Voter Registration

    Update Voter List

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    19/44

    ONVS 19

    Log in

    Change Password

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    20/44

    ONVS 20

    Edit Candidate Information

    Declare Result

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    21/44

    ONVS 21

    Cast Votes

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    22/44

    ONVS 22

    Coding

    Creating database using mysql through terminal window:To open mysql console:

    surabhi@surabhi-laptop:-~$ mysql u rootp (enter)

    then, we enter mysql password on prompt.

    To create database:

    mysql> create database votingsystem;

    To change database:

    Use votingsystem;

    To create table users:

    CREATE TABLE `users` (

    `id` INT NOT NULL auto_increment ,

    `name` VARCHAR( 20 ) NOT NULL ,

    `password` VARCHAR( 20 ) NOT NULL ,

    `email`VARCHAR( 20 ) NOT NULL ,

    adminVARCHAR(20),

    votedVARCHAR(20),

    PRIMARY KEY ( `id` )

    );

    To create table parties:

    CREATE TABLE parties

    (

    'name' varchar(20) NOT NULL,

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    23/44

    ONVS 23

    'candiname' varchar(20),

    'count' int(20),

    primary key ('name'),

    );

    Index.php

    login page

    The online voting system

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    24/44

    ONVS 24

    else if($_SESSION["logging"])

    {

    $number_of_rows=checkpass();

    if($number_of_rows==1)

    {

    $_SESSION[user]=$_POST[userlogin];

    $_SESSION[logged]=true;

    print"you have loged in successfully";

    print_secure_content();

    }

    else{

    print "wrong password or username, please try again";

    print("
    ");

    loginform();

    }

    }

    }

    function loginform()

    {

    print "please enter your login information to proceed with our site";

    print ("usernamepassword");

    print "";

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    25/44

    ONVS 25

    print("
    ");

    print "register now!";

    }

    function checkpass()

    {

    $servername="localhost";

    $username="root";

    $password="compsubi";

    $conn= mysql_connect($servername,$username,$password)or die(mysql_error());

    mysql_select_db("votingsystem",$conn);

    $sql="select * from users where name='$_POST[userlogin]' and

    password='$_POST[password]'";

    $result=mysql_query($sql,$conn) or die(mysql_error());

    return mysql_num_rows($result);

    }

    function print_secure_content()

    {

    print("hi $_SESSION[user]");

    print "
    Now you can cast your precious vote Online!!";

    print "View Candidate Details";

    $servername="localhost";

    $username="root";

    $password="compsubi";

    $conn= mysql_connect($servername,$username,$password)or die(mysql_error());

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    26/44

    ONVS 26

    mysql_select_db("votingsystem",$conn);

    $m= mysql_query("SELECT * FROM users Where name='admin'");

    $n = mysql_fetch_array($m);

    $chk2=$n['admin'];

    $chk1=$n['voted'];

    if($_SESSION[user]!='admin')

    {

    if($chk1=='admin'&&$chk2=='admin')

    {

    echo "The Voting has been closed";

    print "view Result";

    }

    else if($chk2=='admin'&&$chk1!='admin')

    {

    echo "Elections are open now!!";

    print "Cast your Vote here";

    }

    else if($chk1!='admin'&&$chk2!='admin')

    {

    echo "elections are not open yet";

    }

    }

    if($_SESSION[user]=='admin')

    {

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    27/44

    ONVS 27

    print "admin page";

    if($chk1=='admin'&&$chk2=='admin')

    {

    echo "The Voting has been closed";

    print "view Result";

    }

    }

    print "logout";

    }

    ?>

    registerform.php

    register

    welcome to the registration page

    please input the registration details to create an account here

    User Name :

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    28/44

    ONVS 28

    email :

    password :

    retype password :

    Register.php

    h

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    29/44

    ONVS 29

    $password="compsubi";

    $conn= mysql_connect($servername,$username,$password)or die(mysql_error());

    mysql_select_db("votingsystem",$conn);

    $k==0;

    $m= mysql_query("SELECT name FROM users");

    while($n=mysql_fetch_array($m))

    {

    if($_POST["regname"]==$n[name])

    {

    $k++;

    }

    }

    if($k==0)

    {

    $sql="insert into users

    (name,email,password)values('$_POST[regname]','$_POST[regemail]','$_POST[regpass1]')";

    $result=mysql_query($sql,$conn) or die(mysql_error());

    print "you have registered sucessfully";

    }

    else

    {

    print "username already taken";

    }

    print "go to login page";

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    30/44

    ONVS 30

    }

    else print "passwords doesnt match";

    }

    else print"invaild data";

    ?>

    Candi.php

    Candidate Info

    Welcome to the Candidate Info page

    1. Ramdas

    Party: Lok shakti

    Election symbol:

    2. Thakur Shanti Prasad

    Party: Jan Jagruk

    Election symbol:

    3. Lakshmi Devi

    Party: Lok Seva

    Election symbol:

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    31/44

    ONVS 31

    4. Bheem Singh

    Party: Jaago

    Election symbol:

    5. Kamala Ben

    Party: jan samvedna

    Election symbol:

    go back to home page

    Admin.php

    Admin Page

    Welcome Admin

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    32/44

    ONVS 32

    print "back to main page";

    ?>

    open.php

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    33/44

    ONVS 33

    $password="compsubi";

    $conn= mysql_connect($servername,$username,$password)or die(mysql_error());

    mysql_select_db("votingsystem",$conn);

    if($_SESSION[user]=='admin')

    {

    mysql_query("UPDATE users SET voted='$_SESSION[user]' WHERE

    name='$_SESSION[user]'");

    }

    mysql_close($conn);

    echo "The result has been declared on the results page";

    print "proceed to results page";

    print "back to main page";

    ?>

    Vote.php

    For whom do you want to vote?

    Ramdas


    Thakur Shanti Prasad


  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    34/44

    ONVS 34

    Lakshmi Devi


    Bheem Singh


    Kamala Ben


    Count.php

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    35/44

    ONVS 35

    if($chk1!=$chk2)

    {

    $a="Ramdas";

    $b="Thakur Shanti Prasad";

    $c="Lakshmi Devi";

    $d="Bheem Singh";

    $e="Kamala Ben";

    echo "you voted for ".$_POST["candi"];

    if($_POST["candi"]==$a)

    {

    $result = mysql_query("SELECT * FROM parties Where candiname='Ramdas'");

    $row = mysql_fetch_array($result);

    $x=$row['count'];

    $x++;

    mysql_query("UPDATE parties SET count='$x' WHERE candiname='Ramdas'");

    mysql_query("UPDATE users SET voted='$_SESSION[user]' WHERE

    name='$_SESSION[user]'");

    mysql_close($conn);

    }

    else if($_POST["candi"]==$b)

    {

    $result = mysql_query("SELECT * FROM parties Where candiname='Thakur Shanti Prasad'");

    $row = mysql_fetch_array($result);

    $x=$row['count'];

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    36/44

    ONVS 36

    $x++;

    mysql_query("UPDATE parties SET count='$x' WHERE candiname='Thakur Shanti Prasad'");

    mysql_query("UPDATE users SET voted='$_SESSION[user]' WHEREname='$_SESSION[user]'");

    mysql_close($conn);

    }

    else if($_POST["candi"]==$c)

    {

    $result = mysql_query("SELECT * FROM parties Where candiname='Lakshmi Devi'");

    $row = mysql_fetch_array($result);

    $x=$row['count'];

    $x++;

    mysql_query("UPDATE parties SET count='$x' WHERE candiname='Lakshmi Devi'");

    mysql_query("UPDATE users SET voted='$_SESSION[user]' WHERE

    name='$_SESSION[user]'");

    mysql_close($conn);

    }

    else if($_POST["candi"]==$d)

    {

    $result = mysql_query("SELECT * FROM parties Where candiname='Bheem Singh'");

    $row = mysql_fetch_array($result);

    $x=$row['count'];

    $x++;

    mysql_query("UPDATE parties SET count='$x' WHERE candiname='Bheem Singh'");

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    37/44

    ONVS 37

    mysql_query("UPDATE users SET voted='$_SESSION[user]' WHERE

    name='$_SESSION[user]'");

    mysql_close($conn);

    }

    else if($_POST["candi"]==$e)

    {

    $result = mysql_query("SELECT * FROM parties Where candiname='Kamala Ben'");

    $row = mysql_fetch_array($result);

    $x=$row['count'];

    $x++;

    mysql_query("UPDATE parties SET count='$x' WHERE candiname='Kamala Ben'");

    mysql_query("UPDATE users SET voted='$_SESSION[user]' WHERE

    name='$_SESSION[user]'");

    mysql_close($conn);

    }

    }

    else{

    echo "You have already voted";

    }

    print "back to main page";

    ?>

    Result.php

    Results

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    38/44

    ONVS 38

    RESULTS


  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    39/44

    ONVS 39

    echo "Congratulations to the Winners.";

    }

    else

    {

    echo "The Result has not been declared yet.";

    }

    print "back to main page";

    ?>

    Logout.php

    logout

    You have logged out successfully

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    40/44

    ONVS 40

    Screenshots

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    41/44

    ONVS 41

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    42/44

    ONVS 42

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    43/44

    ONVS 43

  • 7/30/2019 Ovs Final Edit 23 04 12 (1)

    44/44

    ONVS 44


Recommended