This repository has been archived by the owner on Mar 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
slidewizard3.php
233 lines (193 loc) · 8.43 KB
/
slidewizard3.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
<?php
require_once('conn.php');
require_once('functions.php');
?><!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="./jquery.datetimepicker.css"/>
<?php
include('head.php');
if(empty($_REQUEST['screenName'])) {
$id = $screens[0]['id'];
} else {
$screenName = $_REQUEST['screenName'];
}
iaAllowedhere($PDO, $_SESSION['user']['username'], $screenName);
if(empty($_REQUEST['template'])) {
$alert = '<div class="tjb_alertbox"><strong><h2>YOU HAVE NOT SELECTED A TEMPLATE - <a href="slidewizard1.php?screenName=' . $screenName . '">CLICK HERE</a></h2></strong></div>';
$_REQUEST['template'] = 'main_photo_landscape';
} else {
$Seltemplate = $_REQUEST['template'];
}
if(empty($_REQUEST['imgSel'])) {
$alert = '<div class="tjb_alertbox"><strong><h2>YOU HAVE NOT SELECTED AN IMAGE - <a href="slidewizard2.php?screenName=' . $screenName . '&template=' . $Seltemplate . '">CLICK HERE</a></h2></strong></div>';
} else {
$imgSel = $_REQUEST['imgSel'];
}
$imgSelpro = fnglobalquery($PDO, '*', 'gallery', 'id', $imgSel, 1, 1, 1, 1, 'id', 'ASC');
$imageSelected = $imgSelpro[0]['fileName'];
$galleryImages = fnglobalquery($PDO, '*', 'gallery', 1, 1, 1, 1, 1, 1, 'dateStamp', 'DESC');
$bgimages = fnglobalquery($PDO, '*', 'gallery', 'type', 'bgimage', 1, 1, 1, 1, 'id', 'ASC');
$templates = fnglobalquery($PDO, '*', 'templates', 1, 1, 1, 1, 1, 1, 'id', 'ASC');
$screenName = $_REQUEST['screenName'];
$screen = fnglobalquery($PDO, '*', 'screens', 'id', $screenName, 1, 1, 1, 1, 'id', 'ASC');
$screenid = $screen[0]['id'];
$tableName = 'screen' . $screenid;
$defaultTitle = $screen[0]['defaultTitle'];
$daTemplate = $_REQUEST['template'];
$thetemplate = fnglobalquery($PDO, '*', 'templates', 'className', $daTemplate, 1, 1, 1, 1, 'id', 'ASC');
#CONFIRM FORM OPTIONS
$is_title = $thetemplate[0]['title'];
$is_message = $thetemplate[0]['message'];
$is_where = $thetemplate[0]['theWhere'];
$is_when = $thetemplate[0]['theWhen'];
$is_who = $thetemplate[0]['theWho'];
$is_why = $thetemplate[0]['theWhy'];
$is_background = $thetemplate[0]['theBackground'];
?>
<title>Slide Details</title>
</head>
<body>
<?php include('nav.php'); ?>
<div class="container tjb_container">
<?php if(isset($alert)){ echo $alert; } ?>
<div class="page_title">
<h1>Slide Details</h1>
</div>
<form name="slidewizardform" id="slidewizardform" action="insertslide.php" method="post">
<div class="col-sm-6">
<input type="hidden" value="<?php echo htmlspecialchars($screenid, ENT_QUOTES); ?>" id="screenid" name="screenid">
<input type="hidden" value="<?php echo htmlspecialchars($daTemplate, ENT_QUOTES); ?>" id="template" name="template">
<input type="hidden" value="<?php echo strtoupper($_SESSION['user']['username']); ?>" id="username" name="username">
<div class="row">
<div class="col-sm-6">
<div class="form-group" style="<?php fnhideornot($is_title); ?>">
<label for="title">Title</label>
<input type="text" class="form-control" name="title" id="title" value="<?php echo htmlspecialchars($defaultTitle, ENT_QUOTES); ?>" <?php fnforminputornot($is_title); ?>/>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="orderNumber">Order</label>
<select type="text" class="form-control" id="orderNumber" name="orderNumber" value="<?php echo fnnextorder($PDO, $tableName, 'orderNumber', 'ASC'); ?>" required>
<?php
$i = 0;
$highest = fncountOrder($PDO, $tableName);
$limit = $highest + 10;
while($i < $limit) {
$i++;
?>
<option value="<?php echo $i; ?>" <?php echo fncheckOption($PDO, $i, $tableName); ?>><?php echo $i; ?></option>
<?php
}
?>
</select>
</div>
</div>
</div>
<div class="form-group" style="<?php fnhideornot($is_message); ?>">
<label for="message">Message</label>
<textarea rows="5" class="form-control" name="message" id="message" value="" <?php fnforminputornot($is_message); ?>></textarea>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group" style="<?php fnhideornot($is_message); ?>">
<label for="fontSize">Font Size</label>
<input type="range" min="40" max="140" step="5" class="form-control" id="fontSize" name="fontSize" value="80" required>
<output name="fontSizeOutname" id="fontSizeOutid">80</output>
</div>
</div>
<div class="col-sm-6">
<div class="form-group" style="<?php fnhideornot($is_message); ?>">
<label for="lineHeight">Line Height</label>
<input type="range" min="40" max="140" step="5" class="form-control" id="lineHeight" name="lineHeight" value="80" required>
<output name="lineHeightOutname" id="lineHeightOutid">80</output>
</div>
</div>
</div>
<div class="form-group" style="<?php fnhideornot($is_where); ?>">
<label for="where">Where</label>
<input class="form-control" name="theWhere" id="theWhere" value="" <?php fnforminputornot($is_where); ?>>
</div>
<div class="form-group" style="<?php fnhideornot($is_when); ?>">
<label for="when">When</label>
<input class="form-control" name="theWhen" id="theWhen" value="" <?php fnforminputornot($is_when); ?>>
</div>
<div class="form-group" style="<?php fnhideornot($is_who); ?>">
<label for="who">Who</label>
<input class="form-control" name="theWho" id="theWho" value="" <?php fnforminputornot($is_who); ?>>
</div>
<div class="form-group" style="<?php fnhideornot($is_why); ?>">
<label for="why">Why</label>
<input class="form-control" name="theWhy" id="theWhy" value="" <?php fnforminputornot($is_why); ?>>
</div>
</div>
<div class="col-sm-6">
<div class="form-group" style="color: black;" >
<label for="department">Picture</label>
<select style="color: black;" type="text" class="form-control" id="picture" name="picture" required>
<option value="<?php echo htmlspecialchars($imageSelected, ENT_QUOTES); ?>"><?php echo htmlspecialchars($imageSelected, ENT_QUOTES); ?></option>
<?php foreach($galleryImages as $imageOptions) {
?>
<option value="<?php echo htmlspecialchars($imageOptions['fileName'], ENT_QUOTES); ?>"><?php echo htmlspecialchars($imageOptions['fileName'], ENT_QUOTES); ?></option>
<?php
}
?>
</select>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="startDate">Start Date & Time</label>
<input class="form-control date_class" id="startDate" name="startDate" value="" required>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="endDate">End Date & Time</label>
<input class="form-control date_class" id="endDate" name="endDate" required>
</div>
</div>
</div>
<div class="form-group">
<label for="defaultBackground">Default Background</label>
<select type="text" class="form-control" id="defaultBackground" name="defaultBackground" value="<?php echo htmlspecialchars($row['defaultBackground'], ENT_QUOTES); ?>">
<?php
$bgselected = $row['defaultBackground'];
foreach($bgimages as $option) {
if($bgselected == $option['fileName']){
?>
<option value="<?php echo htmlspecialchars($option['fileName'], ENT_QUOTES); ?>" selected="selected"><?php echo htmlspecialchars($option['fileName'], ENT_QUOTES); ?></option>
<?php
} else { ?>
<option value="<?php echo htmlspecialchars($option['fileName'], ENT_QUOTES); ?>"><?php echo htmlspecialchars($option['fileName'], ENT_QUOTES); ?></option>
<?php
}
}
?>
</select>
</div>
<br />
<button type="submit" class="btn">Update</button>
</div>
</div>
</form>
<?php
#var_dump($galleryImages);
include('footer.php'); ?>
<script>
document.slidewizardform.lineHeight.oninput = function(){
document.slidewizardform.lineHeightOutid.value = document.slidewizardform.lineHeight.value;
}
document.slidewizardform.fontSize.oninput = function(){
document.slidewizardform.fontSizeOutid.value = document.slidewizardform.fontSize.value;
}
</script>
</body>
<script src="./jquery.js"></script>
<script src="build/jquery.datetimepicker.full.js"></script>
<script>
$('#startDate').datetimepicker({ format: 'd-m-Y H:i' });
$('#endDate').datetimepicker({ format: 'd-m-Y H:i' });
</script>
</html>