예제 #1
0
파일: index.php 프로젝트: RhanCandia/ovscse
include 'core/init.inc.php';
if (isset($_POST['studID'], $_POST['password'])) {
    $errors = array();
    if (empty($_POST['studID'])) {
        $errors[] = "Username ID can not be empty.";
    }
    if (empty($_POST['password'])) {
        $errors[] = "Password can not be empty.";
    }
    if (empty($errors)) {
        if (valid_credentials($_POST['studID'], $_POST['password']) === false) {
            $errors[] = "UserID and/or Password did not match.";
        } else {
            $_SESSION['studID'] = $_POST['studID'];
            $_SESSION['userName'] = get_userName($_POST['studID']);
            $_SESSION['studDept'] = get_userDept($_POST['studID']);
            $_SESSION['userGroup'] = get_userGroup($_POST['studID']);
            if ($_SESSION['userGroup'] === 'admin') {
                header('Location: adminpanel.php');
            }
            if ($_SESSION['userGroup'] === 'user') {
                header('Location: home.php');
            }
            if ($_SESSION['userGroup'] === 'encoder') {
                header('Location: reguser.php');
            }
        }
    }
}
?>
<!DOCTYPE html>
예제 #2
0
파일: home.php 프로젝트: RhanCandia/ovscse
            </li>
            <li>
              <a href="#newBallot" data-toggle="tab">New Ballot</a>
            </li>
            <?php 
}
?>
          </ul>

          <div id="ballotContents" class="tab-content">

            <div class="tab-pane fade in active" id="activeBallots">
              <div class="alert alert-info span10 offset1">
                
                  These are the ballots available for <?php 
echo get_collegeName(get_userDept($_SESSION['studID']));
?>
.

                <?php 
if ($_SESSION['userGroup'] === 'user') {
    ?>
                  <br />
                  <br />
                  If multiple ballots are available, you can cast your votes on each ballot. Just log in again after completing one ballot. Ballot results will be posted once the elections are over. To see the results, just log in again with your account.
                
                <?php 
}
?>
              </div>
              <table class="table table-hover" id="ballots">