forked from Mahmoudb7/faculty_meeting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformation_members.php
88 lines (83 loc) · 4.06 KB
/
formation_members.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
require_once "db.php";
require_once "functions.php";
if (session_status() === PHP_SESSION_NONE)
{
session_start();
}
?>
<!DOCTYPE html>
<html lang="en">
<?php Head("أعضاء التشكيل"); ?>
<body dir="rtl">
<?php Headers();
if (is_logged_in()) {
Nav();
$search = clean_data($_GET["fid"]);
$formation_num = $conn->prepare("SELECT formation_number, formation_id as fid FROM p39_formation WHERE formation_id = ?");
$formation_num->bind_param("i", $search);
$formation_num->execute();
$formation_num_result = $formation_num->get_result();
$formation_num_row = $formation_num_result->fetch_assoc();
$formation_number = $formation_num_row["formation_number"];
if (in_array($formation_num_row["fid"], $_SESSION["formation_ids"]) || $_SESSION["admin"]) {
$formation_members_stmt = $conn->prepare("SELECT
fu.job_title AS jt,
u.name AS n
FROM
`p39_formation_user` AS fu
JOIN p39_users AS u
ON
u.user_id = fu.user_id AND fu.formation_id = ?");
$formation_members_stmt->bind_param("i", $search);
$formation_members_stmt->execute();
$formation_members_result = $formation_members_stmt->get_result();
$formation_members_exist = $formation_members_result->num_rows > 0; ?>
<main class="formation-members-content">
<div class="container">
<div class="title">
<h1> سجل اعضاء التشكيل رقم <?= $formation_number ?> </h1>
</div>
<!-- --><?php //if (@in_array($search, $_SESSION["formation_ids"]) OR $_SESSION["admin"]) { ?>
<?php if ($formation_members_exist) { ?>
<div class="meeting-attendance-page meetings-members">
<table class="attend-table">
<tbody>
<?php while ($formation_members_row = $formation_members_result->fetch_assoc()) { ?>
<tr>
<?php if ($_SESSION["admin"]) { ?>
<td><a href="members.php?f=mn&search=<?= $formation_members_row["n"] ?>"><?= $formation_members_row["n"] ?></a></td>
<?php } else { ?>
<td><?= $formation_members_row["n"] ?></td>
<?php } ?>
<td><?= $formation_members_row["jt"] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="print-container">
<button class="btn-basic" onclick="window.print()">طباعة</button>
</div>
<?php } else { ?>
<main id="empty" class="empty-member">
<h4>لا يوجد أعضاء في هذا التشكيل</h4>
</main>
<?php } ?>
<!-- --><?php //} else { ?>
<!-- <main id="empty" class="empty-member">-->
<!-- <h4>لا يوجد أعضاء في هذا التشكيل</h4>-->
<!-- </main>-->
<!-- --><?php //} ?>
</div>
</main>
<?php } else {
header("location: formation.php", true, 303);}
}
footer(); ?>
<!-- Js Scripts and Plugins -->
<script type="module" src="./js/main.js"></script>
<!-- font Awesome -->
<script src="https://kit.fontawesome.com/eb7dada2f7.js" crossorigin="anonymous"></script>
</body>
</html>