-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_spp.php
66 lines (48 loc) · 1.65 KB
/
edit_spp.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
<?php include "assets/templates/header.php";?>
<?php
$data = $crud->tampilAll("SELECT * FROM spp WHERE id_spp='$_GET[edit]'");
?>
<div class="container mt-5 ">
<div class="card shadow bg-info text-white" >
<h2 class="card-title text-center">Tambah Data Petugas</h2>
<div class="card-body">
<form action="" method="post">
<div class="form-group" >
<label for="">Nominal</label>
<input type="text" class="form-control" value="<?= $data[0]["nominal"] ?>" name="nominal" id="">
</div>
<div class="form-group" >
<label for="">Tahun</label>
<input type="text" class="form-control" name="tahun" value="<?= $data[0]["tahun"] ?>" id="">
</div>
<div class="form-group text-center ">
<button name="submit" class="btn btn-primary btn-lg btn-block ">Submit</button>
</div>
</form>
<?php
if(isset($_POST['submit']))
{
$nominal = $_POST['nominal'];
$tahun = $_POST['tahun'];
$data = array(
'tahun' => $tahun,
'nominal' => $nominal,
);
$id = "id_spp=" . $_GET['edit'];
$edit = $crud->update('spp', $data,$id);
// print_r($insert);
if ($insert) {
$crud::set_flashdata("success","Data berhasil diubah");
echo "<script>location='index.php?menu=spp'</script>";
}
else
{
$crud::set_flashdata("success","Data berhasil diubah");
echo "<script>location='index.php?menu=spp'</script>";
}
}
?>
</div>
</div>
</div>
<?php include "assets/templates/footer.php";?>