-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit.php
112 lines (97 loc) · 2.83 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
109
110
111
112
<?php
include('session.php');
?>
<?php
include('header2.php');
?>
<?php
include('session.php');
?>
<?php
include('image_upload_function.php');
?>
<?php
include('post.php');
$posts = new Post($db);
?>
<?php
if(isset($_POST['btnUpdate'])){
$result = $posts->updatePost($_POST['title'],$_POST['description'],$_GET['slug']);
if($result==true){
echo"<div class='text-center alert alert-success'>Post updated Successfully!</div>";
}
}
?>
<!doctype html>
<html lang="tr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="img/favicon.png" type="image/png">
<title>GAMBIT Esports</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="vendors/linericon/style.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="vendors/owl-carousel/owl.carousel.min.css">
<link rel="stylesheet" href="css/magnific-popup.css">
<link rel="stylesheet" href="vendors/nice-select/css/nice-select.css">
<link rel="stylesheet" href="vendors/animate-css/animate.css">
<link rel="stylesheet" href="vendors/flaticon/flaticon.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<br><br><br><br><br><br><br><br><br>
<div class="container">
<div class="row justify-content-center">
<?php foreach($posts->getSinglePost($_GET['slug'])as $post){ ?>
<div class="col-md-8">
<form action="#" method="POST" enctype="multipart/form-data">
<div class="card">
<div class="card-header">Düzenle</div>
<div class="card-body">
<div class="form-group">
<label for="title">Başlık</label>
<input type="text" name="title" class="form-control" value="<?php echo $post['title']; ?>">
</div>
<div class="form-group">
<label for="description">Açıklama</label>
<textarea cols="10" id="editor" name="description" class="form-control"><?php echo $post['description'] ;?></textarea>
</div>
<div class="form-group">
<label for="image">Görsel</label>
<input type="file" name="image" class="form-control">
<img style="width: 180px;" src="images/<?php echo $post['image'] ?>">
</div>
<div class="form-group">
<button type="submit" name="btnUpdate" class="btn btn-primary">Güncelle </button>
</div>
</div>
</div>
</form>
</div>
<?php }?>
</div>
</div>
<script>
ClassicEditor
.create( document.querySelector( '#editor' ) )
.catch( error => {
console.error( error );
} );
</script>
<style type="text/css">
.card{
margin-top: 10px;
}
</style>
<section class="testimonials_area section_gap">
<div class="container">
<div class="testi_slider owl-carousel">
<div class="testi_item">
</div>
</div>
</div>
</section>
<?php include('footer.php') ?>
</body>
</html>