<?php require 'mods.php'; require 'election.php'; $mods = new Mods(); $mods->startConnection(); $election = new Election(); $election->startReading('candidates'); $action = $mods->escapeString($_POST['action']); if ($action == $mods->getAction(5)) { $position = $mods->escapeString($_POST['position']); $election->connectNow(); echo $election->showVotes($position); } $mods->stopConnection();
<?php require 'requests/mods.php'; $mods = new Mods(); if (isset($_SESSION['user_id']) && isset($_SESSION['user_type']) && $_SESSION['user_type'] != 'Voter') { header('Location: dashboard.php'); } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>UE College of Law Election System</title> <link rel="stylesheet" href="assets/css/font-awesome.min.css"> <link rel="stylesheet" href="assets/css/stylesheet.css"> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/script.js"></script> </head> <body id="main-body"> <div id="main-block" class="shadow"> <div id="header">UE College of Law Election <?php echo date('Y'); ?> </div> <div id="content"> <div id="sub-header">Voter Login</div> <div id="side-bar" style="padding: 0 25px; width: 200px;"> <form class="form" method="POST" action="requests/login_request.php" style="margin-top: 65%;"> <input type="hidden" name="action" value="827bdf30271a01cce1ba1bedae40b4e5"> <label>Student Number:</label>
<?php require 'requests/mods.php'; require 'requests/chat.php'; $mods = new Mods(); if (!(isset($_SESSION['user_id']) && isset($_SESSION['user_type']))) { $mods->sendStatus($mods->getError(1), 'admin.php'); } else { if ($_SESSION['user_type'] == 'Voter') { $mods->sendStatus($mods->getError(7), 'index.php'); } } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>UE College of Law Election System</title> <link rel="stylesheet" href="assets/css/font-awesome.min.css"> <link rel="stylesheet" href="assets/css/stylesheet.css"> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/dashboard.js"></script> </head> <body id="main-body"> <div id="main-block" class="shadow"> <div id="header">UE College of Law Election <?php echo date('Y'); ?> </div> <div id="content">
<?php require 'requests/mods.php'; require 'requests/chat.php'; $mods = new Mods(); if (!(isset($_SESSION['user_id']) && isset($_SESSION['user_type']))) { $mods->sendStatus($mods->getError(1), 'admin.php'); } else { if ($_SESSION['user_type'] == 'Voter') { $mods->sendStatus($mods->getError(7), 'index.php'); } } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>UE College of Law Election System</title> <link rel="stylesheet" href="assets/css/font-awesome.min.css"> <link rel="stylesheet" href="assets/css/stylesheet.css"> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/dashboard.js"></script> </head> <body id="main-body"> <div id="main-block" class="shadow"> <div id="header">UE College of Law Election <?php echo date('Y'); ?> <a href="dashboard.php" class="floating-button" style="right: 10px;"><span class="fa fa-home"></span></a></div> <div id="content">
function __construct() { parent::__construct(); $this->table = 'grid_mods'; }
function __construct() { parent::__construct(); $this->table = 'grid_mods_tpl'; $this->MY_table = 'mods_tpl'; }
<?php require 'mods.php'; require 'election.php'; $mods = new Mods(); $mods->startConnection(); $action = $mods->escapeString($_POST['action']); if ($action == $mods->getAction(1)) { $studentNumber = $mods->escapeString($_POST['studentNumber']); $mods->setQuery("SELECT * FROM voters WHERE Voter_ID='{$studentNumber}'"); if ($mods->getCount() == 1) { $row = $mods->getResults('array'); if ($row['Status'] == 1) { $mods->login($studentNumber, 'Voter'); $mods->sendStatus($mods->getError(0), '../index.php'); } else { if ($row['Status'] == 0) { $mods->sendStatus($mods->getError(3), '../index.php'); } else { if ($row['Status'] == 2) { $mods->sendStatus($mods->getError(4), '../index.php'); } } } } else { $mods->sendStatus($mods->getError(2), '../index.php'); } } else { if ($action == $mods->getAction(2)) { $username = $mods->escapeString($_POST['username']); $password = $mods->escapeString($_POST['password']);
function test_inherit_and_restore_success() { $mods = new Mods($this->parent_slug, array('name1' => 'val1-parent', 'name2' => 'val2-parent'), $this->child_slug, array('name1' => 'val1-child', 'name3' => 'val3-child')); Inherit_theme_mods::set_theme_mods_of($this->parent_slug, $mods->assigned()->parent); Inherit_theme_mods::set_theme_mods_of($this->child_slug, $mods->assigned()->child); switch_theme($this->child_slug); $itm = new Inherit_Theme_Mods(); //test if inheritted $this->assertTrue($itm->inherit()); $this->assertArrayDeepEquals(array('name1' => 'val1-parent', 'name2' => 'val2-parent', 'name3' => 'val3-child'), $mods->actual()->child); // test if automatically stored $this->assertArrayDeepEquals($mods->assigned()->child, $mods->actual()->trashed); //test if restored $this->assertTrue($itm->restore()); $this->assertArrayDeepEquals($mods->assigned()->child, $mods->actual()->child); //clean up. switch_theme($this->parent_slug); foreach ($mods->actual()->parent as $key => $value) { remove_theme_mod($key); } switch_theme($this->child_slug); foreach ($mods->actual()->parent as $key => $value) { remove_theme_mod($key); } }
<?php require 'mods.php'; require 'election.php'; $election = new Election(); $mods = new Mods(); $mods->startConnection(); $action = $mods->escapeString($_POST['action']); if ($action == $mods->getAction(3)) { $position = $mods->escapeString($_POST['position']); $election->startReading('candidates'); echo $election->getCandidates($position); } else { if ($action == $mods->getAction(4)) { $sessionID = $mods->getSession('user_id'); $mods->setQuery("SELECT * FROM voters WHERE Voter_ID='{$sessionID}'"); $row = $mods->getResults('array'); if ($row['Status'] == 0) { echo 'Voter not registered.'; } else { if ($row['Status'] == 1) { $ctr = 0; foreach ($_POST['votes'] as $vote) { if ($vote != '') { $mods->setQuery("INSERT INTO votes (Voter_ID, Candidate_ID) VALUES ('{$sessionID}', '{$vote}')"); if ($mods->getCount() > 0) { $ctr++; } } } if ($ctr > 0) {
<?php require 'requests/mods.php'; $mods = new Mods(); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>UE College of Law Election System</title> <link rel="stylesheet" href="assets/css/font-awesome.min.css"> <link rel="stylesheet" href="assets/css/stylesheet.css"> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/admin.js"></script> </head> <body id="main-body"> <div id="main-block" class="shadow"> <div id="header">UE College of Law Election <?php echo date('Y'); ?> </div> <div id="content"> <div id="sub-header">Administrative Login</div> <div id="side-bar" style="padding: 0 25px; width: 200px;"> <form class="form" method="POST" action="requests/login_request.php" style="margin-top: 65%;"> <input type="hidden" name="action" value="b6e31daf2404aab3d78c7e972dfe3f8d"> <label>Username:</label> <input class="input-box focused-input" type="text" name="username" maxlength="11" required> <label>Password:</label> <input class="input-box" type="password" name="password" maxlength="11" required>