Twenty Five Blessed Brothers – Voting System
An online voting system for Twenty Five Blessed Brothers with features like auto-number assignment, live voting chart, admin dashboard, and CSV/PDF export.
Features
✅ Member registration with phone verification
✅ Automatic assignment of lucky numbers (1–25) when voting
✅ One vote per member
✅ Admin dashboard with live voting chart
✅ Export members & votes as CSV or PDF
✅ Live notifications on new registrations and number assignments
✅ Searchable member list (REG.NO, Name, Phone, Assigned Number)
✅ Mobile-friendly interface
✅ Dark mode toggle for admin dashboard
Technology Stack
Frontend: HTML, CSS, JavaScript, Bootstrap
Backend: PHP (with PDO for MySQL)
Database: MySQL
Charting: Chart.js
Notifications: Toastify.js
PDF Export: TCPDF
CSV Export: PHP native
Installation / Hosting
Clone the repository
git clone https://github.com/Dantechdevs/twenty_five_brothers.git cd twenty_five_brothers
Upload files to your hosting server (cPanel, Plesk, or FTP).
Create the database
Use phpMyAdmin or your hosting MySQL interface to run:
CREATE DATABASE twenty_five_brothers;
USE twenty_five_brothers;
CREATE TABLE members (
id int(11) NOT NULL AUTO_INCREMENT,
reg_no int(11) DEFAULT NULL,
name varchar(100) NOT NULL,
phone varchar(20) NOT NULL,
voted tinyint(1) DEFAULT 0,
assigned_number int(2) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY phone (phone)
);
CREATE TABLE votes (
id int(11) NOT NULL AUTO_INCREMENT,
reg_no int(11) NOT NULL,
picked_number int(2) NOT NULL,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
Configure database connection
Edit php/db.php:
PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC ]; try { $pdo = new PDO($dsn, $user, $pass, $options); } catch (\PDOException $e) { throw new \PDOException($e->getMessage(), (int)$e->getCode()); } ?>Access the system
Member page: https://yourdomain.com/vote.html
Admin dashboard: https://yourdomain.com/admin_dashboard.php
Admin login: https://yourdomain.com/admin_login.php
Admin Credentials
Set up an admin in the admins table:
CREATE TABLE admins (
id int(11) NOT NULL AUTO_INCREMENT,
username varchar(50) NOT NULL,
password varchar(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY username (username)
);
Hash your password using PHP password_hash():
echo password_hash('YOUR_PASSWORD', PASSWORD_DEFAULT);
Insert into admins:
INSERT INTO admins (username, password) VALUES ('admin', 'YOUR_HASHED_PASSWORD');
Folder Structure twenty_five_brothers/ │ ├─ admin_dashboard.php ├─ admin_login.php ├─ admin_results.php ├─ export_pdf.php ├─ export.php ├─ vote.html ├─ css/ │ └─ styles.css ├─ images/ │ └─ logo.png ├─ php/ │ ├─ db.php │ ├─ check_member.php │ ├─ generate_number.php │ ├─ register.php │ ├─ count_registered.php │ └─ submit_vote.php ├─ TCPDF-main/ └─ README.md
Notes
Only 25 members can register. The system automatically assigns numbers 1–25.
Votes are recorded per member REG.NO.
The dashboard live updates every 5 seconds for new registrations and assigned numbers.
License
MIT License – free to use and modify.