-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit.php
91 lines (63 loc) · 1.91 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
<?php
include('includes/connection.php');
$pelajar_id = $_GET['id'];
$sql = "select * from pelajar where pelajar_id = $pelajar_id";
$result = mysqli_query($con, $sql );
/* determine number of rows result set */
$row_cnt = mysqli_num_rows( $result);
$row = mysqli_fetch_array($result);
// Use this to test if the result is 0
// $row_cnt = 0;
?>
<!doctype>
<html>
<head>
<title>JOMWEB : CRUD Challenge</title>
<link rel="stylesheet" href="assets/normalize.css">
<link rel="stylesheet" href="assets/style.css">
<!--FONTS-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,300' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="wrapper">
<h1>Kemaskini Maklumat Pelajar</h1>
<a href="index.php" class="button-link btn-grey">SENARAI</a>
<?php
if ($row_cnt < 1) {
?>
<h3>Rekod tidak ditemui</h3>
<?php
}else{
?>
<form action="save_edit.php" method="post">
<label>No. Matriks</label>
<input type="text" name="no_matriks"
value="<?php echo $row['no_matriks']?>" />
<label>Nama Penuh</label>
<input type="text" name="nama_penuh"
value="<?php echo $row['nama_penuh']?>"/>
<label>No. K/P</label>
<input type="text" name="no_kp"
value="<?php echo $row['no_kp']?>"/>
<label>Kursus</label>
<select name="kursus">
<option value="bit"
<?php if ($row['kursus'] == 'bit') echo " selected"; ?>>
Business IT</option>
<option value="csc"
<?php if ($row['kursus'] == 'csc') echo " selected"; ?>>
Computer Sceince</option>
<option value="mbn"
<?php if ($row['kursus'] == 'mbn') echo " selected"; ?>>
Mobile Network</option>
</select>
<input type="hidden" name="pelajar_id" value="<?php echo $row['pelajar_id']?>" />
<input type="submit" name="submit" value="SIMPAN" class="button-link"/>
</form>
<?php
}
?>
</div>
</body>
</html>