You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1007 B

  1. <?php
  2. ini_set('session.use_only_cookies', TRUE);
  3. ini_set('session.use_trans_sid', FALSE);
  4. session_start();
  5. require_once("conn/db.php");
  6. if (!isset($_SESSION['nim'])) {
  7. header('location:login.php');
  8. } else {
  9. $nim = $_SESSION['nim'];
  10. }
  11. //CEK SUDAH POLING / BELUM :
  12. $queryStudent = "SELECT
  13. TOP 1
  14. a.nim,
  15. b.nim_panitia,
  16. b.role,
  17. COUNT(c.id_pemilu) AS votes
  18. FROM
  19. tb_mhs AS a
  20. LEFT JOIN
  21. tb_panitia b ON b.nim_panitia = a.nim
  22. LEFT JOIN
  23. tb_pemilu c ON c.nim_mhs = a.nim
  24. WHERE
  25. a.nim = '$nim'
  26. GROUP BY
  27. a.nim,
  28. b.nim_panitia,
  29. b.role";
  30. $execStudent = odbc_exec($koneksi, $queryStudent);
  31. $student = odbc_fetch_array($execStudent);
  32. if ($student['votes'] == 0 && $student['nim_panitia'] === null) {
  33. header('location:index.php');
  34. }
  35. ?>
  36. INI Halaman SION