-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_where_teaching.php
More file actions
65 lines (60 loc) · 2.62 KB
/
edit_where_teaching.php
File metadata and controls
65 lines (60 loc) · 2.62 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
<?php include 'includes/dbcon.php'; ?>
<?php
if (isset($_GET['where_id'])) {
$where_id = $_GET['where_id'];
$sql = "SELECT * FROM whereteaching WHERE where_short_title = ?";
$stmt = $pdo->prepare($sql);
$stmt->execute([$where_id]);
$where = $stmt->fetch();
}
?>
<?php
if (isset($_POST['where-update'])) {
$id = $_POST['where-short-title'];
$title = $_POST['where-title'];
$title_en = $_POST['where-title-en'];
$sql = 'UPDATE whereteaching SET where_title = ?, where_title_eng = ? WHERE where_short_title = ?';
$stmt = $pdo->prepare($sql);
$stmt->execute([$title, $title_en, $id]);
header("Location: admin_course_where_teaching.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 $where['where_title']; ?> [<?php echo $where['where_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-where-form">
<!-- <div class="form-row"> -->
<div class="form-row error-message error-lesson-where-teaching-update">
<div class="alert alert-danger" role="alert">
</div>
</div>
<div class="form-group required">
<label for="where-short-title" class="col-form-label font-weight-bold text-gray-800">Κωδικός:</label>
<input type="text" name="where-short-title" class="font-weight-normal form-control" value="<?php echo $where['where_short_title']; ?>" readonly>
</div>
<div class="form-group required">
<label for="where-title" class="col-form-label font-weight-bold text-gray-800">Τίτλος:</label>
<input type="text" name="where-title" id="where-title" class="font-weight-normal form-control" value="<?php echo $where['where_title']; ?>">
</div>
<div class="form-group">
<label for="where-title-en" class="col-form-label font-weight-bold text-gray-800">Τίτλος (EN):</label>
<input type="text" name="where-title-en" id="where-title-eng" class="font-weight-normal form-control" value="<?php echo $where['where_title_eng']; ?>">
</div>
<!-- </div> -->
<button type="submit" name="where-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"; ?>