<?php
session_start();
// if(isset($_POST['adminsubmit'])){
// $_SESSION["admin"] = $_POST["password1"];  
// }
//$_SESSION["admin"] = "digit2024";
if($_SESSION["admin"]== "digit2024"){

?>

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title>KVS DIGITAL - E-VOTING SYSTEM</title>
  <meta content="" name="description">
  <meta content="" name="keywords">

  <!-- Favicons -->
  <link href="assets/img/kvs.png" rel="icon">
  <link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">

  <!-- Google Fonts -->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">

  <!-- Vendor CSS Files -->
 	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="assets/vendor/icofont/icofont.min.css" rel="stylesheet">
  <link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
  <link href="assets/vendor/owl.carousel/assets/owl.carousel.min.css" rel="stylesheet">
  <link href="assets/vendor/venobox/venobox.css" rel="stylesheet">
  <link href="assets/vendor/aos/aos.css" rel="stylesheet">

  <!-- Template Main CSS File -->
  <link href="assets/css/style.css" rel="stylesheet">

  <!-- =======================================================
 
  ======================================================== -->
</head>

<body>

  <!-- ======= Header ======= -->
  <header id="header" class="fixed-top  header-transparent ">
    <div class="container d-flex align-items-center">
      
      <div class="logo mr-auto">      
        
        <!-- Uncomment below if you prefer to use an image logo -->
        <a class="navbar-brand" href="#"></a>
          <h1 class="text-light"><a href="index.html">KVS DIGITAL E- VOTING</h1><h5>ADMIN page</h5></a>
        </a>
      </div>

      <nav class="nav-menu d-none d-lg-block">
        
        <ul>
          <li class="active"><a href="index.php">Home</a></li>
          <li class="get-started"><a href="logout.php">logout</a></li>
        
        </ul>
       
      </nav><!-- .nav-menu -->

    </div>
  </header><!-- End Header -->
  </div>
<br><br><br><br><hr>
<div class="container">
 


 <!-- ======= Hero Section ======= -->
  <section id="hero" class="d-flex align-items-center" style="height:350px;">

    <div class="container">
      <div class="row">
        <div class="col-lg-6 d-lg-flex flex-lg-column justify-content-center align-items-stretch pt-5 pt-lg-0 order-2 order-lg-1" data-aos="fade-up">
          <div>
            <h1>Ruangan Admin</h1>
            <h2>Untuk tujuan urusan pengundian</h2>
            <h5>Terimakasih kerana menggunakan KVSDigital - E-Voting</h5>
          </div>
        </div>
        <div class="col-lg-6 d-lg-flex flex-lg-column align-items-stretch order-1 order-lg-2 hero-img" data-aos="fade-up">
          <img src="assets/img/vote.jpg" class="img-fluid" alt="">
        </div>
      </div>
    </div>

  </section><!-- End Hero -->
  
 <main id="main">
<br><hr>      
      <!-- ======= App Features Section ======= -->
    <section id="features" class="features contact">
      <div class="container">
        <div class="row no-gutters">
          <div class="col-xl-12 d-flex align-items-stretch order-2 order-lg-1">
              
            <div class="content d-flex flex-column justify-content-center">
                
              <div class="row">
                  
                <div class="col-md-6 icon-box" data-aos="fade-up">
                  <i class="bx bxs-add-to-queue"></i>
                  <a data-target="#addPelajar" data-toggle="modal" href="#features"><h4>Tambah Pelajar</h4></a>
                  <p>Isikan maklumat yang betul untuk menambah pelajar tiada dalam senarai</p>
                </div>
                
                <div class="col-md-6 icon-box" data-aos="fade-up" data-aos-delay="200">
                  <i class="bx bxs-message-square-check"></i>
                   <a href="status1.php"><h4>Status Pengundian I</h4></a>
                  <p>Semakan yang telah mengundi</p>
                </div>
                <div class="col-md-6 icon-box" data-aos="fade-up" data-aos-delay="300">
                  <i class="bx bxs-check-circle"></i>
                  <a href="status.php"><h4>Status Pengundian II</h4></a>
                  <p>Semakan pelajar belum mengundi.(ADMIN)</p>
                </div>
                <div class="col-md-6 icon-box" data-aos="fade-up" data-aos-delay="500">
                  <i class="bx bxs-group"></i>
                   <a data-target="#addCalon" data-toggle="modal" href="#features"><h4>Pencalonan</h4></a>
                
                  <p>Muatnaik maklumat calon</p>
                </div>
                <div class="col-md-6 icon-box" data-aos="fade-up" data-aos-delay="400">
                  <i class="bx bx-atom"></i>
                  <a data-target="#update" data-toggle="modal" href="#features"><h4>kemaskini Data Calon</h4></a>
                  <p>Kemaskini data calon</p>
                </div>
                <div class="col-md-6 icon-box" data-aos="fade-up" data-aos-delay="500">
                  <i class="bx bx-check"></i>
                  <a href="undiresult.php" target="_blank"><h4>KEPUTUSAN PEMILIHAN</h4></a>
                  <p>Ketahui keputusan undian secara langsung.</p>
                </div>
                <div class="col-md-6 icon-box" data-aos="fade-up" data-aos-delay="600">
                  <i class="bx bx-id-card"></i>
                  <a href="profilpelajar.php" target="_blank"><h4>PROFIL PELAJAR</h4></a>
                  <p>Paparan interaktif semua maklumat calon.</p>
                </div>
              </div>
            </div>
          </div>
          
        </div>

      </div>
    </section><!-- End App Features Section -->
 
  </main><!-- End #main -->
  
 


<!-- add Calon MODAL -->

<div class="modal fade" id="addCalon" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
          <h5 class="modal-title">PENCALONAN MPP <? echo date("Y");?></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        
        <div class="d-flex flex-column text-center">

<form class="" name="addcandidate" method="post" action="addcandidate.php" enctype="multipart/form-data">
     <div class="form-group">
      <div class="col-sm-10">
        <input type="text" class="form-control" name="candName" placeholder="Nama Penuh" required>
      </div>
    </div>
    
    <div class="form-group">
      <div class="col-sm-10">
        <input type="text" class="form-control" name="candN" placeholder="Nama Pertama" required>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-10">          
        <input type="text" class="form-control" name="candIC" placeholder="No Kad Pengenalan" required>
      </div>
    </div>
    
<div class="form-group row">
    <label class="col-sm-4" for="exampleFormControlSelect1">KELAS</label>
    <div class="col-sm-8">
    <select class="form-control" name="candCourse" id="exampleFormControlSelect1">
       <option value="2DBE">2DBE</option>
       <option value="2DMC">2DMC</option>
      <option value="2DMD">2DMD</option>
       <option value="2KA">2DKA</option>
       <option value="2KB">2DKB</option>
       <option value="2HA">2DHA</option>
       <option value="2DDC">2DDC</option>  
      <option value="1DBE">1DBE</option>
       <option value="1DMC">1DMC</option>
      <option value="1DMD">1DMD</option>
       <option value="1DKA">1DKA</option>
       <option value="1DKB">1DKB</option>
       <option value="1DHA">1DHA</option>
       <option value="1DDC">1DDC</option>
        <option value="2SVM HSK">2SVM HSK</option>
       <option value="2SVM HFD">2SVM HFD</option>
      <option value="2SVM BAK">2SVM BAK</option>
       <option value="2SVM KSK">2SVM KSK</option>
       <option value="2SVM KPD">2SVM KPD</option>
       <option value="2SVM MPP">2SVM MPP</option>
       <option value="2SVM MTA">2SVM MTA</option>
    </select>
    </div>
 <div>  
 <br>
   <div class="form-group">
      <div class="col-sm-12">          
        <input type="text" class="form-control" name="motto" placeholder="Motto/slogan (tidak melebihi 8 patah perkataan)" required>
      </div>
    </div>
  
  <div class="form-group row">  
          <label class="control-label col-sm-6" for="candImage">MuatNaik gambar calon:</label><br>
            <div class="col-sm-6">
            <br>
            <input type="file" name="image" />
               <br>
            </div>    
    </div>
     
      <div class="col-sm-offset-2 col-sm-10">
        <button type="submit" class="btn btn-info">Submit</button>
      </div>
    
  </form>
       <hr>   
          <div class="text-center text-muted delimiter">Admin only</div>
         
        </div>
      </div>
    </div>
      
  </div>
</div>
</div>
</div>
</div>
<!-- End add calon modal -->

<!-- add pelajar MODAL -->

<div class="modal fade" id="addPelajar" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header border-bottom-0">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="form-title text-center">
          <h4>TAMBAH PELAJAR</h4>
        </div>
        <div class="d-flex flex-column text-center">
          <form class="form-horizontal" name="addstudent" method="post" action="addstudent.php">
    <div class="form-group">
      <div class="col-sm-10">
        <input type="text" class="form-control" name="studentName" placeholder="Nama" required>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-10">          
        <input type="text" class="form-control" name="studentIC" placeholder="No Kad Pengenalan" required>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-10">          
        <input type="text" class="form-control" name="studentClass" placeholder="Kelas" required>
      </div>
    </div>
    <div class="form-group">   
       <br>    
      <div class="col-sm-offset-2 col-sm-10">
        <button type="submit" class="btn btn-info btn-block btn-round">Submit</button>
      </div>
    </div>
  </form>
          
          <div class="text-center text-muted delimiter">Admin only</div>
          <div class="d-flex justify-content-center social-buttons">
            
            </button>
          </di>
        </div>
      </div>
    </div>
      
  </div>
</div>
</div>
<!-- End add pelajar modal -->


 <!-- update calon -->
<div class="modal fade" id="update" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header border-bottom-0">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="form-title text-center">
          <h4>KEMASKINI DATA CALON</h4>
        </div>
        <div class="d-flex flex-column text-center">
          <form action="update2.php" method="post" >
             
            <div class="form-group">
              <input type="text" class="form-control" name="icCalon" placeholder="Masukkan no ic calon">
            </div>
            <button type="submit" class="btn btn-info btn-block btn-round">Submit</button>
          </form>
          
          <div class="text-center text-muted delimiter">Admin only</div>
          <div class="d-flex justify-content-center social-buttons">
            
            </button>
          </di>
        </div>
      </div>
    </div>
      
  </div>
</div>
<!-- End update modal -->
</div>  
 <!-- ======= Footer ======= -->
  <footer id="footer">
    <div class="container py-4">
      <div class="copyright">
        &copy; Copyright 2021<strong><span>kvsdigital.my </span></strong>. All Rights Reserved
      </div>
      <div class="credits">
        <!-- All the links in the footer should remain intact. -->
        <!-- You can delete the links only if you purchased the pro version. -->
        <!-- Licensing information: https://bootstrapmade.com/license/ -->
        <!-- Purchase the pro version with working PHP/AJAX contact form: https://bootstrapmade.com/free-bootstrap-app-landing-page-template/ -->
        Designed by Bootstrap</a>
      </div>
    </div>
  </footer><!-- End Footer -->

  <a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>
   <?php
}
else
{
echo '<script type="text/javascript">
   alert("You are not authorized!");
   window.location = "index.php";
</script>';
}
?>

 <!-- Vendor JS Files -->
  <script src="assets/vendor/jquery/jquery.min.js"></script>
  <script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="assets/vendor/jquery.easing/jquery.easing.min.js"></script>
  <script src="assets/vendor/php-email-form/validate.js"></script>
  <script src="assets/vendor/owl.carousel/owl.carousel.min.js"></script>
  <script src="assets/vendor/venobox/venobox.min.js"></script>
  <script src="assets/vendor/aos/aos.js"></script>

  <!-- Template Main JS File -->
  <script src="assets/js/main.js"></script>
  

</body>
</html>