-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprosestransaksi.php
45 lines (41 loc) · 1.21 KB
/
prosestransaksi.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
<?php
session_start();
include 'koneksi.php';
if(isset($_GET['act'])){
if($_GET['act']=='bayar'){
$idspp = $_GET['id'];
$nisn = $_GET['nisn'];
$tglbayar = date('Y-m-d');
$nobayar = date('dmYHisis');
$id_admin = $_SESSION['admin'];
$byr=mysqli_query($conn, "UPDATE pembayaran SET
nobayar = '$nobayar',
tglbayar = '$tglbayar',
ket = 'LUNAS',
id_admin = '$id_admin'
WHERE idspp = '$idspp'");
if($byr){
header('location: pembayaran.php?nisn='.$nisn);
}
else{
echo "<script>alert('GAGAL')</script>";
}
}
else if($_GET['act']=='cencel'){
$idspp = $_GET['id'];
$nisn = $_GET['nisn'];
$batal=mysqli_query($conn, "UPDATE pembayaran SET
nobayar = null,
tglbayar = null,
ket = null,
id_admin = null
WHERE idspp = '$idspp'");
if($batal){
header('location: pembayaran.php?nisn='.$nisn);
}
else{
echo "<script>alert('GAGAL')</script>";
}
}
}
?>