Repository navigation
Expand file tree
/
Copy pathsolus_editCou.php
More file actions
106 lines (93 loc) · 3.59 KB
/
Copy pathsolus_editCou.php
File metadata and controls
106 lines (93 loc) · 3.59 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
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
<!-- Purpose: Edit a course information
Author: Songyu Yang -->
<?php
// Include the database connection file
include 'solus_connectdb.php';
// Get the course code
$id = isset($_GET['id']) ? $_GET['id'] : '';
// Check if the form is submitted
if (!empty($id)) {
$sql = "select * from course where code = :id";
$stmt = $connection->prepare($sql);
$stmt->execute(['id' => $id]);
$info = $stmt->fetch(PDO::FETCH_ASSOC);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit Course</title>
<link rel="stylesheet" type = "text/css" href="main.css">
<link rel="stylesheet" type = "text/css" href="Table_CSS.css">
</head>
<!-- <link rel="stylesheet" href="./css/common.css"> -->
<style>
.textClass{
height: 25px;
width: 260px;
}
.textClass label{
/*width: 50px;*/
}
.textClass input{
height: 25px;
}
.labelClass{
width: 130px;
}
</style>
<body>
<div>
<div style="display: flex">
<div style="margin: auto">
<h1>Welcome to Solus</h1>
<h3>Eidt a Course Information</h3>
</div>
</div>
<div class="header" style="display: flex;">
<div style="margin: auto">
<form method="post" action="solus_enterCouInfo.php">
<table>
<tr>
<div >
<td class="labelClass"><label for="code">Code:</label></td>
<td><input type="text" id="code" name="code" class="textClass" readonly value="<?=isset($info['code'])?$info['code']:''?>"></td>
<input type="hidden" name="type" value="1">
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="units">Units:</label></td>
<td><input type="number" id="units" name="units" class="textClass" value="<?=isset($info['units'])?$info['units']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="learningHours">Learning Hours:</label></td>
<td><input type="number" id="learningHours" name="learningHours" class="textClass" value="<?=isset($info['learningHours'])?$info['learningHours']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="description">Description:</label></td>
<td><textarea name="description" id="" cols="40" rows="10"><?=isset($info['description'])?$info['description']:''?></textarea></td>
</div>
</tr>
</table>
<div class="">
<div>
<div style="margin-left: 50px;margin-top: 10px">
<input type="submit" value="Edit Course" style="height: 28px">
<a href="index.php" style="padding: 2px 6px;background: #54c4e5;color: white">Home</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</body>
</html>