-
Notifications
You must be signed in to change notification settings - Fork 4
/
statistics.php
1214 lines (1113 loc) · 56.9 KB
/
statistics.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
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
function MakeAPercentage($value, $total, $decimals=0) {
if ($total == 0)
return(0);
$frac = $value*100/$total;
$j = log10($frac);
$round = ($j>0)? $decimals: -1*floor($j);
$frac = round($frac, $round);
return($frac);
}
SendNoCacheHeaders('Content-Type: text/html; charset="windows-1252";');
if (!DisplayIfIsPrivateOrAlways($handleadult)) {
$noadult = "AND isadulttitle=0";
$ADULT = "NoAdult";
}
else {
$noadult = "";
$ADULT = "Adult";
}
$hdr = '';
$onres = '';
$hdr .= <<<EOT
<script type="text/javascript">
var RadioButtons = new Array();
function RegisterRadioButtons() {
var whichtable=arguments[0];
RadioButtons[whichtable] = new Array();
for (var i=1; i<arguments.length; i++)
RadioButtons[whichtable][arguments[i]] = document.getElementById(arguments[i]);
}
function RadioAlternate(whichtable, whichdata){
RadioButtons[whichtable][whichdata].style.display="";
for (var i in RadioButtons[whichtable]) {
if (i != whichdata) {
RadioButtons[whichtable][i].style.display="none";
}
}
}
</script>
EOT;
if ($usejpgraph) {
$hdr .= <<<EOT
<script type="text/javascript">
var ResizeTimer;
function GetWidth() {
if (self.innerWidth)
frameWidth = self.innerWidth;
else if (document.documentElement && document.documentElement.clientWidth)
frameWidth = document.documentElement.clientWidth;
else if (document.body)
frameWidth = document.body.clientWidth;
return(frameWidth);
}
function OnRes() {
clearInterval(ResizeTimer);
ResizeTimer = setInterval('UpdateImage()', 1000);
}
function UpdateImage() {
clearInterval(ResizeTimer);
j = GetWidth()-40;
k = document.getElementsByName('jpgraph');
for (i=0; i<k.length; i++)
k[i].src = k[i].src.replace(/graphx=(\d+)/, 'graphx='+j);
}
function FiddleProd(low,high) {
var temp, obj=document.getElementById("byprodyeargraph");
obj.src = obj.src.replace(/low=(\d{4})&high=(\d{4})/, 'low='+low+'&high='+high);
}
function FiddleMonth(str) {
var temp, obj=document.getElementById("bymonthgraph");
obj.src = obj.src.replace(/year=(all|last|year|\d{4})/, 'year='+str);
}
</script>
EOT;
$onres = 'onResize="OnRes()"';
}
// ***************** Page Heading
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[STATISTICS]</title>
<link rel="stylesheet" type="text/css" href="format.css.php">$hdr
</head>
<body class=f6 $onres>
<center><table width="100%" class=f1><tr><td>$lang[STATISTICS]</td></tr></table></center>
<BR>
EOT;
$t0 = microtime_float(); $numtimings = 0;
$centertable = "<table class=f2np cellspacing=0 cellpadding=0><tr><td width=\"50%%\" align=right class=f2np>%d (</td>"
."<td align=left class=f2np>%s%%)</td></tr></table>";
// ***************** General Statistics
echo <<<EOT
<center><table width="80%" class=f1><tr><td>$lang[GENSTATS]</td></tr></table></center>
<center><table width="75%" class=bgl>
EOT;
// Total number of profiles
$sql = "SELECT COUNT(*) AS total FROM $DVD_TABLE WHERE collectiontype='owned' $noadult";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
$total = $dvd['total'];
echo "<tr><td class=f3np>$lang[TOTPROFS]</td><td class=f2np>$total</td><td class=f2np></td></tr>\n";
$db->sql_freeresult($result);
// Total running time
$sql = "SELECT SUM(runningtime) AS total, COUNT(runningtime) AS numfound FROM $DVD_TABLE WHERE collectiontype='owned' $noadult $runtimespecialcondition";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
$totaltime = $dvd['total'];
$totalnum = $dvd['numfound'];
if ($totalnum == 0)
$totalnum = 1;
printf("<tr><td class=f3np>$lang[TOTRUNTIME]</td>"
."<td class=f2np>%s $lang[LITTLEMINUTES] (%s:%02d)</td>"
."<td class=f2np>$lang[AVERAGING]</td></tr>\n",
number_format($totaltime, 0, $lang['MON_DECIMAL_POINT'], $lang['MON_THOUSANDS_SEP']), number_format(floor($totaltime/60), 0, $lang['MON_DECIMAL_POINT'], $lang['MON_THOUSANDS_SEP']),
$totaltime%60, round($totaltime/$totalnum));
$db->sql_freeresult($result);
if ($IsPrivate) {
// Total purchase price (with different currencies possible)
$sql = "SELECT SUM(paid) AS paid,COUNT(*) AS num,purchasepricecurrencyid AS ppci FROM $DVD_TABLE "
."WHERE collectiontype='owned' $currencyspecialcondition $noadult GROUP BY ppci";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
$paid = $dvd['paid'];
printf("<tr><td class=f3np>$lang[TOTALPAID]</td>"
."<td class=f2np>$lang[THETOTAL]</td>"
."<td class=f2np>$lang[AVGPERPROF]</td></tr>\n",
$dvd['ppci'],
my_money_format($dvd['ppci'], $paid), $dvd['ppci'], $dvd['num'],
my_money_format($dvd['ppci'], round($paid/$dvd['num'], money_digits($dvd['ppci']))), $dvd['ppci']);
}
$db->sql_freeresult($result);
}
if (DisplayIfIsPrivateOrAlways($displaySRP)) {
// Total MSRP (with different currencies possible)
$sql = "SELECT SUM(srpdec) AS srp,COUNT(*) AS num,srpcurrencyid AS sci FROM $DVD_TABLE "
."WHERE collectiontype='owned' $srpspecialcondition $noadult GROUP BY sci";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
$srp = $dvd['srp'];
printf("<tr><td class=f3np>$lang[TOTALSRP]</td>"
."<td class=f2np>$lang[THETOTAL]</td>"
."<td class=f2np>$lang[AVGPERPROF]</td></tr>\n",
$dvd['sci'],
my_money_format($dvd['sci'], $srp), $dvd['sci'], $dvd['num'],
my_money_format($dvd['sci'], round($srp/$dvd['num'], money_digits($dvd['sci']))), $dvd['sci']);
}
$db->sql_freeresult($result);
}
echo "</table></center><BR>\n";
if ($usejpgraph) {
if (DisplayIfIsPrivateOrAlways($displaymonth)) {
if (!isset($monthspecialprecondition))
$monthspecialprecondition = '';
$years = array();
$numyears = 3;
$years[] = $lang['GRAPHS']['LAST12'];
$years[] = $lang['GRAPHS']['ALL'];
$years[] = $lang['GRAPHS']['YEARS'];
$sql = "SELECT date_format(from_unixtime(purchasedate), '%Y') AS year, COUNT(title) AS count FROM $DVD_TABLE $monthspecialprecondition WHERE collectiontype='owned' $monthspecialcondition GROUP BY year DESC";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
if ($dvd['year'] != '') {
$numyears++;
$years[] = $dvd['year'];
}
}
$db->sql_freeresult($result);
$odd = $numyears % 2;
$spacing = 1;
if ($odd)
$spacing = 2;
$cols = intval(($numyears+1)/2);
$width = intval(100/$cols);
$width2 = $width;
if ($odd)
$width2 = $width * 2;
$cols = $cols - 2;
echo<<<EOT
<table border width="100%" cellspacing=2 cellpadding=0>
<tr>
<td width="$width%" align=center><a style="cursor:pointer" onClick="FiddleMonth('last')">$years[0]</a></td>
<td width="$width%" align=center><a style="cursor:pointer" onClick="FiddleMonth('year')">$years[2]</a></td>
EOT;
$cols = intval(($numyears+1)/2) - 2;
for ($act=1; $act<=$cols; $act++) {
$tmp=$act+2;
echo "<td width='$width%' align=center><a style=\"cursor:pointer\" onClick=\"FiddleMonth('$years[$tmp]')\">$years[$tmp]</a></td>\n";
}
echo<<<EOT
</tr>
<tr>
<td width="$width2%" colspan=$spacing align=center><a style="cursor:pointer" onClick="FiddleMonth('all')">$years[1]</a></td>
EOT;
for ($act=$cols; $act<=$numyears-4; $act++) {
$tmp=$act+3;
echo "<td width='$width%' align=center><a style=\"cursor:pointer\" onClick=\"FiddleMonth('$years[$tmp]')\">$years[$tmp]</a></td>\n";
}
echo<<<EOT
</tr>
</table>
<center>
<script type="text/javascript">
j = GetWidth()-40;
document.write('<img style="border-width:0px" id=bymonthgraph name=jpgraph src="gr_bymonth.php?year=last&graphx='+j+'&graphy=auto">');
</script>
</center><br>
EOT;
}
if (DisplayIfIsPrivateOrAlways($displaycurrency)) {
$temp = array();
$available = array();
$sql = "SELECT DISTINCT(purchasepricecurrencyid) FROM $DVD_TABLE "
."WHERE collectiontype='owned' $noadult ORDER BY purchasepricecurrencyid";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result))
if ($dvd['purchasepricecurrencyid'] != '')
$temp[] = $dvd['purchasepricecurrencyid'];
$db->sql_freeresult($result);
foreach ($currencypriority as $wantkey => $wantvalue) {
foreach ($temp as $havekey =>$havevalue) {
if ($havevalue == $wantvalue) {
$available[] = $wantvalue;
unset($temp[$havekey]);
break;
}
}
}
if (!$onlycurrencypriority)
foreach ($temp as $havekey =>$havevalue)
$available[] = $havevalue;
unset($temp);
if (count($available) > 0) {
if (count($available) > 1) {
$curlist = '';
foreach ($available as $key => $avail)
$curlist .= "\"$avail\", ";
$curlist = substr($curlist, 0, strlen($curlist)-2);
echo <<<EOT
<center>
<script type="text/javascript">
j = GetWidth()-40;
function SwitchCurrency(obj) {
var currencies=new Array($curlist);
var curr, next;
curr = obj.src.replace(/.*&next=([^&]*)/, '$1');
for (var i=0; i<currencies.length; i++) {
if (currencies[i] == curr) {
if (i != currencies.length-1)
next = currencies[i+1];
else
next = currencies[0];
}
}
obj.src = obj.src.replace(/¤cy=.*&next=.*/, '¤cy='+curr+'&next='+next);
}
document.write('<a style="cursor:pointer" title="{$lang['GRAPHS']['CLICK']}"><img style="border-width:0px" onClick="SwitchCurrency(this)" name=jpgraph src="gr_bycurrency.php?graphx='+j+'&graphy=auto¤cy={$available[0]}&next={$available[1]}"></a>');
</script>
</center><br>
EOT;
}
else {
echo<<<EOT
<center>
<script type="text/javascript">
j = GetWidth()-40;
document.write('<img style="border-width:0px" name=jpgraph src="gr_bycurrency.php?graphx='+j+'&graphy=auto¤cy={$available[0]}">');
</script>
</center><br>
EOT;
}
}
}
if (DisplayIfIsPrivateOrAlways($displayplace)) {
echo<<<EOT
<center>
<script type="text/javascript">
j = GetWidth()-40;
document.write('<img name=jpgraph src="gr_byplace.php?graphx='+j+'&graphy=auto">');
</script>
</center><br>
EOT;
}
$numyears = 1;
$allyears = $lang['GRAPHS']['PRODALL'];
$sql = "SELECT MIN(productionyear) AS minyear, MAX(productionyear) AS maxyear FROM $DVD_TABLE WHERE collectiontype='owned' $productionyearspecialcondition";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$maxyear = $dvd['maxyear'];
$minyear = 10*(int)($dvd['minyear']/10);
$numyears += 1+(int)(($maxyear-$minyear)/10);
$cols = intval(($numyears+1)/2);
$width = intval(100/$cols);
echo<<<EOT
<table border width="100%" cellspacing=2 cellpadding=0>
<tr>
<td width="$width%" align=center><a style="cursor:pointer" onClick="FiddleProd('$minyear','$maxyear')">$allyears</a></td>
EOT;
for ($i=1,$tmp=$minyear; $i<$numyears; $i++,$tmp+=10) {
$tmp1 = $tmp + 9;
if ($i == $cols) echo "</tr><tr>\n";
echo "<td width='$width%' align=center><a style=\"cursor:pointer\" onClick=\"FiddleProd('$tmp','$tmp1')\">$tmp</a></td>\n";
}
echo<<<EOT
</tr></table>
<center>
<script type="text/javascript">
j = GetWidth()-40;
document.write('<img id=byprodyeargraph name=jpgraph src="gr_byproduction.php?low=$minyear&high=$maxyear&graphx='+j+'&graphy=auto">');
</script>
</center><br>
EOT;
}
$ProfileName[$numtimings] = 'GeneralStats'; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// ***************** Region Statistics
echo "<center><table width=\"75%\" class=f1><tr><td>$lang[NUMPROFREG]</td></tr></table></center><BR>\n";
echo "<center><table width=\"50%\" class=bgl>\n";
// Profile totals organised by on-disc regions (ie. number of discs with regions 1,3,4)
echo "<tr><th align=left class=f3np style=\"color: black;\">$lang[REGIONSONDVD]</th>"
."<th class=f2np>$lang[NUMPROF]</th></tr>\n";
$sql = "SELECT region,COUNT(*) AS total FROM $DVD_TABLE WHERE collectiontype='owned' $noadult GROUP BY region ORDER BY region";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
$regioncommas = AddCommas($dvd['region']);
if ($regioncommas == '0') $regioncommas = $lang['ALLREGIONSDVD'];
if ($regioncommas == '@') $regioncommas = $lang['ALLREGIONSBLURAY'];
$str = "<a target=\"_blank\" href=\"javascript:;\" onClick=\"window.open("
."'popup.php?acttype=REGION&fullname=$dvd[region]','Actors',$ActorWindowSettings); "
."return false;\">$regioncommas</a>";
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$str, $dvd['total'], MakeAPercentage($dvd['total'], $total));
}
$db->sql_freeresult($result);
echo "</table></center><BR>\n";
$ProfileName[$numtimings] = 'RegionStats1'; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// Profile totals per region (ie. number of discs playable in region 2)
echo "<center><table width=\"50%\" class=bgl>\n";
echo "<tr><th align=left class=f3np style=\"color:black;\">$lang[REGION]</th>"
."<th class=f2np>$lang[NUMPROF]</th></tr>\n";
$sql = "SELECT namestring1 AS region,counts AS total from $DVD_STATS_TABLE "
."WHERE stattype='Region$ADULT'";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
if ($dvd['total'] != 0) {
$disp = $lang['REGION'] . " " . $dvd['region'];
if ($dvd['region'] == '0') $disp = $lang['ALLREGIONSDVD'];
if ($dvd['region'] == '@') $disp = $lang['ALLREGIONSBLURAY'];
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$disp, $dvd['total'], MakeAPercentage($dvd['total'], $total));
}
}
$db->sql_freeresult($result);
echo "</table></center><BR>\n";
if ($usejpgraph) {
echo<<<EOT
<center>
<script type="text/javascript">
j = GetWidth()-40;
document.write('<img name=jpgraph src="gr_bylocality.php?graphx='+j+'&graphy=auto">');
</script>
</center><br>
<center>
<script type="text/javascript">
j = GetWidth()-40;
document.write('<img name=jpgraph src="gr_byorigin.php?graphx='+j+'&graphy=auto">');
</script>
</center><br>
EOT;
}
$ProfileName[$numtimings] = 'RegionStats2'; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// ***************** Genre Statistics
echo "<center><table width=\"75%\" class=f1><tr><td>$lang[NUMPROFGEN]</td></tr></table></center><BR>\n";
// Total number of profiles per primary (ie. first) genre
$genre = array();
$sql = "SELECT primegenre,COUNT(*) AS total FROM $DVD_TABLE "
."WHERE collectiontype='owned' $noadult GROUP BY primegenre "
."ORDER BY total DESC";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
$genre[$dvd['primegenre']]['primetotal'] = $dvd['total'];
$genre[$dvd['primegenre']]['primefrac'] = MakeAPercentage($dvd['total'], $total, 1);
$genre[$dvd['primegenre']]['alltotal'] = 0;
$genre[$dvd['primegenre']]['allfrac'] = 0;
}
$db->sql_freeresult($result);
$ProfileName[$numtimings] = 'GenreStats1'; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// Total number of profiles containing a particular genre (ie. not just first genre)
$sql = "SELECT genre,COUNT(genre) AS total FROM $DVD_TABLE d,$DVD_GENRES_TABLE g "
."WHERE d.id=g.id AND collectiontype='owned' $noadult $genrespecialcondition "
."GROUP BY genre";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
// if the determinant for adult is more than containing the adult genre, then this is incorrect
if (($dvd['genre'] == 'Adult') && !DisplayIfIsPrivateOrAlways($handleadult))
continue;
if (!isset($genre[$dvd['genre']]['primetotal'])) {
$genre[$dvd['genre']]['primetotal'] = 0;
$genre[$dvd['genre']]['primefrac'] = 0;
}
$genre[$dvd['genre']]['alltotal'] = $dvd['total'];
$genre[$dvd['genre']]['allfrac'] = MakeAPercentage($dvd['total'], $total, 1);
}
$db->sql_freeresult($result);
$ProfileName[$numtimings] = 'GenreStats2'; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
echo "<center><table width=\"50%\" class=bgl>\n";
echo "<tr><th align=left class=f3np style=\"color: black;\">$lang[GENRE]</th>"
."<th class=f2np>$lang[PRIMGEN]</th>"
."<th class=f2np>$lang[ANYGEN]</th></tr>\n";
foreach ($genre as $key => $value) {
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
GenreTranslation($key),
$genre[$key]['primetotal'], $genre[$key]['primefrac'],
$genre[$key]['alltotal'], $genre[$key]['allfrac']);
}
echo "</table></center><BR>\n";
if ($usejpgraph) {
echo<<<EOT
<center>
<script type="text/javascript">
j = GetWidth()-40;
document.write('<img name=jpgraph src="gr_byprimarygenre.php?graphx='+j+'&graphy=auto">');
</script>
</center><br>
<center>
<script type="text/javascript">
j = GetWidth()-40;
document.write('<img name=jpgraph src="gr_bygenre.php?graphx='+j+'&graphy=auto">');
</script>
</center><br>
EOT;
}
$ProfileName[$numtimings] = 'GenreStats3'; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// ***************** Aspect Ratio Statistics
echo "<center><table width=\"75%\" class=f1><tr><td>$lang[NUMPROFASPECT]</td></tr></table></center><BR>\n";
echo "<center><table width=\"50%\" class=bgl>\n";
echo "<tr><th class=f3np style=\"color: black;\">$lang[ASPECTRATIO]</th>"
."<th class=f2np>$lang[NUMPROF]</th></tr>\n";
// Total number of profiles per specific Aspect Ratio
$sql = "SELECT formataspectratio AS fma,COUNT(*) AS total FROM $DVD_TABLE "
."WHERE collectiontype='owned' $noadult GROUP BY fma "
."ORDER BY total DESC,fma";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
printf("<tr><td align=center class=f3np>%s:1</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$dvd['fma'], $dvd['total'], MakeAPercentage($dvd['total'], $total));
}
$db->sql_freeresult($result);
echo "</table></center><BR>\n";
$ProfileName[$numtimings] = 'AspectStats'; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// ***************** Audio Statistics
echo "<center><table width=\"75%\" class=f1><tr><td>$lang[NUMPROFAUD]</td></tr></table></center><BR>\n";
echo "<center><table width=\"50%\" class=bgl>\n";
// Total number of THX DVDs
$sql = "SELECT COUNT(distinct(id)) AS total FROM $DVD_TABLE "
."WHERE featurethxcertified=1 AND collectiontype='owned' $noadult";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$lang['THXCERTIFIED'], $dvd['total'], MakeAPercentage($dvd['total'], $total));
$db->sql_freeresult($result);
// Total number of DTS DVDs
$sql = "SELECT COUNT(distinct(d.id)) AS total FROM $DVD_TABLE d, $DVD_AUDIO_TABLE a "
."WHERE audioformat LIKE 'DTS%' AND d.id=a.id AND collectiontype='owned' $noadult";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$lang['AUDIO']['DTS'], $dvd['total'], MakeAPercentage($dvd['total'], $total));
$db->sql_freeresult($result);
// Total number of DVDs with 5.1 audio channels
$sql = "SELECT COUNT(distinct(d.id)) AS total FROM $DVD_TABLE d, $DVD_AUDIO_TABLE a "
."WHERE audiochannels LIKE '%5.1%' AND d.id=a.id AND collectiontype='owned' $noadult";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$lang['5.1CHANNEL'], $dvd['total'], MakeAPercentage($dvd['total'], $total));
$db->sql_freeresult($result);
// Total number of DVDs with 6.1 audio channels
$sql = "SELECT COUNT(distinct(d.id)) AS total FROM $DVD_TABLE d, $DVD_AUDIO_TABLE a "
."WHERE audiochannels LIKE '%6.1%' AND d.id=a.id AND collectiontype='owned' $noadult";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$lang['6.1CHANNEL'], $dvd['total'], MakeAPercentage($dvd['total'], $total));
$db->sql_freeresult($result);
// Total number of DVDs with 7.1 audio channels
$sql = "SELECT COUNT(distinct(d.id)) AS total FROM $DVD_TABLE d, $DVD_AUDIO_TABLE a "
."WHERE audiochannels LIKE '%7.1%' AND d.id=a.id AND collectiontype='owned' $noadult";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$lang['7.1CHANNEL'], $dvd['total'], MakeAPercentage($dvd['total'], $total));
$db->sql_freeresult($result);
// Total number of DVDs in Dolby Digital
$sql = "SELECT COUNT(distinct(d.id)) AS total FROM $DVD_TABLE d, $DVD_AUDIO_TABLE a "
."WHERE audioformat LIKE 'Dolby Digital%' AND d.id=a.id AND collectiontype='owned' $noadult";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$lang['AUDIO']['DD'], $dvd['total'], MakeAPercentage($dvd['total'], $total));
$db->sql_freeresult($result);
echo "</table></center><BR>\n";
$ProfileName[$numtimings] = 'AudioStats'; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// Audio FORMAT/COMPRESSION/CHANNELS SECTION
echo "<center><table width=\"75%\" class=f1><tr><td>$lang[NUMPROFAUDFORM]</td></tr></table></center><BR>\n";
echo "<center><table width=\"50%\" class=bgl>\n";
// Total number of Audio tracks
$sql = "SELECT COUNT(*) AS totalaudio FROM $DVD_AUDIO_TABLE a, $DVD_TABLE d "
."WHERE d.id=a.id AND collectiontype='owned' $noadult";
$result = $db->sql_query($sql) or die($db->sql_error());
$dvd = $db->sql_fetchrow($result);
$totalaudio = $dvd['totalaudio'];
$db->sql_freeresult($result);
// Number of profiles per Audio Format
echo "<tr><th align=left class=f3np style=\"color:black;\">$lang[AUDIOFORM]</th><th class=f2np>$lang[NUMTRACK]</th></tr>\n";
$sql = "SELECT namestring1 AS aform,counts AS total FROM $DVD_STATS_TABLE "
."WHERE stattype='AudioFormat$ADULT'";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
printf("<tr><td class=f3np>%s</td>"
."<td align=center class=f2np>$centertable</td></tr>\n",
$aformat_name[$dvd['aform']],
$dvd['total'], MakeAPercentage($dvd['total'], $totalaudio));
}
$db->sql_freeresult($result);
echo "</table></center><BR>\n";
$ProfileName[$numtimings] = 'FormatStats'; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// ***************** Running Time Statistics
echo "<center><table width=\"75%\" class=f1><tr><td>$lang[TOPTENRUNTIMES]</td></tr>";
echo "<tr><td class=f1sm><form name=\"runtime\">";
echo "<center><table class=f1sm>";
echo "<tr><td align=right>$lang[LONGEST]<input type=radio name=1 onClick=\"RadioAlternate('runtime', 'long');\" checked></td>";
echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('runtime', 'longnotv');\">$lang[LONGESTNOTV]</td></tr>";
echo "<tr><td align=right>$lang[SHORTEST]<input type=radio name=1 onClick=\"RadioAlternate('runtime', 'short');\"></td>";
echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('runtime', 'shortnotv');\">$lang[SHORTESTNOTV]</td></tr>";
echo "</table></center></form></td></tr></table></center><br>\n";
echo "<center>";
// $TopX profiles with longest running time
echo "<table width=\"50%\" class=bgl id=\"long\">\n";
$sql = "SELECT namestring1 AS title,namestring2 AS sorttitle,id,counts AS runningtime FROM $DVD_STATS_TABLE "
."WHERE stattype='LongTime$ADULT' LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
$dvd['title'] = "<a href=\"$PHP_SELF?mediaid=$dvd[id]&action=show\" "
."title=\"$dvd[sorttitle]\">$dvd[title]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d $lang[MINUTES]</td></tr>\n",
$dvd['title'], $dvd['runningtime']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "LongTime$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX profiles with shortest running time
echo "<table width=\"50%\" class=bgl id=\"short\" style=\"display:none\">\n";
$sql = "SELECT namestring1 AS title,namestring2 AS sorttitle,id,counts AS runningtime FROM $DVD_STATS_TABLE "
."WHERE stattype='ShortTime$ADULT' LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
$dvd['title'] = "<a href=\"$PHP_SELF?mediaid=$dvd[id]&action=show\" "
."title=\"$dvd[sorttitle]\">$dvd[title]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d $lang[MINUTES]</td></tr>\n",
$dvd['title'], $dvd['runningtime']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "ShortTime$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX profiles with longest running time NO TV
echo "<table width=\"50%\" class=bgl id=\"longnotv\" style=\"display:none\">\n";
$sql = "SELECT namestring1 AS title,namestring2 AS sorttitle,id,counts AS runningtime FROM $DVD_STATS_TABLE "
."WHERE stattype='LongTimeNOTV$ADULT' LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
$dvd['title'] = "<a href=\"$PHP_SELF?mediaid=$dvd[id]&action=show\" "
."title=\"$dvd[sorttitle]\">$dvd[title]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d $lang[MINUTES]</td></tr>\n",
$dvd['title'], $dvd['runningtime']);
}
$db->sql_freeresult($result);
echo "</table>\n";
$ProfileName[$numtimings] = "LongTimeNOTV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX profiles with shortest running time
echo "<table width=\"50%\" class=bgl id=\"shortnotv\" style=\"display:none\">\n";
$sql = "SELECT namestring1 AS title,namestring2 AS sorttitle,id,counts AS runningtime FROM $DVD_STATS_TABLE "
."WHERE stattype='ShortTimeNOTV$ADULT' LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
$dvd['title'] = "<a href=\"$PHP_SELF?mediaid=$dvd[id]&action=show\" "
."title=\"$dvd[sorttitle]\">$dvd[title]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d $lang[MINUTES]</td></tr>\n",
$dvd['title'], $dvd['runningtime']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "ShortTimeNOTV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
echo "</center><BR>\n";
echo "<script type=\"text/javascript\">RegisterRadioButtons('runtime', 'long', 'short', 'longnotv', 'shortnotv');</script>\n";
// ***************** Actor Statistics
echo "<center><table width=\"75%\" class=f1><tr><td>$lang[TOPTENACTORS]</td></tr>\n";
echo "<tr><td class=f1sm><form name=\"actors\">";
echo "<center><table class=f1sm>";
echo "<tr><td align=right>$lang[ACTORS]<input type=radio name=1 onClick=\"RadioAlternate('actors', 'mostactor');\" checked></td>";
echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('actors', 'actornv');\">$lang[ACTORSNV]</td></tr>";
// echo "<tr><td align=right>$lang[NORMACTORS]<input type=radio name=1 onClick=\"RadioAlternate('actors', 'normactor');\"></td>";
// echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('actors', 'normactornv');\">$lang[NORMACTORSNV]</td></tr>";
echo "<tr><td align=right>$lang[ACTORSNOTV]<input type=radio name=1 onClick=\"RadioAlternate('actors', 'actornotv');\"></td>";
echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('actors', 'actornvnotv');\">$lang[ACTORSNVNOTV]</td></tr>";
// echo "<tr><td align=right>$lang[NORMACTORSNOTV]<input type=radio name=1 onClick=\"RadioAlternate('actors', 'normactornotv');\">"</td>;
// echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('actors', 'normactornvnotv');\">$lang[NORMACTORSNVNOTV]</td></tr>";
echo "<tr><td align=right>$lang[ACTORSORIG]<input type=radio name=1 onClick=\"RadioAlternate('actors', 'actoror');\"></td>";
echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('actors', 'actorornotv');\">$lang[ACTORSORIGNOTV]</td></tr>";
echo "</table></center></form></td></tr></table></center><br>\n";
echo "<center>";
// $TopX most collected Actors
echo "<table width=\"50%\" class=bgl id=\"mostactor\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='Actors$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "Actors$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX most collected Actors excluding voice-only parts
echo "<table width=\"50%\" class=bgl id=\"actornv\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='ActorsNV$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "ActorsNV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
/**********************************
// $TopX most collected Actors counting BoxSets as 1
echo "<table width=\"50%\" class=bgl id=\"normactor\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='NormActors$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "NormActors$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX most collected Actors (non-voice) counting BoxSets as 1
echo "<table width=\"50%\" class=bgl id=\"normactornv\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='NormActorsNV$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "NormActorsNV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
*********************************/
// $TopX most collected Actors NOTV
echo "<table width=\"50%\" class=bgl id=\"actornotv\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='ActorsNOTV$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "ActorsNOTV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX most collected Actors excluding voice-only parts NOTV
echo "<table width=\"50%\" class=bgl id=\"actornvnotv\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='ActorsNVNOTV$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "ActorsNVNOTV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
/**********************************
// $TopX most collected Actors counting BoxSets as 1 NO TV
echo "<table width=\"50%\" class=bgl id=\"normactornotv\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='NormActorsNOTV$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "NormActorsNOTV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX most collected Actors (non-voice) counting BoxSets as 1 NO TV
echo "<table width=\"50%\" class=bgl id=\"normactornvnotv\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='NormActorsNVNOTV$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "NormActorsNVNOTV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
*********************************/
// $TopX most collected Actors OriginalTitle
echo "<table width=\"50%\" class=bgl id=\"actoror\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='ActorsOR$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "ActorsOR$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX most collected Actors NOTV
echo "<table width=\"50%\" class=bgl id=\"actorornotv\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_ACTOR_TABLE ca "
."WHERE stattype='ActorsORNOTV$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcast, $castsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=ACTOR&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "ActorsNOTV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
echo "</center><br>\n";
echo "<script type=\"text/javascript\">RegisterRadioButtons('actors', 'mostactor', 'actornv'";
// echo ", 'normactor', 'normactornv'";
echo ", 'actornotv', 'actornvnotv'";
// echo ", 'normactornotv', 'normactornvnotv'";
echo ", 'actoror', 'actorornotv'";
echo ");</script>\n";
// ***************** Director Statistics
echo "<center><table width=\"75%\" class=f1><tr><td>$lang[TOPTENDIRS]</td></tr>\n";
echo "<tr><td class=f1sm><form name=\"dirs\">";
echo "<center><table class=f1sm>";
echo "<tr><td align=right>$lang[DIRECTORS]<input type=radio name=1 onClick=\"RadioAlternate('dirs', 'mostdir');\" checked></td>";
echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('dirs', 'dirnotv');\">$lang[DIRSNOTV]</td></tr>";
// echo "<tr><td align=right>$lang[NORMDIRS]<input type=radio name=1 onClick=\"RadioAlternate('dirs', 'normdir');\"></td>";
// echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('dirs', 'normdirnotv');\">$lang[NORMDIRSNOTV]</td></tr>";
echo "</table></center></form></td></tr></table></center><br>\n";
echo "<center>";
// $TopX most collected Directors
echo "<table width=\"50%\" class=bgl id=\"mostdir\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_CREDITS_TABLE ca "
."WHERE stattype='Directors$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcrew, $crewsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=CREDIT&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "Directors$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX most collected Directors NO TV
echo "<table width=\"50%\" class=bgl id=\"dirnotv\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_CREDITS_TABLE ca "
."WHERE stattype='DirectorsNOTV$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcrew, $crewsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=CREDIT&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "DirectorsNOTV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
/***************************************
// $TopX most collected Directors counting BoxSets as 1
echo "<table width=\"50%\" class=bgl id=\"normdir\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_CREDITS_TABLE ca "
."WHERE stattype='NormDirectors$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcrew, $crewsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=CREDIT&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "NormDirectors$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
// $TopX most collected Directors counting BoxSets as 1 NO TV
echo "<table width=\"50%\" class=bgl id=\"normdirnotv\" style=\"display:none\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_CREDITS_TABLE ca "
."WHERE stattype='NormDirectorsNOTV$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcrew, $crewsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=CREDIT&fullname=".urlencode($dvd['namestring1'])."',"
."'Actors',$ActorWindowSettings); return false;\">$dvd[fullname]</a>";
printf("<tr><td class=f3np>%s</td>"
."<td class=f2np align=right>%d (%d)</td></tr>\n",
"$image $str", $dvd['times'], $dvd['namestring2']);
}
$db->sql_freeresult($result);
echo "</table>";
$ProfileName[$numtimings] = "NormDirectorsNOTV$ADULT"; $Profile[$numtimings++] = microtime_float()-$t0; $t0 = microtime_float();
**************************************/
echo "</center><br>\n";
echo "<script type=\"text/javascript\">RegisterRadioButtons('dirs', 'mostdir', 'dirnotv'";
// echo ", 'normdir', 'normdirnotv'";
echo ");</script>\n";
// ***************** Writer Statistics
echo "<center><table width=\"75%\" class=f1><tr><td>$lang[TOPTENWRITERS]</td></tr>\n";
echo "<tr><td class=f1sm><form name=\"writers\">";
echo "<center><table class=f1sm>";
echo "<tr><td align=right>$lang[WRITERS]<input type=radio name=1 onClick=\"RadioAlternate('writers', 'mostwriter');\" checked></td>";
echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('writers', 'writernotv');\">$lang[WRITERSNOTV]</td></tr>";
// echo "<tr><td align=right>$lang[NORMWRITERS]<input type=radio name=1 onClick=\"RadioAlternate('writers', 'normwriters');\"></td>";
// echo "<td align=left><input type=radio name=1 onClick=\"RadioAlternate('writers', 'normwritersnotv');\">$lang[NORMWRITERSNOTV]</td></tr>";
echo "</table></center></form></td></tr></table></center><br>\n";
echo "<center>";
// $TopX most collected Writers
echo "<table width=\"50%\" class=bgl id=\"mostwriter\">\n";
$sql = "SELECT namestring1,namestring2,firstname,middlename,lastname,fullname,birthyear,counts AS times FROM $DVD_STATS_TABLE s,$DVD_COMMON_CREDITS_TABLE ca "
."WHERE stattype='Writers$ADULT' AND namestring1=caid LIMIT $TopX";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($dvd = $db->sql_fetchrow($result)) {
GetHeadAndMouse($dvd, $headcrew, $crewsubs, $image, $mouse);
$str = "<a target=\"_blank\" href=\"javascript:;\" $mouse onClick=\"window.open("
."'popup.php?acttype=CREDIT&fullname=".urlencode($dvd['namestring1'])."',"