-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit.php
108 lines (90 loc) · 2.46 KB
/
edit.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
<!DOCTYPE >
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
include 'db/connect.php';
session_start();
if(isset($_GET['status'])){
echo '<h1>'.$_GET['status'].'</h1>';
}
if(isset($_SESSION['ta_id'])){
$sql ="SELECT * From travel_agent WHERE ta_id=".$_SESSION['ta_id'];
$result=mysqli_query($link,$sql);
foreach ($result as $val) {
if ($val['image']!=null){
$img="<img src='db/travel_agent/".$val['image']."' width='45px'>";
}
?>
<!-- new -->
<form method="POST" action="db/edit.php" enctype="multipart/form-data">
<input type="hidden" value="true" name="register_ta" id="register_ta"> <!-- change -->
<input type="hidden" value="<?php echo $val['ta_id']; ?>" name="ta_id" id="ta_id"> <!-- change -->
<div>
<label>Name</label>
<div>
<input type="text" id="name" name="name" value="<?php echo $val['name']; ?>" required>
</div>
</div>
<div>
<label>Registered Number</label>
<div>
<input type="text" id="regno" name="regno" value="<?php echo $val['regno']; ?>" required>
</div>
</div>
<div>
<label>Contact Number</label>
<div>
<input type="text" id="tel" name="tel" value="<?php echo $val['tel']; ?>" required>
</div>
</div>
<div>
<label>Address</label>
<div>
<input type="textarea" id="address" name="address" value="<?php echo $val['address']; ?>" required>
</div>
</div>
<div>
<label>Email</label>
<div>
<input type="email" id="email" name="email" value="<?php echo $val['email']; ?>" required>
</div>
</div>
<div>
<label>Photo</label>
<div>
<?php echo $img; ?>
<input type="file" id="image" name="image" accept="image/*" required>
</div>
</div>
<div>
<label>Password</label>
<div>
<input type="password" id="password" name="password" value="<?php echo $val['password']; ?>" required>
</div>
</div>
<div>
<center>
<button type="submit" >
Update
</button>
</center>
</div>
</form>
<form method="POST" action="db/delete.php">
<input type="hidden" value="true" name="delete" id="delete">
<input type="hidden" value="<?php echo $val['ta_id']; ?>" name="ta_id" id="ta_id">
<div>
<button type="submit" >
Delete
</button>
</div>
</form>
<?php }
} ?>
</body>
</html>
<?php include 'db/config.php'; ?>