From 8a535a3649b3fb45ea449cac12f6d3426ab8f745 Mon Sep 17 00:00:00 2001 From: Kavya Krishnan <69427698+kavyakrishnan42@users.noreply.github.com> Date: Thu, 7 Oct 2021 16:43:06 +0530 Subject: [PATCH 1/2] Some operational changes - Added voter profile card - Added withdrawal for the candidate - Added feature to start voting at the specified time --- admin_dashboard.php | 85 +++++++++++++++++ already.php | 131 ++++++++++++++++++++++++++ can_vote.php | 18 ++++ confirmation.php | 219 ++++++++++++++++++++++++++++++++++++++++++ conform_withdraw.php | 15 +++ process_cand_2.php | 30 ++++++ process_cand_3.php | 37 ++++++++ profile.php | 142 ++++++++++++++++++++++++++++ register.php | 220 +++++++++++++++++++++++++++++++++++++++++++ start_voting.php | 22 +++++ user_cand.php | 135 ++++++++++++++++++++++++++ voting_status.php | 18 ++++ wait.php | 124 ++++++++++++++++++++++++ withdraw.php | 47 +++++++++ 14 files changed, 1243 insertions(+) create mode 100644 admin_dashboard.php create mode 100644 already.php create mode 100644 can_vote.php create mode 100644 confirmation.php create mode 100644 conform_withdraw.php create mode 100644 process_cand_2.php create mode 100644 process_cand_3.php create mode 100644 profile.php create mode 100644 register.php create mode 100644 start_voting.php create mode 100644 user_cand.php create mode 100644 voting_status.php create mode 100644 wait.php create mode 100644 withdraw.php diff --git a/admin_dashboard.php b/admin_dashboard.php new file mode 100644 index 0000000..fd2a311 --- /dev/null +++ b/admin_dashboard.php @@ -0,0 +1,85 @@ + + + + + + + Document + + + + + + + + + +
+ +
+
+
+
+

ADMIN DASHBOARD

+
+
+
+
+
+ +
+ + + + + + + + \ No newline at end of file diff --git a/already.php b/already.php new file mode 100644 index 0000000..3978901 --- /dev/null +++ b/already.php @@ -0,0 +1,131 @@ + + + + + + + Document + + + + + + + + + +
+ + +
+ +
+
+ +

ALREADY VOTED

+
+ +
+ + + +
+
+shinzo + + +

+ +

+ + +

+ VoterID: +

+ + + +

+

+

+

+

+

+

Voted For: + +

+

+ +

+
+
+ + + + + + \ No newline at end of file diff --git a/can_vote.php b/can_vote.php new file mode 100644 index 0000000..4477e7e --- /dev/null +++ b/can_vote.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/confirmation.php b/confirmation.php new file mode 100644 index 0000000..44a7808 --- /dev/null +++ b/confirmation.php @@ -0,0 +1,219 @@ + + + + + + + Document + + + + + + + + +
+ + + + + +
+
+
+
+

Voting Confirmation

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name :
Email :
Branch :
Mobile Number :
Which Candidate :
Voter ID :
Roll No. :
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/conform_withdraw.php b/conform_withdraw.php new file mode 100644 index 0000000..abb2ac0 --- /dev/null +++ b/conform_withdraw.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/process_cand_2.php b/process_cand_2.php new file mode 100644 index 0000000..4f02639 --- /dev/null +++ b/process_cand_2.php @@ -0,0 +1,30 @@ +" . mysqli_error($conn); +} + + +?> diff --git a/process_cand_3.php b/process_cand_3.php new file mode 100644 index 0000000..bd173dd --- /dev/null +++ b/process_cand_3.php @@ -0,0 +1,37 @@ + 0) { + header("location:already.php?username=".$uname); +} +else +{ +$sql = "select * from voterlogin where email='".$uname."' and password='".$pword."'"; + +$result = mysqli_query($conn, $sql); + +if (mysqli_num_rows($result) > 0) { + // changing 'result' to associative arr and stored to 'row' + while($row = mysqli_fetch_assoc($result)) { + // created a session key and allocated values to iy + $_SESSION['vid'] = $row['voterid']; + $name = $_POST['fname']; + header("location:profile.php?username=".$uname); + } +} else { + $_SESSION['error'] = "Wrong Username or Password"; + header("location:login.php"); +} +} +mysqli_close($conn); + + +?> \ No newline at end of file diff --git a/profile.php b/profile.php new file mode 100644 index 0000000..92c5cb6 --- /dev/null +++ b/profile.php @@ -0,0 +1,142 @@ + + + + e-voting Candidates + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +

VOTER CARD

+
+ +
+ + + + + +
+
+shinzo + + +

+ +

+ + +

+ VoterID: +

+ + + +

+

+

+

+

+

+ +

+

+ + + + +

+
+
+ + + + + + \ No newline at end of file diff --git a/register.php b/register.php new file mode 100644 index 0000000..1d83a5f --- /dev/null +++ b/register.php @@ -0,0 +1,220 @@ + + + + + + Document + + + + + + + + + +
+ + + + + +
+
+
+
+

Voters Registration

+

Register

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name :
Email :
Mobile Number :
Branch :
Are you a candidate :
+ +
Password :
Confirm password :
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/start_voting.php b/start_voting.php new file mode 100644 index 0000000..b2dd4d3 --- /dev/null +++ b/start_voting.php @@ -0,0 +1,22 @@ +"; + foreach($rs as $row){ + + + + if($row['start']==2){ + echo 'Start Voting'; + }else if($row['start']==1){ + echo 'Stop Voting'; + }else if($row['start']==0){ + echo 'Start Voting'; + echo 'Stop Voting'; + } + } + echo ""; + +?> \ No newline at end of file diff --git a/user_cand.php b/user_cand.php new file mode 100644 index 0000000..2ef14a8 --- /dev/null +++ b/user_cand.php @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + + + Sno. + Name + Email + Number + Branch + status + Action + + "; + $i = 1; + foreach($rs as $row){ + $cid = $row['id']; + echo " + + ".$i." + ".$row['name']." + ".$row['email']." + ".$row['mobile']." + ".$row['branch']." + "; + if($row['approve_status']==0){ + echo "Pending"; + }else if($row['approve_status']==1){ + echo "Approved"; + }else{ + echo "Rejected"; + } + + echo " + "; + if($row['approve_status']==2){ + echo 'Approve'; + }else if($row['approve_status']==1){ + echo 'Reject'; + }else if($row['approve_status']==0){ + echo 'Approve'; + echo 'Reject'; + } + + echo " + + "; + $i++; + } + echo ""; + ?> +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/voting_status.php b/voting_status.php new file mode 100644 index 0000000..dcd5bce --- /dev/null +++ b/voting_status.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/wait.php b/wait.php new file mode 100644 index 0000000..e54cd02 --- /dev/null +++ b/wait.php @@ -0,0 +1,124 @@ + + + + + + + Document + + + + + + + +
+ +
+
+
+
+

Voting hasn't started yet

+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/withdraw.php b/withdraw.php new file mode 100644 index 0000000..549ed0c --- /dev/null +++ b/withdraw.php @@ -0,0 +1,47 @@ + + + + + + Document + + + +
+
+
+
+

Withdrawal Form

+

Are you sure you want to withdraw?

+
+
+

Withdrawal Form

+ + + + + + + + + + + + + +
+ +
+
+ +
+
+
+
+ + + \ No newline at end of file From fc1b4eee1ede14a08cc3f458e0bee3fde02dcbd4 Mon Sep 17 00:00:00 2001 From: Kavya Krishnan <69427698+kavyakrishnan42@users.noreply.github.com> Date: Thu, 7 Oct 2021 16:53:50 +0530 Subject: [PATCH 2/2] New database --- evoting (1).sql | 241 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 evoting (1).sql diff --git a/evoting (1).sql b/evoting (1).sql new file mode 100644 index 0000000..398c020 --- /dev/null +++ b/evoting (1).sql @@ -0,0 +1,241 @@ +-- phpMyAdmin SQL Dump +-- version 5.0.2 +-- https://www.phpmyadmin.net/ +-- +-- Host: 127.0.0.1:3306 +-- Generation Time: Oct 07, 2021 at 11:22 AM +-- Server version: 8.0.21 +-- PHP Version: 7.3.21 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Database: `evoting` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `admin` +-- + +DROP TABLE IF EXISTS `admin`; +CREATE TABLE IF NOT EXISTS `admin` ( + `aid` int NOT NULL AUTO_INCREMENT, + `username` varchar(100) DEFAULT NULL, + `password` varchar(100) DEFAULT NULL, + `aname` varchar(100) DEFAULT NULL, + PRIMARY KEY (`aid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `admin` +-- + +INSERT INTO `admin` (`aid`, `username`, `password`, `aname`) VALUES +(1, 'admin@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', 'admin'), +(2, 'admin@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', 'admin'), +(3, 'abc', '123', 'admin'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `candidates` +-- + +DROP TABLE IF EXISTS `candidates`; +CREATE TABLE IF NOT EXISTS `candidates` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(50) DEFAULT NULL, + `email` varchar(100) DEFAULT NULL, + `mobile` bigint DEFAULT NULL, + `branch` varchar(30) DEFAULT NULL, + `approve_status` int DEFAULT '0' COMMENT '0 for pending , 1 for approve 2 for reject', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `candidates` +-- + +INSERT INTO `candidates` (`id`, `name`, `email`, `mobile`, `branch`, `approve_status`) VALUES +(36, 'Gautham', 'gautham321@gmail.com', 8290869976, 'Computer Science', 1), +(35, 'Ayimen ', 'mailtoayimen@gmail.com', 9082378122, 'Information Technology', 1), +(37, 'Karthika', 'karthia@cusat.ac.in', 1234567, 'Information Technology', 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `candidate_3rd` +-- + +DROP TABLE IF EXISTS `candidate_3rd`; +CREATE TABLE IF NOT EXISTS `candidate_3rd` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(60) DEFAULT NULL, + `email` varchar(60) DEFAULT NULL, + `mobile` bigint DEFAULT NULL, + `branch` varchar(60) DEFAULT NULL, + `rollno` bigint DEFAULT NULL, + `enrollid` varchar(40) DEFAULT NULL, + `approve_status` int DEFAULT '0' COMMENT ' 0 for pending , 1 for approve 2 for reject', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `candidate_3rd` +-- + +INSERT INTO `candidate_3rd` (`id`, `name`, `email`, `mobile`, `branch`, `rollno`, `enrollid`, `approve_status`) VALUES +(1, 'Mayank', 'mayank@gmail.com', 32412, 'Information Technology', 3342, '432', 1), +(2, 'Parinay', 'mayank@gmail.com', 6269888, 'Mechanical', 6849545, '32432', 1), +(3, 'Abhay', 'mayank@gmail.com', 626887802, 'Information Technology', 5255152, '3242134', 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `comm` +-- + +DROP TABLE IF EXISTS `comm`; +CREATE TABLE IF NOT EXISTS `comm` ( + `id` int NOT NULL, + `start` int NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `comm` +-- + +INSERT INTO `comm` (`id`, `start`) VALUES +(1, 2); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `contact` +-- + +DROP TABLE IF EXISTS `contact`; +CREATE TABLE IF NOT EXISTS `contact` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(100) DEFAULT NULL, + `email` varchar(100) DEFAULT NULL, + `message` varchar(250) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `suggestion` +-- + +DROP TABLE IF EXISTS `suggestion`; +CREATE TABLE IF NOT EXISTS `suggestion` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(50) DEFAULT NULL, + `email` varchar(50) DEFAULT NULL, + `number` bigint DEFAULT NULL, + `rollno` bigint DEFAULT NULL, + `suggestion` varchar(250) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +CREATE TABLE IF NOT EXISTS `users` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(60) DEFAULT NULL, + `email` varchar(60) DEFAULT NULL, + `Branch` text, + `number` bigint DEFAULT NULL, + `candidate` varchar(60) DEFAULT NULL, + `rollno` bigint DEFAULT NULL, + `reason` varchar(200) DEFAULT NULL, + `status` varchar(5) NOT NULL DEFAULT 'NO', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `users` +-- + +INSERT INTO `users` (`id`, `name`, `email`, `Branch`, `number`, `candidate`, `rollno`, `reason`, `status`) VALUES +(46, 'Kailas', '19it048kail@ug.ac.cusat.in', 'I T', 8281867676, 'Ayimen', 1, '58436', 'yes'), +(47, 'NewVoter', 'newvoter@cusat.ac.in', 'Information Technology', 123456789, 'Ayimen', 12345, '63515', 'yes'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `users_3rd` +-- + +DROP TABLE IF EXISTS `users_3rd`; +CREATE TABLE IF NOT EXISTS `users_3rd` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(60) DEFAULT NULL, + `email` varchar(60) DEFAULT NULL, + `Branch` varchar(60) DEFAULT NULL, + `number` bigint DEFAULT NULL, + `candidate` varchar(60) DEFAULT NULL, + `rollno` bigint DEFAULT NULL, + `reason` varchar(250) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `users_3rd` +-- + +INSERT INTO `users_3rd` (`id`, `name`, `email`, `Branch`, `number`, `candidate`, `rollno`, `reason`) VALUES +(1, 'Abhay', 'mayank@gmail.com', 'IT', 684565, 'Parinay', 651, 'sade'), +(2, 'Aditya', 'adityakumarverified@gmail.com', 'IT', 6268887802, 'Parinay', 205503318002, 'nothing\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `voterlogin` +-- + +DROP TABLE IF EXISTS `voterlogin`; +CREATE TABLE IF NOT EXISTS `voterlogin` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(200) DEFAULT NULL, + `email` varchar(200) DEFAULT NULL, + `mobile` bigint DEFAULT NULL, + `branch` varchar(200) DEFAULT NULL, + `IsCand` varchar(5) DEFAULT NULL, + `voterid` int NOT NULL, + `password` varchar(50) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `voterlogin` +-- + +INSERT INTO `voterlogin` (`id`, `name`, `email`, `mobile`, `branch`, `IsCand`, `voterid`, `password`) VALUES +(7, 'Kailas', '19it048kail@ug.ac.cusat.in', 8281867676, 'Information Technology', 'No', 58436, '12345678'), +(8, 'NewVoter', 'newvoter@cusat.ac.in', 123456789, 'Information Technology', 'No', 63515, 'abc@123'), +(10, 'Kavya', 'kavya@cusat.ac.in', 1234567, 'Information Technology', 'No', 28378, '123'), +(12, 'Karthika', 'karthia@cusat.ac.in', 1234567, 'Information Technology', 'No', 47136, '123'); +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;