-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdate.php
More file actions
47 lines (47 loc) · 1.49 KB
/
Update.php
File metadata and controls
47 lines (47 loc) · 1.49 KB
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
<?php
ob_start();
include 'db.php';
if (isset($_POST['update'])) {
$id = $_POST['id'];
$name = $_POST['name'];
$summasi = $_POST['summasi'];
$olganVaqt = $_POST['olganVaqt'];
$qaytarishMuddati = $_POST['muddat'];
$selects = $_POST['selects'];
$result = $crud->SetUpdate($id, $name, $summasi, $olganVaqt, $qaytarishMuddati, $selects);
if ($result) {
header("Location: index.php");
ob_end_flush();
}
}
if (isset($_POST['btn'])) {
$id = $_POST['id'];
$result = $crud->Update($id);
if ($result) {
?>
<link rel="stylesheet" type="text/css" href="style.css">
<div class="container">
<div class="form">
<form action="" method="POST" enctype="multipart/form-data">
<h3 class="centir">Qarz berdim</h3>
<label>Kimga/Nimaga</label>
<input type="text" name="name" value="<?=$result['name']; ?>">
<input type="hidden" name="id" value="<?=$result['id']; ?>">
<label>Qarz miqdori(so'mda)</label>
<input type="text" name="summasi" value="<?=$result['summasi']; ?>">
<label>Qarz bergan kunim</label>
<input type="date" name="olganVaqt" value="<?=$result['olganVaqt']; ?>">
<label>To'lash muddati</label>
<input type="date" name="muddat" value="<?=$result['qaytarishMuddati']?>">
<select name="selects">
<option value="0">To'lanmadi</option>
<option value="1">To'landi</option>
</select>
<button class="btn" name="update">Qo'shish</button>
</form>
</div>
</div>
<?php
}
}
?>