├── Voting System ├── sample.txt ├── admin │ ├── config.ini │ ├── logout.php │ ├── includes │ │ ├── conn.php │ │ ├── footer.php │ │ ├── session.php │ │ ├── slugify.php │ │ ├── ballot_modal.php │ │ ├── votes_modal.php │ │ ├── config_modal.php │ │ ├── menubar.php │ │ ├── navbar.php │ │ ├── header.php │ │ ├── scripts.php │ │ ├── profile_modal.php │ │ ├── positions_modal.php │ │ ├── voters_modal.php │ │ └── candidates_modal.php │ ├── voters_row.php │ ├── positions_row.php │ ├── votes_reset.php │ ├── candidates_row.php │ ├── voters_delete.php │ ├── positions_delete.php │ ├── candidates_delete.php │ ├── config_save.php │ ├── positions_edit.php │ ├── voters_photo.php │ ├── candidates_photo.php │ ├── candidates_edit.php │ ├── ballot_up.php │ ├── login.php │ ├── positions_add.php │ ├── candidates_add.php │ ├── ballot_down.php │ ├── voters_edit.php │ ├── voters_add.php │ ├── profile_update.php │ ├── index.php │ ├── print.php │ ├── ballot_fetch.php │ ├── votes.php │ ├── ballot.php │ ├── positions.php │ ├── voters.php │ ├── candidates.php │ └── home.php ├── images │ ├── cc.png │ ├── AAP.png │ ├── BJP.jpg │ ├── CCodes.png │ ├── profile.jpg │ ├── Congress.jpg │ ├── download-2.png │ ├── 1591634099318.jpg │ ├── icons8-youtube-96.png │ ├── Alpha Code Academy.jpg │ ├── bank management system.png │ ├── facebook-profile-image.jpeg │ └── 55279922-a70e4300-52ec-11e9-9b0c-893752ab791f.png ├── logout.php ├── includes │ ├── conn.php │ ├── footer.php │ ├── session.php │ ├── slugify.php │ ├── scripts.php │ ├── navbar.php │ ├── header.php │ └── ballot_modal.php ├── login.php ├── dist │ └── css │ │ ├── alt │ │ ├── AdminLTE-fullcalendar.min.css │ │ ├── AdminLTE-fullcalendar.css │ │ ├── AdminLTE-select2.min.css │ │ ├── AdminLTE-select2.css │ │ └── AdminLTE-bootstrap-social.min.css │ │ └── skins │ │ ├── skin-blue.min.css │ │ ├── skin-black.min.css │ │ ├── skin-green-light.min.css │ │ ├── skin-blue-light.min.css │ │ ├── skin-black-light.min.css │ │ ├── skin-green.css │ │ ├── skin-blue.css │ │ ├── skin-black.css │ │ ├── skin-green-light.css │ │ ├── skin-blue-light.css │ │ └── skin-black-light.css ├── time.css ├── submit_ballot.php ├── index.php ├── preview.php ├── time.html ├── readme.txt ├── db │ └── votingsystem.sql └── home.php ├── AAP.png ├── BJP.jpg ├── Congress.jpg ├── Final_VotingSystem.pptx ├── Timer_images ├── rocket.png ├── triangle.png └── background.png ├── SMS ├── tut.py ├── voters.csv ├── mail.py └── msg.py ├── README.md ├── Time ├── check_time.php └── index.html └── Registration ├── connect.php ├── style.css └── index.html /Voting System/sample.txt: -------------------------------------------------------------------------------- 1 | This is a sample file 2 | -------------------------------------------------------------------------------- /Voting System/admin/config.ini: -------------------------------------------------------------------------------- 1 | election_title = 2024 PM Election -------------------------------------------------------------------------------- /AAP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/AAP.png -------------------------------------------------------------------------------- /BJP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/BJP.jpg -------------------------------------------------------------------------------- /Congress.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Congress.jpg -------------------------------------------------------------------------------- /Final_VotingSystem.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Final_VotingSystem.pptx -------------------------------------------------------------------------------- /Timer_images/rocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Timer_images/rocket.png -------------------------------------------------------------------------------- /Timer_images/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Timer_images/triangle.png -------------------------------------------------------------------------------- /Timer_images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Timer_images/background.png -------------------------------------------------------------------------------- /Voting System/images/cc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/cc.png -------------------------------------------------------------------------------- /Voting System/images/AAP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/AAP.png -------------------------------------------------------------------------------- /Voting System/images/BJP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/BJP.jpg -------------------------------------------------------------------------------- /Voting System/logout.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Voting System/images/CCodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/CCodes.png -------------------------------------------------------------------------------- /Voting System/images/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/profile.jpg -------------------------------------------------------------------------------- /Voting System/admin/logout.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Voting System/images/Congress.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/Congress.jpg -------------------------------------------------------------------------------- /Voting System/images/download-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/download-2.png -------------------------------------------------------------------------------- /Voting System/images/1591634099318.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/1591634099318.jpg -------------------------------------------------------------------------------- /Voting System/images/icons8-youtube-96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/icons8-youtube-96.png -------------------------------------------------------------------------------- /Voting System/images/Alpha Code Academy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/Alpha Code Academy.jpg -------------------------------------------------------------------------------- /Voting System/images/bank management system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/bank management system.png -------------------------------------------------------------------------------- /Voting System/images/facebook-profile-image.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/facebook-profile-image.jpeg -------------------------------------------------------------------------------- /SMS/tut.py: -------------------------------------------------------------------------------- 1 | import requests 2 | resp = requests.post('https://textbelt.com/text', { 3 | 'phone': '8792367697', 4 | 'message' : 'Hello world', 5 | 'key' : 'textbelt', 6 | }) 7 | print(resp.json()) -------------------------------------------------------------------------------- /Voting System/images/55279922-a70e4300-52ec-11e9-9b0c-893752ab791f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirudh1103/Online-Voting-System/HEAD/Voting System/images/55279922-a70e4300-52ec-11e9-9b0c-893752ab791f.png -------------------------------------------------------------------------------- /Voting System/includes/conn.php: -------------------------------------------------------------------------------- 1 | connect_error) { 5 | die("Connection failed: " . $conn->connect_error); 6 | } 7 | 8 | ?> -------------------------------------------------------------------------------- /Voting System/admin/includes/conn.php: -------------------------------------------------------------------------------- 1 | connect_error) { 5 | die("Connection failed: " . $conn->connect_error); 6 | } 7 | 8 | ?> -------------------------------------------------------------------------------- /Voting System/admin/includes/footer.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Online-Voting-System 2 | Online voting system is a web based application using which Election process can be made easy. We all know that conducting elections is a cumbersome process, Using this Online voting system we can conduct the elections easily and get the results of the elections instantly & accurately. 3 | -------------------------------------------------------------------------------- /Voting System/admin/voters_row.php: -------------------------------------------------------------------------------- 1 | query($sql); 8 | $row = $query->fetch_assoc(); 9 | 10 | echo json_encode($row); 11 | } 12 | ?> -------------------------------------------------------------------------------- /Voting System/admin/positions_row.php: -------------------------------------------------------------------------------- 1 | query($sql); 8 | $row = $query->fetch_assoc(); 9 | 10 | echo json_encode($row); 11 | } 12 | ?> -------------------------------------------------------------------------------- /Voting System/includes/footer.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Voting System/admin/votes_reset.php: -------------------------------------------------------------------------------- 1 | query($sql)){ 6 | $_SESSION['success'] = "Votes reset successfully"; 7 | } 8 | else{ 9 | $_SESSION['error'] = "Something went wrong in reseting"; 10 | } 11 | 12 | header('location: votes.php'); 13 | 14 | ?> -------------------------------------------------------------------------------- /Voting System/includes/session.php: -------------------------------------------------------------------------------- 1 | query($sql); 8 | $voter = $query->fetch_assoc(); 9 | } 10 | else{ 11 | header('location: index.php'); 12 | exit(); 13 | } 14 | 15 | ?> -------------------------------------------------------------------------------- /Voting System/admin/includes/session.php: -------------------------------------------------------------------------------- 1 | query($sql); 11 | $user = $query->fetch_assoc(); 12 | 13 | ?> -------------------------------------------------------------------------------- /Voting System/admin/candidates_row.php: -------------------------------------------------------------------------------- 1 | query($sql); 8 | $row = $query->fetch_assoc(); 9 | 10 | echo json_encode($row); 11 | } 12 | ?> -------------------------------------------------------------------------------- /SMS/voters.csv: -------------------------------------------------------------------------------- 1 | "id","voters_id","password","firstname","lastname","email","number" 2 | "1","PiMtOog48kY9Zwp","Anir8792","Anirudh","C M","cmanirudh03@gmail.com","8792367697" 3 | "2","3ArO6wCi72GmbhV","Akas6360","Akash","B","akash077789@gmail.com","6360443749" 4 | "3","ytqzZmT1u6CLbMh","Chan9845","Chandan","T O","chandanto9036@gmail.com","9845449173" 5 | "4","ytqzZmT1u6CLbMh","Chan9845","Chandan","T O","cc8501417@gmail.com","9036372592" 6 | -------------------------------------------------------------------------------- /Voting System/admin/voters_delete.php: -------------------------------------------------------------------------------- 1 | query($sql)){ 8 | $_SESSION['success'] = 'Voter deleted successfully'; 9 | } 10 | else{ 11 | $_SESSION['error'] = $conn->error; 12 | } 13 | } 14 | else{ 15 | $_SESSION['error'] = 'Select item to delete first'; 16 | } 17 | 18 | header('location: voters.php'); 19 | 20 | ?> -------------------------------------------------------------------------------- /Voting System/admin/positions_delete.php: -------------------------------------------------------------------------------- 1 | query($sql)){ 8 | $_SESSION['success'] = 'Position deleted successfully'; 9 | } 10 | else{ 11 | $_SESSION['error'] = $conn->error; 12 | } 13 | } 14 | else{ 15 | $_SESSION['error'] = 'Select item to delete first'; 16 | } 17 | 18 | header('location: positions.php'); 19 | 20 | ?> -------------------------------------------------------------------------------- /Voting System/admin/candidates_delete.php: -------------------------------------------------------------------------------- 1 | query($sql)){ 8 | $_SESSION['success'] = 'Candidate deleted successfully'; 9 | } 10 | else{ 11 | $_SESSION['error'] = $conn->error; 12 | } 13 | } 14 | else{ 15 | $_SESSION['error'] = 'Select item to delete first'; 16 | } 17 | 18 | header('location: candidates.php'); 19 | 20 | ?> -------------------------------------------------------------------------------- /Voting System/includes/slugify.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Voting System/admin/includes/slugify.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Voting System/admin/config_save.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Voting System/admin/positions_edit.php: -------------------------------------------------------------------------------- 1 | query($sql)){ 11 | $_SESSION['success'] = 'Position updated successfully'; 12 | } 13 | else{ 14 | $_SESSION['error'] = $conn->error; 15 | } 16 | } 17 | else{ 18 | $_SESSION['error'] = 'Fill up edit form first'; 19 | } 20 | 21 | header('location: positions.php'); 22 | 23 | ?> -------------------------------------------------------------------------------- /Time/check_time.php: -------------------------------------------------------------------------------- 1 | $openHour || ($hour === $openHour && $minute >= $openMinute)) && 19 | 20 | ($hour < $closeHour || ($hour === $closeHour && $minute < $closeMinute)) 21 | 22 | ) { 23 | 24 | echo 'ACCESS_GRANTED'; 25 | 26 | } else { 27 | 28 | echo 'ACCESS_DENIED'; 29 | 30 | } 31 | 32 | ?> -------------------------------------------------------------------------------- /Voting System/admin/voters_photo.php: -------------------------------------------------------------------------------- 1 | query($sql)){ 13 | $_SESSION['success'] = 'Photo updated successfully'; 14 | } 15 | else{ 16 | $_SESSION['error'] = $conn->error; 17 | } 18 | 19 | } 20 | else{ 21 | $_SESSION['error'] = 'Select voter to update photo first'; 22 | } 23 | 24 | header('location: voters.php'); 25 | ?> -------------------------------------------------------------------------------- /Voting System/admin/candidates_photo.php: -------------------------------------------------------------------------------- 1 | query($sql)){ 13 | $_SESSION['success'] = 'Photo updated successfully'; 14 | } 15 | else{ 16 | $_SESSION['error'] = $conn->error; 17 | } 18 | 19 | } 20 | else{ 21 | $_SESSION['error'] = 'Select candidate to update photo first'; 22 | } 23 | 24 | header('location: candidates.php'); 25 | ?> -------------------------------------------------------------------------------- /Voting System/admin/candidates_edit.php: -------------------------------------------------------------------------------- 1 | query($sql)){ 13 | $_SESSION['success'] = 'Candidate updated successfully'; 14 | } 15 | else{ 16 | $_SESSION['error'] = $conn->error; 17 | } 18 | } 19 | else{ 20 | $_SESSION['error'] = 'Fill up edit form first'; 21 | } 22 | 23 | header('location: candidates.php'); 24 | 25 | ?> -------------------------------------------------------------------------------- /Voting System/admin/ballot_up.php: -------------------------------------------------------------------------------- 1 | false); 8 | 9 | $sql = "SELECT * FROM positions WHERE id='$id'"; 10 | $query = $conn->query($sql); 11 | $row = $query->fetch_assoc(); 12 | 13 | $priority = $row['priority'] - 1; 14 | 15 | if($priority == 0){ 16 | $output['error'] = true; 17 | $output['message'] = 'This position is already at the top'; 18 | } 19 | else{ 20 | $sql = "UPDATE positions SET priority = priority + 1 WHERE priority = '$priority'"; 21 | $conn->query($sql); 22 | 23 | $sql = "UPDATE positions SET priority = '$priority' WHERE id = '$id'"; 24 | $conn->query($sql); 25 | } 26 | 27 | echo json_encode($output); 28 | 29 | } 30 | 31 | ?> -------------------------------------------------------------------------------- /Voting System/admin/login.php: -------------------------------------------------------------------------------- 1 | query($sql); 11 | 12 | if($query->num_rows < 1){ 13 | $_SESSION['error'] = 'Cannot find account with the username'; 14 | } 15 | else{ 16 | $row = $query->fetch_assoc(); 17 | if(password_verify($password,$row['password'])){ 18 | $_SESSION['admin'] = $row['id']; 19 | } 20 | else{ 21 | $_SESSION['error'] = 'Incorrect password'; 22 | } 23 | } 24 | 25 | } 26 | else{ 27 | $_SESSION['error'] = 'Input admin credentials first'; 28 | } 29 | 30 | header('location: index.php'); 31 | 32 | ?> -------------------------------------------------------------------------------- /Voting System/admin/positions_add.php: -------------------------------------------------------------------------------- 1 | query($sql); 10 | $row = $query->fetch_assoc(); 11 | 12 | $priority = $row['priority'] + 1; 13 | 14 | $sql = "INSERT INTO positions (description, max_vote, priority) VALUES ('$description', '$max_vote', '$priority')"; 15 | if($conn->query($sql)){ 16 | $_SESSION['success'] = 'Position added successfully'; 17 | } 18 | else{ 19 | $_SESSION['error'] = $conn->error; 20 | } 21 | 22 | } 23 | else{ 24 | $_SESSION['error'] = 'Fill up add form first'; 25 | } 26 | 27 | header('location: positions.php'); 28 | ?> -------------------------------------------------------------------------------- /Voting System/admin/includes/ballot_modal.php: -------------------------------------------------------------------------------- 1 | 2 |
Sign in to start your session
16 | 17 | 32 |".$_SESSION['error']."
38 |