This page lists files in the current directory. You can view content, get download/execute commands for Wget, Curl, or PowerShell, or filter the list using wildcards (e.g., `*.sh`).
wget 'https://lists2.roe3.org/tg-hof/admin/add_member.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Add Member | Tech-Geeks Hall of Fame</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- include summernote css/js -->
<link href="summernote/summernote-lite.css" rel="stylesheet">
<script src="summernote/summernote-lite.js "></script>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Add Hall of Fame Member</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Add Hall of Fame Member</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Add a new hall of fame member here. Using this form <u>will automatically approve</u> the hall of fame member.</div>
</div>
<form method="POST">
<div class="card-body">
<div class="row g-3">
<div class="col-md-12">
<label for="fullname" class="form-label">Full Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="fullname" name="fullname" required>
</div>
<div class="col-md-6">
<label for="nominated_by" class="form-label">Nominated By<span class="text-danger">*</span></label>
<div class="input-group">
<input type="text" class="form-control" id="nominated_by" name="nominated_by">
</div>
</div>
<div class="col-md-6">
<label for="year_inducted" class="form-label">Year Inducted<span class="text-danger">*</span></label>
<div class="input-group">
<input type="number" class="form-control" id="year_inducted" name="year_inducted" min="2000" max="2099" step="1" value="2025"required>
</div>
</div>
<!--
<div class="col-md-6">
<label for="vita" class="form-label">Background/Work Experience<span class="text-danger">*</span></label>
<textarea rows="4" class="form-control" id="vita" name="vita" required></textarea>
</div>
<div class="col-md-6">
<label for="location" class="form-label">Districts/Schools/Entities Served<span class="text-danger">*</span></label>
<textarea class="form-control" id="location" name="location" rows="4" required></textarea>
</div>
-->
<div class="col-md-12">
<label for="contributions" class="form-label">Contributions to Tech-Geeks<span class="text-danger">*</span></label>
<textarea rows="4" class="form-control" id="contributions" name="contributions" required></textarea>
</div>
</div>
</div>
<div class="card-footer">
<button class="btn btn-primary" name="member_registration" type="submit"><i class="bi bi-plus-circle"></i> Add Hall of Fame Member</button>
<a href="approve_members.php" class="btn float-end"><i class="bi bi-eye"></i> View Approved Members</a>
</div>
</form>
</div>
<?php
if (isset($_POST['member_registration'])) {
$Name = $_POST['fullname'];
$nominated_by = $_POST['nominated_by'];
$Year = $_POST['year_inducted'];
// $Vita = $_POST['vita'];
$Contributions = $_POST['contributions'];
// $Location = $_POST['location'];
$Approved = 1;
if ($Name == "" || $Year == "" || $Contributions == "" ) {
echo '<div class="callout callout-danger">Please fill in all required fields.</div>';
} else {
$sql = "INSERT INTO member (name,nominated_by,year_inducted,contributions,approved) VALUES ('$Name', '$nominated_by', '$Year', '$Contributions', '$Approved')";
//$sql = "INSERT INTO member (name,nominated_by,year_inducted,vita,contributions,location,approved) VALUES ('$Name', '$nominated_by', '$Year', '$Vita', '$Contributions', '$Location', '$Approved')";
$result = mysqli_query($conn, $sql);
if ($result) {
echo '<div class="callout callout-success">Registration successful!</div>';
echo "<meta http-equiv='refresh' content='2;url=" . $_SERVER['PHP_SELF'] . "'>";
} else {
echo '<div class="callout callout-warning">Something went wrong. Please try again!</div>';
}
}
}
?>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
<script>
$(document).ready(function() {
$('#vita').summernote({
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['insert', ['link']],
['view', ['fullscreen', 'codeview', 'help']]
]
}
);
$('#location').summernote({
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['insert', ['link']],
['view', ['fullscreen', 'codeview', 'help']]
]
}
);
$('#contributions').summernote({
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['insert', ['link']],
['view', ['fullscreen', 'codeview', 'help']]
]
}
);
});
</script>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/admin.php'
<?php
header("Location: dashboard.php");
exit();
?>
wget 'https://lists2.roe3.org/tg-hof/admin/all_members.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$limit = 8;
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
$offset = ($page - 1) * $limit;
$ret = mysqli_query($conn, "SELECT * FROM member LIMIT $limit OFFSET $offset");
$total_records_query = mysqli_query($conn, "SELECT COUNT(*) as total FROM member");
$total_records_row = mysqli_fetch_assoc($total_records_query);
$total_records = $total_records_row['total'];
$total_pages = ceil($total_records / $limit);
if (isset($_GET['id'])) {
$rid = intval($_GET['id']);
$sql = mysqli_query($conn, "delete from member where Member_id=$rid");
header("Location: all_members.php?delete=success");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>All Members | Tech-Geeks Hall of Fame</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
table.table tr th,
table.table tr td {
border-color: #e9e9e9;
padding: 10px;
}
table.table th i {
font-size: 13px;
margin: 0 5px;
cursor: pointer;
}
table.table td:last-child {
width: 130px;
}
table.table td a {
color: #a0a5b1;
display: inline-block;
margin: 0 5px;
}
table.table td a.view {
color: #03A9F4;
}
table.table td a.edit {
color: #FFC107;
}
table.table td a.delete {
color: #E34724;
}
table.table td i {
font-size: 19px;
}
.hint-text {
float: left;
margin-top: 10px;
font-size: 13px;
}
</style>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">All Hall of Fame Nominees and Members</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">All Hall of Fame Members</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">All hall of fame members and nominees are shown here</div>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-striped table-hover" id="table-data">
<thead>
<tr class="align-middle">
<th style="width: 10px">#</th>
<th>Name</th>
<th>Year Inducted or Nominated</th>
<th>Nominated By</th>
<th style="width: 40px">Action</th>
</tr>
</thead>
<tbody>
<?php
$cnt = $offset + 1;
if (mysqli_num_rows($ret) > 0) {
while ($row = mysqli_fetch_array($ret)) {
?>
<tr class="align-middle">
<td><?php echo $cnt; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['year_inducted']; ?></td>
<td><?php echo $row['nominated_by']; ?></td>
<td>
<a href="view_member.php?id=<?php echo htmlentities($row['member_id']); ?>" class="view" title="View" data-toggle="tooltip"><i class="bi bi-eye-fill"></i></a>
<a href="edit_member.php?id=<?php echo htmlentities($row['member_id']); ?>" class="edit" title="Edit" data-toggle="tooltip"><i class="bi bi-pencil-fill"></i></a>
<a href="all_members.php?id=<?php echo ($row['member_id']); ?>" class="delete" title="Delete" data-toggle="tooltip" onclick="return confirm('Do you really want to Delete?');"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php
$cnt = $cnt + 1;
}
} else { ?>
<tr>
<th style="text-align:center; color:red;" colspan="7">No Record Found</th>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="card-footer clearfix">
<form action="export_data.php" method="POST">
<a href="add_member.php" class="btn btn-primary"><i class="bi bi-plus-circle"></i> Add New Member</a>
<button class="exportexcel btn btn-success" id="exportexcel" name="exportexcel" type="submit"><i class="bi bi-download"></i> Export Data</button>
<ul class="pagination pagination-sm m-0 float-end">
<?php if ($page > 1): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page - 1; ?>">« Previous</a></li>
<?php endif; ?>
<?php for ($i = 1; $i <= $total_pages; $i++): ?>
<li class="page-item <?php if ($i == $page) echo 'active'; ?>">
<a class="page-link" href="?page=<?php echo $i; ?>"><?php echo $i; ?></a>
</li>
<?php endfor; ?>
<?php if ($page < $total_pages): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page + 1; ?>">Next »</a></li>
<?php endif; ?>
</ul>
</form>
</div>
</div>
<?php if (isset($_GET['update']) && htmlspecialchars($_GET['update']) == 'success'): ?>
<div class="callout callout-success">Member Details updated successfully!</div>
<?php endif; ?>
<?php if (isset($_GET['delete']) && htmlspecialchars($_GET['delete']) == 'success'): ?>
<div class="callout callout-success">Member Details deleted successfully!</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/approved_members.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$limit = 8;
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
$offset = ($page - 1) * $limit;
$ret = mysqli_query($conn, "SELECT * FROM member WHERE approved = 1 LIMIT $limit OFFSET $offset");
$total_records_query = mysqli_query($conn, "SELECT COUNT(*) as total FROM member");
$total_records_row = mysqli_fetch_assoc($total_records_query);
$total_records = $total_records_row['total'];
$total_pages = ceil($total_records / $limit);
if (isset($_GET['id'])) {
$rid = intval($_GET['id']);
$sql = mysqli_query($conn, "delete from member where Member_id=$rid");
header("Location: all_members.php?delete=success");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Approved Members | Tech-Geeks Hall of Fame</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
table.table tr th,
table.table tr td {
border-color: #e9e9e9;
padding: 10px;
}
table.table th i {
font-size: 13px;
margin: 0 5px;
cursor: pointer;
}
table.table td:last-child {
width: 130px;
}
table.table td a {
color: #a0a5b1;
display: inline-block;
margin: 0 5px;
}
table.table td a.view {
color: #03A9F4;
}
table.table td a.edit {
color: #FFC107;
}
table.table td a.delete {
color: #E34724;
}
table.table td i {
font-size: 19px;
}
.hint-text {
float: left;
margin-top: 10px;
font-size: 13px;
}
</style>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Approved Hall of Fame Members</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Approved Hall of Fame Members</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Approved hall of fame members are shown here</div>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-striped table-hover" id="table-data">
<thead>
<tr class="align-middle">
<th style="width: 10px">#</th>
<th>Name</th>
<th>Year Inducted</th>
<th>Nominated By</th>
<th style="width: 40px">Action</th>
</tr>
</thead>
<tbody>
<?php
$cnt = $offset + 1;
if (mysqli_num_rows($ret) > 0) {
while ($row = mysqli_fetch_array($ret)) {
?>
<tr class="align-middle">
<td><?php echo $cnt; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['year_inducted']; ?></td>
<td><?php echo $row['nominated_by']; ?></td>
<td>
<a href="view_member.php?id=<?php echo htmlentities($row['member_id']); ?>" class="view" title="View" data-toggle="tooltip"><i class="bi bi-eye-fill"></i></a>
<a href="edit_member.php?id=<?php echo htmlentities($row['member_id']); ?>" class="edit" title="Edit" data-toggle="tooltip"><i class="bi bi-pencil-fill"></i></a>
<a href="all_members.php?id=<?php echo ($row['member_id']); ?>" class="delete" title="Delete" data-toggle="tooltip" onclick="return confirm('Do you really want to Delete?');"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php
$cnt = $cnt + 1;
}
} else { ?>
<tr>
<th style="text-align:center; color:red;" colspan="7">No Record Found</th>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="card-footer clearfix">
<form action="export_data.php" method="POST">
<a href="add_member.php" class="btn btn-primary"><i class="bi bi-plus-circle"></i> Add New Member</a>
<button class="exportexcel btn btn-success" id="exportexcel" name="exportexcel" type="submit"><i class="bi bi-download"></i> Export Data</button>
<ul class="pagination pagination-sm m-0 float-end">
<?php if ($page > 1): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page - 1; ?>">« Previous</a></li>
<?php endif; ?>
<?php for ($i = 1; $i <= $total_pages; $i++): ?>
<li class="page-item <?php if ($i == $page) echo 'active'; ?>">
<a class="page-link" href="?page=<?php echo $i; ?>"><?php echo $i; ?></a>
</li>
<?php endfor; ?>
<?php if ($page < $total_pages): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page + 1; ?>">Next »</a></li>
<?php endif; ?>
</ul>
</form>
</div>
</div>
<?php if (isset($_GET['update']) && htmlspecialchars($_GET['update']) == 'success'): ?>
<div class="callout callout-success">Member Details updated successfully!</div>
<?php endif; ?>
<?php if (isset($_GET['delete']) && htmlspecialchars($_GET['delete']) == 'success'): ?>
<div class="callout callout-success">Member Details deleted successfully!</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/dashboard.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$_SESSION['approved'] = "approved";
$_SESSION['all'] = "all";
$_SESSION['pending'] = "pending";
$_SESSION['deferred'] = "deferred";
$programmeData = [];
$sql = "SELECT COUNT(*) AS count FROM member";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$programmeData[] = [
'count' => $row['count']
];
}
} else {
echo "No results found.";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Dashboard | Tech-Geeks Hall of Fame</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<link rel="stylesheet" href="css/apexcharts.min.css">
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Dashboard</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">
Dashboard
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-4 col-12">
<div class="small-box text-bg-success">
<div class="inner">
<h3>
<?php
$sql = "select * from member where approved = 1";
$result = $conn->query($sql);
$count = 0;
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$count = $count + 1;
}
}
echo $count;
?>
</h3>
<p>Approved Members</p>
</div>
<svg class="small-box-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path d="M6.25 6.375a4.125 4.125 0 118.25 0 4.125 4.125 0 01-8.25 0zM3.25 19.125a7.125 7.125 0 0114.25 0v.003l-.001.119a.75.75 0 01-.363.63 13.067 13.067 0 01-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 01-.364-.63l-.001-.122zM19.75 7.5a.75.75 0 00-1.5"></path>
</svg>
<a href="approved_members.php" class="small-box-footer link-light link-underline-opacity-0 link-underline-opacity-50-hover">Click To View Records <i class="bi bi-link-45deg"></i> </a>
</div>
</div>
<div class="col-lg-4 col-12">
<div class="small-box text-bg-warning">
<div class="inner">
<h3>
<?php
$sql = "select * from member where approved = 0";
$result = $conn->query($sql);
$count = 0;
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$count = $count + 1;
}
}
echo $count;
?>
</h3>
<p>Pending Members</p>
</div>
<svg class="small-box-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path d="M6.25 6.375a4.125 4.125 0 118.25 0 4.125 4.125 0 01-8.25 0zM3.25 19.125a7.125 7.125 0 0114.25 0v.003l-.001.119a.75.75 0 01-.363.63 13.067 13.067 0 01-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 01-.364-.63l-.001-.122zM19.75 7.5a.75.75 0 00-1.5"></path>
</svg>
<a href="pending_members.php" class="small-box-footer link-light link-underline-opacity-0 link-underline-opacity-50-hover">Click To View Records <i class="bi bi-link-45deg"></i> </a>
</div>
</div>
<div class="col-lg-4 col-12">
<div class="small-box text-bg-danger">
<div class="inner">
<h3>
<?php
$sql = "select * from member where approved = 2";
$result = $conn->query($sql);
$count = 0;
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$count = $count + 1;
}
}
echo $count;
?>
</h3>
<p>Deferred Nominees</p>
</div>
<svg class="small-box-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path d="M6.25 6.375a4.125 4.125 0 118.25 0 4.125 4.125 0 01-8.25 0zM3.25 19.125a7.125 7.125 0 0114.25 0v.003l-.001.119a.75.75 0 01-.363.63 13.067 13.067 0 01-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 01-.364-.63l-.001-.122zM19.75 7.5a.75.75 0 00-1.5"></path>
</svg>
<a href="deferred_members.php" class="small-box-footer link-light link-underline-opacity-0 link-underline-opacity-50-hover">Click To View Records <i class="bi bi-link-45deg"></i> </a>
</div>
</div>
<div class="col-lg-4 col-12">
<div class="small-box text-bg-primary">
<div class="inner">
<h3>
<?php
$sql = "select * from member";
$result = $conn->query($sql);
$count = 0;
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$count = $count + 1;
}
}
echo $count;
?>
</h3>
<p>All Members (Approved, Pending and Deferred)</p>
</div>
<svg class="small-box-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path d="M6.25 6.375a4.125 4.125 0 118.25 0 4.125 4.125 0 01-8.25 0zM3.25 19.125a7.125 7.125 0 0114.25 0v.003l-.001.119a.75.75 0 01-.363.63 13.067 13.067 0 01-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 01-.364-.63l-.001-.122zM19.75 7.5a.75.75 0 00-1.5"></path>
</svg>
<a href="all_members.php" class="small-box-footer link-light link-underline-opacity-0 link-underline-opacity-50-hover">Click To View Records <i class="bi bi-link-45deg"></i> </a>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
<script src="js/apexcharts.min.js"></script>
<script src="js/Sortable.min.js"></script>
<script>
const connectedSortables =
document.querySelectorAll(".connectedSortable");
connectedSortables.forEach((connectedSortable) => {
let sortable = new Sortable(connectedSortable, {
group: "shared",
handle: ".card-header",
});
});
const cardHeaders = document.querySelectorAll(
".connectedSortable .card-header",
);
cardHeaders.forEach((cardHeader) => {
cardHeader.style.cursor = "move";
});
</script>
<script>
const programmeData = <?php echo json_encode($programmeData); ?>;
const programmeNames = programmeData.map(data => data.programme);
const counts = programmeData.map(data => data.count);
const programmeChartOptions = {
series: [{
name: "Members",
data: counts
}],
chart: {
height: 300,
type: "area",
animations: {
enabled: true,
easing: 'easeinout',
speed: 800,
animateGradually: {
enabled: true,
delay: 150
},
dynamicAnimation: {
enabled: true,
speed: 350
}
},
toolbar: {
show: true
}
},
stroke: {
curve: 'smooth',
width: 3
},
colors: ["#20c997"],
xaxis: {
categories: programmeNames,
labels: {
style: {
colors: '#4d4d4d',
fontSize: '9.5px'
}
}
},
yaxis: {
labels: {
style: {
colors: '#4d4d4d',
fontSize: '12px'
}
}
},
dataLabels: {
enabled: true,
style: {
colors: ['#ffffff']
},
background: {
enabled: true,
foreColor: '#28a745',
borderRadius: 4,
padding: 4,
}
},
tooltip: {
theme: 'light',
y: {
formatter: (val) => `${val} members`
}
},
markers: {
size: 6,
colors: ["#28a745"],
strokeColors: "#ffffff",
strokeWidth: 2,
hover: {
size: 8
}
},
grid: {
borderColor: '#e0e0e0',
strokeDashArray: 5,
}
};
const programmeChart = new ApexCharts(document.querySelector("#programme-chart"), programmeChartOptions);
programmeChart.render();
</script>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/deferred_members.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$limit = 8;
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
$offset = ($page - 1) * $limit;
$ret = mysqli_query($conn, "SELECT * FROM member WHERE approved = 2 LIMIT $limit OFFSET $offset");
$total_records_query = mysqli_query($conn, "SELECT COUNT(*) as total FROM member");
$total_records_row = mysqli_fetch_assoc($total_records_query);
$total_records = $total_records_row['total'];
$total_pages = ceil($total_records / $limit);
if (isset($_GET['id'])) {
$rid = intval($_GET['id']);
$sql = mysqli_query($conn, "delete from member where Member_id=$rid");
header("Location: all_members.php?delete=success");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Deferred Nominees | Tech-Geeks Hall of Fame</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
table.table tr th,
table.table tr td {
border-color: #e9e9e9;
padding: 10px;
}
table.table th i {
font-size: 13px;
margin: 0 5px;
cursor: pointer;
}
table.table td:last-child {
width: 130px;
}
table.table td a {
color: #a0a5b1;
display: inline-block;
margin: 0 5px;
}
table.table td a.view {
color: #03A9F4;
}
table.table td a.edit {
color: #FFC107;
}
table.table td a.delete {
color: #E34724;
}
table.table td i {
font-size: 19px;
}
.hint-text {
float: left;
margin-top: 10px;
font-size: 13px;
}
</style>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Deferred Hall of Fame Nominees</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Deferred Hall of Fame Members</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Deferred hall of fame nominees are shown here</div>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-striped table-hover" id="table-data">
<thead>
<tr class="align-middle">
<th style="width: 10px">#</th>
<th>Name</th>
<th>Year Nominated</th>
<th>Nominated By</th>
<th style="width: 40px">Action</th>
</tr>
</thead>
<tbody>
<?php
$cnt = $offset + 1;
if (mysqli_num_rows($ret) > 0) {
while ($row = mysqli_fetch_array($ret)) {
?>
<tr class="align-middle">
<td><?php echo $cnt; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['year_inducted']; ?></td>
<td><?php echo $row['nominated_by']; ?></td>
<td>
<a href="view_member.php?id=<?php echo htmlentities($row['member_id']); ?>" class="view" title="View" data-toggle="tooltip"><i class="bi bi-eye-fill"></i></a>
<a href="edit_member.php?id=<?php echo htmlentities($row['member_id']); ?>" class="edit" title="Edit" data-toggle="tooltip"><i class="bi bi-pencil-fill"></i></a>
<a href="all_members.php?id=<?php echo ($row['member_id']); ?>" class="delete" title="Delete" data-toggle="tooltip" onclick="return confirm('Do you really want to Delete?');"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php
$cnt = $cnt + 1;
}
} else { ?>
<tr>
<th style="text-align:center; color:red;" colspan="7">No Records Found</th>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="card-footer clearfix">
<form action="export_data.php" method="POST">
<a href="add_member.php" class="btn btn-primary"><i class="bi bi-plus-circle"></i> Add New Member</a>
<button class="exportexcel btn btn-success" id="exportexcel" name="exportexcel" type="submit"><i class="bi bi-download"></i> Export Data</button>
<ul class="pagination pagination-sm m-0 float-end">
<?php if ($page > 1): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page - 1; ?>">« Previous</a></li>
<?php endif; ?>
<?php for ($i = 1; $i <= $total_pages; $i++): ?>
<li class="page-item <?php if ($i == $page) echo 'active'; ?>">
<a class="page-link" href="?page=<?php echo $i; ?>"><?php echo $i; ?></a>
</li>
<?php endfor; ?>
<?php if ($page < $total_pages): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page + 1; ?>">Next »</a></li>
<?php endif; ?>
</ul>
</form>
</div>
</div>
<?php if (isset($_GET['update']) && htmlspecialchars($_GET['update']) == 'success'): ?>
<div class="callout callout-success">Member Details updated successfully!</div>
<?php endif; ?>
<?php if (isset($_GET['delete']) && htmlspecialchars($_GET['delete']) == 'success'): ?>
<div class="callout callout-success">Member Details deleted successfully!</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/edit_member.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
if (isset($_POST['member_registration'])) {
$eid = $_GET['id'];
$Name = $_POST['name'];
$nominated_by = $_POST['nominated_by'];
$year = $_POST['year_inducted'];
// $vita = $_POST['vita'];
// $location = $_POST['location'];
$contributions = $_POST['contributions'];
$approved = $_POST['approved'];
if ($Name == "" || $year == "" || $contributions == "" || $approved == "") {
echo '<div class="callout callout-danger">Please fill in all required fields.</div>';
} else {
//$sql = "UPDATE member SET name='$Name',nominated_by='$nominated_by', year_inducted='$year', vita='$vita', contributions='$contributions' , location='$location', approved='$approved' where member_id='$eid'";
$sql = "UPDATE member SET name='$Name',nominated_by='$nominated_by', year_inducted='$year', contributions='$contributions' , approved='$approved' where member_id='$eid'";
$result = mysqli_query($conn, $sql);
if ($result) {
header("Location: all_members.php?update=success");
//header("Location: ".$_SERVER['HTTP_REFERER']."?update=success");
exit();
} else {
echo '<div class="callout callout-warning">Something went wrong. Please try again!</div>';
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Update Member Details | Tech-Geeks Hall of Fame</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- include summernote css/js -->
<link href="summernote/summernote-lite.css" rel="stylesheet">
<script src="summernote/summernote-lite.js "></script>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Update Member Details</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Update Member Details</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Member details are shown here</div>
</div>
<form method="POST">
<?php
$eid = $_GET['id'];
$ret = mysqli_query($conn, "SELECT * from member where member_id='$eid'");
while ($row = mysqli_fetch_array($ret)) {
?>
<div class="card-body">
<div class="row g-3">
<div class="col-md-6">
<label for="name" class="form-label">Full Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="name" name="name" value="<?php echo htmlspecialchars($row['name']); ?>" required>
</div>
<div class="col-md-6">
<label for="nominated_by" class="form-label">Nominated By <span class="text-danger">*</span></label>
<div class="input-group">
<input type="text" class="form-control" id="nominated_by" name="nominated_by" value="<?php echo htmlspecialchars($row['nominated_by']); ?>">
</div>
</div>
<div class="col-md-3">
<label for="year" class="form-label">Year Inducted<span class="text-danger">*</span></label>
<div class="input-group">
<input type="number" class="form-control" id="year" name="year_inducted" value="<?php echo htmlspecialchars($row['year_inducted']); ?>" min="2000" max="2070" required>
</div>
</div>
<!--
<div class="col-md-12">
<label for="vita" class="form-label">Background/Work Experience <span class="text-danger">*</span></label>
<textarea rows="4" class="form-control" id="vita" name="vita"><?php echo htmlspecialchars($row['vita']); ?></textarea>
</div>
<div class="col-md-12">
<label for="location" class="form-label">Districts/Schools/Entities Served <span class="text-danger">*</span></label>
<textarea rows="4" class="form-control" id="location" name="location"><?php echo htmlspecialchars($row['location']); ?></textarea>
</div>
-->
<div class="col-md-12">
<label for="contributions" class="form-label">Contributions to Tech-Geeks <span class="text-danger">*</span></label>
<textarea rows="4" class="form-control" id="contributions" name="contributions"><?php echo htmlspecialchars($row['contributions']); ?></textarea>
</div>
<div class="col-md-3">
<label for="approved" class="form-label">Approval<span class="text-danger">*</span></label>
<select class="form-control form-select" id="approved" name="approved" required>
<option value="" selected>Select</option>
<option value="1" <?php echo ($row['approved'] == 1 ? 'selected' : ''); ?>>Approved</option>
<option value="0" <?php echo ($row['approved'] == 0 ? 'selected' : ''); ?>>Pending</option>
<option value="2" <?php echo ($row['approved'] == 2 ? 'selected' : ''); ?>>Deferred</option>
</select>
</div>
</div>
</div>
<?php
} ?>
<div class="card-footer">
<button class="btn btn-primary" name="member_registration" type="submit"><i class="bi bi-floppy"></i> Save Changes</button>
<a href="<?php echo $_SERVER['HTTP_REFERER']; ?>" class="btn float-end"><i class="bi bi-arrow-left-circle"></i> Back to Member Listing</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
<script>
$(document).ready(function() {
$('#vita').summernote({
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['insert', ['link']],
['view', ['fullscreen', 'codeview', 'help']]
]
}
);
$('#location').summernote({
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['insert', ['link']],
['view', ['fullscreen', 'codeview', 'help']]
]
}
);
$('#contributions').summernote({
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['insert', ['link']],
['view', ['fullscreen', 'codeview', 'help']]
]
}
);
});
</script>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/edit_profile.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$user_id = $_POST['user_id'];
$email = $_POST['email'];
$password = md5($_POST['password']);
$sql = "UPDATE user SET Email = ?, Password = ? WHERE User_id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ssi", $email, $password, $user_id);
$stmt->execute();
$stmt->close();
header("Location: profile.php?update=success");
exit();
} else {
$sql = "SELECT * FROM user WHERE Email = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $usermail);
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_assoc();
$stmt->close();
}
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Edit Profile | Alumni Association SICT</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Edit Profile</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Edit Profile</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Hello, Admin! Please update the information below to improve your profile.</div>
</div>
<form method="POST" action="">
<div class="card-body">
<div class="mb-3">
<label for="user_id" class="form-label">User ID</label>
<input type="text" class="form-control" id="user_id" name="user_id" value="<?php echo htmlspecialchars($user['User_id']); ?>" readonly>
</div>
<div class="mb-3">
<label for="email" class="form-label">Username</label>
<input type="email" class="form-control" id="email" name="email" value="<?php echo htmlspecialchars($user['Email']); ?>" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">New Password</label>
<input type="password" class="form-control" id="password" name="password" placeholder="Enter New Password" required>
</div>
<div class="mb-3">
<label for="conf_password" class="form-label">Confirm Password</label>
<input type="password" class="form-control" id="conf_password" placeholder="Confirm Password" required>
</div>
</div>
<div class="card-footer">
<button type="submit" class="btn btn-primary"><i class="bi bi-floppy"></i> Save Changes</button>
<a href="profile.php" class="btn float-end"><i class="bi bi-arrow-left-circle"></i> Back to Profile</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
<script>
document.getElementById('conf_password').oninput = function() {
const password = document.getElementById('password').value;
const confPassword = this.value;
if (password !== confPassword) {
this.setCustomValidity("Passwords do not match.");
} else {
this.setCustomValidity("");
}
};
</script>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/export_data.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$sql = "SELECT
name as 'Name',
nominated_by as 'Nominated By',
year_inducted as 'Year Inducted/Nominated',
contributions as 'Contributions to Tech-Geeks'
FROM member";
$result = mysqli_query($conn,$sql);
$member_record = array();
while($rows = mysqli_fetch_assoc($result)){
$member_record[] = $rows;
}
if(isset($_POST["exportexcel"]))
{
$filename = "tech-geek-hall-of-fame-members_".date('Ymd') .".xlsx";
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$filename\"");
$show_coloumn = false;
if(!empty($member_record)){
foreach($member_record as $record){
if(!$show_coloumn){
echo implode("\t",array_keys($record)) . "\n";
$show_coloumn = true;
}
echo implode("\t", array_values($record)) . "\n";
}
}
exit;
}
?>
wget 'https://lists2.roe3.org/tg-hof/admin/finalize_results.php'
<?php
$mysqli = new mysqli("localhost", "mdrone", "einstein", "aasict_db");
// Get threshold
$thresholdRes = $mysqli->query("SELECT threshold_value FROM threshold WHERE threshold_key = 'threshold'");
$threshold = $thresholdRes->fetch_assoc()['threshold_value'];
// Get vote summary grouped by nominee name
$query = "
SELECT
m.name,
SUM(CASE WHEN mv.vote = 'approve' THEN 1 ELSE 0 END) AS approve_votes,
SUM(CASE WHEN mv.vote = 'disapprove' THEN 1 ELSE 0 END) AS disapprove_votes
FROM member_votes mv
JOIN member m ON mv.member_id = m.member_id
WHERE m.approved = 0
GROUP BY m.name
";
$result = $mysqli->query($query);
// Loop through and update all related member records
while ($row = $result->fetch_assoc()) {
$total_votes = $row['approve_votes'] + $row['disapprove_votes'];
if ($total_votes === 0) continue;
$percentage = ($row['approve_votes'] / $total_votes) * 100;
$status = ($percentage >= $threshold) ? 1 : 2;
$stmt = $mysqli->prepare("UPDATE member SET approved = ? WHERE name = ? AND approved = 0");
$stmt->bind_param("is", $status, $row['name']);
$stmt->execute();
$stmt->close();
}
echo "<script>alert('Voting Results Finalized.'); window.location.href = 'preview_results.php';</script>";
?>
wget 'https://lists2.roe3.org/tg-hof/admin/pending_members.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$limit = 8;
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
$offset = ($page - 1) * $limit;
$ret = mysqli_query($conn, "SELECT * FROM member WHERE approved = 0 LIMIT $limit OFFSET $offset");
$total_records_query = mysqli_query($conn, "SELECT COUNT(*) as total FROM member");
$total_records_row = mysqli_fetch_assoc($total_records_query);
$total_records = $total_records_row['total'];
$total_pages = ceil($total_records / $limit);
if (isset($_GET['id'])) {
$rid = intval($_GET['id']);
$sql = mysqli_query($conn, "delete from member where Member_id=$rid");
header("Location: all_members.php?delete=success");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Pending Members | Tech-Geeks Hall of Fame</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
table.table tr th,
table.table tr td {
border-color: #e9e9e9;
padding: 10px;
}
table.table th i {
font-size: 13px;
margin: 0 5px;
cursor: pointer;
}
table.table td:last-child {
width: 130px;
}
table.table td a {
color: #a0a5b1;
display: inline-block;
margin: 0 5px;
}
table.table td a.view {
color: #03A9F4;
}
table.table td a.edit {
color: #FFC107;
}
table.table td a.delete {
color: #E34724;
}
table.table td i {
font-size: 19px;
}
.hint-text {
float: left;
margin-top: 10px;
font-size: 13px;
}
</style>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Pending Hall of Fame Members</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Pending Hall of Fame Members</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Pending hall of fame members are shown here</div>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-striped table-hover" id="table-data">
<thead>
<tr class="align-middle">
<th style="width: 10px">#</th>
<th>Name</th>
<th>Year Nominated</th>
<th>Nominated By</th>
<th style="width: 40px">Action</th>
</tr>
</thead>
<tbody>
<?php
$cnt = $offset + 1;
if (mysqli_num_rows($ret) > 0) {
while ($row = mysqli_fetch_array($ret)) {
?>
<tr class="align-middle">
<td><?php echo $cnt; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['year_inducted']; ?></td>
<td><?php echo $row['nominated_by']; ?></td>
<td>
<a href="view_member.php?id=<?php echo htmlentities($row['member_id']); ?>" class="view" title="View" data-toggle="tooltip"><i class="bi bi-eye-fill"></i></a>
<a href="edit_member.php?id=<?php echo htmlentities($row['member_id']); ?>" class="edit" title="Edit" data-toggle="tooltip"><i class="bi bi-pencil-fill"></i></a>
<a href="all_members.php?id=<?php echo ($row['member_id']); ?>" class="delete" title="Delete" data-toggle="tooltip" onclick="return confirm('Do you really want to Delete?');"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php
$cnt = $cnt + 1;
}
} else { ?>
<tr>
<th style="text-align:center; color:red;" colspan="7">No Records Found</th>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="card-footer clearfix">
<form action="export_data.php" method="POST">
<a href="add_member.php" class="btn btn-primary"><i class="bi bi-plus-circle"></i> Add New Member</a>
<button class="exportexcel btn btn-success" id="exportexcel" name="exportexcel" type="submit"><i class="bi bi-download"></i> Export Data</button>
<ul class="pagination pagination-sm m-0 float-end">
<?php if ($page > 1): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page - 1; ?>">« Previous</a></li>
<?php endif; ?>
<?php for ($i = 1; $i <= $total_pages; $i++): ?>
<li class="page-item <?php if ($i == $page) echo 'active'; ?>">
<a class="page-link" href="?page=<?php echo $i; ?>"><?php echo $i; ?></a>
</li>
<?php endfor; ?>
<?php if ($page < $total_pages): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page + 1; ?>">Next »</a></li>
<?php endif; ?>
</ul>
</form>
</div>
</div>
<?php if (isset($_GET['update']) && htmlspecialchars($_GET['update']) == 'success'): ?>
<div class="callout callout-success">Member Details updated successfully!</div>
<?php endif; ?>
<?php if (isset($_GET['delete']) && htmlspecialchars($_GET['delete']) == 'success'): ?>
<div class="callout callout-success">Member Details deleted successfully!</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/preview_results.php'
<?php
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$mysqli = new mysqli("localhost", "mdrone", "einstein", "aasict_db");
// Get threshold
$thresholdRes = $mysqli->query("SELECT threshold_value FROM threshold WHERE threshold_key = 'threshold'");
$threshold = $thresholdRes->fetch_assoc()['threshold_value'];
// Get voting results grouped by name
$query = "
SELECT
m.name,
SUM(CASE WHEN mv.vote = 'approve' THEN 1 ELSE 0 END) AS approve_votes,
SUM(CASE WHEN mv.vote = 'disapprove' THEN 1 ELSE 0 END) AS disapprove_votes
FROM member_votes mv
JOIN member m ON mv.member_id = m.member_id
WHERE m.approved = 0
GROUP BY m.name
";
$result = $mysqli->query($query);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Tech-Geeks Hall of Fame: Voting Results Preview</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
table.table tr th,
table.table tr td {
border-color: #e9e9e9;
padding: 10px;
}
table.table th i {
font-size: 13px;
margin: 0 5px;
cursor: pointer;
}
table.table td:last-child {
width: 130px;
}
table.table td a {
color: #a0a5b1;
display: inline-block;
margin: 0 5px;
}
table.table td a.view {
color: #03A9F4;
}
table.table td a.edit {
color: #FFC107;
}
table.table td a.delete {
color: #E34724;
}
table.table td i {
font-size: 19px;
}
.hint-text {
float: left;
margin-top: 10px;
font-size: 13px;
}
.modal-content {
color: #000; // Example: Black text
}
</style>
<link rel="stylesheet" href="../assets/css/bootstrap-icons.min.css">
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Tech-Geeks Hall of Fame Voting Results Preview</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Hall of Fame Voting Results Preview</li>
</ol>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModal"> ? </button>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-body p-2">
<div class="table-responsive">
<h3>Voting Results Preview</h3>
<p>Threshold: <strong><?= $threshold ?>%</strong></p>
<table class="table table-striped table-bordered table-hover align-middle" id="table-data">
<thead class="table-dark align-middle">
<tr>
<th>Nominee</th>
<th>Votes to Approve</th>
<th>Votes to Postpone Approval</th>
<th>Approval Percentage</th>
<th>Recommendation</th>
</tr>
</thead>
<tbody>
<?php while ($row = $result->fetch_assoc()):
$total = $row['approve_votes'] + $row['disapprove_votes'];
$percent = $total ? ($row['approve_votes'] / $total) * 100 : 0;
$status = $percent >= $threshold ? 'Induct' : 'Defer';
?>
<tr>
<td><?= htmlspecialchars($row['name']) ?></td>
<td><?= $row['approve_votes'] ?></td>
<td><?= $row['disapprove_votes'] ?></td>
<td><?= round($percent) ?>%</td>
<td><span class="badge bg-<?= $status === 'Induct' ? 'success' : 'secondary' ?>"><?= $status ?></span></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
<form action="finalize_results.php" method="post" onsubmit="return confirm('Are you sure you want to finalize these results? This cannot be undone.');">
<button type="submit" class="btn btn-primary">Finalize Results</button>
</form>
</div>
<!-- The Modal -->
<div class="modal" id="myModal">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Finalizing the Votes</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<!-- Modal body -->
<div class="modal-body ">
<p class="text-start"><p>After the voting has concluded, use this panel to examine the results.
By pressing the [Finalize Results] button, nominees who received enough votes to meet or exceed the threshold of votes needed to be inducted will have their status changed to "approved".</p>
<p class="text-start">Nominees who do not receive the number of votes to reach the threshold will have their status changed to "deferred" and will be eligible during the next voting cycle.</p>
<p class="text-start">Proceed with caution. The action can only be changed in the main Dashboard.</p>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">X</button>
</div>
</div>
</div>
</main>
<?php
include("includes/footer.php");
?>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/preview_results.php.orig'
<?php
$mysqli = new mysqli("localhost", "mdrone", "einstein", "aasict_db");
// Get threshold
$thresholdRes = $mysqli->query("SELECT threshold_value FROM threshold WHERE threshold_key = 'threshold'");
$threshold = $thresholdRes->fetch_assoc()['threshold_value'];
// Get voting results grouped by name
$query = "
SELECT
m.name,
SUM(CASE WHEN mv.vote = 'approve' THEN 1 ELSE 0 END) AS approve_votes,
SUM(CASE WHEN mv.vote = 'disapprove' THEN 1 ELSE 0 END) AS disapprove_votes
FROM member_votes mv
JOIN member m ON mv.member_id = m.member_id
WHERE m.approved = 0
GROUP BY m.name
";
$result = $mysqli->query($query);
?>
<!DOCTYPE html>
<html>
<head>
<title>Voting Results Preview</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
</head>
<body class="p-4">
<h3>Voting Results Preview</h3>
<p>Threshold: <strong><?= $threshold ?>%</strong></p>
<table class="table table-bordered">
<thead>
<tr>
<th>Nominee</th>
<th>Votes to Approve</th>
<th>Votes to Postpone Approval</th>
<th>Approval Percentage</th>
<th>Recommendation</th>
</tr>
</thead>
<tbody>
<?php while ($row = $result->fetch_assoc()):
$total = $row['approve_votes'] + $row['disapprove_votes'];
$percent = $total ? ($row['approve_votes'] / $total) * 100 : 0;
$status = $percent >= $threshold ? 'Induct' : 'Defer';
?>
<tr>
<td><?= htmlspecialchars($row['name']) ?></td>
<td><?= $row['approve_votes'] ?></td>
<td><?= $row['disapprove_votes'] ?></td>
<td><?= round($percent) ?>%</td>
<td><span class="badge bg-<?= $status === 'Induct' ? 'success' : 'secondary' ?>"><?= $status ?></span></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
<form action="finalize_results.php" method="post" onsubmit="return confirm('Are you sure you want to finalize these results? This cannot be undone.');">
<button type="submit" class="btn btn-primary">Finalize Results</button>
</form>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/process_votes.php'
<?php
// process_votes.php
$mysqli = new mysqli("localhost", "mdrone", "einstein", "aasict_db");
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
// Handle admin action
$processed = false;
if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST['confirm_process'])) {
// Get threshold
$threshold_result = $mysqli->query("SELECT threshold_value FROM threshold WHERE threshold_key = 'threshold'");
$threshold = intval($threshold_result->fetch_assoc()['threshold_value'] ?? 70);
// Get vote counts aggregated by name
$query = "
SELECT
m.name,
SUM(CASE WHEN mv.vote = 'approve' THEN 1 ELSE 0 END) AS approve_votes,
SUM(CASE WHEN mv.vote = 'disapprove' THEN 1 ELSE 0 END) AS disapprove_votes
FROM member_votes mv
JOIN member m ON mv.member_id = m.member_id
WHERE m.approved = 0
GROUP BY m.name
";
$result = $mysqli->query($query);
while ($row = $result->fetch_assoc()) {
$total_votes = $row['approve_votes'] + $row['disapprove_votes'];
if ($total_votes === 0) continue; // Avoid division by zero
$percentage = ($row['approve_votes'] / $total_votes) * 100;
$status = ($percentage >= $threshold) ? 1 : 2;
// Now update ALL member records with this name
$stmt = $mysqli->prepare("UPDATE member SET approved = ? WHERE name = ? AND approved = 0");
$stmt->bind_param("is", $status, $row['name']);
$stmt->execute();
$stmt->close();
}
$processed = true;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Process Voting Results</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
<div class="container mt-5">
<div class="card shadow">
<div class="card-header bg-dark text-white">
<h4 class="mb-0">Finalize Hall of Fame Voting</h4>
</div>
<div class="card-body">
<?php if ($processed): ?>
<div class="alert alert-success">
✅ Voting results have been processed and member statuses updated.
</div>
<?php else: ?>
<p>This action will update the approval status of all nominees based on the current vote threshold.</p>
<form method="POST">
<input type="hidden" name="confirm_process" value="1">
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure you want to finalize the results? This cannot be undone.')">
Finalize Results
</button>
</form>
<?php endif; ?>
</div>
</div>
</div>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/profile.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$sql = "SELECT * FROM user WHERE Email = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $usermail);
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_assoc();
$stmt->close();
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>User Profile | Alumni Association SICT</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<style>
.table-responsive {
padding: 4px;
padding-top: 8px;
margin-bottom: -14px;
}
.table-wrapper {
min-width: 1000px;
background: #fff;
padding: 20px;
box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}
table.table tr th,
table.table tr td {
border-color: #e9e9e9;
padding: 10px;
}
table.table td:last-child {
width: auto;
}
</style>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">User Profile</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">User Profile</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Welcome, Admin!</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered">
<tbody>
<?php if ($user): ?>
<div class="profile-info">
<tr>
<th>User ID</th>
<td><?php echo htmlspecialchars($user['User_id']); ?></td>
</tr>
<tr>
<th>Username</th>
<td><?php echo htmlspecialchars($user['Email']); ?></td>
</tr>
</div>
<?php else: ?>
<p>User data not found.</p>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<div class="card-footer">
<a href="edit_profile.php" class="btn btn-primary"><i class="bi bi-pencil-square"></i> Edit Profile</a>
</div>
</div>
<?php if (isset($_GET['update']) && htmlspecialchars($_GET['update']) == 'success'): ?>
<div class="callout callout-success">Profile updated successfully!</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/set_threshold.php'
<?php
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
// set_threshold.php
$mysqli = new mysqli("localhost", "mdrone", "einstein", "aasict_db");
if ($mysqli->connect_errno) {
die("Failed to connect to MySQL: " . $mysqli->connect_error);
}
// Handle form submission
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$new_threshold = intval($_POST["threshold"]);
$stmt = $mysqli->prepare("UPDATE threshold SET threshold_value = ? WHERE threshold_key = 'threshold'");
$stmt->bind_param("s", $new_threshold);
$stmt->execute();
$stmt->close();
$message = "Threshold updated to $new_threshold%.";
}
// Get current threshold
$result = $mysqli->query("SELECT threshold_value FROM threshold WHERE threshold_key = 'threshold'");
$current_threshold = $result->fetch_assoc()['threshold_value'] ?? 70;
$result->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Tech-Geeks Hall of Fame: Set Voting Threshold</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Tech-Geeks Hall of Fame: Set Induction Threshold</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Hall of Fame: Set Induction Threshold</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Hall of Fame Set Voting Threshold Control</div>
</div>
<div class="card shadow">
<div class="card-body p-4">
<?php if (!empty($message)): ?>
<div class="alert alert-success"><?= $message ?></div>
<?php endif; ?>
<form method="POST">
<div class="mb-3">
<label for="threshold" class="form-label">Select Required Approval Percentage</label>
<select name="threshold" id="threshold" class="form-select" required>
<?php
for ($i = 50; $i <= 100; $i += 5) {
$selected = ($i == $current_threshold) ? 'selected' : '';
echo "<option value='$i' $selected>$i%</option>\n";
}
?>
</select>
</div>
<button type="submit" class="btn btn-success">Update Threshold</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/set_threshold.php.orig'
<?php
// set_threshold.php
$mysqli = new mysqli("localhost", "mdrone", "einstein", "aasict_db");
if ($mysqli->connect_errno) {
die("Failed to connect to MySQL: " . $mysqli->connect_error);
}
// Handle form submission
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$new_threshold = intval($_POST["threshold"]);
$stmt = $mysqli->prepare("UPDATE threshold SET threshold_value = ? WHERE threshold_key = 'threshold'");
$stmt->bind_param("s", $new_threshold);
$stmt->execute();
$stmt->close();
$message = "Threshold updated to $new_threshold%.";
}
// Get current threshold
$result = $mysqli->query("SELECT threshold_value FROM threshold WHERE threshold_key = 'threshold'");
$current_threshold = $result->fetch_assoc()['threshold_value'] ?? 70;
$result->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Set Hall of Fame Vote Threshold</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
<div class="container mt-5">
<div class="card shadow">
<div class="card-header bg-primary text-white">
<h4 class="mb-0">Set Induction Threshold</h4>
</div>
<div class="card-body">
<?php if (!empty($message)): ?>
<div class="alert alert-success"><?= $message ?></div>
<?php endif; ?>
<form method="POST">
<div class="mb-3">
<label for="threshold" class="form-label">Select Required Approval Percentage</label>
<select name="threshold" id="threshold" class="form-select" required>
<?php
for ($i = 50; $i <= 100; $i += 5) {
$selected = ($i == $current_threshold) ? 'selected' : '';
echo "<option value='$i' $selected>$i%</option>";
}
?>
</select>
</div>
<button type="submit" class="btn btn-success">Update Threshold</button>
</form>
</div>
</div>
</div>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/summernote-0.9.0-dist.zip'
wget 'https://lists2.roe3.org/tg-hof/admin/toggle_voting.php'
<?php
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$conn = mysqli_connect("localhost", "mdrone", "einstein", "aasict_db");
// Handle form submission
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$enabled = isset($_POST['voting_enabled']) ? '1' : '0';
mysqli_query($conn, "UPDATE settings SET setting_value = '$enabled' WHERE setting_key = 'voting_enabled'");
}
// Get current value
$res = mysqli_query($conn, "SELECT setting_value FROM settings WHERE setting_key = 'voting_enabled'");
$row = mysqli_fetch_assoc($res);
$is_enabled = $row['setting_value'] == '1';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Tech-Geeks Hall of Fame: Turn Voting On/Off</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
.switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
background-color: #ccc;
transition: .4s;
border-radius: 34px;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #4CAF50;
}
input:checked + .slider:before {
transform: translateX(26px);
}
</style>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Tech-Geeks Hall of Fame: Turn Voting On/Off</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Hall of Fame: Turn Voting On/Off</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Hall of Fame Voting Control</div>
</div>
<div class="card-body p-4">
<form method="POST">
<label class="switch">
<input type="checkbox" name="voting_enabled" <?= $is_enabled ? 'checked' : '' ?> onchange="this.form.submit()">
<span class="slider"></span>
</label>
</form>
<p>Status:
<?= $is_enabled ? '<span style="color:green;">Voting is ON</span>' : '<span style="color:red;">Voting is OFF</span>' ?>
</p>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/view_member.php'
<?php
include("../config.php");
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Member Details | Tech-Geeks Hall of Fame</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
.table-responsive {
padding: 4px;
padding-top: 8px;
margin-bottom: -14px;
}
.table-wrapper {
min-width: 1000px;
background: #fff;
padding: 20px;
box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}
table.table tr th,
table.table tr td {
border-color: #e9e9e9;
padding: 10px;
}
table.table td:last-child {
width: auto;
}
</style>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Hall of Fame Member Details</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Member Details</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Member details are shown here</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered">
<tbody>
<?php
$vid = $_GET['id'];
$ret = mysqli_query($conn, "select * from member where member_id =$vid");
$cnt = 1;
while ($row = mysqli_fetch_array($ret)) {
?>
<tr>
<th>Full Name</th>
<td><?php echo $row['name']; ?></td>
</tr>
<tr>
<th>Nominated By</th>
<td><?php echo $row['nominated_by']; ?></td>
</tr>
<tr>
<?php if($row["approved"] == 1) { echo "<th>Year Inducted</th>";} ?>
<?php if($row["approved"] == 0) { echo "<th>Year Nominated</th>";} ?>
<td><?php echo $row['year_inducted']; ?></td>
</tr>
<!--
<tr>
<th>Background/Work Experience</th>
<td><?php echo $row['vita']; ?></td>
</tr>
<tr>
<th>Districts/Schools/Entities Served</th>
<td><?php echo $row['location']; ?></td>
</tr>
-->
<tr>
<th>Contributions to Tech-Geeks</th>
<td><?php echo $row['contributions']; ?></td>
</tr>
<?php
$cnt = $cnt + 1;
} ?>
</tbody>
</table>
</div>
</div>
<div class="card-footer">
<a href="<?php echo $_SERVER['HTTP_REFERER']; ?>" class="btn btn-primary"><i class="bi bi-arrow-left-circle"></i> Back to Member Listing</a>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
</body>
</html>
wget 'https://lists2.roe3.org/tg-hof/admin/voting_results.php'
<?php
session_start();
if (!isset($_SESSION['usermail']) || empty($_SESSION['usermail']) || $_SESSION['user_type'] !== 'user') {
header("Location: ../login.php");
exit();
}
$usermail = $_SESSION['usermail'];
$pdo = new PDO("mysql:host=localhost;dbname=aasict_db", "mdrone", "einstein");
$limit = 10;
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
$offset = ($page - 1) * $limit;
$ret = mysqli_query("SELECT * FROM member_votes LIMIT $limit OFFSET $offset");
$total_records_query = mysqli_query("SELECT COUNT(*) as total FROM member_votes");
$total_records_row = mysqli_fetch_assoc($total_records_query);
$total_records = $total_records_row['total'];
$total_pages = ceil($total_records / $limit);
/*
$sql = "
SELECT
m.name,
SUM(CASE WHEN mv.vote = 'approve' THEN 1 ELSE 0 END) AS approve_votes,
SUM(CASE WHEN mv.vote = 'disapprove' THEN 1 ELSE 0 END) AS disapprove_votes
FROM
member_votes mv
JOIN
member m ON mv.member_id = m.member_id
GROUP BY
m.member_id, m.name
ORDER BY
m.name;
";
*/
// New Query
$sql= "
SELECT
m.name,
SUM(CASE WHEN mv.vote = 'approve' THEN 1 ELSE 0 END) AS approve_votes,
SUM(CASE WHEN mv.vote = 'disapprove' THEN 1 ELSE 0 END) AS disapprove_votes,
FORMAT(
(SUM(CASE WHEN mv.vote = 'approve' THEN 1 ELSE 0 END) /
(SUM(CASE WHEN mv.vote = 'approve' THEN 1 ELSE 0 END) + SUM(CASE WHEN mv.vote = 'disapprove' THEN 1 ELSE 0 END))) * 100, 0
) as percentage
FROM
member_votes mv
JOIN
member m ON mv.member_id = m.member_id
GROUP BY
m.member_id, m.name
ORDER BY
m.name;
";
$stmt = $pdo->query($sql);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Tech-Geeks Hall of Fame: Nominee Results</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../assets/img/favicon.png" type="image/x-icon">
<?php include('includes/global_styles.php'); ?>
<!-- Include jQuery and Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
table.table tr th,
table.table tr td {
border-color: #e9e9e9;
padding: 10px;
}
table.table th i {
font-size: 13px;
margin: 0 5px;
cursor: pointer;
}
table.table td:last-child {
width: 130px;
}
table.table td a {
color: #a0a5b1;
display: inline-block;
margin: 0 5px;
}
table.table td a.view {
color: #03A9F4;
}
table.table td a.edit {
color: #FFC107;
}
table.table td a.delete {
color: #E34724;
}
table.table td i {
font-size: 19px;
}
.hint-text {
float: left;
margin-top: 10px;
font-size: 13px;
}
</style>
</head>
<body class="layout-fixed sidebar-expand-lg bg-body-tertiary">
<div class="app-wrapper">
<?php
include('includes/navbar.php');
include('includes/sidebar.php');
?>
<main class="app-main">
<div class="app-content-header">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<h3 class="mb-0">Tech-Geeks Hall of Fame Voting Summary</h3>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-end">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Hall of Fame Voting Summary</li>
</ol>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="container-fluid">
<div class="row g-4">
<div class="col-md-12">
<div class="card card-primary card-outline mb-4">
<div class="card-header">
<div class="card-title">Hall of Fame Voting Results are displayed here</div>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover align-middle" id="table-data">
<thead class="table-dark align-middle">
<tr>
<th>Nominee</th>
<th>Votes to Approve Nominee</th>
<th>Votes to Postpone Approval</th>
<th>% Approval</th>
</tr>
</thead>
<tbody>
<?php
$cnt = $offset + 1;
foreach ($results as $row):
?>
<tr>
<td><b><?= htmlspecialchars($row['name']) ?></b></td>
<td><?= $row['approve_votes'] ?></td>
<td><?= $row['disapprove_votes'] ?></td>
<td><?= $row['percentage'] ?>%</td>
<!-- <td><?php echo $row['approve_votes']/($row['approve_votes']+$row['disapprove_votes'])*100; ?>%</td> -->
</tr>
<?php
endforeach;
$cnt = $cnt + 1;
?>
</tbody>
</table>
</div>
</div>
<div class="card-footer clearfix">
<ul class="pagination pagination-sm m-0 float-end">
<?php if ($page > 1): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page - 1; ?>">« Previous</a></li>
<?php endif; ?>
<?php for ($i = 1; $i <= $total_pages; $i++): ?>
<li class="page-item <?php if ($i == $page) echo 'active'; ?>">
<a class="page-link" href="?page=<?php echo $i; ?>"><?php echo $i; ?></a>
</li>
<?php endfor; ?>
<?php if ($page < $total_pages): ?>
<li class="page-item"><a class="page-link" href="?page=<?php echo $page + 1; ?>">Next »</a></li>
<?php endif; ?>
</ul>
</div>
</div>
<?php //echo "<i>".$sql."</i>"; ?>
</main>
<?php
include("includes/footer.php");
?>
</body>
</html>