Use this page to prepare passwords, configure the database, and deploy the system.
The system uses PHP's password_hash(). Generate hashes here to paste into your SQL or config files.
Note: This tool runs in your browser β passwords never leave your device.
| Purpose | Suggested Password | Where Used |
|---|---|---|
| Red House vote page | redhouse2081 | houses table, id=1 |
| Blue House vote page | bluehouse2081 | houses table, id=2 |
| Green House vote page | greenhouse2081 | houses table, id=3 |
| Yellow House vote page | yellowhouse2081 | houses table, id=4 |
| Results unlock (admin) | results2081 | election_config table |
β Change these before going live. Don't use the same password for multiple houses.
Run schema.sql in phpMyAdmin or via MySQL CLI:
mysql -u root -p < schema.sql
Use the generator above. Then update the houses table and election_config:
UPDATE houses SET password='YOUR_HASH' WHERE id=1; -- Red UPDATE houses SET password='YOUR_HASH' WHERE id=2; -- Blue UPDATE houses SET password='YOUR_HASH' WHERE id=3; -- Green UPDATE houses SET password='YOUR_HASH' WHERE id=4; -- Yellow UPDATE election_config SET value='YOUR_HASH' WHERE `key`='results_password';
Set your actual database credentials:
define('DB_USER', 'your_cpanel_db_user');
define('DB_PASS', 'your_db_password');
define('DB_NAME', 'daisy_election');
Edit the INSERT statements in schema.sql with real names, or insert via phpMyAdmin.
Candidates need: name, class, section, house_id, role.
Students need: name, roll_no, class, section, house_id.
Upload to your public_html or a subfolder. Files needed:
index.html β Main dashboard vote_red.html β Red House voting booth vote_blue.html β Blue House voting booth vote_green.html β Green House voting booth vote_yellow.html β Yellow House voting booth api.php β Backend (all API calls) config.php β DB credentials (keep private)
β Open each house voting page and verify password works
β Look up a test student roll number
β Cast a test vote and check the DB
β Verify the live count on index.html updates
β Test results unlock with the admin password
β Reset test votes: DELETE FROM votes; UPDATE students SET has_voted_house=0, has_voted_head=0, voted_at=NULL;
| File | Purpose | Audience |
|---|---|---|
index.html | Main dashboard β live counts + results | Public screen / Admin |
vote_red.html | Red House voting station | Red House students only |
vote_blue.html | Blue House voting station | Blue House students only |
vote_green.html | Green House voting station | Green House students only |
vote_yellow.html | Yellow House voting station | Yellow House students only |
api.php | All backend logic & DB queries | Server-side only |
config.php | DB credentials | Server-side only |
schema.sql | Full DB schema + sample data | One-time setup |
setup.html | This page β setup guide | Admin only (delete after setup) |
β Warning Delete setup.html from the server after completing setup.