-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_details.php
146 lines (141 loc) · 5.19 KB
/
user_details.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
include "connect.php";
$host = "localhost";
$user = "root";
$password = "";
$database = "manpro";
$conn = mysqli_connect($host, $user, $password, $database);
?>
<!DOCTYPE html>
<html>
<head>
<title>Proyek Manpro</title>
<?php include('assets/header.php'); ?>
<link rel="stylesheet" type="text/css" href="assets/css/admin_sidebar.css">
<link rel="stylesheet" type="text/css" href="assets/css/admin_home.css">
<link rel="stylesheet" href="assets/css/admin_files.css">
</head>
<body>
<style>
#container{
padding: 20px;
}
.accordion{
width: 400px;
}
.accordion-button{
height: 40px;
}
.accordion-body {
margin-top:-10px;
}
.accordion-button:not(.collapsed){
color:black;
}
.form-control{
font-size: 15px;
}
.form-label{
margin-top: 8px;
margin-bottom: 0px;
}
</style>
<div id="container">
<!-- awal buat box detail event -->
<div class="accordion" id="accordionPanelsStayOpenExample">
<div class="accordion-item">
<h2 class="accordion-header" id="panelsStayOpen-headingOne">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="true" aria-controls="panelsStayOpen-collapseOne">
<h6 style="text-align: center; margin-top: 10px;"><i class="fa-solid fa-circle-info"></i> Detail Event</h6>
</button>
</h2>
<div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show" aria-labelledby="panelsStayOpen-headingOne">
<div class="accordion-body">
<?php
$email = $_SESSION['email'];
$query = "SELECT nama, jenis, tempat, link FROM event WHERE id IN (SELECT id_event FROM detail_event);";
$user = mysqli_query($conn, $query);
while($data = mysqli_fetch_array($user)){
$profile = $data;
break;
}
?>
<form>
<fieldset disabled>
<div class="sm-3">
<label for="exampleInputEmail1" class="form-label">Nama Kegiatan</label>
<input type="event" class="form-control" id="disabledTextInput" value="<?php echo $profile['nama']; ?>">
</div>
<div class="sm-3">
<label for="exampleInputEmail1" class="form-label">Jenis Kegiatan</label>
<input type="event" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" value="<?php echo $profile['jenis']; ?>">
</div>
<div class="sm-3">
<label for="exampleInputEmail1" class="form-label">Tempat/Lokasi Kegiatan</label>
<input type="event" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" value="<?php echo $profile['tempat']; ?>">
</div>
<div class="sm-3">
<label for="exampleInputEmail1" class="form-label">Link Kegiatan</label>
<input type="event" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" value="<?php echo $profile['link']; ?>">
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
<!-- awal buat detail kehadiran -->
<div id="konten-user" style="margin-top:30px;">
<h3><i class="fa-solid fa-user-group"></i> Detail Group </h3>
<table id="dtOrderExample" class="table table-striped table-bordered table-sm" cellspacing="0" width="100%">
<thead class="table-secondary">
<tr>
<th class="col" scope="col">Nama</th>
<th class="col" scope="col">Status Kehadiran</th>
<th class="col" scope="col">Keterangan</th>
<th class="col" scope="col">Action</th>
</tr>
</thead>
<tbody>
<?php
$email = $_SESSION['email'];
$query = "SELECT user.nama, detail_event.absen, detail_event.alasan, detail_event.id_group, detail_event.id_event, detail_event.id_user\n" . "FROM user\n" . "RIGHT JOIN detail_event ON user.id = detail_event.id_user;";
$result = mysqli_query($conn, $query);
$a = mysqli_fetch_array($result);
while($row = mysqli_fetch_array($result)){
$b = $row['id_group'];
$c = $row['id_event'];
$d = $row['id_user'];
?>
<tr>
<td><?php echo htmlspecialchars($row['nama']); ?></td>
<td>
<?php if($row['absen'] == "1"){ ?>
Hadir</i>
<?php } ?>
<?php if($row['absen'] == "0") { ?>
Tidak hadir
<?php } ?>
</td>
<td>
<?php if($row['alasan'] == ""){ ?>
Tidak ada keterangan
<?php } ?>
<?php if($row['alasan']) { ?>
<?php echo htmlspecialchars($row['alasan']); ?>
<?php } ?>
</td>
<td>
<a href="<?php echo 'user_details_edit.php?idg='.$b . '&ide=' .$c . '&idu=' .$d; ?>">
<button type="button" class="btn btn-primary">
<i class="fa-solid fa-pen-to-square"></i>
</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</body>
</html>