示例#1
0
    }
}
?>
<!DOCTYPE html>
<html>
  <head>
    <title>Voting System - Ballot</title>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
    <link href="misc/css/index.css" rel="stylesheet" media="screen" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="bootsrap/assets/css/bootstrap-responsive.css" rel="stylesheet" />
  </head>
  <body>
    
    <?php 
if (in_array($_SESSION['studID'], get_voters($_GET['bid'])) || get_status($_GET['bid']) === '1' && $_SESSION['userGroup'] !== 'admin' || isActive($_GET['bid']) === '0' && $_SESSION['userGroup'] !== 'admin') {
    ?>
			
			<div class="container-fluid" id="base">
				<div class="row-fluid">
					<div class="span8 offset2" id="content" style="position: fixed; top: 35%; max-height: 200px;">
						<p>
							<br />
							<br />
							<h1 style="text-align: center;">This ballot is no longer available for you.</h1>
						</p>
					</div>
				</div>
			</div>
			
			<?php 
示例#2
0
}
?>
              </div>
              <table class="table table-hover" id="ballots"> 
                <?php 
$a_ballots = get_active_ballots();
if ($a_ballots) {
    foreach ($a_ballots as $ballot) {
        ?>
                        
                        <?php 
        if ($_SESSION['studDept'] === $ballot['department'] || $_SESSION['userGroup'] === 'admin') {
            ?>
                        
                        <?php 
            $voters = get_voters($ballot['id']);
            $voted = in_array($_SESSION['studID'], $voters) ? true : false;
            ?>
                        
                        <tr>
                          <td>
                            <?php 
            if ($voted === false && $ballot['status'] === '0') {
                ?>
                              <a href="ballot.php?bid=<?php 
                echo $ballot['id'];
                ?>
"><?php 
                echo $ballot['title'];
                ?>
</a>