forked from ScriptureEarth/ScriptureEarth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScripture_Edit.php
More file actions
4526 lines (4436 loc) · 236 KB
/
Scripture_Edit.php
File metadata and controls
4526 lines (4436 loc) · 236 KB
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
// Change PHP.ini from max_input_vars = 1000 to max_input_vars = 3000 because POST has to be set for 3000!
/*************************************************************************************************************************************
*
* CAREFUL when your making any additions! Any "onclick", "change", etc. that occurs on "input", "a", "div", etc.
* should be placed in "_js/CMS_events.js". Also, in "_js/CMS_events.js" any errors in previous statements will
* not works in any of the satesments then on. It can also help in the Firefox browser (version 79.0+) run
* "Scripture_Edit.php", menu "Tools", "Web developement", and "Toggle Tools". Then menu "Debugger". In the left
* side of the windows click on "Scripture Edit", Localhost", "_js", and "CMS_events.js". Look down the js file
* and find out if there are errors using the "underline" indicator and fix them if there are any. You can also
* use "Scripture_Edit.php" just to make sure that the document.getElementById('...') name is corrent.
* But, BE CAREFUL!
*
**************************************************************************************************************************************/
include './include/session.php';
global $session;
/* Login attempt */
$retval = $session->checklogin();
if (!$retval) {
echo "<br /><div style='text-align: center; font-size: 16pt; font-weight: bold; padding: 10px; color: navy; background-color: #dddddd; '>You are not logged in!</div>";
/* Link back to the main page */
header('Location: login.php');
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="ObjectType" content="Document" />
<meta http-equiv="Window-target" content="_top" />
<meta name="Created-by" content="Scott Starker" />
<title>Scripture Edit</title>
<link type="text/css" rel="stylesheet" href="_css/Scripture_Edit.css" />
<script type="text/javascript" language="javascript" src="_js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" language="JavaScript" src="_js/AddorChange.js?v=1.1.9"></script>
<!-- see the bottom of this PHP file for CMS_events.js -->
</head>
<body>
<?php
function check_input($value) {
return str_replace("'", "ꞌ", trim($value)); // for input tag (single quote "'" to glottal stop "ꞌ")
}
function OT_Test($PDF, $OT_Index) {
global $OT_array;
$a_index = 0;
foreach ($OT_array[$OT_Index] as $a) {
if ($PDF == $a_index) return true;
$a_index++;
}
return false;
}
function NT_Test($PDF, $NT_Index) {
global $NT_array;
$a_index = 0;
foreach ($NT_array[$NT_Index] as $a) {
if ($PDF == $a_index) return true;
$a_index++;
}
return false;
}
// To tie the script together and prevent direct access to Edit_Lang_Validation.php and SumbitEditConfirm.php.
define('RIGHT_ON', true);
// To hold error messages
$messages = [];
// Default input values (later, sanitized $_POST inputs)
$inputs = ['iso' => ''];
$inputs = ['rod' => ''];
$inputs = ['var' => ''];
include './OT_Books.php';
include './NT_Books.php';
include './include/conn.inc.php';
$db = get_my_db();
// Checks that the form was submitted after Scripture_Edit.php submitted.
if (isset($_POST['btnSubmit'])) {
// Runs the validation script which only returns to the form page if validation fails.
require_once './Edit_Lang_Validation.php';
// Returns from Edit_Lang_Validation.php if the validation failed.
}
$GetName = 'all';
$which = 'Name';
$st = 'en';
$MajorLanguage = "LN_English";
$SpecificCountry = "countries.English";
$Scriptname = basename($_SERVER["SCRIPT_NAME"]);
$counterName = "English";
$MajorCountryAbbr = "en";
echo "<div class='content' style='background-color: white; padding: 20px; width: 1020px; height: 100px; margin-left: auto; margin-right: auto; vertical-align: middle; border-radius: 15px; -moz-border-radius: 15px; -webkit-box-shadow: 15px; '>";
echo "<img style='margin-left: 40px; ' src='images/guyReading.png' /><div style='text-align: center; margin-top: -60px; margin-left: 180px; font-size: 18pt; font-weight: bold; color: black; '>Edit the ScriptureEarth Database</div>";
echo "</div><br />";
echo "<div style='background-color: white; padding: 20px; width: 1020px; margin-left: auto; margin-right: auto; border-radius: 15px; -moz-border-radius: 15px; -webkit-box-shadow: 15px; '>";
echo "<a style='float: right; font-size: small; font-weight: normal; vertical-align: bottom; margin: 10px 10px 0px 0px; ' href='process.php'>[Logout]</a>";
echo "<a style='float: right; font-size: small; font-weight: normal; vertical-align: bottom; margin: 10px 10px 0px 0px; ' href='Scripture_Add.php'>[Scripture Add]</a>";
echo "<a style='float: right; font-size: small; font-weight: normal; vertical-align: bottom; margin: 10px 10px 0px 0px; ' href='Scripture_Edit.php'>[Scripture Edit]</a>";
/************************************************
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
if $_GET does NOT have idx
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
************************************************/
if (!isset($_GET["idx"])) {
?>
<br />
<label for='iso_idx'>ISO code or idx to edit: </label>
<input type="text" id="iso_idx" name="iso_idx" autofocus size='18' maxtlength='4' pattern="([a-z]{3}|0-9]{1,4})" placeholder="3 lowercase or number" title="ISO code or index number" value='' />
<input type="button" value="OK" id="iso_idx_goto" onClick="iso_idx()" />
<div id='iso_response'></div>
<?php
echo "<h2><span style='color: red; font-size: bold; '>Or</span> Choose the 'pencil' to edit</h2>";
$query = "SELECT DISTINCT * FROM nav_ln ORDER BY ISO, ROD_Code"; // get all of the navigational language names
$result = $db->query($query);
/**********************************************************************************************************************
select the default primary language name to be used by displaying the Countries and indigenous langauge names
**********************************************************************************************************************/
// languages
$db->query('DROP TABLE IF EXISTS LN_Temp'); // Get the names of all of the major languages or else get the default names
$db->query('CREATE TEMPORARY TABLE LN_Temp (iso VARCHAR(3) NOT NULL, rod VARCHAR(5) NOT NULL, idx INT NULL, LN VARCHAR(50) NOT NULL) ENGINE = MEMORY CHARSET = utf8') or die ('Query failed: ' . $db->error . '</body></html>');
$stmt = $db->prepare("INSERT INTO LN_Temp (iso, rod, idx, LN) VALUES (?, ?, ?, ?)");
while($row = $result->fetch_assoc()) {
$iso = $row['ISO']; // ISO
$rod = $row['ROD_Code']; // ROD_Code
$var = $row['Variant_Code']; // Variant_Code
$idx = $row['ISO_ROD_index']; // ISO_ROD_index
$ISO_ROD_index = (string)$idx; // make sure that 00-DBLanguageCountryName.inc.php will work correctly
include './include/00-DBLanguageCountryName.inc.php';
$stmt->bind_param("ssis", $iso, $rod, $idx, $LN); // bind parameters for markers
$stmt->execute(); // execute query
}
$stmt->close();
// Letters
?>
<div id='Letters'>
<table class='languageNames'>
<tr valign='middle'>
<td width='90%'>
<?php
$Letter = "";
$number = 2;
$BegLetters=str_replace(' ', ' ', 'Select the beginning of the Language Name:') . ' ';
$query = 'SELECT DISTINCT UPPER(LEFT(LN, 1)) AS Beg FROM LN_Temp ORDER BY LN';
$resultLetter = $db->query($query);
while ($row = $resultLetter->fetch_assoc()) {
$BegLetter = $row['Beg'];
if (!isset($_GET["Beg"]) || $_GET["Beg"] == "" || $_GET["Beg"] == $BegLetter) {
$BegLetters=$BegLetters . "<a style='text-decoration: underline; color: red; ' href='#' onclick='Switch(" . $number . ", \"" . $BegLetter . "\")'>" . $BegLetter . "</a> ";
$Letter = $BegLetter;
$_GET['Beg'] = $BegLetter;
}
else
$BegLetters=$BegLetters . "<a style='text-decoration: underline; ' href='#' onclick='Switch(" . $number . ", \"" . $BegLetter . "\")'>" . $BegLetter . "</a> ";
}
if ($_GET["Beg"] == 'all')
$BegLetters=$BegLetters . "[<a style='text-decoration: underline; color: red; ' href='#' onclick='Switch(" . $number . ", \"all\")'>All</a>]";
else
$BegLetters=$BegLetters . "[<a style='text-decoration: underline; ' href='#' onclick='Switch(" . $number . ", \"all\")'>" . "All" . "</a>]";
echo "<div id='BeginningLetters' style='margin-top: 10px; margin-bottom: 10px; font-weight: bold; '>$BegLetters</div>";
?>
</td>
<td width='10%'>
</td>
</tr>
</table>
</div>
<?php
$resultLetter->free();
// switch
// language name and ISO code here
// The width and padding-left are what changes the spaces around the words.
// When doing a Switch() Netscape 9 drops the table down a 1/2 inch. I don't know why.
?>
<table class='languageNames' style='width: 1020px; margin: 0px; padding: 0px; '>
<tr id='languageName'>
<?php
echo "<th width='6%' class='secondHeader'>Edit:</th>";
echo "<th width='32%' class='secondHeaderSelection'>Language Name: <img src='images/downTriangle.png' /></th>";
echo "<th width='34%' class='secondHeader'>Alternate Language Names:</th>";
echo "<th width='20%' class='secondHeader'><a id='one' title='Click to sort' href='#' onclick='Switch(1, \"$Letter\")'>ISO ROD Code<br />Variant Code:</a></th>";
echo "<th width='8%' class='secondHeader'>Country:</th>";
?>
</tr>
<tr id='languageCode'>
<?php
echo "<th width='6%' class='secondHeader'>Edit:</th>";
echo "<th width='28%' class='secondHeader'><a id='two' title='Click to sort.' href='#' onclick='Switch(2, \"$Letter\")'>Language Name:</a></th>";
echo "<th width='31%' class='secondHeader'>Alternate Language Names:</th>";
echo "<th width='15%' class='secondHeaderSelection'>ISO ROD Code<br />Variant Code: <img src='images/downTriangle.png' /></th>";
echo "<th width='20%' class='secondHeader'>Country:</th>";
?>
</tr>
</table>
<div id="wait" style="display:none; position:absolute; top:45%; left:50%; padding:2px; "><img src="images/wait.gif" width="64" height="64" /></div>
<?php
// order by language name or ISO code
if ($which == 'Name') {
if ($Letter != '')
$query="SELECT DISTINCT LN_Temp.LN, scripture_main.* FROM LN_Temp, scripture_main WHERE scripture_main.ISO_ROD_index = LN_Temp.idx AND LN_Temp.LN LIKE '$Letter%' ORDER BY LN_Temp.LN";
else
$query="SELECT DISTINCT LN_Temp.LN, scripture_main.* FROM LN_Temp, scripture_main WHERE scripture_main.ISO_ROD_index = LN_Temp.idx ORDER BY LN_Temp.LN";
}
else { // $which == 'Code'
$query="SELECT DISTINCT LN_Temp.LN, scripture_main.* FROM LN_Temp, scripture_main WHERE scripture_main.ISO_ROD_index = LN_Temp.idx ORDER BY LN_Temp.iso, LN_Temp.rod";
}
$result = $db->query($query);
$num=$result->num_rows;
echo "<div id='NamesLang' class='callR'>";
/**********************************************************************************************************************
display the langauge names for this country
***********************************************************************************************************************/
echo "<div id='CT'>";
echo "<table id='CountryTable'>";
$query='SELECT alt_lang_name FROM alt_lang_names WHERE ISO_ROD_index = ?'; // alt_lang_names
$stmt_alt=$db->prepare($query); // create a prepared statement
$query = 'SELECT Variant_Eng FROM Variants WHERE Variant_Code = ?';
$stmt_Var=$db->prepare($query); // create a prepared statement
$query='SELECT countries.English FROM ISO_countries, countries WHERE ISO_countries.ISO_ROD_index = ? AND ISO_countries.ISO_countries = countries.ISO_Country ORDER BY countries.English';
$stmt_ISO_countries=$db->prepare($query); // create a prepared statement
$i=0;
while ($r = $result->fetch_assoc()) {
if ($i % 2)
$color = "f8fafa";
else
$color = "EEF1F2";
$iso = $r['ISO'];
$rod = $r['ROD_Code'];
$var = $r['Variant_Code']; // Variant_Code to the language name
$idx = $r['ISO_ROD_index'];
$LN = $r['LN'];
// Cross Site Scripting (XSS) attack happens where client side code (usually JavaScript) gets injected into the output of your PHP script. The next line cleans it up.
$LN = htmlspecialchars($LN, ENT_QUOTES, 'UTF-8');
echo "<tr valign='middle' style='color: black; background-color: #$color; margin: 0px; padding: 0px; '>";
echo "<td width='6%' style='cursor: pointer; ' onclick='parent.location=\"Scripture_Edit.php?idx=$idx\"'><img style='margin-bottom: 3px; margin-left: 13px; cursor: hand; ' src='images/pencil_edit.png' /></td>";
echo "<td width='28%' style='background-color: #$color; margin: 0px; padding: 3px 5px 3px 5px; border-width: thin; border-style: none; border-color: #$color; '>$LN</td>";
$stmt_alt->bind_param("i", $idx); // bind parameters for markers //
$stmt_alt->execute(); // execute query
$result_alt = $stmt_alt->get_result(); // instead of bind_result (used for only 1 record):
$num_alt=$result_alt->num_rows;
if ($result_alt && $num_alt > 0) {
echo "<td width='31%' style='background-color: #$color; margin: 0px; padding: 3px 5px 3px 5px; border-width: thin; border-style: none; border-color: #$color; '>";
$i_alt=0;
while ($row_alt = $result_alt->fetch_assoc()) {
if ($i_alt != 0) { // 0 is the first one
echo ', ';
}
$alt_lang_name = $row_alt['alt_lang_name'];
// Cross Site Scripting (XSS) attack happens where client side code (usually JavaScript) gets injected into the output of your PHP script. The next line cleans it up.
$alt_lang_name = htmlspecialchars($alt_lang_name, ENT_QUOTES, 'UTF-8');
echo $alt_lang_name;
$i_alt++;
}
echo '</td>';
}
else
echo "<td width='31%'style='margin: 0px; padding: 3px 5px 3px 5px; border-width: thin; border-style: none; border-color: #$color; '> </td>";
$VD = '';
if (!is_null($var) && $var != '') {
$stmt_Var->bind_param("s", $var); // bind parameters for markers //
$stmt_Var->execute(); // execute query
$resultVar = $stmt_Var->get_result(); // instead of bind_result (used for only 1 record):
$numVar=$resultVar->num_rows;
if ($resultVar && $numVar > 0) {
$VD_Temp = $resultVar->fetch_assoc();
$VD = $VD_Temp['Variant_Eng'];
}
}
echo "<td width='15%' style='margin: 0px; padding: 3px 5px 3px 5px; border-width: thin; border-style: none; border-color: #$color; '>" . $iso . " " . $rod;
if ($VD != '') {
echo "<br /><span style='font-style: italic; font-size: 8pt; '>($VD)</span>";
}
echo '</td>';
$stmt_ISO_countries->bind_param("i", $idx); // bind parameters for markers
$stmt_ISO_countries->execute(); // execute query
$result_ISO_countries = $stmt_ISO_countries->get_result(); // instead of bind_result (used for only 1 record):
if ($result_ISO_countries && $result_ISO_countries->num_rows == 0) {
echo "<td width='20%' style='color: red; font-weight: bold; margin: 0px; padding: 3px 5px 3px 5px; border-width: thin; border-style: none; border-color: #$color; '>There is no idx $idx. Is ISO_countries up to date?</td>";
echo '</tr>';
$i++;
continue;
}
$temp_ISO_countries = $result_ISO_countries->fetch_assoc();
$Eng_country = str_replace("'", "'", $temp_ISO_countries['English']); // name of the country in the language version
while ($temp_ISO_countries = $result_ISO_countries->fetch_assoc()) {
if ($Eng_country != '') {
$Eng_country .= ', ';
}
$Eng_country .= str_replace("'", "'", $temp_ISO_countries['English']); // name of the country in the language version
}
$result_ISO_countries->free();
echo "<td width='20%'style='margin: 0px; padding: 3px 5px 3px 5px; border-width: thin; border-style: none; border-color: #$color; '>$Eng_country</td>";
echo '</tr>';
$i++;
}
$stmt_alt->close();
$stmt_Var->close();
$stmt_ISO_countries->close();
echo '</table>';
echo '</div>';
echo '</div>';
/* Explicitly destroy the table */
$db->query('DROP TABLE LN_Temp');
$result->free();
echo "<div id='count' style='margin: 40px; font-size: 14pt; color: navy; font-weight: bold; '>Total languages are $num</div>";
}
/************************************************
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
if $_GET does have idx
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
************************************************/
elseif (isset($_GET['idx'])) {
$idx = check_input($_GET['idx']);
if (!is_numeric($idx)) {
echo '<script type="text/javascript" language="javascript">
location.replace("process.php");
document.write ("Hacker!");
</script>';
}
if (count($messages) > 0) {
echo '<br />';
echo 'Please correct these errors:<br />';
// Displays a list of error messages
echo '<ul style="color: red; "><li>'.implode('</li><li>', $messages).'</li></ul>';
}
if (!isset($_SESSION['nav_ln_array'])) {
$_SESSION['nav_ln_array'] = [];
$ln_query = "SELECT `translation_code`, `name`, `nav_fileName`, `ln_number`, `language_code`, `ln_abbreviation` FROM `translations` ORDER BY `translation_code`";
$ln_result=$db->query($ln_query) or die ('Query failed: ' . $db->error . '</body></html>');
if ($ln_result->num_rows == 0) {
die ('<div style="background-color: white; color: red; font-size: 16pt; padding-top: 20px; padding-bottom: 20px; margin-top: 200px; ">' . translate('The translation_code is not found.', $st, 'sys') . '</div></body></html>');
}
while ($ln_row = $ln_result->fetch_array()){
$ln_temp[0] = $ln_row['translation_code'];
$ln_temp[1] = $ln_row['name'];
$ln_temp[2] = $ln_row['nav_fileName'];
$ln_temp[3] = $ln_row['ln_number'];
$ln_temp[4] = $ln_row['ln_abbreviation'];
$_SESSION['nav_ln_array'][$ln_row['language_code']] = $ln_temp;
}
}
$query="SELECT * FROM nav_ln WHERE ISO_ROD_index = $idx"; // boolean for navigational languagae names
$ln_result=$db->query($query) or die ('navigational language name is not found. ' . $db->error . '</body></html>');
$ln_row = $ln_result->fetch_assoc();
$def_LN = $ln_row['Def_LN']; // default langauge (a 2 digit number for the national langauge)
$nav_ln_row = $ln_row; // the whole row including ISO, etc.
foreach ($nav_ln_row as $code => $array) { // delete lines that don't begin with "LN_"
if (substr($code, 0, 3) != 'LN_') {
unset($nav_ln_row[$code]);
}
}
foreach ($_SESSION['nav_ln_array'] as $code => $array){ // build language name array to be used later
${"LN_".$array[1]} = $nav_ln_row['LN_'.$array[1]]; // boolean
${$array[1]."_lang_name"} = '';
if (${"LN_".$array[1]}) { // if = 1
$query="SELECT LN_".$array[1]." FROM LN_".$array[1]." WHERE ISO_ROD_index = $idx";
$result_LN=$db->query($query);
if ($result_LN->num_rows > 0) {
$temp_LN = $result_LN->fetch_assoc();
${$array[1]."_lang_name"} = $temp_LN['LN_'.$array[1]]; // build language name array from language table
// Cross Site Scripting (XSS) attack happens where client side code (usually JavaScript) gets injected into the output of your PHP script. The next line cleans it up.
${$array[1]."_lang_name"} = htmlspecialchars(${$array[1]."_lang_name"}, ENT_QUOTES, 'UTF-8');
}
}
}
$query="SELECT DISTINCT * FROM scripture_main WHERE ISO_ROD_index = $idx";
$result=$db->query($query) or die ('Query failed: ' . $db->error . '</body></html>');
if ($db->error) {
die ("'scripture_main' ISO_ROD_index is not found.<br />" . $db->error . '</body></html>');
}
$SM_row = $result->fetch_assoc();
$iso = $SM_row['ISO']; // ISO
$rod = $SM_row['ROD_Code']; // ROD_Code
$var = $SM_row['Variant_Code']; // Variant_Code to the language name
$AddNo = $SM_row['AddNo']; // boolean
$AddTheBibleIn = $SM_row['AddTheBibleIn']; // boolean
$AddTheScriptureIn = $SM_row['AddTheScriptureIn']; // boolean
$BibleIs = $SM_row['BibleIs']; // 1, 2 or 3
?>
<br />
<form name='myForm' action='Scripture_Edit.php?idx=<?php echo $idx; ?>' method='post'>
<div class='enter' style='color: navy; font-weight: bold; '>ISO ROD Code: <?php echo $iso . " " . $rod; ?> (idx: <?php echo $idx; ?>)
<?php
$VD = '';
if (!is_null($var) && $var != '') {
$query = "SELECT Variant_Eng FROM Variants WHERE Variant_Code = '$var'";
$resultVar=$db->query($query) or die ('Query failed: ' . $db->error . '</body></html>');
$numVar=$resultVar->num_rows;
if ($resultVar && $numVar > 0) {
$VD_Temp = $resultVar->fetch_assoc();
$VD = $VD_Temp['Variant_Eng'];
}
}
if ($VD != '') {
echo ' Variant_Code: <span style="font-style: italic; ">' . $VD . '</span>';
}
?>
</div>
<input type='hidden' name='idx' id='idx' value='<?php echo $idx; ?>' />
<input type='hidden' name='iso' id='iso' value='<?php echo $iso; ?>' />
<input type='hidden' name='rod' id='rod' value='<?php echo $rod; ?>' />
<input type='hidden' name='var' id='var' value='<?php echo $var; ?>' />
<input type='hidden' name='viewerer' id='viewerer' value='<?php
if (isset($_POST['viewerer'])) {
if ($_POST['viewerer'] == "on")
echo "on";
else
echo "off";
}
?>' />
<input type='hidden' name='rtler' id='rtler' value='<?php
if (isset($_POST['rtler'])) {
if ($_POST['rtler'] == "on")
echo "on";
else
echo "off";
}
?>' />
<input type='hidden' name='eBibleer' id='eBibleer' value='<?php
if (isset($_POST['eBibleer'])) {
if ($_POST['eBibleer'] == "on")
echo "on";
else
echo "off";
}
?>' />
<?php
/************************************************
Countries
*************************************************/
$Eng_country = '';
$query="SELECT countries.English, countries.ISO_Country FROM countries, ISO_countries WHERE ISO_countries.ISO_ROD_index = $idx AND ISO_countries.ISO_countries = countries.ISO_Country ORDER BY countries.English";
$result=$db->query($query);
$num=$result->num_rows;
if ($result && $num > 0) {
$temp_Country = $result->fetch_assoc();
$Eng_country = $temp_Country['English'];
$Eng_country=str_replace("'","'",$Eng_country); // for input tag (single quote to "'")
$ISO_Country = $temp_Country['ISO_Country']; // save it till almost through with this page of the script
}
?>
<br />
<div class='enter' style='font-weight: bold; '>COUNTRIES</div>
<table width="100%" cellpadding="0" cellspacing="0" name="tableEngCountries" id="tableEngCountries">
<tr>
<td width="53%">
<span style='font-size: 10pt; '>In English, enter the <span style='font-size: 12pt; font-weight: bold; '>COUNTRY(IES)</span> in which this Language is indigenous:</span>
</td>
<td width="30%">
<input type='text' name='Eng_country-1' id='Eng_country-1' autofocus style='color: navy; ' size='60' value="<?php if (isset($_POST['Eng_country-1'])) echo $_POST['Eng_country-1']; else echo $Eng_country; ?>" />
</td>
<td width="17%" style="text-align: right; ">
<input id="addRowTableCountry" style="font-size: 9pt; " type="button" value="Add" />
<input id="removeRowTableCountry" style="font-size: 9pt; " type="button" value="Remove" />
</td>
</tr>
<?php
$i = 2;
if (isset($_POST['Eng_country-'.(string)$i])) {
while (isset($_POST['Eng_country-'.(string)$i])) {
echo "<tr>";
echo "<td width='53%'>";
echo " ";
echo "</td>";
echo "<td width='30%'>";
// In HTML tags like "input" tags the "value" attributes text are not to have '. The PHP htmlentities function changes ' to ' (an HTML character) so it works.
echo "<input type='text' name='Eng_country-$i' id='Eng_country-$i' style='color: navy; ' size='60' value='" . htmlentities($_POST['Eng_country-'.(string)$i], ENT_QUOTES) . "' />";
echo "</td>";
echo "<td width='17%'>";
echo " ";
echo "</td>";
echo "</tr>";
$i++;
}
}
elseif ($num > 1) {
$y = $i - 1;
while ($y < $num) {
$temp_Country = $result->fetch_assoc();
${'Eng_country-$i'} = $temp_Country['English'];
echo "<tr>";
echo "<td width='53%'>";
echo " ";
echo "</td>";
echo "<td width='30%'>";
// In HTML tags like "input" tags the "value" attributes text are not to have '. The PHP htmlentities function changes ' to ' (an HTML character) so it works.
echo "<input type='text' name='Eng_country-$i' id='Eng_country-$i' style='color: navy; ' size='60' value='" . htmlentities(${'Eng_country-$i'}, ENT_QUOTES) . "' />";
echo "</td>";
echo "<td width='17%'>";
echo " ";
echo "</td>";
echo "</tr>";
$y++;
$i++;
}
$result->free();
}
else {
}
/************************************************
Navigational Language Names
*************************************************/
?>
</table>
<br /><br />
<?php
foreach ($_SESSION['nav_ln_array'] as $code => $array){
$html = "<div class='enter' style='font-size: 10pt; '>In <span style='font-size: 12pt; font-weight: bold; '>".strtoupper($array[1])."</span>, enter the Language Name: <input type='text' name='".$array[1]."_lang_name' id='".$array[1]."_lang_name' size='35' style='color: navy; font-weight: bold; ' value=\"switch\" /></div>";
if (isset($_POST[$array[1].'_lang_name'])){
$result = str_replace('switch', $_POST[$array[1].'_lang_name'], $html);
} else {
$result = str_replace('switch', ${$array[1].'_lang_name'}, $html);
}
echo $result;
}
/************************************************
Default Navigational Language Name
*************************************************/
?>
<br />
<p>Select the default major langauge <span style="font-size: 10pt; ">(i.e. the major language from above)</span>:
<select name="DefaultLang" id="DefaultLang">
<?php
if (isset($_POST['DefaultLang'])) {
foreach ($_SESSION['nav_ln_array'] as $code => $array){
$html = "<option value=\"".$array[1]."Lang\" switch >".$array[1]."</option>";
if ($_POST['DefaultLang'] == $array[1].'Lang'){
$result = str_replace('switch', " selected='yes'", $html);
} else {
$result = str_replace('switch', '', $html);
}
echo $result;
}
}
else {
foreach ($_SESSION['nav_ln_array'] as $code => $array){
$html = "<option value=\"".$array[1]."Lang\" switch >".$array[1]."</option>";
if ($def_LN == $array[3]){
$result = str_replace('switch', " selected='yes'", $html);
} else {
$result = str_replace('switch', '', $html);
}
echo $result;
}
}
?>
</select>
</p>
<br />
<?php
/************************************************
alternate language names
*************************************************/
$i=1;
$num = 0;
if (isset($_POST['txtAltNames-'.(string)$i])) {
}
else {
$query="SELECT alt_lang_name FROM alt_lang_names WHERE ISO_ROD_index = $idx";
$result1=$db->query($query);
$num=$result1->num_rows;
if ($result1 && $num > 0) {
$tempAlt = $result1->fetch_assoc();
${'txtAltNames-$i'} = $tempAlt['alt_lang_name'];
}
else
${'txtAltNames-$i'} = '';
}
?>
<table width="100%" cellpadding="0" cellspacing="0" name="tableAltNames" id="tableAltNames">
<tr>
<td width="53%" style="padding-left: 3px; ">
Enter the Alternate Language Name(s)<span style="font-size: 9pt; "><br />(only one Language Name per line)</span>:
</td>
<td width="26%" style="padding-left: 3px; ">
<input type='text' name='txtAltNames-1' id='txtAltNames-1' style='color: navy; ' size='50' onclick='ALNidx(1)' value="<?php if (isset($_POST['txtAltNames-1'])) echo $_POST['txtAltNames-1']; else echo ${'txtAltNames-$i'}; ?>" />
</td>
<td width="4%" style="text-align: right; ">
<div onclick="moveUpDownALN('tableAltNames', 'up')" style="cursor: pointer; "><img src="images/up.png" width="24" height="20" /></div>
<div onclick="moveUpDownALN('tableAltNames', 'down')" style="cursor: pointer; "><img src="images/down.png" width="24" height="18" /></div>
</td>
<td width="17%" style="text-align: right; ">
<input id="addRowTableAlt" style="font-size: 9pt; " type="button" value="Add" />
<input id="removeRowTableAlt" style="font-size: 9pt; " type="button" value="Remove" />
</td>
</tr>
<?php
$i = 2;
if (isset($_POST['txtAltNames-'.(string)$i])) {
while (isset($_POST['txtAltNames-'.(string)$i])) {
echo "<tr>";
echo "<td width='53%'>";
echo " ";
echo "</td>";
echo "<td width='26%'>";
echo "<input type='text' name='txtAltNames-$i' id='txtAltNames-$i' style='color: navy; ' size='50' onclick='ALNidx($i)' value='" . $_POST['txtAltNames-'.(string)$i] . "' />";
echo "</td>";
echo "<td width='21%' colspan='2'>";
echo " ";
echo "</td>";
echo "</tr>";
$i++;
}
}
elseif ($num > 1) {
$y = $i - 1;
while ($y < $num) {
$tempAlt = $result1->fetch_assoc();
${'txtAltNames-$i'} = stripslashes($tempAlt['alt_lang_name']);
echo "<tr>";
echo "<td width='53%'>";
echo " ";
echo "</td>";
echo "<td width='26%'>";
echo "<input type='text' name='txtAltNames-$i' id='txtAltNames-$i' style='color: navy; ' size='50' onclick='ALNidx($i)' value=\"" . ${'txtAltNames-$i'} . "\" />";
echo "</td>";
echo "<td width='21%' colspan='2'>";
echo " ";
echo "</td>";
echo "</tr>";
$y++;
$i++;
}
$result1->free();
}
else {
}
?>
</table>
<br /><br />
<?php
/************************************************
wording?
*************************************************/
if (isset($_POST['GroupAdd'])) {
?>
<input type='radio' name='GroupAdd' value='AddNo' checked <?php echo ($_POST['GroupAdd'] == 'AddNo' ? ' checked' : '') ?> /> No "The Bible In" or "The Scripture In".<br />
<input type='radio' name='GroupAdd' value='AddTheBibleIn' <?php echo ($_POST['GroupAdd'] == 'AddTheBibleIn' ? ' checked' : '') ?> /> "The Bible In" added to the specific name of the language on the top of the screen.<br />
<input type='radio' name='GroupAdd' value='AddTheScriptureIn' <?php echo ($_POST['GroupAdd'] == 'AddTheScriptureIn' ? ' checked' : '') ?> /> "The Scripture In" added to the specific name of the language on the top of the screen.<br /><br />
<?php
}
else {
if ($AddNo) {
?>
<input type='radio' name='GroupAdd' value='AddNo' checked /> No "The Bible In" or "The Scripture In".<br />
<input type='radio' name='GroupAdd' value='AddTheBibleIn' /> "The Bible In" added to the specific name of the language on the top of the screen.<br />
<input type='radio' name='GroupAdd' value='AddTheScriptureIn' /> "The Scripture In" added to the specific name of the language on the top of the screen.<br /><br />
<?php
}
if ($AddTheBibleIn) {
?>
<input type='radio' name='GroupAdd' value='AddNo' /> No "The Bible In" or "The Scripture In".<br />
<input type='radio' name='GroupAdd' value='AddTheBibleIn' checked /> "The Bible In" added to the specific name of the language on the top of the screen.<br />
<input type='radio' name='GroupAdd' value='AddTheScriptureIn' /> "The Scripture In" added to the specific name of the language on the top of the screen.<br /><br />
<?php
}
if ($AddTheScriptureIn) {
?>
<input type='radio' name='GroupAdd' value='AddNo' /> No "The Bible In" or "The Scripture In".<br />
<input type='radio' name='GroupAdd' value='AddTheBibleIn' /> "The Bible In" added to the specific name of the language on the top of the screen.<br />
<input type='radio' name='GroupAdd' value='AddTheScriptureIn' checked /> "The Scripture In" added to the specific name of the language on the top of the screen.<br /><br />
<?php
}
}
/************************************************
isop
*************************************************/
echo '<br />What is the isoP code for this minority language if it needs one (“<span style="color: navy; font-weight: bold; ">'.$iso.'</span>” plus 4 maximum capital letters or numbers)? ';
if (isset($_POST['isopText'])) {
?>
<input type='text' style='color: navy; ' size='6' name='isopText' id='isopText' value="<?php if (isset($_POST['isopText'])) echo $_POST['isopText']; else echo ''; ?>" />
<?php
}
else {
$query = "SELECT isop FROM isop WHERE ISO_ROD_index = $idx";
$resultisop=$db->query($query) or die ('Query failed: ' . $db->error . '</body></html>');
if ($resultisop->num_rows > 0) {
$isop_Temp = $resultisop->fetch_assoc();
$isop = $isop_Temp['isop'];
?>
<input type='text' style='color: navy; ' size='6' name='isopText' id='isopText' value="<?php echo $isop; ?>" />
<?php
}
else {
?>
<input type='text' style='color: navy; ' size='6' name='isopText' id='isopText' value='' />
<?php
}
}
?>
<br /><br />
<hr align="center" width="90%" color="#0066CC" />
<br />
<?php
/************************************************
whole Bible and complete Scripture
*************************************************/
$whole_Bible = '';
$complete_Scripture = '';
$ScriptureDescription = '';
if (isset($_POST['whole_Bible']) || isset($_POST['Scripture_Bible_Filename'])) {
}
else {
$whole_Bible = '';
$Scripture_Bible_Filename = '';
$query="SELECT Item, Scripture_Bible_Filename, `description` FROM Scripture_and_or_Bible WHERE ISO_ROD_index = $idx";
$result1=$db->query($query);
$num=$result1->num_rows;
if ($result1 && $num > 0) {
while ($r = $result1->fetch_assoc()) {
$Item = $r['Item'];
$ScriptureDescription = $r['description'];
if ($Item == 'B') { // "B"ible
$whole_Bible = $r['Scripture_Bible_Filename'];
}
else { // else = "S"cripture
$complete_Scripture = $r['Scripture_Bible_Filename'];
}
}
}
$result1->free();
}
?>
Enter the PDF file name of the whole Bible in this language:
<input type='text' name='whole_Bible' id='whole_Bible' style='color: navy; ' size='40' value="<?php if (isset($_POST['whole_Bible'])) echo $_POST['whole_Bible']; else echo ${'whole_Bible'}; ?>" />
<br /><br />
<span style='font-size: 11pt; '>Enter the PDF file name of the complete Scripture publication (although NOT the OT nor NT) in this language:</span>
<input type='text' name='complete_Scripture' id='complete_Scripture' style='color: navy; ' size='40' value="<?php if (isset($_POST['complete_Scripture'])) echo $_POST['complete_Scripture']; else echo ${'complete_Scripture'}; ?>" />
<span style='font-size: 11pt; '>description (optional):</span>
<input type='text' name='ScriptureDescription' id='ScriptureDescription' style='color: navy; ' size='40' value="<?php if (isset($_POST['ScriptureDescription'])) echo $_POST['ScriptureDescription']; else echo ${'ScriptureDescription'}; ?>" />
<br /><br />
<hr align="center" width="90%" color="#0066CC" />
<br />
<?php
/************************************************
OT PDF books
*************************************************/
if ($SM_row['OT_PDF']) {
$query="SELECT * FROM OT_PDF_Media WHERE ISO_ROD_index = $idx AND OT_PDF = 'OT'";
$result1=$db->query($query);
$num=$result1->num_rows;
if ($result1 && $num > 0) {
$r = $result1->fetch_assoc();
$OT_PDF_Filename = $r['OT_PDF_Filename'];
$OT_name = $OT_PDF_Filename;
}
else {
$OT_name = '';
}
$result1->free();
?>
<div class='enter'>PDF file name of the OT in this language: <input type='text' name='OT_name' id='OT_name' size='40' value="<?php echo $OT_name ?>" /></div>
<?php
}
else {
?>
<div class='enter'>PDF file name of the OT in this language: <input type='text' name='OT_name' id='OT_name' size='40' value="<?php if (isset($_POST['OT_name'])) echo $_POST['OT_name']; else echo ''; ?>" /></div>
<?php
}
?>
<br />
<?php
$num = 0;
if (isset($_POST['OT_PDF_Book-1']) || isset($_POST["OT_PDF_appendix"]) || isset($_POST["OT_PDF_glossary"])) { //else {
?>
<input type='hidden' name='OT_PDF_Button' id='OT_PDF_Button' value='No' />
<div id='OT_Off_Books'> <!-- The id has to the same because of function classChange in AddorChange.js! -->
<input type='button' id='Open_OT_PDFs' value='Open OT PDFs' /> Are there any of the books in the Old Testament in PDF?<br />
</div>
<div class='enter' id='OT_Books'> <!-- The id has to the same because of function classChange in AddorChange.js! -->
<input type='button' id='Close_OT_PDF' name='Close_OT_PDF' value="Close OT PDFs" /> Here are the books that ocurr in the Old Testament in PDF:<br />
<input type='button' id='OT_PDF_Books' value='All PDF OT Books' /><span style='font-size: 10pt; font-weight: bold; '> Enter the PDF filename for Genesis and click on this button to have all of the rest of the OT filled in.</span><br />
<input type='button' id='No_OT_PDF_Books' value='No PDF OT Books' /><span style='font-size: 10pt; font-weight: bold; '> Delete the PDF filename for Genesis and click on this button to have none of the rest of the OT deleted.</span>
<br />
<div id='All_OT_Books_Div'>
<div id='None_OT_Books_Div'>
<table id="OT_PDF_Table" width="100%">
<?php
for ($i=0; $i < 39; $i++) {
$item_from_array = $OT_array[2][$i];
if ($i % 2)
$color = "ffffff";
else
$color = "f0f4f0";
echo "<tr style='background-color: #$color;'><td width='30%'>";
echo " <input type='checkbox' name='OT_PDF_Book-$i' id='OT_PDF_Book-$i'" . (isset($_POST['OT_PDF_Book-'.(string)$i]) ? ' checked' : '' ) . " /> $item_from_array";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename-$i' id='OT_PDF_Filename-$i' size='50' value='" . (isset($_POST['OT_PDF_Filename-'.(string)$i]) ? $_POST['OT_PDF_Filename-'.(string)$i] : '' ) . "' />";
echo "</td></tr>";
}
echo "<tr valign='bottom' style='background-color: #fff;'><td width='30%'>";
echo "<br />";
echo " <input type='checkbox' name='OT_PDF_appendix' id='OT_PDF_appendix'" . (isset($_POST['OT_PDF_appendix']) ? ' checked' : '' ) . " /> OT Appendix";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename_appendix' id='OT_PDF_Filename_appendix' size='50' value='" . (isset($_POST['OT_PDF_Filename_appendix']) ? $_POST['OT_PDF_Filename_appendix'] : '' ) . "' />";
echo "</td></tr>";
echo "<tr valign='bottom' style='background-color: #f0f4f0;'><td width='30%'>";
echo " <input type='checkbox' name='OT_PDF_glossary' id='OT_PDF_glossary'" . (isset($_POST['OT_PDF_glossary']) ? ' checked' : '' ) . " /> OT Glossary";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename_glossary' id='OT_PDF_Filename_glossary' size='50' value='" . (isset($_POST['OT_PDF_Filename_glossary']) ? $_POST['OT_PDF_Filename_glossary'] : '' ) . "' />";
echo "</td></tr>";
?>
</table>
</div>
</div>
</div>
<?php
}
else { // (mysql_result($result,0,'OT_PDF')) {
$query="SELECT * FROM OT_PDF_Media WHERE ISO_ROD_index = $idx AND OT_PDF != 'OT' ORDER BY (OT_PDF+0)"; // turns strings into numbers // [AND NT_PDF NOT REGEXP '[[:<:]][[:digit:]]{3,3}' works but doesn't do 200, etc. only 0 - 99]
$result1=$db->query($query);
$num=$result1->num_rows;
if ($result1 && $num > 0) {
?>
<input type='hidden' name='OT_PDF_Button' id='OT_PDF_Button' value='No' />
<div id='OT_Off_Books'> <!-- The id has to the same because of function classChange in AddorChange.js! -->
<input type='button' id='Open_OT_PDFs' value='Open OT PDFs' /> Are there any of the books in the Old Testament in PDF?<br />
</div>
<div class='enter' id='OT_Books'> <!-- The id has to the same because of function classChange in AddorChange.js! -->
<input type='button' id='Close_OT_PDF' name='Close_OT_PDF' value="Close OT PDFs" /> Here are the books that occur in the Old Testament in PDF:<br />
<input type='button' id='OT_PDF_Books' value='All PDF OT Books' /><span style='font-size: 10pt; font-weight: bold; '> Enter the PDF filename for Genesis and click on this button to have all of the rest of the OT filled in.</span><br />
<input type='button' id='No_OT_PDF_Books' value='No PDF OT Books' /><span style='font-size: 10pt; font-weight: bold; '> Delete the PDF filename for Genesis and click on this button to have none of the rest of the OT deleted.</span>
<br />
<div id='All_OT_Books_Div'>
<div id='None_OT_Books_Div'>
<table id="OT_PDF_Table" width="100%">
<?php
$i = 0;
$j = 0;
$OT_appendix = -1; // must be initialized to -1!
$OT_glossary = -1; // must be initialized to -1!
$temp_t = 0;
$temp = 0;
while ($i < $num) {
$r = $result1->fetch_assoc();
$temp_t = $r['OT_PDF'];
if (preg_match("/^[0-9][0-9][0-9]$/", $temp_t)) {
if ($temp_t == 100) $OT_appendix = $i;
if ($temp_t == 101) $OT_glossary = $i;
$i++;
continue;
}
$temp = $temp_t;
for (; $j <= $temp; $j++) {
$item_from_array = $OT_array[2][$j];
if ($j % 2)
$color = "ffffff";
else
$color = "f0f4f0";
echo "<tr style='background-color: #$color;'><td width='30%'>";
if ($j == $temp) {
echo " <input type='checkbox' name='OT_PDF_Book-$j' id='OT_PDF_Book-$j' checked /> $item_from_array";
echo "</td><td width='70%'>";
${'OT_PDF_Filename-$i'} = $r['OT_PDF_Filename']; // $i is the actual OT_PDF_Filename in the row (ISO)!
$temp_OT_PDF_Filename = ${'OT_PDF_Filename-$i'};
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename-$j' id='OT_PDF_Filename-$j' size='50' value='$temp_OT_PDF_Filename' />";
}
else {
echo " <input type='checkbox' name='OT_PDF_Book-$j' id='OT_PDF_Book-$j' /> $item_from_array";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename-$j' id='OT_PDF_Filename-$j' size='50' value='' />";
}
echo "</td></tr>";
}
$i++;
}
$temp++;
for (; $temp < 39; $temp++) {
$item_from_array = $OT_array[2][$temp];
if ($temp % 2)
$color = "ffffff";
else
$color = "f0f4f0";
echo "<tr style='background-color: #$color;'><td width='30%'>";
echo " <input type='checkbox' name='OT_PDF_Book-$temp' id='OT_PDF_Book-$temp' /> $item_from_array";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename-$temp' id='OT_PDF_Filename-$temp' size='50' value='' />";
echo "</td></tr>";
}
echo "<tr valign='bottom' style='background-color: #fff;'><td width='30%'>";
echo "<br />";
if ($OT_appendix != -1) {
echo " <input type='checkbox' name='OT_PDF_appendix' id='OT_PDF_appendix' checked /> OT Appendix";
echo "</td><td width='70%'>";
$result1->data_seek($OT_appendix);
$r = $result1->fetch_assoc();
$OT_PDF_Filename_appendix = $r['OT_PDF_Filename'];
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename_appendix' id='OT_PDF_Filename_appendix' size='50' value='$OT_PDF_Filename_appendix' />";
}
else {
echo " <input type='checkbox' name='OT_PDF_appendix' id='OT_PDF_appendix' /> OT Appendix";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename_appendix' id='OT_PDF_Filename_appendix' size='50' value='' />";
}
echo "</td></tr>";
echo "<tr valign='bottom' style='background-color: #f0f4f0;'><td width='30%'>";
if ($OT_glossary != -1) {
echo " <input type='checkbox' name='OT_PDF_glossary' id='OT_PDF_glossary' checked /> OT Glossary";
echo "</td><td width='70%'>";
$result1->data_seek($OT_glossary);
$r = $result1->fetch_assoc();
$OT_PDF_Filename_glossary = $r['OT_PDF_Filename'];
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename_glossary' id='OT_PDF_Filename_glossary' size='50' value='$OT_PDF_Filename_glossary' />";
}
else {
echo " <input type='checkbox' name='OT_PDF_glossary' id='OT_PDF_glossary' /> OT Glossary";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename_glossary' id='OT_PDF_Filename_glossary' size='50' value='' />";
}
echo "</td></tr>";
?>
</table>
</div>
</div>
</div>
<?php
}
else {
?>
<input type='hidden' name='OT_PDF_Button' id='OT_PDF_Button' value='No' />
<div id='OT_Off_Books'> <!-- The id has to the same because of function classChange in AddorChange.js! -->
<input type='button' id='Open_OT_PDFs' value='Open OT PDFs' /> Are there any of the books in the Old Testament in PDF?<br />
</div>
<div class='enter' id='OT_Books'> <!-- The id has to the same because of function classChange in AddorChange.js! -->
<input type='button' id='Close_OT_PDF' name='Close_OT_PDF' value="Close OT PDFs" /> Here are the books that ocurr in the Old Testament in PDF:<br />
<input type='button' id='OT_PDF_Books' value='All PDF OT Books' /><span style='font-size: 10pt; font-weight: bold; '> Enter the PDF filename for Genesis and click on this button to have all of the rest of the OT filled in.</span><br />
<input type='button' id='No_OT_PDF_Books' value='No PDF OT Books' /><span style='font-size: 10pt; font-weight: bold; '> Delete the PDF filename for Genesis and click on this button to have none of the rest of the OT deleted.</span>
<br />
<div id='All_OT_Books_Div'>
<div id='None_OT_Books_Div'>
<table id="OT_PDF_Table" width="100%">
<?php
for ($i=0; $i < 39; $i++) {
$item_from_array = $OT_array[2][$i];
if ($i % 2)
$color = "ffffff";
else
$color = "f0f4f0";
echo "<tr style='background-color: #$color;'><td width='30%'>";
echo " <input type='checkbox' name='OT_PDF_Book-$i' id='OT_PDF_Book-$i' /> $item_from_array";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename-$i' id='OT_PDF_Filename-$i' size='50' value='' />";
echo "</td></tr>";
}
echo "<tr valign='bottom' style='background-color: #fff;'><td width='30%'>";
echo "<br />";
echo " <input type='checkbox' name='OT_PDF_appendix' id='OT_PDF_appendix' /> OT Appendix";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename_appendix' id='OT_PDF_Filename_appendix' size='50' value='' />";
echo "</td></tr>";
echo "<tr valign='bottom' style='background-color: #f0f4f0;'><td width='30%'>";
echo " <input type='checkbox' name='OT_PDF_glossary' id='OT_PDF_glossary' /> OT Glossary";
echo "</td><td width='70%'>";
echo "OT PDF Filename: <input type='text' name='OT_PDF_Filename_glossary' id='OT_PDF_Filename_glossary' size='50' value='' />";
echo "</td></tr>";
?>
</table>
</div>
</div>
</div>