-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_course_teaching_methods.php
More file actions
70 lines (65 loc) · 3.16 KB
/
edit_course_teaching_methods.php
File metadata and controls
70 lines (65 loc) · 3.16 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
<?php include 'includes/dbcon.php'; ?>
<?php
if (isset($_GET['teaching_id'])) {
$teaching_id = $_GET['teaching_id'];
$sql = "SELECT * FROM teaching WHERE teaching_short_title = ?";
$stmt = $pdo->prepare($sql);
$stmt->execute([$teaching_id]);
$teaching = $stmt->fetch();
}
?>
<?php
if (isset($_POST['teaching-update'])) {
$teaching_short_title = $_POST['teaching-short-title'];
$teaching_order = $_POST['teaching-order'];
$teaching_title = $_POST['teaching-title'];
$teaching_title_en = $_POST['teaching-title-en'];
$sql = 'UPDATE teaching SET teaching_title = ?, teaching_title_eng = ?, teaching_order = ? WHERE teaching_short_title = ?';
$stmt = $pdo->prepare($sql);
$stmt->execute([$teaching_title, $teaching_title_en, $teaching_order, $teaching_short_title]);
header("Location: admin_course_teaching_methods.php");
}
?>
<?php include "includes/header.php"; ?>
<!-- Begin Page Content -->
<div class="container-fluid">
<div class="mb-3">
<h1 class="h3 mb-0 text-gray-800 font-weight-bold">
<?php echo $teaching['teaching_title']; ?> [<?php echo $teaching['teaching_short_title']; ?>]
</h1>
</div>
<div class="card shadow mb-3">
<div class="card-body edit-lesson">
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="POST" id="update-teaching-methods-form">
<div class="form-row error-message error-update-teaching-methods">
<div class="alert alert-danger" role="alert">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2 required">
<label for="teaching-order" class="col-form-label font-weight-bold text-gray-800">A/A:</label>
<input type="text" name="teaching-order" class="font-weight-normal form-control" value="<?php echo $teaching['teaching_order']; ?>" readonly>
</div>
<div class="form-group col-md-2 required">
<label for="teaching-short-title" class="col-form-label font-weight-bold text-gray-800">Κωδικός:</label>
<input type="text" name="teaching-short-title" class="font-weight-normal form-control" value="<?php echo $teaching['teaching_short_title']; ?>" readonly>
</div>
</div>
<div class="form-group required">
<label for="teaching-title" class="col-form-label font-weight-bold text-gray-800">Τίτλος:</label>
<input type="text" name="teaching-title" id="teaching-title" class="font-weight-normal form-control" value="<?php echo $teaching['teaching_title']; ?>">
</div>
<div class="form-group">
<label for="teaching-title-en" class="col-form-label font-weight-bold text-gray-800">Τίτλος (EN):</label>
<input type="text" name="teaching-title-en" class="font-weight-normal form-control" value="<?php echo $teaching['teaching_title_eng']; ?>">
</div>
<button type="submit" name="teaching-update" class="btn btn-primary float-right">Ενημέρωση</button>
<input type="reset" class="btn btn-warning float-right mr-3" value="Επαναφορά">
</form>
</div>
</div>
<!-- /.container-fluid -->
</div>
</div>
<!-- End of Main Content -->
<?php include "includes/footer.php"; ?>