<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
  <title>KVS DIGITAL - E-Vote</title>
<style>


input[type=radio] {
  border: 1px solid #000000;
  padding: 1em;
  -webkit-appearance: none;
}

input[type=radio]:checked {
  background: url(images/check.png) no-repeat center center;
  background-size: 15px 15px;
}

input[type=radio]:focus {
  outline-color: transparent;
}
</style>

  </head>
<body>
<div class="container">
    <nav class="navbar navbar-default">

    <h1>KVS Digital - VOTING SYSTEM</h1>
    <ul class="nav navbar-nav">
      <li class="active"><a href="index.html">Home</a></li>
       <li><a href="login.html">Undian</a></li>
      <li><a href="admin.html">Admin</a></li>
    </ul>

  </nav>

  <?php   

    $servername = "msv55-sh-ash";
    $username = "kvsdigit_nazli";
    $password="a0021856";
    $dbname = "kvsdigit_evote";

// Create connection

$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}


//CHECK STUDENT STATUS


//check FOR IF STUDENT EXIST BASED ON IC


//SELECT ALL CANDIDATE 
$sql = "SELECT * FROM tblcandidate";
$result = mysqli_query($conn, $sql);

if (!$result) {
    echo "Error".mysqli_error($conn);
}


 	
 	echo "<h3>PILIHANRAYA MAJLIS PERWAKILAN PELAJAR KOLEJ VOKASIONAL KAJANG 2018/2019</h3><br>";
    echo "<h4>PASTIKAN ANDA MENGUNDI 1 CALON UNTUK EXCO KOLEJ KEDIAMAN PUTERA</h4><br>";

while($row = mysqli_fetch_assoc($result)) {

?>

    <form action="" method="post">
   
    <?php 
    if($row[candPost] == "DIPLOMA") {?>
              
            <div class="col-md-3">
            <p><?php echo $row[candName];?> </p> 
            <p><?php echo $row[candCourse];?> </p>
            
            
            <p><img src="<?php echo $row[image];?>" style="width:128px;height:128px;"></p>
             
                <p><input type="radio" id="test<?php echo $row[candID];?>" name="kediaman1" value="<?php echo $row[candID];?>"  onclick="chkChecks('check[]')">
                  <label for="test<?php echo $row[candID];?>"></label></p><br><br>
               </div>       
        
 <?php
}
}



?>    


<input type="submit" class="btn btn-success" name="submit1" value="Sila hantar undian">
</form>



<script type="text/javascript">


</script>


</div>
</body>
</html>
