-
Notifications
You must be signed in to change notification settings - Fork 0
/
treatment_form.php
144 lines (130 loc) · 5.84 KB
/
treatment_form.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
<?php include('templates/header.php'); ?>
<div class="container mb-5">
<div class="row">
<div class="col-md-12">
<img src="img/header.jpg" class="img-fluid" alt="...">
</div>
</div>
<div class="row mt-3 mb-2">
<div class="col">
<?php include('menu.php'); ?>
</div>
</div>
<div class="row">
<figure class="text-center">
<blockquote class="blockquote">
<p>Form SPK</p>
</blockquote>
<figcaption class="blockquote-footer">
Beauty Lux
</figcaption>
</figure>
</div>
<div class="row">
<div class="col-md-6">
<?php
$id_treatment = $_GET['id_treatment'];
$no = 1;
include 'templates/koneksi.php';
$query = mysqli_query($koneksi, "
SELECT *
FROM treatment
JOIN customer
ON treatment.id_customer = customer.id_customer
WHERE id_treatment=$id_treatment");
while ($d = mysqli_fetch_array($query)) {
?>
<form method="post" action="treatment_tambah.php" class="row g-3" enctype="multipart/form-data">
<div class="col-12">
<input type="hidden" name="id_treatment" class="form-control" value="<?= $d['id_treatment']; ?>"
readonly>
<label><b>Nomor RM</b></label>
<input type="text" name="" class="form-control" value="<?= $d['id_customer']; ?>" readonly>
</div>
<div class="col-12">
<label><b>Nama Lengkap</b></label>
<input type="text" name="" class="form-control" value="<?= $d['nama']; ?>" readonly>
</div>
<div class="col-12">
<label><b>Nama Produk</b></label>
<select name="id_produk" class="form-select" aria-label="Default select example" required>
<option value="">Pilih</option>
<?php
$no = 0;
$data = mysqli_query(
$koneksi,
"SELECT * FROM produk;"
);
while ($a = mysqli_fetch_array($data)) { ?>
<option value="<?= $a['id_produk']; ?>"><?= $a['nama_produk']; ?></option>
<?php } ?>
</select>
</div>
<div class="col-12">
<label><b>Dosis</b></label>
<select name="dosis" class="form-select" aria-label="Default select example" required>
<option value="">Pilih</option>
<option value="1">1 (Satu)</option>
<option value="2">2 (Dua)</option>
<option value="3">3 (Tiga)</option>
<option value="4">4 (Empat)</option>
<option value="5">5 (Lima)</option>
</select>
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary float-end">Tambah</button>
</div>
</form>
</div>
<div class="col-md-6">
<form method="post" action="treatment_tambah_kesimpulan.php" class="row g-3 mb-5"
enctype="multipart/form-data">
<div class="col-12">
<input type="hidden" name="id_treatment" class="form-control" value="<?= $d['id_treatment']; ?>"
readonly>
<label><b>Kesimpulan Konsultasi</b></label>
<textarea class="form-control" name="kesimpulan" rows="4" cols="50"
placeholder="Tuliskan.."></textarea>
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary float-end">Tambah</button>
</div>
</form>
<?php } ?>
<table class="table table-hover table-light table-striped">
<thead>
<tr>
<th class="text-center" scope="col">#</th>
<th class="text-center" scope="col">Nama Produk</th>
<th class="text-center" scope="col">Dosis</th>
<th class="text-center" scope="col">Action</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
include 'templates/koneksi.php';
$query = mysqli_query($koneksi, "
SELECT *
FROM treatment_detail
JOIN produk
ON treatment_detail.id_produk = produk.id_produk
WHERE treatment_detail.id_treatment = '$id_treatment'
");
while ($d = mysqli_fetch_array($query)) {
?>
<tr>
<td class="text-center" scope="row"><?= $no++; ?></td>
<td class="text-left" scope="row"><?= $d['nama_produk']; ?></td>
<td class="text-center" scope="row"><?= $d['dosis']; ?></td>
<td class="text-center" scope="row">
<a href="spk_hapus_item.php?id_spk=<?= $_GET['id_treatment']; ?>&id_item=<?= $d['id_treatment_detail']; ?>"
type="button" class="btn btn-danger btn-sm"
onclick="return confirm('Yakin hapus?');">Hapus</a>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
<?php include('templates/footer.php'); ?>