-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_show_names.php
257 lines (159 loc) · 7.19 KB
/
edit_show_names.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php
ob_start();
include('includes/db.php');
session_start();
if (empty($_COOKIE['remember_me'])) {
if (empty($_SESSION['user_id'])) {
header('location:login.php');
}
}
if (!in_array(4, $_SESSION["user_access_arr"])) {
header('location:index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include_once("includes/head.php"); ?>
<title>Edit Show Names</title>
</head>
<body class="page-body">
<div class="page-container">
<!-- add class "sidebar-collapsed" to close sidebar by default, "chat-visible" to make chat appear always -->
<!-- leftbar starts -->
<?php include_once("includes/left-bar.php"); ?>
<!-- leftbar ends -->
<div class="main-content">
<div class="row">
<!-- header starts-->
<?php include_once("includes/header.php"); ?>
<!-- header ends -->
</div>
<hr />
<ol class="breadcrumb bc-3">
<li>
<a href="index.php"><i class="fa-home"></i>Home</a>
</li>
<li>
<a href="#">Show names</a>
</li>
<li class="active">
<strong>Edit Show Name</strong>
</li>
</ol>
<h2>Edit Show Name</h2>
<br />
<div class="row">
<div class="col-md-12">
<div id="notification-div">
</div>
<div class="panel panel-primary" data-collapsed="0">
<div class="panel-heading">
<div class="panel-title">
Edit Show Name Info
</div>
<div class="panel-options">
<a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>
<a href="#" data-rel="reload"><i class="entypo-arrows-ccw"></i></a>
</div>
</div>
<div class="panel-body">
<?php
$show_name_id = $_GET["show_name_id"];
$query = $conn->prepare(
"SELECT show_names.* , users.name as user_name
FROM users JOIN show_names
ON show_names.created_by=users.id
Where show_names.id='$show_name_id'"
);
$query->execute();
$result = $query->fetch(PDO::FETCH_ASSOC);
?>
<form id="form" class="form-horizontal form-groups-bordered">
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label">Show Name</label>
<div class="col-sm-5">
<input required="" type="text" name="show_name" value="<?php echo $result["show_name"]; ?>" class="form-control" id="field-1" placeholder="Show Name">
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label">Show Description</label>
<div class="col-sm-5">
<input required="" type="text" name="description" value="<?php echo $result["description"]; ?>" class="form-control" id="field-1" placeholder="Show Description">
</div>
</div>
<div class="form-group">
<label for="field-1" class="col-sm-3 control-label">Show Plateform</label>
<div class="col-sm-5">
<input required="" type="text" name="plateform" value="<?php echo $result["plateform"]; ?>" class="form-control" id="field-1" placeholder="Show Plateform">
</div>
</div>
<input type="hidden" name="show_name_id" value="<?php echo $show_name_id ?>">
<div class="form-group">
<div class="col-sm-offset-3 col-sm-5">
<button onclick="sendFormData()" type="submit" name="upd-submit" class="btn btn-default">Edit show name</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Footer starts -->
<?php include_once("includes/footer.php"); ?>
<!-- Footer end -->
</div>
</div>
<!-- Bottom scripts (common) -->
<script src="assets/js/gsap/TweenMax.min.js"></script>
<script src="assets/js/jquery-ui/js/jquery-ui-1.10.3.minimal.min.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src="assets/js/joinable.js"></script>
<script src="assets/js/resizeable.js"></script>
<script src="assets/js/neon-api.js"></script>
<!-- Imported scripts on this page -->
<script src="assets/js/bootstrap-switch.min.js"></script>
<script src="assets/js/neon-chat.js"></script>
<!-- JavaScripts initializations and stuff -->
<script src="assets/js/neon-custom.js"></script>
<!-- Demo Settings -->
<script src="assets/js/neon-demo.js"></script>
<script src="assets/js/jquery.validate.min.js"></script>
<script>
function sendFormData() {
$('#form').validate({ // initialize the plugin
ignore: [],
rules: {
show_name: {
required: true,
},
description: {
required: true,
},
plateform: {
required: true,
},
},
submitHandler: function(form) { // for demo
var form_data = $("#form").serialize();
$.ajax({
type: "POST",
url: "send_show_name_data.php",
data: form_data,
cache: false,
success: function(data) {
var res = $.parseJSON(data);
console.log(res);
$("#notification-div").html(res[0]);
$('html, body').animate({
scrollTop: $("#notification-div").offset().top
}, 100);
}
});
}
});
// console.log($("#song-form").validate());
}
</script>
</body>
</html>