您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

40 行
1007 B

<?php
ini_set('session.use_only_cookies', TRUE);
ini_set('session.use_trans_sid', FALSE);
session_start();
require_once("conn/db.php");
if (!isset($_SESSION['nim'])) {
header('location:login.php');
} else {
$nim = $_SESSION['nim'];
}
//CEK SUDAH POLING / BELUM :
$queryStudent = "SELECT
TOP 1
a.nim,
b.nim_panitia,
b.role,
COUNT(c.id_pemilu) AS votes
FROM
tb_mhs AS a
LEFT JOIN
tb_panitia b ON b.nim_panitia = a.nim
LEFT JOIN
tb_pemilu c ON c.nim_mhs = a.nim
WHERE
a.nim = '$nim'
GROUP BY
a.nim,
b.nim_panitia,
b.role";
$execStudent = odbc_exec($koneksi, $queryStudent);
$student = odbc_fetch_array($execStudent);
if ($student['votes'] == 0 && $student['nim_panitia'] === null) {
header('location:index.php');
}
?>
INI Halaman SION