forked from julmud/phpDVDProfiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Chooser.php
472 lines (439 loc) · 25.3 KB
/
Chooser.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
<?php
error_reporting(E_ALL);
if (!defined('IN_SCRIPT'))
define('IN_SCRIPT', 1);
include_once('global.php');
SendNoCacheHeaders('Content-Type: text/html; charset="windows-1252";');
if (!isset($ChangedColor))
$ChangedColor = 'Gold';
$limit = 5;
$thelimit = "<select onChange=\"HandleSelectChange(this)\" style=\"vertical-align:middle\" name=\"limit\">";
$thelimit .= "<option value=\"1\">1</option>";
for ($i=5; $i<55; $i+=5) {
$sel = ''; if ($i == $limit) $sel = 'selected';
$thelimit .= "<option value=\"$i\" $sel>$i</option>";
}
$thelimit .= "<option value=\"100\" $sel>100</option>";
$thelimit .= "</select>\n";
$thelimit = sprintf($lang['CHOOSERHEADER'], $thelimit);
$collections = "<b>$lang[COLLECTIONTYPE]</b>:<br><select onChange=\"HandleSelectChange(this)\" name=\"collectiontype\"><option value=\"?\">$lang[ALL]</option>";
$res = $db->sql_query("SELECT DISTINCT collectiontype FROM $DVD_TABLE ORDER BY collectiontype") or die($db->sql_error());
while ($val = $db->sql_fetchrow($res)) {
$displayCollectionType = isset($lang[strtoupper($val['collectiontype'])]) ? $lang[strtoupper($val['collectiontype'])] : ucfirst($val['collectiontype']);
$collections .= "<option value=\"$val[collectiontype]\"";
if (strtoupper($val['collectiontype']) == 'OWNED') {
$collections .= ' selected="selected"';
}
$collections .= ">" . $displayCollectionType . "</option>";
}
$db->sql_freeresult($res);
$res = $db->sql_query("SELECT COUNT(*) AS itemcount FROM $DVD_TABLE WHERE loaninfo != ''") or die($db->sql_error());
$val = $db->sql_fetchrow($res);
$db->sql_freeresult($res);
if ($val['itemcount'] != 0) {
$collections .= "<option value=loaned>$lang[LOANED]</option>";
}
foreach ($masterauxcolltype as $num => $auxcoltype) {
if ($auxcoltype != '') {
$collections .= "<option value=$num>$auxcoltype</option>";
}
}
$collections .= "</select>\n";
$mediatable = <<<EOT
<table cellpadding=3 border=1><tr><th>$lang[MEDIATYPE]</th></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('mediatypedvd')" src="gfx/dontcare.png" id="mediatypedvd_img"><input type="hidden" name="mediatypedvd" id="mediatypedvd_input" value="?"> $lang[DVD]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('mediatypehddvd')" src="gfx/dontcare.png" id="mediatypehddvd_img"><input type="hidden" name="mediatypehddvd" id="mediatypehddvd_input" value="?"> $lang[HDDVD]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('mediatypebluray')" src="gfx/dontcare.png" id="mediatypebluray_img"><input type="hidden" name="mediatypebluray" id="mediatypebluray_input" value="?"> $lang[BLURAY]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('mediatypeultrahd')" src="gfx/dontcare.png" id="mediatypeultrahd_img"><input type="hidden" name="mediatypeultrahd" id="mediatypeultrahd_input" value="?"> $lang[ULTRAHD]</td></tr>
</table>
EOT;
$formattable = <<<EOT
<table cellpadding=3 border=1><tr><th colspan=2>$lang[FORMAT]</th></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('formatletterbox')" src="gfx/dontcare.png" id="formatletterbox_img"><input type="hidden" name="formatletterbox" id="formatletterbox_input" value="?"> $lang[WIDESCREEN]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('formatpanandscan')" src="gfx/dontcare.png" id="formatpanandscan_img"><input type="hidden" name="formatpanandscan" id="formatpanandscan_input" value="?"> $lang[PANANDSCAN]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('formatfullframe')" src="gfx/dontcare.png" id="formatfullframe_img"><input type="hidden" name="formatfullframe" id="formatfullframe_input" value="?"> $lang[FULLFRAME]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('format16x9')" src="gfx/dontcare.png" id="format16x9_img"><input type="hidden" name="format16x9" id="format16x9_input" value="?"> {$lang['16X9']}</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('formatdualsided')" src="gfx/dontcare.png" id="formatdualsided_img"><input type="hidden" name="formatdualsided" id="formatdualsided_input" value="?"> $lang[DUALSIDED]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('formatduallayered')" src="gfx/dontcare.png" id="formatduallayered_img"><input type="hidden" name="formatduallayered" id="formatduallayered_input" value="?"> $lang[DUALLAYERED]</td></tr>
</table>
EOT;
$bstable = <<<EOT
<table cellpadding=3 border=1><tr><th>$lang[BOXSET]</th></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('boxchild')" src="gfx/dontcare.png" id="boxchild_img"><input type="hidden" name="boxchild" id="boxchild_input" value="?"> $lang[CHOOSERBOXCHILD]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('boxparent')" src="gfx/dontcare.png" id="boxparent_img"><input type="hidden" name="boxparent" id="boxparent_input" value="?"> $lang[CHOOSERBOXPARENT]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('boxtvparent')" src="gfx/dontcare.png" id="boxtvparent_img"><input type="hidden" name="boxtvparent" id="boxtvparent_input" value="?"> $lang[CHOOSERBOXTVPARENT]</td></tr>
</table>
EOT;
$extrastable = <<<EOT
<table cellpadding=3 border=1><tr><th colspan=3>$lang[EXTRAS]</th></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('featuresceneaccess')" src="gfx/dontcare.png" id="featuresceneaccess_img"><input type="hidden" name="featuresceneaccess" id="featuresceneaccess_input" value="?"> $lang[SCENEACCESS]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featureplayall')" src="gfx/dontcare.png" id="featureplayall_img"><input type="hidden" name="featureplayall" id="featureplayall_input" value="?"> $lang[PLAYALL]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featuretrailer')" src="gfx/dontcare.png" id="featuretrailer_img"><input type="hidden" name="featuretrailer" id="featuretrailer_input" value="?"> $lang[TRAILER]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('featurebonustrailers')" src="gfx/dontcare.png" id="featurebonustrailers_img"><input type="hidden" name="featurebonustrailers" id="featurebonustrailers_input" value="?"> $lang[BONUSTRAILERS]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featuremakingof')" src="gfx/dontcare.png" id="featuremakingof_img"><input type="hidden" name="featuremakingof" id="featuremakingof_input" value="?"> $lang[MAKINGOF]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featurecommentary')" src="gfx/dontcare.png" id="featurecommentary_img"><input type="hidden" name="featurecommentary" id="featurecommentary_input" value="?"> $lang[COMMENTARY]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('featuredeletedscenes')" src="gfx/dontcare.png" id="featuredeletedscenes_img"><input type="hidden" name="featuredeletedscenes" id="featuredeletedscenes_input" value="?"> $lang[DELETEDSCENES]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featureinterviews')" src="gfx/dontcare.png" id="featureinterviews_img"><input type="hidden" name="featureinterviews" id="featureinterviews_input" value="?"> $lang[INTERVIEWS]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featureouttakes')" src="gfx/dontcare.png" id="featureouttakes_img"><input type="hidden" name="featureouttakes" id="featureouttakes_input" value="?"> $lang[OUTTAKES]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('featurestoryboardcomparisons')" src="gfx/dontcare.png" id="featurestoryboardcomparisons_img"><input type="hidden" name="featurestoryboardcomparisons" id="featurestoryboardcomparisons_input" value="?"> $lang[STORYBOARDCOMPARISONS]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featurephotogallery')" src="gfx/dontcare.png" id="featurephotogallery_img"><input type="hidden" name="featurephotogallery" id="featurephotogallery_input" value="?"> $lang[PHOTOGALLERY]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featureproductionnotes')" src="gfx/dontcare.png" id="featureproductionnotes_img"><input type="hidden" name="featureproductionnotes" id="featureproductionnotes_input" value="?"> $lang[PRODUCTIONNOTES]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('featuredvdromcontent')" src="gfx/dontcare.png" id="featuredvdromcontent_img"><input type="hidden" name="featuredvdromcontent" id="featuredvdromcontent_input" value="?"> $lang[DVDROMCONTENT]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featuregame')" src="gfx/dontcare.png" id="featuregame_img"><input type="hidden" name="featuregame" id="featuregame_input" value="?"> $lang[GAME]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featuremultiangle')" src="gfx/dontcare.png" id="featuremultiangle_img"><input type="hidden" name="featuremultiangle" id="featuremultiangle_input" value="?"> $lang[MULTIANGLE]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('featuremusicvideos')" src="gfx/dontcare.png" id="featuremusicvideos_img"><input type="hidden" name="featuremusicvideos" id="featuremusicvideos_input" value="?"> $lang[MUSICVIDEOS]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featurethxcertified')" src="gfx/dontcare.png" id="featurethxcertified_img"><input type="hidden" name="featurethxcertified" id="featurethxcertified_input" value="?"> $lang[THXCERTIFIED]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featureclosedcaptioned')" src="gfx/dontcare.png" id="featureclosedcaptioned_img"><input type="hidden" name="featureclosedcaptioned" id="featureclosedcaptioned_input" value="?"> $lang[CLOSEDCAPTIONED]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('featuredigitalcopy')" src="gfx/dontcare.png" id="featuredigitalcopy_img"><input type="hidden" name="featuredigitalcopy" id="featuredigitalcopy_input" value="?"> $lang[DIGITALCOPY]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featurepip')" src="gfx/dontcare.png" id="featurepip_img"><input type="hidden" name="featurepip" id="featurepip_input" value="?"> $lang[PIP]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featurebdlive')" src="gfx/dontcare.png" id="featurebdlive_img"><input type="hidden" name="featurebdlive" id="featurebdlive_input" value="?"> $lang[BDLIVE]</td></tr>
<tr><td><img style="vertical-align:middle" onClick="SwitchState('featuredbox')" src="gfx/dontcare.png" id="featuredbox_img"><input type="hidden" name="featuredbox" id="featuredbox_input" value="?"> $lang[DBOX]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featurecinechat')" src="gfx/dontcare.png" id="featurecinechat_img"><input type="hidden" name="featurecinechat" id="featurecinechat_input" value="?"> $lang[CINECHAT]</td>
<td><img style="vertical-align:middle" onClick="SwitchState('featuremovieiq')" src="gfx/dontcare.png" id="featuremovieiq_img"><input type="hidden" name="featuremovieiq" id="featuremovieiq_input" value="?"> $lang[MOVIEIQ]</td></tr>
</table>
EOT;
$genretable = "<table cellpadding=3 border=1><tr><th colspan=5>$lang[GENRES]</th></tr><tr>";
$res = $db->sql_query("SELECT genre,COUNT(genre) AS counts FROM $DVD_GENRES_TABLE GROUP BY genre ORDER BY genre") or die($db->sql_error());
$tmpcount = 1;
$valgen = "\tgenrecount = 0;\n";
while ($val = $db->sql_fetchrow($res)) {
if ($val['counts'] != 0) {
if ($tmpcount++ % 5 == 1) $genretable .= "</tr>\n<tr>";
$gen = str_replace(' ', '_', $val['genre']);
$gen = str_replace("'", '#', $gen);
$valgen .= "\tif ($('genre_{$gen}_input').value == '1') genrecount++;\n";
$genretable .= "<td><img style=\"vertical-align:middle\" onClick=\"SwitchState('genre_$gen')\" src=\"gfx/dontcare.png\""
." id=\"genre_{$gen}_img\"><input type=\"hidden\" name=\"genre_$gen\" id=\"genre_{$gen}_input\""
." value=\"?\"> ".GenreTranslation($val['genre'])."</td>";
}
}
$db->sql_freeresult($res);
$genretable .= "</tr></table>";
$aspectcombo = '';
$res = $db->sql_query("SELECT DISTINCT formataspectratio FROM $DVD_TABLE ORDER BY formataspectratio") or die($db->sql_error());
if ($db->sql_numrows($res) < 2) {
$val = $db->sql_fetchrow($res);
$aspectcombo .= "<tr><td align=right>$lang[ASPECTRATIO]:</td><td>$val[formataspectratio]</td></tr>";
}
else {
$aspectcombo .= "<tr><td align=right>$lang[ASPECTRATIO]:</td><td><select onChange=\"HandleSelectChange(this)\" name=\"formataspectratio\"><option value=\"?\" selected>$lang[CHOOSERDONTCARE]</option>";
while ($val = $db->sql_fetchrow($res)) {
$aspectcombo .= "<option value=\"$val[formataspectratio]\">$val[formataspectratio]</option>";
}
$aspectcombo .= "</select></td></tr>";
}
$db->sql_freeresult($res);
$vidstdcombo = '';
$res = $db->sql_query("SELECT DISTINCT formatvideostandard FROM $DVD_TABLE ORDER BY formatvideostandard") or die($db->sql_error());
if ($db->sql_numrows($res) < 2) {
$val = $db->sql_fetchrow($res);
$vidstdcombo .= "<tr><td align=right>$lang[CHOOSERVIDEOSTANDARD]:</td><td>$val[formatvideostandard]</td></tr>";
}
else {
$vidstdcombo .= "<tr><td align=right>$lang[CHOOSERVIDEOSTANDARD]:</td><td><select onChange=\"HandleSelectChange(this)\" name=\"formatvideostandard\"><option value=\"?\" selected>$lang[CHOOSERDONTCARE]</option>";
while ($val = $db->sql_fetchrow($res)) {
$vidstdcombo .= "<option value=\"$val[formatvideostandard]\">$val[formatvideostandard]</option>";
}
$vidstdcombo .= "</select></td></tr>";
}
$db->sql_freeresult($res);
$coocombo = '';
$res = $db->sql_query("SELECT DISTINCT countryoforigin FROM $DVD_TABLE ORDER BY countryoforigin") or die($db->sql_error());
if ($db->sql_numrows($res) < 2) {
$val = $db->sql_fetchrow($res);
$coocombo .= "<tr><td align=right>$lang[COUNTRYOFORIGIN]:</td><td>$val[countryoforigin]</td></tr>";
}
else {
$coocombo .= "<tr><td align=right>$lang[COUNTRYOFORIGIN]:</td><td><select onChange=\"HandleSelectChange(this)\" name=\"countryoforigin\"><option value=\"?\" selected>$lang[CHOOSERDONTCARE]</option>";
while ($val = $db->sql_fetchrow($res)) {
$vvv = $val['countryoforigin'];
if ($vvv == '')
$vvv = $lang['UNKNOWN'];
$coocombo .= "<option value=\"$val[countryoforigin]\">$vvv</option>";
}
$coocombo .= "</select></td></tr>";
}
$db->sql_freeresult($res);
$regioncombo = '';
$res = $db->sql_query("SELECT DISTINCT region FROM $DVD_TABLE ORDER BY region") or die($db->sql_error());
$rgnlist = '';
while ($val = $db->sql_fetchrow($res)) {
$rgnlist .= $val['region'];
}
$db->sql_freeresult($res);
if (strlen($rgnlist) < 2) {
$regioncombo .= "<tr><td align=right>$lang[REGION]:</td><td>$rgnlist</td></tr>";
}
else {
$PossibleRegions = '0123456@ABC';
$regioncombo .= "<tr><td align=right>$lang[REGION]:</td><td><select onChange=\"HandleSelectChange(this)\" name=\"region\"><option value=\"?\" selected>$lang[CHOOSERDONTCARE]</option>";
for ($i=0; $i<=strlen($PossibleRegions); $i++) {
$currentRegion = substr($PossibleRegions, $i, 1);
if (!empty($currentRegion) && strpos($rgnlist, $currentRegion) !== false) {
$val = $PossibleRegions{$i};
$disp = $PossibleRegions{$i};
if ($val == '0') $disp = $lang['ALLREGIONSDVD'];
if ($val == '@') $disp = $lang['ALLREGIONSBLURAY'];
$regioncombo .= "<option value=\"$val\">$disp</option>";
}
}
$regioncombo .= "</select></td></tr>";
}
$casecombo = '';
$res = $db->sql_query("SELECT DISTINCT casetype FROM $DVD_TABLE ORDER BY casetype") or die($db->sql_error());
if ($db->sql_numrows($res) < 2) {
$val = $db->sql_fetchrow($res);
$casecombo .= "<tr><td align=right>$lang[CASETYPE]:</td><td>$val[casetype]</td></tr>";
}
else {
$casecombo .= "<tr><td align=right>$lang[CASETYPE]:</td><td><select onChange=\"HandleSelectChange(this)\" name=\"casetype\"><option value=\"?\" selected>$lang[CHOOSERDONTCARE]</option>";
while ($val = $db->sql_fetchrow($res)) {
$casecombo .= "<option value=\"$val[casetype]\">$val[casetype]</option>";
}
$casecombo .= "</select> <span><img style=\"vertical-align:middle\" onClick=\"SwitchState('caseslipcover')\""
." src=\"gfx/dontcare.png\" id=\"caseslipcover_img\"><input type=\"hidden\" name=\"caseslipcover\""
." id=\"caseslipcover_input\" value=\"?\"> $lang[SLIPCOVER]</span></td></tr>";
}
$db->sql_freeresult($res);
$ratingcombo = '';
$sql = "SELECT IF (LOCATE('.',id) = '0',0,SUBSTRING(id,locate('.',id)+1,LENGTH(id)-LOCATE('.',id)))+0 AS locality,rating"
." FROM $DVD_TABLE GROUP BY locality,rating ORDER BY locality,rating";
$res = $db->sql_query($sql) or die($db->sql_error());
if ($db->sql_numrows($res) < 2) {
$val = $db->sql_fetchrow($res);
$ratingcombo .= "<tr><td align=right>$lang[RATING]:</td><td>$val[rating] (".$lang['LOCALE'.$val['locality']].")</td></tr>";
}
else {
$ratingcombo .= "<tr><td align=right>$lang[RATING]:</td><td><select onChange=\"HandleSelectChange(this)\" name=\"rating\"><option value=\"?\" selected>$lang[CHOOSERDONTCARE]</option>";
while ($val = $db->sql_fetchrow($res)) {
$ratingcombo .= "<option value=\"$val[locality].$val[rating]\">$val[rating] (".$lang['LOCALE'.$val['locality']].")</option>";
}
$ratingcombo .= "</select></td></tr>";
}
$db->sql_freeresult($res);
$suppliercombo = '';
if (DisplayIfIsPrivateOrAlways($displayplace)) {
$res = $db->sql_query("SELECT sid,suppliername FROM $DVD_SUPPLIER_TABLE ORDER BY suppliername") or die($db->sql_error());
if ($db->sql_numrows($res) < 2) {
$val = $db->sql_fetchrow($res);
$suppliercombo .= "<tr><td align=right>$lang[PURCHASEPLACE]:</td><td>$val[suppliername]</td></tr>";
}
else {
$suppliercombo .= "<tr><td align=right>$lang[PURCHASEPLACE]:</td><td><select onChange=\"HandleSelectChange(this)\" name=\"purchaseplace\"><option value=\"?\" selected>$lang[CHOOSERDONTCARE]</option>";
while ($val = $db->sql_fetchrow($res)) {
$suppliercombo .= "<option value=\"$val[sid]\">$val[suppliername]</option>";
}
$suppliercombo .= "</select></td></tr>";
}
$db->sql_freeresult($res);
}
$watchedby = '';
if ($IsPrivate) {
$res = $db->sql_query("SELECT u.uid,firstname,lastname,COUNT(id) AS numwatched FROM $DVD_EVENTS_TABLE e, $DVD_USERS_TABLE u WHERE e.uid=u.uid AND eventtype='watched' GROUP BY lastname,firstname") or die($db->sql_error());
if ($db->sql_numrows($res) >= 1) {
$watchedby .= "<table cellpadding=3 border=1><tr><th colspan=3>$lang[CHOOSERWATCHEDBY]</th></tr><tr>";
$count = 1;
while ($val = $db->sql_fetchrow($res)) {
if ($count++ % 3 == 1)
$watchedby .= "</tr>\n<tr>";
$name = $val['uid'];
$watchedby .= "<td><img style=\"vertical-align:middle\" onClick=\"SwitchState('watched_$name')\" src=\"gfx/dontcare.png\""
." id=\"watched_{$name}_img\"><input type=\"hidden\" name=\"watched_$name\" id=\"watched_{$name}_input\""
." value=\"?\"> $val[firstname] " . HideName($val['lastname']) . "</td>";
}
$watchedby .= "</tr></table>\n";
}
$db->sql_freeresult($res);
}
$tagtable = '';
$res = $db->sql_query("SELECT DISTINCT fullyqualifiedname FROM $DVD_TAGS_TABLE WHERE fullyqualifiedname NOT LIKE 'tabs/%' AND fullyqualifiedname NOT LIKE 'tabs'") or die($db->sql_error());
if ($db->sql_numrows($res) >= 1) {
$tagtable .= "<table cellpadding=3 border=1><tr><th colspan=3>$lang[TAGS]</th></tr><tr>";
$count = 1;
while ($val = $db->sql_fetchrow($res)) {
if ($count++ % 3 == 1)
$tagtable .= "</tr>\n<tr>";
$name = urlencode($val['fullyqualifiedname']);
$tagtable .= "<td><img style=\"vertical-align:middle\" onClick=\"SwitchState('tag_$name')\" src=\"gfx/dontcare.png\""
." id=\"tag_{$name}_img\"><input type=\"hidden\" name=\"tag_$name\" id=\"tag_{$name}_input\""
." value=\"?\"> $val[fullyqualifiedname]</td>\n";
}
$tagtable .= "</tr></table>";
}
$db->sql_freeresult($res);
echo <<<EOT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=windows-1252">
<title>$lang[CHOOSERSHORT] - $lang[CHOOSERDESC]</title>
<link rel="stylesheet" type="text/css" href="format.css.php">
<script type="text/javascript">
function $(obj) {
return(document.getElementById(obj));
}
function IsANumber(obj) {
if (obj.value != '?') {
if (/^\d+$/.test(obj.value) == false) {
alert('"' + obj.value + '" is not a number. Please enter a number of minutes.');
obj.focus();
return(false);
}
}
return(true);
}
function ValidateThenSubmit() {
var theform=$('search_form');
// Check number of genres
$valgen
if (genrecount > 5) {
alert('There can be no more than 5 genres selected');
return(false);
}
if (IsANumber(document.getElementsByName('rtimelower')[0]) == false)
return(false);
if (IsANumber(document.getElementsByName('rtimehigher')[0]) == false)
return(false);
// Made it!
return(true);
}
function HandleTextChange(textobj) {
if (textobj.value != '')
textobj.style.backgroundColor = '$ChangedColor';
else
textobj.style.backgroundColor = '';
}
function HandleSelectChange(selectobj) {
if (selectobj.selectedIndex != 0)
selectobj.style.backgroundColor = '$ChangedColor';
else
selectobj.style.backgroundColor = '';
}
function ResetToDontCare() {
var theform=$('search_form');
for (i=0; i<theform.elements.length; i++) {
switch (theform.elements[i].type) {
case 'select-one':
case 'text':
theform.elements[i].style.backgroundColor = '';
break;
case 'hidden':
theform.elements[i].value = '?';
$(theform.elements[i].id.replace('_input', '_img')).src = "gfx/dontcare.png";
theform.elements[i].parentNode.style.backgroundColor = '';
break;
default:
break;
}
}
}
function FixIFrame() {
var InMenu='0';
if (window.name == 'entry')
InMenu = '1';
$('search_form').action = "Picker.php?InMenu="+InMenu;
$('theiframe').src = "Picker.php?InMenu="+InMenu;
}
function SwitchState(obj) {
switch ($(obj+"_input").value) {
case "-1":
$(obj+"_input").value = '?';
$(obj+"_img").src = "gfx/dontcare.png";
$(obj+"_img").parentNode.style.backgroundColor = '';
break;
case "?":
$(obj+"_input").value = 1;
$(obj+"_img").src = "gfx/wantit.png";
$(obj+"_img").parentNode.style.backgroundColor = '$ChangedColor';
break;
case "1":
$(obj+"_input").value = -1;
$(obj+"_img").src = "gfx/dontwantit.png";
$(obj+"_img").parentNode.style.backgroundColor = '$ChangedColor';
break;
}
}
function ManageRT(obj, inout) {
if (inout == 'in') {
if (obj.value == '?') {
obj.value = '';
}
}
else if (inout == 'out') {
if (obj.value == '' || obj.value == '?') {
obj.value = '?';
obj.style.backgroundColor = '';
}
else
obj.style.backgroundColor = '$ChangedColor';
}
}
</script>
</head>
<body class=f6 onLoad="FixIFrame()">
<form method=post action="#" target=theiframe id=search_form onSubmit="return(ValidateThenSubmit())">
<h1>$thelimit</h1>
<input type="submit" value="$lang[CHOOSERPICK]"> <input type="reset" value="$lang[CHOOSERRESET]" onClick="ResetToDontCare()">
<br><iframe style="border:medium double black" src=""" width=800 height="240" id="theiframe" name="theiframe"></iframe><br>
<table><tr>
<td align=center valign=top>
$collections
$mediatable
</td>
<td align=center valign=top>
$formattable
$bstable
</td>
<td valign=top>
$watchedby
</td></tr></table>
$genretable
<table cellpadding=3 border=1><tr><th>$lang[RUNNINGTIME]</th></tr>
<tr><td align="center">
Minimum runtime <input onFocus="ManageRT(this, 'in')" onBlur="ManageRT(this, 'out')" type="text" size="5" value="?" name="rtimelower"> <input onFocus="ManageRT(this, 'in')" onBlur="ManageRT(this, 'out')" type="text" size="5" value="?" name="rtimehigher">Maximum runtime
</td></tr></table>
<table>
$aspectcombo
$vidstdcombo
$coocombo
$regioncombo
$casecombo
$ratingcombo
$suppliercombo
</table>
<br><table>
<tr><td>$lang[CHOOSERFINDTITLE]:</td><td><input onChange="HandleTextChange(this)" type="text" name="title" width=40></td></tr>
<tr><td>$lang[CHOOSERFINDOFEATURES]:</td><td><input onChange="HandleTextChange(this)" type="text" name="featureother" width=40></td></tr>
<tr><td>$lang[CHOOSERFINDOVERVIEW]:</td><td><input onChange="HandleTextChange(this)" type="text" name="overview" width=40></td></tr>
<tr><td>$lang[CHOOSERFINDEGGS]:</td><td><input onChange="HandleTextChange(this)" type="text" name="eastereggs" width=40></td></tr>
<tr><td>$lang[CHOOSERFINDNOTES]:</td><td><input onChange="HandleTextChange(this)" type="text" name="notes" width=40></td></tr>
<tr><td>$lang[CHOOSERFINDACTORS]:</td><td><input onChange="HandleTextChange(this)" type="text" name="actors" width=40></td></tr>
<tr><td>$lang[CHOOSERFINDROLES]:</td><td><input onChange="HandleTextChange(this)" type="text" name="roles" width=40></td></tr>
<tr><td>$lang[CHOOSERFINDCREW]:</td><td><input onChange="HandleTextChange(this)" type="text" name="credits" width=40></td></tr>
<tr><td>$lang[CHOOSERFINDSTUDIOS]:</td><td><input onChange="HandleTextChange(this)" type="text" name="studios" width=40></td></tr>
</table>
$lang[CHOOSERFINDTITLEEXPLAIN]<br>
$extrastable
$tagtable
<br><br><br><br><br><br><br><font size="-2">
<h2>Things that cannot yet be selected:</h2>
collectionnumber
<br>productionyear
<br>released
<br>reviewfilm
<br>reviewvideo
<br>reviewaudio
<br>reviewextras
<br>srp
<br>purchaseprice
<br>purchasedate
<br>loaninfo
<br>loandue
<br>locks
<br>Audio
<br>Subtitles</font>
</form>
</body>
</html>
EOT;
?>