-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsertifikat.php
187 lines (146 loc) · 7.8 KB
/
sertifikat.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?php
date_default_timezone_set('Asia/Jakarta'); //define local time
$tanggal_sekarang = date("Y-m-d ");
// echo $tanggal_sekarang ;
session_start();
if (!isset($_SESSION["email"])) {
header("Location:session.php");
exit;
}
$nama_lengkap = $_SESSION["nama_lengkap"];
$id_peserta = $_SESSION["id_peserta"];
include "koneksi.php";
// result sertificate
$result_sertificate = $koneksi->query("SELECT a.* , b.* FROM peserta_event a,master_event b WHERE id_peserta ='$id_peserta' and absen = 1 and a.id_event = b.id_event and '$tanggal_sekarang'>= b.tanggal");
$const_locate_sertificate = "asset/TSP.jpg";
// result feedback
$result_feed = $koneksi->query("SELECT a.* , b.* FROM peserta_event a,master_event b WHERE id_peserta ='$id_peserta' and absen = 0 and a.id_event = b.id_event and '$tanggal_sekarang'> b.tanggal");
//
if (isset($_POST['isi_feed'])){
$id_psr = $_POST['id_psr'];
$id_evn = $_POST['id_evn'];
$link_feed = $_POST['link_feed'];
// echo $id_psr;
// echo $id_evn;
// echo $link_feed;
//update psrevn status
mysqli_query($koneksi , "UPDATE peserta_event SET absen=1 WHERE id_event ='$id_evn' and id_peserta ='$id_psr'");
header('Location: '.$link_feed.'');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DC-Event | Certificate</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="images/icons/" />
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="fonts/iconic/css/material-design-iconic-font.min.css">
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="css/certif.css">
</head>
<body>
<div class="container-login" style="background-image: url('images/bg05.jpg');">
<div class="wrap-login p-l-55 p-r-55 p-t-10 p-b-30" style="min-height:95vh;">
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<!--<div id="navpro">
<ul>
<li></li>
<p><img src="#" style="width: 190px; height: 230px;"></p>
</ul>
</div>-->
<a href="beranda.php">Home</a>
<a href="event.php">Webinar</a>
<a href="sertifikat.php">Certificate</a>
<a href="ganti-password.php">Ganti Password</a>
<a href="logout.php">Keluar</a>
</div>
<span style="font-size:25px;cursor:pointer; float: right;" onclick="openNav()">☰</span>
<span class="title p-t-8" style="float:left; font-size:20px;"><?php echo $nama_lengkap;?></span>
<br>
<hr>
<div class="txt2 text-center mb-3">
Sertifikat Webinar
</div>
<!-- Feedback -->
<?php
while ($row = $result_feed->fetch_assoc())
{
$id_event = $row['id_event'];
$id_peserta_event = $row['id_peserta_event'];
$judul = $row['judul'];
$avatar_event = $row['avatar_event'];
$tanggal = $row['tanggal'];
$alamat_sertifikat =$row['lokasi_sertifikat'];
$date_format = date("d F Y",strtotime($tanggal));
$feedback = $row['feedback'];
// echo "$id_event";
echo '<div class="card mb-3" style="width: 18rem; background-color: aliceblue; border-radius: 15px; box-shadow: 0 5px 20px 0px rgb(126, 128, 127);" >
<img class="card-img-top " style="height: 150px;"src="asset/tsps/'.$id_event."/".$alamat_sertifikat.'" alt="Gambaran Sertifikat">
<div class="card-body">
<h5 class="card-title">'.$judul.'</h5>
<p class="card-text">'.$tanggal.'</p>
<div class="container-login-form-btn p-t-20 p-b-10">
<form action = "sertifikat.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="id_psr" value="'.$id_peserta.'">
<input type="hidden" name="id_evn" value="'.$id_event.'">
<input type="hidden" name="link_feed" value="'.$feedback.'">
<input type="submit" value="isi feedback" name="isi_feed" style="color: white; cursor:pointer;" class="login-form-btn" ></input>
</form>
</div>
</div>
</div>';
};
?>
<!--Sertificate -->
<?php
while ($row = $result_sertificate->fetch_assoc()){
if (is_null($row ['id_peserta_event']))
{
echo $event_empty;
}
else {
$id_event = $row['id_event'];
$id_peserta_event = $row['id_peserta_event'];
$judul = $row['judul'];
$avatar_event = $row['avatar_event'];
$tanggal = $row['tanggal'];
$alamat_sertifikat =$row['lokasi_sertifikat'];
$date_format = date("d F Y",strtotime($tanggal));
// echo "$id_event";
echo '<div class="card mb-3" style="width: 18rem; background-color: aliceblue; border-radius: 15px; box-shadow: 0 5px 20px 0px rgb(126, 128, 127);" >
<img class="card-img-top " style="height: 150px;"src="asset/tsps/'.$id_event."/".$alamat_sertifikat.'" alt="Gambaran Sertifikat">
<div class="card-body">
<h5 class="card-title">'.$judul.'</h5>
<p class="card-text">'.$tanggal.'</p>
<div class="container-login-form-btn p-t-20 p-b-10">
<a href="donwload-certificate.php?l='.$alamat_sertifikat.'&e='.$id_event.'" style="color: white;" class="login-form-btn">Donwload Sertifikat</a>
</div>
</div>
</div>';
}
};
?>
</div>
</div>
<!-- script java script -->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="vendor/select2/select2.min.js"></script>
<script src="js/main.js"></script>
<script>
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
</script>
</body>
</html>