-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathops_req.php
566 lines (524 loc) · 21.8 KB
/
ops_req.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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
<?php
include_once('mysql2i.class.php'); // migration step
require_once('access_and_open.php');
// required to get user name
$user = $_SERVER['PHP_AUTH_USER'];
$REMOTE_USER = $user; // for phpMyEdit
if ($user == '') {
// fail
header('WWW-Authenticate: Basic realm="'.$event_tools_event_name.' Op Session Request (enter your '.$event_tools_event_name.' email address for name)"');
header('HTTP/1.0 401 Unauthorized');
}
if (! (strpos($user, "@") && strpos($user, ".")) ) {
header('WWW-Authenticate: Basic realm="'.$event_tools_event_name.' Op Session Request (enter your '.$event_tools_event_name.' email address for name)"');
header('HTTP/1.0 401 Unauthorized');
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Operating Session Request - Error</title>
</head>
<body>
<h2>Operating Session Request - Error</h2>
You must provide a valid email address
as part of entering your request.
Please hit the back button on your browser and
try again.</body>
';
return;
}
global $opts, $event_tools_db_prefix;
if ($event_tools_require_customer_id) {
// OK, now check if account in cart
$query = "SELECT *
FROM ".$event_tools_db_prefix ."customers
WHERE customers_email_address = '".$REMOTE_USER."';
";
$result=mysql_query($query);
$num=mysql_numrows($result);
if ( $num == 0) {
header('WWW-Authenticate: Basic realm="'.$event_tools_event_name.' Op Session Request (enter your '.$event_tools_event_name.' email address for name)"');
header('HTTP/1.0 401 Unauthorized');
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Operating Session Request - Error</title>
</head>
<body>
<h2>Operating Session Request - Error</h2>
You must provide the email address you
used for your '.$event_tools_event_name.' account.
</body>
';
return;
}
}
// OK, now check if ops req record exists
$query = "SELECT *
FROM ".$event_tools_db_prefix ."eventtools_opsession_req
WHERE opsreq_person_email = '".$REMOTE_USER."';
";
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num == 0) {
// doesn't exist, insert
$query = "
INSERT INTO ".$event_tools_db_prefix ."eventtools_opsession_req
( opsreq_person_email )
VALUE
( '".$REMOTE_USER."' );
";
$result=mysql_query($query);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Operating Session Request</title>
<style type="text/css">
hr.pme-hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; }
table.pme-main { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
td.pme-navigation-0, td.pme-navigation-1 { white-space: nowrap; }
th.pme-header { border: #004d9c 1px solid; padding: 4px; background: #add8e6; }
td.pme-key-0, td.pme-value-0, td.pme-help-0, td.pme-navigation-0, td.pme-cell-0,
td.pme-key-1, td.pme-value-1, td.pme-help-0, td.pme-navigation-1, td.pme-cell-1,
td.pme-sortinfo, td.pme-filter { border: #004d9c 1px solid; padding: 3px; }
td.pme-buttons { text-align: left; }
td.pme-message { text-align: center; }
td.pme-stats { text-align: right; }
.pme-more { visibility:hidden; } // suppress Apply button
</style>
</head>
<body>
<h2>Operating Session Request</h2>
On this page, you can view the requests you are making for operating sessions.
<p>
To make a new request if you have not made one yet, or to change requests you have already made,
click the "Change" button at the bottom of this page.
This will take you to a selection page.
<p>
Then to add a new request, click on the down arrow in the first priority row
and select your first priority for an operating session.
Continue in this manner until you have selected all the sessions you want to attend ranked by priority,
and then click "Save". To change an existing request, click on the drop down arrow next to that request,
and select your new choice. When you are finished, click "Save". Clicking "Cancel" will leave your existing requests unchanged.
<p>
<?php
/*
* IMPORTANT NOTE: This generated file contains only a subset of huge amount
* of options that can be used with phpMyEdit. To get information about all
* features offered by phpMyEdit, check official documentation. It is available
* online and also for download on phpMyEdit project management page:
*
* http://platon.sk/projects/main_page.php?project_id=5
*
* This file was generated by:
*
* phpMyEdit version: 5.7.1
* phpMyEdit.class.php core class: 1.204
* phpMyEditSetup.php script: 1.50
* generating setup script: 1.50
*/
if (!$event_tools_user_email_log_skip) {
// email results
$opts['notify']['all'] = $event_tools_notify_email_address;
$opts['notify']['prefix'] = $event_tools_notify_email_prefix;
}
// MySQL host name, user name, password, database, and table
$opts['tb'] = $event_tools_db_prefix . 'eventtools_opsession_req';
// Name of field which is the unique key
$opts['key'] = 'opsreq_id';
// Type of key field (int/real/string/date etc.)
$opts['key_type'] = 'int';
// Sorting field(s)
$opts['sort_field'] = array('opsreq_id');
// Number of records to display on the screen
// Value of -1 lists all records in a table
$opts['inc'] = 15;
// Number of lines to display on multiple selection filters
$opts['multiple'] = '4';
// Navigation style: B - buttons (default), T - text links, G - graphic links
// Buttons position: U - up, D - down (default)
$opts['navigation'] = 'DB';
// Display special page elements
$opts['display'] = array(
'form' => true,
'query' => false,
'sort' => false,
'time' => false,
'tabs' => false
);
// Set default prefixes for variables
$opts['js']['prefix'] = 'PME_js_';
$opts['dhtml']['prefix'] = 'PME_dhtml_';
$opts['cgi']['prefix']['operation'] = 'PME_op_';
$opts['cgi']['prefix']['sys'] = 'PME_sys_';
$opts['cgi']['prefix']['data'] = 'PME_data_';
/* Get the user's default language and use it if possible or you can
specify particular one you want to use. Refer to official documentation
for list of available languages. */
$opts['language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'] . '-UTF8';
/* Table-level filter capability. If set, it is included in the WHERE clause
of any generated SELECT statement in SQL query. This gives you ability to
work only with subset of data from table.
$opts['filters'] = "column1 like '%11%' AND column2<17";
$opts['filters'] = "section_id = 9";
$opts['filters'] = "PMEtable0.sessions_count > 200";
*/
$opts['filters'] = "opsreq_person_email = '".$REMOTE_USER."' ";
// Options you wish to give the users
// A - add, C - change, P - copy, V - view, D - delete,
// F - filter, I - initial sort suppressed
$opts['options'] = 'CV';
/* Field definitions
Fields will be displayed left to right on the screen in the order in which they
appear in generated list. Here are some most used field options documented.
['name'] is the title used for column headings, etc.;
['maxlen'] maximum length to display add/edit/search input boxes
['trimlen'] maximum length of string content to display in row listing
['width'] is an optional display width specification for the column
e.g. ['width'] = '100px';
['mask'] a string that is used by sprintf() to format field output
['sort'] true or false; means the users may sort the display on this column
['strip_tags'] true or false; whether to strip tags from content
['nowrap'] true or false; whether this field should get a NOWRAP
['select'] T - text, N - numeric, D - drop-down, M - multiple selection
['options'] optional parameter to control whether a field is displayed
L - list, F - filter, A - add, C - change, P - copy, D - delete, V - view
Another flags are:
R - indicates that a field is read only
W - indicates that a field is a password field
H - indicates that a field is to be hidden and marked as hidden
['URL'] is used to make a field 'clickable' in the display
e.g.: 'mailto:$value', 'http://$value' or '$page?stuff';
['URLtarget'] HTML target link specification (for example: _blank)
['textarea']['rows'] and/or ['textarea']['cols']
specifies a textarea is to be used to give multi-line input
e.g. ['textarea']['rows'] = 5; ['textarea']['cols'] = 10
['values'] restricts user input to the specified constants,
e.g. ['values'] = array('A','B','C') or ['values'] = range(1,99)
['values']['table'] and ['values']['column'] restricts user input
to the values found in the specified column of another table
['values']['description'] = 'desc_column'
The optional ['values']['description'] field allows the value(s) displayed
to the user to be different to those in the ['values']['column'] field.
This is useful for giving more meaning to column values. Multiple
descriptions fields are also possible. Check documentation for this.
*/
$opts['fdd']['opsreq_id'] = array(
'name' => 'ID',
'select' => 'T',
'options' => 'APDR', // auto increment
'maxlen' => 5,
'default' => '0',
'sort' => true
);
$opts['fdd']['opsreq_person_email'] = array(
'name' => 'Your email address',
'select' => 'T',
'options' => 'LCVR',
'maxlen' => 32,
'sort' => true
);
$opts['fdd']['opsreq_pri1'] = array(
'name' => '1st priority',
'help' => "If blank, you haven't selected any preferred operating sessions",
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri2'] = array(
'name' => '2nd priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri3'] = array(
'name' => '3rd priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri4'] = array(
'name' => '4th priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri5'] = array(
'name' => '5th priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri6'] = array(
'name' => '6th priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri7'] = array(
'name' => '7th priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri8'] = array(
'name' => '8th priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri9'] = array(
'name' => '9th priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri10'] = array(
'name' => '10th priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri11'] = array(
'name' => '11th priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_pri12'] = array(
'name' => '12th priority',
'select' => '',
'maxlen' => 5,
'sort' => true,
'default' => 'None',
'values' => array('table' => $event_tools_db_prefix.'eventtools_opsession_name',
'column' => 'ops_id',
'orderby' => 'show_name',
'description' => array(
'columns' => array(
'show_name' ,
'presenting_time'
),
'divs' => array(
' ',
''
)
)
)
);
$opts['fdd']['opsreq_any'] = array(
'name' => "Any session OK, not just priorities?",
'select' => 'T',
'maxlen' => 5,
'sort' => true,
'values' => array('Y','N')
);
$opts['fdd']['opsreq_number'] = array(
'name' => "Number of sessions you'd like",
'help' => "We'll try to schedule as many sessions as possible for you, up to this limit",
'select' => 'T',
'maxlen' => 5,
'sort' => true,
'values' => array('','1','2','3','4','5','6','7','8','9','10','11','12'),
'sqlw' => 'IF($val_qas = "", NULL, $val_qas)'
);
$opts['fdd']['opsreq_comment'] = array(
'name' => 'Any comments?',
'textarea' => array('rows' => 4, 'cols' => 50),
'select' => 'T',
'maxlen' => 200,
'sort' => true
);
// Now important call to phpMyEdit
//require_once 'phpMyEdit.class.php';
//new phpMyEdit($opts);
require_once 'extensions/phpMyEdit-slide-single-input.class.php';
new phpMyEdit_slide($opts);
// start the bottom matter
echo '<p>';
global $opts, $event_tools_db_prefix;
$query = "SELECT *
FROM ".$event_tools_db_prefix ."eventtools_opsession_req
WHERE opsreq_person_email = '".$REMOTE_USER."';
";
$result=mysql_query($query);
$num=mysql_numrows($result);
echo '<p>
For more information on operating sessions at '.$event_tools_event_name.', please
see the
<a href="/">'.$event_tools_event_name.' page</a>.
<p>';
?>
</body>
</html>