-
Notifications
You must be signed in to change notification settings - Fork 1
/
tambah_transaksi.php
77 lines (75 loc) · 2.39 KB
/
tambah_transaksi.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
<!DOCTYPE html>
<html>
<head>
<title>Tambah Transaksi</title>
</head>
<?php
//koneksi database
include 'koneksi.php';
//menangkap data yang dikirim dari form
if(!empty($_POST['save'])){
$Tanggal = $_POST['tgl_transaksi'];
$No = $_POST['no_transaksi'];
$Jenis = $_POST['jenis_transaksi'];
$Penjualan = $_POST['id_penjualan'];
$Barang = $_POST['id_barang'];
$Jumlah = $_POST['jumlah_transaksi'];
$Member = $_POST['id_member'];
$Total = $_POST['total'];
//menginput data ke database
$a = mysqli_query($koneksi,"insert into transaksi values('','$Tanggal','$No','$Jenis','$Penjualan','$Barang','$Jumlah','$Member','$Total')");
if($a){
//mengalihkan ke halaman kembali
header("location:tambah_transaksi.php");
}else{
echo mysqli_error($koneksi);
}
}
?>
<body>
<h2>Pemograman 1 2023</h2>
<br>
<a href="tambah_transaksi.php">Kembali</a>
<br>
<h3>TAMBAH DATA TRANSAKSI</h3>
<form method="POST">
<table>
<tr>
<td>Tanggal Transaksi</td>
<td><input type="date" name="tgl_transaksi"></td>
</tr>
<tr>
<td>Nomor Transaksi</td>
<td><input type="number" name="no_transaksi"></td>
</tr>
<tr>
<td>Jenis Transaksi</td>
<td><input type="text" name="jenis_transaksi"></td>
</tr>
<tr>
<td>Penjualan_id</td>
<td><input type="text" name="id_penjualan"></td>
</tr>
<tr>
<td>Id Barang</td>
<td><input type="number" name="id_barang"></td>
</tr>
<tr>
<td>Jumlah Transaksi</td>
<td><input type="number" name="jumlah_transaksi"></td>
</tr>
<tr>
<td>Member Id </td>
<td><input type="number" name="id_member"></td>
</tr>
<tr>
<td>Total</td>
<td><input type="number" name="total"></td>
</tr>
<td></td>
<td><input type="submit" name="save"></td>
</tr>
</table>
</form>
</body>
</html>