-
Notifications
You must be signed in to change notification settings - Fork 11
/
ajax_forms.php
executable file
·1050 lines (769 loc) · 42.1 KB
/
ajax_forms.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
/*
**************************************************************************************************************************
** CORAL Usage Statistics Module
**
** Copyright (c) 2010 University of Notre Dame
**
** This file is part of CORAL.
**
** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
**
** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License along with CORAL. If not, see <http://www.gnu.org/licenses/>.
**
**************************************************************************************************************************
**************************************************************************************************************************
** ajax_processing.php contains processing (adds/updates/deletes) on data sent using ajax from forms and other pages
**
** when ajax_processing.php is called through ajax, 'action' parm is required to dictate which form will be returned
**
**************************************************************************************************************************
*/
include "common.php";
include_once 'directory.php';
$action = $_REQUEST['action'];
switch ($action) {
//log email addresses (on admin page)
case 'getLogEmailAddressForm':
if (isset($_GET['logEmailAddressID']) && ($_GET['logEmailAddressID'] != '')){
$logEmailAddressID = $_GET['logEmailAddressID'];
$addUpdate = 'Update';
$logEmailAddress = new LogEmailAddress(new NamedArguments(array('primaryKey' => $_GET['logEmailAddressID'])));
}else{
$logEmailAddressID = '';
$addUpdate = 'Add';
$logEmailAddress = new LogEmailAddress();
}
?>
<div id='div_updateForm'>
<input type='hidden' id='updateLogEmailAddressID' name='updateLogEmailAddressID' value='<?php echo $logEmailAddressID; ?>'>
<table class="thickboxTable" style="width:230px;">
<tr>
<td colspan='2'><br /><span class='headerText'><?php echo $addUpdate; ?> Email Address</span><br /><span id='span_errors' style='color:red;'></span><br /></td>
</tr>
<tr>
<td>
<input type='text' id='emailAddress' name='emailAddress' value='<?php if (isset($_GET['logEmailAddressID']) && ($_GET['logEmailAddressID'] != '')) echo $logEmailAddress->emailAddress; ?>' style='width:190px;'/>
</td>
<td>
<a href='javascript:doSubmitLogEmailAddress();'><?php echo strtolower($addUpdate); ?></a>
</td>
</tr>
<tr>
<td colspan='2'><p><a href='#' onclick='window.parent.tb_remove(); return false'>close</a></td>
</tr>
</table>
</div>
<script type="text/javascript">
//attach enter key event to new input and call add data when hit
$('#emailAddress').keyup(function(e) {
if(e.keyCode == 13) {
doSubmitLogEmailAddress();
}
});
</script>
<?php
break;
//prompt for running sushi, posts to sushi.php
case 'getSushiRunForm':
if ((isset($_GET['sushiServiceID'])) && ($_GET['sushiServiceID'] != '')){
$sushiServiceID = $_GET['sushiServiceID'];
$sushiService = new SushiService(new NamedArguments(array('primaryKey' => $sushiServiceID)));
$sushiService->setDefaultImportDates();
?>
<div id='div_sushiRunForm'>
<form name="input" action="sushi.php" method="post">
<input type='hidden' id='sushiServiceID' name='sushiServiceID' value='<?php echo $sushiServiceID; ?>'>
<table class="thickboxTable" style="width:300px;padding:2px;">
<tr>
<td colspan='2'><span class='headerText'>SUSHI Service for <?php echo $sushiService->getServiceProvider; ?></span><br /> Optional Parameters<span id='span_errors' style='color:red;'><br /></span><br /></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:85px;'><label for='startDate'><b>Start Date:</b></label></td>
<td><input type='text' id='startDate' name='startDate' value="<?php echo $sushiService->startDate; ?>" style='width:90px;' /> (yyyy-mm-dd)<span id='span_error_startDate' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='endDate'><b>End Date:</b></label></td>
<td><input type='text' id='endDate' name='endDate' value="<?php echo $sushiService->endDate; ?>" style='width:90px;' /> (yyyy-mm-dd)<span id='span_error_endDate' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><input type='checkbox' id='overwritePlatform' name='overwritePlatform' value='1' checked /></td>
<td>
Ensure platform name stays CORAL's Platform Name: "<?php echo $sushiService->getServiceProvider; ?>"
</td>
</tr>
<tr style="vertical-align:middle;">
<td style="padding-top:8px;text-align:right;"> </td>
<td style="padding-top:8px;padding-right:8px;">
<table class='noBorderTable' style='width:100%;'>
<tr>
<td style='text-align:left'><input type='submit' value='submit for processing' name='submitSushiRun' id ='submitSushiRun'></td>
<td style='text-align:right'><input type='button' value='cancel' onclick="tb_remove()"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<?php
}else{
echo "No Sushi Service passed in!";
}
break;
case 'getOutlierForm':
if (isset($_GET['outlierID']) && ($_GET['outlierID'] != '')){
$outlierID = $_GET['outlierID'];
$outlier = new Outlier(new NamedArguments(array('primaryKey' => $_GET['outlierID'])));
}
?>
<div id='div_updateForm'>
<input type='hidden' id='updateOutlierID' name='updateOutlierID' value='<?php echo $outlierID; ?>'>
<table class="thickboxTable" style="width:300px;padding:2px;">
<tr><td colspan='2'><span class='headerText'>Update Outlier - <b>Level <?php echo $outlier->outlierLevel; ?></b></span><br /><br /></td></tr>
<tr><td style='vertical-align:top;text-align:right;'><label for='overageCount'><b>Count Over</b></label></td><td><input type='text' id='overageCount' name='overageCount' value="<?php echo $outlier->overageCount; ?>" style='width:140px;' /><span id='span_error_overageCount' style='color:red'></span></td></tr>
<tr><td style='vertical-align:top;text-align:right;'><label for='overagePercent'><b>% Over prior 12 months</b></label></td><td><input type='text' id='overagePercent' name='overagePercent' value="<?php echo $outlier->overagePercent; ?>" style='width:140px;' /><span id='span_error_overagePercent' style='color:red'></span></td></tr>
<tr style="vertical-align:middle;">
<td style="padding-top:8px;text-align:right;"> </td>
<td style="padding-top:18px;padding-right:8px;text-align:left;"><input type='button' value='Update' onclick='javascript:window.parent.updateOutlier();'> <input type='button' value='cancel' onclick="window.parent.tb_remove(); return false"></td>
</tr>
</table>
</div>
<script type="text/javascript">
//attach enter key event to new input and call add data when hit
$('#overageCount').keyup(function(e) {
if(e.keyCode == 13) {
window.parent.updateOutlier();
}
});
//do submit if enter is hit
$('#overagePercent').keyup(function(e) {
if(e.keyCode == 13) {
window.parent.updateOutlier();
}
});
</script>
<?php
break;
//reporting display name (on reporting page)
case 'getReportDisplayForm':
if (isset($_GET['updateID'])) $updateID = $_GET['updateID']; else $updateID = '';
if ($_GET['type'] == 'platform'){
$obj = new Platform(new NamedArguments(array('primaryKey' => $updateID)));
}else{
$obj = new PublisherPlatform(new NamedArguments(array('primaryKey' => $updateID)));
}
?>
<div id='div_updateForm'>
<input type='hidden' id='updateID' name='updateID' value='<?php echo $updateID; ?>'>
<input type='hidden' id='type' name='type' value='<?php echo $_GET['type']; ?>'>
<table class="thickboxTable" style="width:230px;">
<tr>
<td colspan='2'><br /><span class='headerText'>Update Report Display Name</span><br /><span id='span_errors' style='color:red;'></span></td>
</tr>
<tr>
<td>
<?php
echo "<input type='text' id='reportDisplayName' name='reportDisplayName' value='" . $obj->reportDisplayName . "' style='width:190px;'/></td><td><a href='javascript:updateReportDisplayName();'>update</a>";
?>
</td>
</tr>
<tr>
<td colspan='2'><p><a href='#' onclick='window.parent.tb_remove(); return false'>close</a></td>
</tr>
</table>
</div>
<script type="text/javascript">
//attach enter key event to new input and call add data when hit
$('#reportDisplayName').keyup(function(e) {
if(e.keyCode == 13) {
updateReportDisplayName();
}
});
</script>
<?php
break;
case 'getPlatformNoteForm':
if (isset($_GET['platformNoteID'])) $platformNoteID = $_GET['platformNoteID']; else $platformNoteID = '';
if (isset($_GET['platformID'])) $platformID = $_GET['platformID'];
if ($platformNoteID) $addUpdate = 'Update'; else $addUpdate = 'Add';
if ($platformNoteID){
$platformNote = new PlatformNote(new NamedArguments(array('primaryKey' => $platformNoteID)));
$platformID = $platformNote->platformID;
if ($platformNote->counterCompliantInd == '1'){
$counterCompliant = 'checked';
$notCounterCompliant = '';
}elseif ($platformNote->counterCompliantInd == '0'){
$notCounterCompliant = 'checked';
$counterCompliant = '';
}else{
$notCounterCompliant = '';
$counterCompliant = '';
}
if (($platformNote->endYear == '0') || ($platformNote->endYear =='')) $endYear = ''; else $endYear = $platformNote->endYear;
$startYear = $platformNote->startYear;
$noteText = $platformNote->noteText;
}else{
$platformNote = new PlatformNote();
$notCounterCompliant = '';
$counterCompliant = '';
$startYear = '';
$endYear = '';
$noteText = '';
}
?>
<div id='div_updateForm'>
<input type='hidden' id='editPlatformNoteID' name='editPlatformNoteID' value='<?php echo $platformNoteID; ?>'>
<input type='hidden' id='platformID' name='platformID' value='<?php echo $platformID; ?>'>
<table class="thickboxTable" style="width:400px;padding:2px;">
<tr>
<td colspan='2'><span class='headerText'><?php echo $addUpdate; ?> Interface Notes</span><span id='span_errors' style='color:red;'><br /></span><br /></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='startYear'><b>Start Year:</b></label></td>
<td><input type='text' id='startYear' name='startYear' value="<?php echo $platformNote->startYear; ?>" style='width:90px;' /><span id='span_error_startYear' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='endYear'><b>End Year:</b></label></td>
<td><input type='text' id='endYear' name='endYear' value="<?php echo $endYear; ?>" style='width:90px;' /><span id='span_error_endYear' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='counterCompliantInd'><b>Counter Compliant?</b></label></td>
<td>
<input type='radio' id='counterCompliantInd' name='counterCompliantInd' value='1' <?php echo $counterCompliant; ?> /> Yes
<input type='radio' id='counterCompliantInd' name='counterCompliantInd' value='0' <?php echo $notCounterCompliant; ?> /> No
</td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='noteText'><b>Interface Notes:</b></label></td>
<td><textarea cols='36' rows='4' id='noteText' name='noteText' style='width:250px;'><?php echo $noteText; ?></textarea></td>
</tr>
<tr style="vertical-align:middle;">
<td style="padding-top:8px;text-align:right;"> </td>
<td style="padding-top:8px;padding-right:8px;">
<table class='noBorderTable' style='width:100%;'>
<tr>
<td style='text-align:left'><input type='button' value='submit' name='submitPlatformNoteForm' id ='submitPlatformNoteForm'></td>
<td style='text-align:right'><input type='button' value='cancel' onclick="tb_remove()"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script type="text/javascript" src="js/forms/platformNoteSubmitForm.js?random=<?php echo rand(); ?>"></script>
<?php
break;
case 'getPublisherNoteForm':
if (isset($_GET['publisherPlatformNoteID'])) $publisherPlatformNoteID = $_GET['publisherPlatformNoteID']; else $publisherPlatformNoteID = '';
if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID'];
if ($publisherPlatformNoteID){
$addUpdate = 'Update';
$publisherPlatformNote = new PublisherPlatformNote(new NamedArguments(array('primaryKey' => $publisherPlatformNoteID)));
$publisherPlatformID = $publisherPlatformNote->publisherPlatformID;
if (($publisherPlatformNote->endYear == '0') || ($publisherPlatformNote->endYear =='')) $endYear = ''; else $endYear = $publisherPlatformNote->endYear;
}else{
$addUpdate = 'Add';
$publisherPlatformNote = new PublisherPlatformNote();
}
?>
<div id='div_updateForm'>
<input type='hidden' id='editPublisherPlatformNoteID' name='editPublisherPlatformNoteID' value='<?php echo $publisherPlatformNoteID; ?>'>
<input type='hidden' id='publisherPlatformID' name='publisherPlatformID' value='<?php echo $publisherPlatformID; ?>'>
<table class="thickboxTable" style="width:310px;padding:2px;">
<tr>
<td colspan='2'><span class='headerText'><?php echo $addUpdate; ?> Publisher Notes</span><span id='span_errors' style='color:red;'><br /></span><br /></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='startYear'><b>Start Year:</b></label></td>
<td><input type='text' id='startYear' name='startYear' value="<?php echo $publisherPlatformNote->startYear; ?>" style='width:90px;' /><span id='span_error_startYear' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='endYear'><b>End Year:</b></label></td>
<td><input type='text' id='endYear' name='endYear' value="<?php echo $endYear; ?>" style='width:90px;' /><span id='span_error_endYear' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='noteText'><b>Publisher Notes:</b></label></td>
<td><textarea cols='36' rows='4' id='noteText' name='noteText' style='width:200px;'><?php echo $publisherPlatformNote->noteText; ?></textarea></td>
</tr>
<tr style="vertical-align:middle;">
<td style="padding-top:8px;text-align:right;"> </td>
<td style="padding-top:8px;padding-right:8px;">
<table class='noBorderTable' style='width:100%;'>
<tr>
<td style='text-align:left'><input type='button' value='submit' name='submitPublisherNoteForm' id ='submitPublisherNoteForm'></td>
<td style='text-align:right'><input type='button' value='cancel' onclick="tb_remove()"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script type="text/javascript" src="js/forms/publisherNoteSubmitForm.js?random=<?php echo rand(); ?>"></script>
<?php
break;
case 'getLoginForm':
if (isset($_GET['externalLoginID'])) $externalLoginID = $_GET['externalLoginID']; else $externalLoginID = '';
if (isset($_GET['platformID'])) $platformID = $_GET['platformID']; else $platformID = '';
if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID']; else $publisherPlatformID = '';
if ($externalLoginID){
$addUpdate = 'Update';
$externalLogin = new ExternalLogin(new NamedArguments(array('primaryKey' => $externalLoginID)));
$publisherPlatformID = $externalLogin->publisherPlatformID;
$platformID = $externalLogin->platformID;
}else{
$addUpdate = 'Add';
$externalLogin = new ExternalLogin();
}
?>
<div id='div_updateForm'>
<input type='hidden' id='editExternalLoginID' name='editExternalLoginID' value='<?php echo $externalLoginID; ?>'>
<input type='hidden' id='platformID' name='platformID' value='<?php echo $platformID; ?>'>
<input type='hidden' id='publisherPlatformID' name='publisherPlatformID' value='<?php echo $publisherPlatformID; ?>'>
<table class="thickboxTable" style="width:320px;padding:2px;">
<tr>
<td colspan='2'><span class='headerText'><?php echo $addUpdate; ?> Login</span><span id='span_errors' style='color:red;'><br /></span><br /></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='username'><b>Username:</b></label></td>
<td><input type='text' id='username' name='username' value="<?php if ($externalLoginID) echo $externalLogin->username; ?>" style='width:200px;' /><span id='span_error_loginID' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='password'><b>Password:</b></label></td>
<td><input type='text' id='password' name='password' value="<?php if ($externalLoginID) echo $externalLogin->password; ?>" style='width:200px;' /><span id='span_error_password' style='color:red'></span></td> </tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='loginURL'><b>URL:</b></label></td>
<td><input type='text' id='loginURL' name='loginURL' value="<?php if ($externalLoginID) echo $externalLogin->loginURL; ?>" style='width:200px;' /><span id='span_error_url' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='noteText'><b>Login Notes:</b></label></td>
<td><textarea cols='36' rows='4' id='noteText' name='noteText' style='width:200px;'><?php if ($externalLoginID) echo $externalLogin->noteText; ?></textarea></td>
</tr>
<tr style="vertical-align:middle;">
<td style="padding-top:8px;text-align:right;"> </td>
<td style="padding-top:8px;padding-right:8px;">
<table class='noBorderTable' style='width:100%;'>
<tr>
<td style='text-align:left'><input type='button' value='submit' name='submitExternalLoginForm' id ='submitExternalLoginForm'></td>
<td style='text-align:right'><input type='button' value='cancel' onclick="tb_remove()"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script type="text/javascript" src="js/forms/externalLoginSubmitForm.js?random=<?php echo rand(); ?>"></script>
<?php
break;
//sushi service information
case 'getSushiForm':
$sushiServiceID = $_GET['sushiServiceID'];
$platformID = $_GET['platformID'];
if ($sushiServiceID){
$addUpdate = 'Update';
$sushiService = new SushiService(new NamedArguments(array('primaryKey' => $sushiServiceID)));
}else{
$addUpdate = 'Add';
$sushiService = new SushiService();
}
?>
<div id='div_updateForm'>
<input type='hidden' id='editSushiServiceID' name='editSushiServiceID' value='<?php echo $sushiServiceID; ?>'>
<input type='hidden' id='platformID' name='platformID' value='<?php echo $platformID; ?>'>
<table class="thickboxTable" style="width:500px;padding:2px;">
<tr>
<td colspan='2'><span class='headerText'><?php echo $addUpdate; ?> SUSHI Connection</span><span id='span_errors' style='color:red;'><br /></span><br /></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='serviceURL'><b>Service/Endpoint URL:</b></label></td>
<td><input type='text' id='serviceURL' name='serviceURL' value="<?php if ($sushiServiceID) echo $sushiService->serviceURL; ?>" style='width:330px;' />
<br /><span class="smallDarkRedText"> - if using COUNTER's WSDL</span>
<span id='span_error_serviceURL' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='wsdlURL'><b> - or - WSDL URL:</b></label></td>
<td><input type='text' id='wsdlURL' name='wsdlURL' value="<?php if ($sushiServiceID) echo $sushiService->wsdlURL; ?>" style='width:330px;' />
<br /><span class="smallDarkRedText"> - if not using COUNTER's WSDL</span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='reportLayouts'><b>Report Type(s):</b></label></td>
<td><input type='text' id='reportLayouts' name='reportLayouts' value="<?php if ($sushiServiceID) echo $sushiService->reportLayouts; ?>" style='width:150px;' />
<br /><span class="smallDarkRedText">separate report types with semi-colon, e.g. JR1;BR1</span>
<span id='span_error_reportLayouts' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='releaseNumber'><b>COUNTER Release:</b></label></td>
<td>
<select id='releaseNumber' name='releaseNumber' style='width:50px;'>
<option value='3' <?php if (!$sushiServiceID){ echo "selected"; } else if ($sushiService->releaseNumber == "3"){ echo "selected"; } ?>>3</option>
<option value='4' <?php if ($sushiService->releaseNumber == "4"){ echo "selected"; } ?>>4</option>
</select>
</td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='requestorID'><b>Requestor ID:</b></label></td>
<td><input type='text' id='requestorID' name='requestorID' value="<?php if ($sushiServiceID) echo $sushiService->requestorID; ?>" style='width:150px;' /></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='customerID'><b>Customer ID:</b></label></td>
<td><input type='text' id='customerID' name='customerID' value="<?php if ($sushiServiceID) echo $sushiService->customerID; ?>" style='width:150px;' /></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;width:135px;'><label for='security'><b>Security Type:</b></label></td>
<td><input type='text' id='security' name='security' value="<?php if ($sushiServiceID) echo $sushiService->security; ?>" style='width:150px;' />
<span class="smallDarkRedText">(optional)<br />can be: HTTP Basic, WSSE Authentication</span>
<span id='span_error_security' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='login'><b>Login:</b></label></td>
<td><input type='text' id='login' name='login' value="<?php if ($sushiServiceID) echo $sushiService->login; ?>" style='width:150px;' />
<span class="smallDarkRedText">(optional)<br /> - only needed for HTTP or WSSE Authentication</span>
<span id='span_error_login' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='password'><b>Password:</b></label></td>
<td><input type='text' id='password' name='password' value="<?php if ($sushiServiceID) echo $sushiService->password; ?>" style='width:150px;' />
<span class="smallDarkRedText">(optional)<br /> - only needed for HTTP or WSSE Authentication</span>
<span id='span_error_password' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='serviceDayOfMonth'><b>Service Day:</b></label></td>
<td><input type='text' id='serviceDayOfMonth' name='serviceDayOfMonth' value="<?php if ($sushiServiceID) echo $sushiService->serviceDayOfMonth; ?>" style='width:50px;' />
<span class="smallDarkRedText">(optional)<br /> - number indicating the day of month the service should run <br />(e.g. 27 will run 27th of every month)</span><span id='span_error_serviceDay' style='color:red'></span></td>
</tr>
<tr>
<td style='vertical-align:top;text-align:right;'><label for='noteText'><b>Sushi Notes:</b></label></td>
<td><textarea cols='46' rows='4' id='noteText' name='noteText' style='width:330px;'><?php if ($sushiServiceID) echo $sushiService->noteText; ?></textarea></td>
</tr>
<tr style="vertical-align:middle;">
<td style="padding-top:8px;text-align:right;"> </td>
<td style="padding-top:8px;padding-right:8px;">
<table class='noBorderTable' style='width:100%;'>
<tr>
<td style='text-align:left'><input type='button' value='submit' name='submitSushiForm' id ='submitSushiForm'></td>
<td style='text-align:right'><input type='button' value='cancel' onclick="tb_remove()"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script type="text/javascript" src="js/forms/sushiSubmitForm.js?random=<?php echo rand(); ?>"></script>
<?php
break;
//form to edit associated organizations
case 'getOrganizationForm':
$publisherPlatformID = $_GET['publisherPlatformID'];
$platformID = $_GET['platformID'];
if (isset($_GET['publisherPlatformID']) && ($_GET['publisherPlatformID'] != '')){
$obj = new PublisherPlatform(new NamedArguments(array('primaryKey' => $_GET['publisherPlatformID'])));
}else{
$obj = new Platform(new NamedArguments(array('primaryKey' => $_GET['platformID'])));
}
if ($obj->organizationID) $organizationName = $obj->getOrganizationName; else $organizationName = '';
?>
<div id='div_organizationsForm'>
<form id='organizationsForm'>
<input type='hidden' id='publisherPlatformID' name='publisherPlatformID' value='<?php echo $publisherPlatformID; ?>'>
<input type='hidden' id='platformID' name='platformID' value='<?php echo $platformID; ?>'>
<table class="thickboxTable" style="width:260px;">
<tr>
<td colspan='2'><span class='headerText'>Link Associated Organization</span><br /><br /></td>
</tr>
<tr>
<td colspan='2'><label for="organizationID" class="formText">Organization:</label> <span id='span_error_organizationName' class='errorText'></span><br />
<input type='textbox' id='organizationName' name='organizationName' value="<?php echo $organizationName; ?>" style='width:232px;' />
<input type='hidden' id='organizationID' name='organizationID' value='<?php echo $obj->organizationID; ?>'>
<span id='span_error_organizationNameResult' class='errorText'></span>
<br />
</td>
</tr>
<tr style="vertical-align:middle;">
<td style="padding-top:8px;"><input type='button' value='submit' name='submitOrganization' id ='submitOrganization'></td>
<td style="padding-top:8px;padding-right:8px;text-align:right;"><input type='button' value='cancel' onclick="tb_remove()"></td>
</tr>
</table>
<script type="text/javascript" src="js/forms/organizationForm.js?random=<?php echo rand(); ?>"></script>
</form>
</div>
<?php
break;
case 'getMonthlyOutlierForm':
if (isset($_GET['platformID'])) $platformID = $_GET['platformID']; else $platformID = '';
if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID'];
$archiveInd = $_GET['archiveInd'];
$year = $_GET['year'];
$month = $_GET['month'];
$statsArray = array();
if ($publisherPlatformID) {
$publisherPlatform = new PublisherPlatform(new NamedArguments(array('primaryKey' => $publisherPlatformID)));
$publisher = new Publisher(new NamedArguments(array('primaryKey' => $publisherPlatform->publisherID)));
$platform = new Platform(new NamedArguments(array('primaryKey' => $publisherPlatform->platformID)));
$nameDisplay = $publisher->name . " / " . $platform->name;
$statsArray = $publisherPlatform->getMonthlyOutliers($archiveInd, $year, $month);
}else{
$platform = new Platform(new NamedArguments(array('primaryKey' => $platformID)));
$nameDisplay = $platform->name;
$statsArray = $platform->getMonthlyOutliers($archiveInd, $year, $month);
}
$totalRows = count($statsArray);
?>
<div id='div_outlierForm'>
<table class="thickboxTable" style="background-image:url('images/tbtitle.gif');width:410px;">
<tr>
<td><span class='headerText'><?php echo $nameDisplay; ?></span><br /></td>
</tr>
<tr>
<table class='dataTable' style='width:408px;margin-left:2px;'>
<?php
if ($totalRows == 0){
echo "<tr><td>None currently</td></tr>";
}else{
foreach($statsArray as $monthlyStat){
echo "<tr>";
echo "<td style='width:170px;'>" . $monthlyStat['Title']. "<span id='span_error_overrideUsageCount_" . $monthlyStat['monthlyUsageSummaryID'] . "' style='color:red;'></span></td>";
echo "<td style='width:50px;text-align:center;background-color:" . $monthlyStat['color'] . "'>" . $monthlyStat['usageCount'] . "</td>";
echo "<td style='width:55px;'><input type='text' name = 'overrideUsageCount_" . $monthlyStat['monthlyUsageSummaryID'] . "' id = 'overrideUsageCount_" . $monthlyStat['monthlyUsageSummaryID'] . "' value='" . $monthlyStat['overrideUsageCount'] . "' style='width:50px'></td>";
echo "<td style='width:80px;'><a href=\"javascript:updateOverride('" . $monthlyStat['monthlyUsageSummaryID'] . "');\" style='font-size:100%;'>update override</a><br /><a href=\"javascript:ignoreOutlier('" . $monthlyStat['monthlyUsageSummaryID'] . "');\" style='font-size:100%;'>ignore outlier</a></td>";
echo "</tr>";
}
}
?>
</table>
</tr>
<tr><td style='text-align:center;width:100%;'><br /><br /><a href='#' onclick='window.parent.updateFullStatsDetails(); window.parent.tb_remove(); return false'>Close</a></td></tr>
</table>
<input type="hidden" id='platformID' name='platformID' value='<?php echo $platformID; ?>'>
<input type="hidden" id='publisherPlatformID' name='publisherPlatformID' value='<?php echo $publisherPlatformID; ?>'>
<input type="hidden" id='archiveInd' name='archiveInd' value='<?php echo $archiveInd; ?>'>
<input type="hidden" id='year' name='year' value='<?php echo $year; ?>'>
<input type="hidden" id='month' name='month' value='<?php echo $month; ?>'>
<script type="text/javascript" src="js/forms/outlierSubmitForm.js?random=<?php echo rand(); ?>"></script>
</div>
<?php
break;
case 'getYearlyOverrideForm':
if (isset($_GET['platformID'])) $platformID = $_GET['platformID']; else $platformID = '';
if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID'];
$archiveInd = $_GET['archiveInd'];
$year = $_GET['year'];
$statsArray = array();
if ($publisherPlatformID) {
$publisherPlatform = new PublisherPlatform(new NamedArguments(array('primaryKey' => $publisherPlatformID)));
$publisher = new Publisher(new NamedArguments(array('primaryKey' => $publisherPlatform->publisherID)));
$platform = new Platform(new NamedArguments(array('primaryKey' => $publisherPlatform->platformID)));
$nameDisplay = $publisher->name . " / " . $platform->name;
$statsArray = $publisherPlatform->getYearlyOverrides($archiveInd, $year);
}else{
$platform = new Platform(new NamedArguments(array('primaryKey' => $platformID)));
$nameDisplay = $platform->name;
$statsArray = $platform->getYearlyOverrides($archiveInd, $year);
}
$totalRows = count($statsArray);
?>
<div id='div_overrideForm'>
<table class="thickboxTable" style="background-image:url('images/tbtitle.gif');width:410px;">
<tr>
<td><span class='headerText'><?php echo $nameDisplay; ?></span><br />(showing only titles for which there were outliers during the year) </td>
</tr>
<tr>
<table class='dataTable' style='width:408px;margin-left:2px;'>
<?php
if ($totalRows == 0){
echo "<tr><td>None currently</td></tr>";
}else{
foreach($statsArray as $yearlyStat){
?>
<tr>
<td width="149" class='alt'><?php echo $yearlyStat['Title']; ?></td>
<td width="40" class='alt'>Total</td>
<td width="40" class='alt'><?php echo $yearlyStat['totalCount']; ?></td>
<td width="40" class='alt'><input name="overrideTotalCount_<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>" id="overrideTotalCount_<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>" type="text"value="<?php echo $yearlyStat['overrideTotalCount']; ?>" size="6" maxlength="6"/></td>
<td width="40" class='alt'><a href="javascript:updateYTDOverride('<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>', 'overrideTotalCount')">update</a></td>
</tr>
<tr>
<td width="149"><span id="span_error_<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>_response" style='color:red;'></span></td>
<td width="40">PDF</td>
<td width="40"><?php echo $yearlyStat['ytdPDFCount']; ?></td>
<td width="40"><input name="overridePDFCount_<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>" id="overridePDFCount_<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>" type="text"value="<?php echo $yearlyStat['overridePDFCount']; ?>" size="6" maxlength="6"/></td>
<td width="40"><a href="javascript:updateYTDOverride('<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>', 'overridePDFCount')">update</a></td>
</tr>
<tr>
<td width="149"> </td>
<td width="40">HTML</td>
<td width="40"><?php echo $yearlyStat['ytdHTMLCount']; ?></td>
<td width="40"><input name="overrideHTMLCount_<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>" id="overrideHTMLCount_<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>" type="text"value="<?php echo $yearlyStat['overrideHTMLCount']; ?>" size="6" maxlength="6"/></td>
<td width="40"><a href="javascript:updateYTDOverride('<?php echo $yearlyStat['yearlyUsageSummaryID']; ?>', 'overrideHTMLCount')">update</a></td>
</tr>
<?php
}
}
?>
</table>
</tr>
<tr><td style='text-align:center;width:100%;'><br /><br /><a href='#' onclick='window.parent.tb_remove(); return false'>Close</a></td></tr>
</table>
<input type="hidden" id='platformID' name='platformID' value='<?php echo $platformID; ?>'>
<input type="hidden" id='publisherPlatformID' name='publisherPlatformID' value='<?php echo $publisherPlatformID; ?>'>
<input type="hidden" id='archiveInd' name='archiveInd' value='<?php echo $archiveInd; ?>'>
<input type="hidden" id='year' name='year' value='<?php echo $year; ?>'>
<script type="text/javascript" src="js/forms/overrideSubmitForm.js?random=<?php echo rand(); ?>"></script>
</div>
<?php
break;
//Add Platforms for sushi
case 'getAddPlatformForm':
?>
<div id='div_addPlatformForm'>
<table class="thickboxTable" style="width:300px;padding:2px;">
<tr><td colspan='2'><span class='headerText'>Add New Platform for SUSHI Connection</span><br /><br /></td></tr>
<tr><td style='vertical-align:top;text-align:right;'><label for='platformName'><b>Platform Name</b></label></td><td><input type='text' id='platformName' name='platformName' value="" style='width:200px;' /><span id='span_error_Platform' style='color:red'></span></td></tr>
<tr style="vertical-align:middle;">
<td style="padding-top:8px;text-align:right;"> </td>
<td style="padding-top:8px;padding-right:8px;">
<table class='noBorderTable' style='width:100%;'>
<tr>
<td style='text-align:left'><input type='button' value='submit' name='submitPlatformForm' id ='submitPlatformForm'></td>
<td style='text-align:right'><input type='button' value='cancel' onclick="tb_remove()"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script type="text/javascript" src="js/forms/platformSubmitForm.js?random=<?php echo rand(); ?>"></script>
<?php
break;
//Add Identifiers
case 'getAddIdentifierForm':
if (isset($_GET['platformID'])) $platformID = $_GET['platformID']; else $platformID = '';
if (isset($_GET['publisherPlatformID'])) $publisherPlatformID = $_GET['publisherPlatformID'];
if (isset($_GET['titleID'])) $titleID = $_GET['titleID'];
?>
<div id='div_addIdentifierForm'>
<table class="thickboxTable" style="width:200px;padding:2px;">
<tr><td colspan='2'><span class='headerText'>Add Identifier</span><br /><br /></td></tr>
<tr><td style='vertical-align:top;text-align:right;'><label for='identifierType'><b>Identifier Type</b></label></td>
<td>
<select id='identifierType' name='identifierType' style='width:90px;'>
<option value='ISSN'>ISSN</option>
<option value='eISSN'>eISSN</option>
<option value='ISBN'>ISBN</option>
<option value='eISBN'>eISBN</option>
<option value='doi'>DOI</option>
<option value='pi'>Proprietary ID</option>
</select>
</td>
</tr>
<tr><td style='vertical-align:top;text-align:right;'><label for='identifier'><b>Identifier</b></label></td><td><input type='text' id='identifier' name='identifier' value="" style='width:90px;' /><span id='span_error_Identifier' style='color:red'></span></td></tr>
<tr style="vertical-align:middle;">
<td style="padding-top:8px;text-align:right;"> </td>
<td style="padding-top:8px;padding-right:8px;">
<table class='noBorderTable' style='width:100%;'>
<tr>
<td style='text-align:left'><input type='button' value='submit' name='submitIdentifierForm' id ='submitIdentifierForm'></td>
<td style='text-align:right'><input type='button' value='cancel' onclick="tb_remove()"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<input type="hidden" id='titleID' name='titleID' value='<?php echo $titleID; ?>'>
<input type="hidden" id='platformID' name='platformID' value='<?php echo $platformID; ?>'>
<input type="hidden" id='publisherPlatformID' name='publisherPlatformID' value='<?php echo $publisherPlatformID; ?>'>
<script type="text/javascript" src="js/forms/identifierSubmitForm.js?random=<?php echo rand(); ?>"></script>
<?php
break;
//Related Titles (this form is display only)
case 'getRelatedTitlesForm':
if (isset($_GET['titleID'])) $titleID = $_GET['titleID'];
$title = new Title(new NamedArguments(array('primaryKey' => $titleID)));
?>
<div id='div_relatedTitles'>
<table class="thickboxTable" style="width:250px;padding:2px;">
<tr><td><span class='headerText'>Associated Titles and Identifiers</span><br /></td></tr>
<tr>
<td>
<table border="0" style="width:246px">
<?php
$relatedTitle = new Title();
foreach($title->getRelatedTitles as $relatedTitle) {
echo "<tr>";
echo "<td colspan = '2' style='width:250px'><b>" . $relatedTitle->title . "</b></td>";
echo "</tr>";
foreach($relatedTitle->getIdentifiers as $relatedTitleIdentifier) {
$displayIdentifier = substr($relatedTitleIdentifier->identifier,0,4) . "-" . substr($relatedTitleIdentifier->identifier,4,4);
echo "<tr>";
echo "<td style='width:40px'>" . $relatedTitleIdentifier->identifierType . "</td>";
echo "<td style='width:210px'>" . $displayIdentifier . "</td>";
echo "</tr>";
}
}
?>
</table>
</td>
</tr>
<tr>
<td style='text-align:center;width:100%;'><br /><br /><a href='#' onclick='window.parent.tb_remove(); return false'>Close</a>
</td>
</tr>
</table>
</div>
<?php
break;
//user form on the admin tab needs its own form since there are other attributes
case 'getAdminUserUpdateForm':
if (isset($_GET['loginID'])) $loginID = $_GET['loginID']; else $loginID = '';
if ($loginID != ''){
$update='Update';
$updateUser = new User(new NamedArguments(array('primaryKey' => $loginID)));
}else{
$update='Add New';
}
?>
<div id='div_updateForm'>
<table class="thickboxTable" style="width:245px;padding:2px;">
<tr><td colspan='3'><span class='headerText'><?php echo $update; ?> User</span><br /><br /></td></tr>
<tr><td colspan='2' style='width:135px;'><label for='loginID'><b>Login ID</b></label></td><td><input type='text' id='loginID' name='loginID' value='<?php echo $loginID; ?>' style='width:140px;' /></td></tr>
<tr><td colspan='2'><label for='firstName'><b>First Name</b></label></td><td><input type='text' id='firstName' name='firstName' value="<?php if (isset($updateUser)) echo $updateUser->firstName; ?>" style='width:140px;' /></td></tr>
<tr><td colspan='2'><label for='lastName'><b>Last Name</b></label></td><td><input type='text' id='lastName' name='lastName' value="<?php if (isset($updateUser)) echo $updateUser->lastName; ?>" style='width:140px;' /></td></tr>
<tr><td><label for='privilegeID'><b>Privilege</b></label></td>
<td>
<fieldset id="foottip">
<a href="#footnote_priv"><img src='images/help.gif'></a>
<div id="footnote_priv" style='display:none;'>Add/Edit users have access to everything<br />except the Admin tab and admin users<br />have access to everything</div>
</fieldset>
</td>
<td>