-
Notifications
You must be signed in to change notification settings - Fork 1
/
family.php
2401 lines (2119 loc) · 97.3 KB
/
family.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
// *************************************************************
// *** Family ***
// *************************************************************
//error_reporting(E_ALL);
$screen_mode='';
if (isset($_POST["screen_mode"]) AND $_POST["screen_mode"]=='PDF'){ $screen_mode='PDF'; }
if (isset($_POST["screen_mode"]) AND $_POST["screen_mode"]=='RTF'){ $screen_mode='RTF'; }
if (isset($_GET["screen_mode"]) AND $_GET["screen_mode"]=='STAR'){ $screen_mode='STAR'; }
if (isset($_GET["screen_mode"]) AND $_GET["screen_mode"]=='STARSIZE'){ $screen_mode='STARSIZE'; }
$hourglass=false;
if (isset($_GET["screen_mode"]) AND $_GET["screen_mode"]=='HOUR'){ $screen_mode='STAR'; $hourglass=true; }
if (isset($_GET["screen_mode"]) AND $_GET["screen_mode"]=='HOURSTARSIZE'){ $screen_mode='STARSIZE'; $hourglass=true; }
$pdf_source= array(); // is set in show_sources.php with sourcenr as key to be used in source appendix
// see end of this code
global $chosengen, $genarray, $size, $keepfamily_id, $keepmain_person, $direction;
global $pdf_footnotes;
include_once("header.php"); // returns CMS_ROOTPATH constant
// *** "Last visited" id is used for contact form ***
$last_visited=$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$_SESSION['save_last_visitid']=$last_visited;
@set_time_limit(300);
$menu=0;
if(isset($_GET['menu']) AND $_GET['menu']=="1") { $menu = 1; } // called from fanchart iframe with &menu=1-> no menu!
if($screen_mode!='PDF' AND $menu!=1) { //we can't have a menu in pdf... and don't want it when called in an iframe
include_once(CMS_ROOTPATH."menu.php");
}
if($screen_mode=='PDF') { // if PDF: necessary parts from menu.php
include_once(CMS_ROOTPATH."include/db_functions_cls.php");
$db_functions = New db_functions;
$db_functions->set_tree_prefix($tree_prefix_quoted);
if (isset($_SESSION['tree_prefix'])){
$dataqry = "SELECT * FROM humo_trees LEFT JOIN humo_tree_texts
ON humo_trees.tree_id=humo_tree_texts.treetext_tree_id
AND humo_tree_texts.treetext_language='".$selected_language."'
WHERE tree_prefix='".$tree_prefix_quoted."'";
@$datasql = $dbh->query($dataqry);
@$dataDb = $datasql->fetch(PDO::FETCH_OBJ);
}
$tree_id=$dataDb->tree_id;
$db_functions->set_tree_id($tree_id);
}
include_once(CMS_ROOTPATH."include/language_date.php");
include_once(CMS_ROOTPATH."include/language_event.php");
include_once(CMS_ROOTPATH."include/date_place.php");
include_once(CMS_ROOTPATH."include/process_text.php");
include_once(CMS_ROOTPATH."include/calculate_age_cls.php");
include_once(CMS_ROOTPATH."include/person_cls.php");
include_once(CMS_ROOTPATH."include/marriage_cls.php");
include_once(CMS_ROOTPATH."include/show_sources.php");
include_once(CMS_ROOTPATH."include/witness.php");
include_once(CMS_ROOTPATH."include/show_picture.php");
//include_once(CMS_ROOTPATH."include/db_functions_cls.php"); // *** Extra db_functions include, needed for PDF report ***
// *** Show person/ family topline: family top text, pop-up settings, PDF export, favorite ***
function topline(){
global $dataDb, $bot_visit, $descendant_loop, $parent1_marr, $rtlmarker, $family_id, $main_person;
global $alignmarker, $language, $uri_path, $descendant_report, $family_expanded;
global $user, $source_presentation, $change_main_person, $maps_presentation, $picture_presentation, $text_presentation, $database, $man_cls, $person_manDb;
global $woman_cls, $person_womanDb, $selected_language;
$text='<tr class="table_headline"><td class="table_header" width="65%">';
// *** Text above family ***
$treetext=show_tree_text($dataDb->tree_prefix, $selected_language);
$text.='<div class="family_page_toptext fonts">'.$treetext['family_top'].'<br></div>';
$text.='</td><td class="table_header fonts" width="10%" style="text-align:center";>';
// *** Hide selections for bots, and second family screen (descendant report etc.) ***
if (!$bot_visit AND $descendant_loop==0 AND $parent1_marr==0){
// *** Settings in pop-up screen ***
$text.= '<div class="'.$rtlmarker.'sddm" style="left:10px;top:10px;display:inline;">';
$text.= '<a href="'.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.'"';
$text.= ' style="display:inline" ';
$text.= 'onmouseover="mopen(event,\'help_menu\',0,0)"';
$text.= 'onmouseout="mclosetime()">';
$text.= '<b>'.__('Settings').'</b>';
$text.= '</a>';
//$text='<div style="z-index:40; padding:4px; direction:'.$rtlmarker.'" id="help_menu" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
$text.='<div class="sddm_fixed" style="z-index:10; padding:4px; text-align:'.$alignmarker.'; direction:'.$rtlmarker.';" id="help_menu" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
$text.='<span style="color:blue">=====</span> <b>'.__('Settings family screen').'</b> <span style="color:blue">=====</span><br><br>';
$text.='<table><tr><td>';
// *** Extended view button ***
$text.='<b>'.__('Family Page').'</b><br>';
$desc_rep = ''; if($descendant_report==true) { $desc_rep = '&descendant_report=1'; }
$selected=' CHECKED'; $selected2=''; if ($family_expanded==true) { $selected=''; $selected2=' CHECKED'; }
$text.='<input type="radio" name="keuze0" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&family_expanded=0&xx=\'+this.value"'.$selected.'>'.__('Compact view')."<br>\n";
$text.='<input type="radio" name="keuze0" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&family_expanded=1&xx=\'+this.value"'.$selected2.'>'.__('Expanded view')."<br>\n";
// *** Select source presentation (as title/ footnote or hide sources) ***
if($user['group_sources']!='n') {
$text.='<hr>';
$text.='<b>'.__('Sources').'</b><br>';
$desc_rep = ''; if($descendant_report==true) { $desc_rep = '&descendant_report=1'; }
$selected=''; if ($source_presentation=='title') { $selected=' CHECKED'; }
$text.='<input type="radio" name="keuze1" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&source_presentation=title&xx=\'+this.value"'.$selected.'>'.__('Show source title')."<br>\n";
$selected=''; if ($source_presentation=='footnote') { $selected=' CHECKED'; }
$text.='<input type="radio" name="keuze1" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&source_presentation=footnote&xx=\'+this.value"'.$selected.'>'.__('Show source title as footnote')."<br>\n";
$selected=''; if ($source_presentation=='hide') { $selected=' CHECKED'; }
$text.='<input type="radio" name="keuze1" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&source_presentation=hide&xx=\'+this.value"'.$selected.'>'.__('Hide sources')."<br>\n";
}
// *** Show/ hide Google maps ***
if($descendant_report==false) {
$text.='<hr>';
$text.='<b>'.__('Google maps').'</b><br>';
$selected=''; $selected2=''; if ($maps_presentation=='hide') $selected2=' CHECKED'; else $selected=' CHECKED';
$text.='<input type="radio" name="keuze2" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.'&maps_presentation=show&xx=\'+this.value"'.$selected.'>'.__('Show Google maps')."<br>\n";
$text.='<input type="radio" name="keuze2" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.'&maps_presentation=hide&xx=\'+this.value"'.$selected2.'>'.__('Hide Google maps')."<br>\n";
}
$text.='</td><td valign="top">';
if ($user['group_pictures']=='j'){
$text.='<b>'.__('Pictures').'</b><br>';
$selected=''; $selected2=''; if ($picture_presentation=='hide') $selected2=' CHECKED'; else $selected=' CHECKED';
$text.='<input type="radio" name="keuze3" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&picture_presentation=show&xx=\'+this.value"'.$selected.'>'.__('Show pictures')."<br>\n";
$text.='<input type="radio" name="keuze3" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&picture_presentation=hide&xx=\'+this.value"'.$selected2.'>'.__('Hide pictures')."<br>\n";
$text.='<hr>';
}
$text.='<b>'.__('Texts').'</b><br>';
$selected=''; if ($text_presentation=='show') $selected=' CHECKED';
$text.='<input type="radio" name="keuze4" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&text_presentation=show&xx=\'+this.value"'.$selected.'>'.__('Show texts')."<br>\n";
$selected=''; if ($text_presentation=='popup') $selected=' CHECKED';
$text.='<input type="radio" name="keuze4" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&text_presentation=popup&xx=\'+this.value"'.$selected.'>'.__('Show texts in popup screen')."<br>\n";
$selected=''; if ($text_presentation=='hide') $selected=' CHECKED';
$text.='<input type="radio" name="keuze4" value="" onclick="javascript: document.location.href=\''.$_SERVER['PHP_SELF'].'?id='.$family_id.'&main_person='.$main_person.$desc_rep.'&text_presentation=hide&xx=\'+this.value"'.$selected.'>'.__('Hide texts')."<br>\n";
$text.='</td></tr></table>';
$text.='</div>';
$text.='</div>';
$text.='</td><td class="table_header fonts" width="20%" style="text-align:center";>';
// *** PDF button ***
//if($user["group_pdf_button"]=='y' AND $language["dir"]!="rtl") {
if($user["group_pdf_button"]=='y' AND $language["dir"]!="rtl" AND $language["name"]!="简体中文") {
$text.='<form method="POST" action="'.$uri_path.'family.php?show_sources=1" style="display : inline;">';
$text.='<input type="hidden" name="id" value="'.$family_id.'">';
$text.='<input type="hidden" name="main_person" value="'.$main_person.'">';
$text.='<input type="hidden" name="database" value="'.$database.'">';
$text.='<input type="hidden" name="screen_mode" value="PDF">';
if($descendant_report==true) {
$text.='<input type="hidden" name="descendant_report" value="'.$descendant_report.'">';
}
$text.='<input class="fonts" type="Submit" name="submit" value="'.__('PDF Report').'">';
//$text.='<input type="image" src="images/pdf.jpeg" width="20" border="0" alt="PDF">';
$text.='</form> ';
}
// *** RTF button ***
if($user["group_rtf_button"]=='y' AND $language["dir"]!="rtl") {
$text.='<form method="POST" action="'.$uri_path.'family.php?show_sources=1" style="display : inline;">';
$text.='<input type="hidden" name="id" value="'.$family_id.'">';
$text.='<input type="hidden" name="main_person" value="'.$main_person.'">';
$text.='<input type="hidden" name="database" value="'.$database.'">';
$text.='<input type="hidden" name="screen_mode" value="RTF">';
if($descendant_report==true) {
$text.='<input type="hidden" name="descendant_report" value="'.$descendant_report.'">';
}
$text.='<input class="fonts" type="Submit" name="submit" value="'.__('RTF Report').'">';
$text.='</form> ';
}
$text.='</td><td class="table_header fonts" width="5%" style="text-align:center";>';
// *** Add family to favorite list ***
// If there is a N.N. father, then use mother in favorite icon.
if ($change_main_person==true OR !isset($person_manDb->pers_gedcomnumber)){
$name=$woman_cls->person_name($person_womanDb);
$favorite_gedcomnumber=' ['.$person_womanDb->pers_gedcomnumber.']';
}
else{
$name=$man_cls->person_name($person_manDb);
$favorite_gedcomnumber=' ['.$person_manDb->pers_gedcomnumber.']';
}
if ($name){
$favorite_values=$name['name'].$favorite_gedcomnumber.'|'.$family_id.'|'.$_SESSION['tree_prefix'].'|'.$main_person;
$check=false;
if (isset($_SESSION['save_favorites'])){
foreach($_SESSION['save_favorites'] as $key=>$value){
if ($value==$favorite_values){ $check=true; }
}
}
$text.='<form method="POST" action="'.$uri_path.'family.php" style="display : inline;">';
$text.='<input type="hidden" name="id" value="'.$family_id.'">';
$text.='<input type="hidden" name="main_person" value="'.$main_person.'">';
if ($descendant_report==true){ echo '<input type="hidden" name="descendant_report" value="1">'; }
if ($check==false){
$text.='<input type="hidden" name="favorite" value="'.$favorite_values.'">';
$text.=' <input type="image" src="images/favorite.png" name="favorite_button" alt="'.__('Add to favourite list').'" />';
}
else{
$text.='<input type="hidden" name="favorite_remove" value="'.$favorite_values.'">';
$text.=' <input type="image" src="images/favorite_blue.png" name="favorite_button" alt="'.__('Add to favourite list').'" />';
}
$text.='</form>';
}
} // End of bot visit
$text.='</td></tr>';
return $text;
}
$family_nr=1; // *** process multiple families ***
$family_id=1; // *** standard: show first family ***
if (isset($urlpart[1])){ $family_id=$urlpart[1]; }
if (isset($_GET["id"])){ $family_id=$_GET["id"]; }
if (isset($_POST["id"])){ $family_id=$_POST["id"]; }
$main_person=''; // *** Mainperson of a family ***
if (isset($urlpart[2])){ $main_person=$urlpart[2]; }
if (isset($_GET["main_person"])){ $main_person=$_GET["main_person"]; }
if (isset($_POST["main_person"])){ $main_person=$_POST["main_person"]; }
// *** A favorite ID is used ***
if (isset($_POST["favorite_id"])){
$favorite_array_id=explode("|",$_POST["favorite_id"]);
$family_id=$favorite_array_id[0];
$main_person=$favorite_array_id[1];
}
if($screen_mode=='STAR' OR $screen_mode=='STARSIZE') {
$dna = "none"; // DNA setting
if (isset($_GET["dnachart"])){ $dna=$_GET["dnachart"]; }
if (isset($_POST["dnachart"])){ $dna=$_POST["dnachart"]; }
$chosengen=4; if($dna!="none") $chosengen="All"; // in DNA chart by default show all generations
if (isset($_GET["chosengen"])){ $chosengen=$_GET["chosengen"]; }
if (isset($_POST["chosengen"])){ $chosengen=$_POST["chosengen"]; }
$chosengenanc=4; // for hourglass -- no. of generations of ancestors
if (isset($_GET["chosengenanc"])){ $chosengenanc=$_GET["chosengenanc"]; }
if (isset($_POST["chosengenanc"])){ $chosengenanc=$_POST["chosengenanc"]; }
if(isset($_SESSION['chartsize'])) { $size=$_SESSION['chartsize']; }
else { $size=50; if($dna!="none") $size=25;} // in DNA chart by default zoom position 4
if (isset($_GET["chosensize"])){ $size=$_GET["chosensize"]; }
if (isset($_POST["chosensize"])){ $size=$_POST["chosensize"]; }
$_SESSION['chartsize']=$size;
$keepfamily_id=$family_id;
$keepmain_person=$main_person;
$direction=0; // vertical
if (isset($_GET["direction"])){ $direction=$_GET["direction"]; }
if (isset($_POST["direction"])){ $direction=$_POST["direction"]; }
if($dna!="none") {
if (isset($_GET["bf"])){ $base_person_famc=$_GET["bf"]; }
if (isset($_POST["bf"])){ $base_person_famc=$_POST["bf"]; }
if (isset($_GET["bs"])){ $base_person_sexe=$_GET["bs"]; }
if (isset($_POST["bs"])){ $base_person_sexe=$_POST["bs"]; }
if (isset($_GET["bn"])){ $base_person_name=$_GET["bn"]; }
if (isset($_POST["bn"])){ $base_person_name=$_POST["bn"]; }
if (isset($_GET["bg"])){ $base_person_gednr=$_GET["bg"]; }
if (isset($_POST["bg"])){ $base_person_gednr=$_POST["bg"]; }
}
}
if($screen_mode=='STARSIZE') {
if (isset($_SESSION['genarray'])){ $genarray=$_SESSION['genarray']; }
}
if($screen_mode!='STAR' AND $screen_mode!='STARSIZE') {
// ***************************************************************
// *** Descendant report ***
// ***************************************************************
// == define numbers (max. 60 generations)
$number_roman = array( 1=>'I', 2=>'II', 3=>'III', 4=>'IV', 5=>'V', 6=>'VI', 7=>'VII', 8=>'VIII', 9=>'IX', 10=>'X',
11=>'XI', 12=>'XII', 13=>'XIII', 14=>'XIV', 15=>'XV', 16=>'XVI', 17=>'XVII', 18=>'XVIII', 19=>'XIX', 20=>'XX',
21=>'XXI', 22=>'XXII', 23=>'XXIII', 24=>'XXIV', 25=>'XXV', 26=>'XXVII', 27=>'XXVII', 28=>'XXVIII', 29=>'XXIX', 30=>'XXX',
31=>'XXXI',32=>'XXXII',33=>'XXXIII',34=>'XXXIV',35=>'XXXV',36=>'XXXVII',37=>'XXXVII',38=>'XXXVIII',39=>'XXXIX',40=>'XL',
41=>'XLI', 42=>'XLII', 43=>'XLIII', 44=>'XLIV', 45=>'XLV', 46=>'XLVII', 47=>'XLVII', 48=>'XLVIII', 49=>'XLIX', 50=>'L',
51=>'LI', 52=>'LII', 53=>'LIII', 54=>'LIV', 55=>'LV', 56=>'LVII', 57=>'LVII', 58=>'LVIII', 59=>'LIX', 60=>'LX',);
//a-z
$number_generation[]=''; //(1st number_generation is not used)
for ($i=1; $i<=26; $i++) {
$number_generation[]=chr($i+96); //chr(97)=a
}
//aa-zz
for ($i=1; $i<=676; $i++) {
for ($j=1; $j<=26; $j++) {
$number_generation[]=chr($i+96).chr($j+96); //chr(97)=a
}
}
// **********************************************************
// *** Maximum number of generations in descendant report ***
// **********************************************************
$max_generation=($humo_option["descendant_generations"]-1);
$descendant_report=false;
if (isset($_GET['descendant_report'])){ $descendant_report=true; }
if (isset($_POST['descendant_report'])){ $descendant_report=true; }
// *** Compact or expanded view ***
if (isset($_GET['family_expanded'])){
if ($_GET['family_expanded']=='0') $_SESSION['save_family_expanded']='0';
else $_SESSION['save_family_expanded']='1';
}
// *** Default setting is selected by administrator ***
if ($user['group_family_presentation']=='expanded')
$family_expanded=true;
else
$family_expanded=false;
if (isset($_SESSION['save_family_expanded'])) $family_expanded=$_SESSION['save_family_expanded'];
// *** Source presentation selected by user (title/ footnote/ hide) ***
if (isset($_GET['source_presentation'])){
$_SESSION['save_source_presentation']=safe_text($_GET["source_presentation"]);
}
// *** Default setting is selected by administrator ***
$source_presentation=$user['group_source_presentation'];
if (isset($_SESSION['save_source_presentation'])) $source_presentation=$_SESSION['save_source_presentation'];
else{
// *** Extra saving of setting in session (if no choice is made, this is admin default setting, needed for show_sources.php!!!) ***
$_SESSION['save_source_presentation']=safe_text($source_presentation);
}
// *** Show/ hide Google maps ***
if (isset($_GET['maps_presentation'])) $_SESSION['save_maps_presentation']=safe_text($_GET["maps_presentation"]);
// *** Default setting is selected by administrator ***
$maps_presentation=$user['group_maps_presentation'];
//if ($user['group_maps_presentation']=='sources') $maps_presentation='hide'; // *** sources = backwards compatible!! ***
if (isset($_SESSION['save_maps_presentation'])) $maps_presentation=$_SESSION['save_maps_presentation'];
// *** Show/ hide pictures ***
if (isset($_GET['picture_presentation'])) $_SESSION['save_picture_presentation']=safe_text($_GET["picture_presentation"]);
// *** Default setting is selected by administrator ***
//$picture_presentation=$user['group_picture_presentation'];
if (isset($_SESSION['save_picture_presentation'])) $picture_presentation=$_SESSION['save_picture_presentation'];
// *** Show/ hide texts ***
if (isset($_GET['text_presentation'])) $_SESSION['save_text_presentation']=safe_text($_GET["text_presentation"]);
// *** Default setting is selected by administrator ***
$text_presentation=$user['group_text_presentation'];
if (isset($_SESSION['save_text_presentation'])) $text_presentation=$_SESSION['save_text_presentation'];
}
if($screen_mode=='STAR') {
$descendant_report=true;
$genarray = array();
$family_expanded=false;
}
if($screen_mode=='PDF') { //initialize pdf generation
$family_expanded=false;
$pdfdetails=array();
$pdf_marriage=array();
$pdf=new PDF();
// *** Generate title of PDF file ***
@$persDb = $db_functions->get_person($main_person);
// *** Use class to process person ***
$pers_cls = New person_cls;
$pers_cls->construct($persDb);
$name=$pers_cls->person_name($persDb);
if(!$descendant_report==false) {
$title=pdf_convert(__('Descendant report').__(' of ').$name["standard_name"]);
}
else {
$title=pdf_convert(__('Family group sheet').__(' of ').$name["standard_name"]);
}
$pdf->SetTitle($title);
$pdf->SetAuthor('Huub Mons (pdf: Yossi Beck)');
$pdf->AddPage();
$pdf->SetFont('Arial','',12);
} // end if pdfmode
if($screen_mode=='RTF') { // initialize rtf generation
require_once 'include/phprtflite/lib/PHPRtfLite.php';
$family_expanded=false;
// *** registers PHPRtfLite autoloader (spl) ***
PHPRtfLite::registerAutoloader();
// *** rtf document instance ***
$rtf = new PHPRtfLite();
// *** Add section ***
$sect = $rtf->addSection();
// *** RTF Settings ***
$arial12 = new PHPRtfLite_Font(12, 'Arial');
$arial14 = new PHPRtfLite_Font(14, 'Arial', '#000066');
//Fonts
$fontHead = new PHPRtfLite_Font(12, 'Arial');
$fontSmall = new PHPRtfLite_Font(3);
$fontAnimated = new PHPRtfLite_Font(10);
$fontLink = new PHPRtfLite_Font(10, 'Helvetica', '#0000cc');
$parBlack = new PHPRtfLite_ParFormat();
$parBlack->setIndentRight(12.5);
//$parBlack->setBackgroundColor('#000000');
$parBlack->setSpaceBefore(12);
$parHead = new PHPRtfLite_ParFormat();
$parHead->setSpaceBefore(3);
$parHead->setSpaceAfter(8);
$parHead->setBackgroundColor('#baf4c1');
$parSimple = new PHPRtfLite_ParFormat();
$parSimple->setIndentLeft(1);
$parSimple->setIndentRight(0.5);
$par_child_text = new PHPRtfLite_ParFormat();
$par_child_text->setIndentLeft(0.5);
$par_child_text->setIndentRight(0.5);
//$rtf->setMargins(3, 1, 1 ,2);
// *** Generate title of RTF file ***
@$persDb = $db_functions->get_person($main_person);
// *** Use class to process person ***
$pers_cls = New person_cls;
$pers_cls->construct($persDb);
$name=$pers_cls->person_name($persDb);
if(!$descendant_report==false) {
$title=__('Descendant report').__(' of ').$name["standard_name"];
}
else {
$title=__('Family group sheet').__(' of ').$name["standard_name"];
}
//$sect->writeText($title, $arial14, new PHPRtfLite_ParFormat());
$sect->writeText($title, $arial14, $parHead);
$file_name=date("Y_m_d_H_i_s").'.rtf';
// *** FOR TESTING PURPOSES ONLY ***
if (@file_exists("../gedcom-bestanden")) $file_name='../gedcom-bestanden/'.$file_name;
else $file_name='tmp_files/'.$file_name;
// *** Automatically remove old RTF files ***
$dh = opendir('tmp_files');
while (false !== ($filename = readdir($dh))) {
if (substr($filename, -3) == "rtf"){
//echo 'tmp_files/'.$filename.'<br>';
// *** Remove files older then today ***
if (substr($filename,0,10)!=date("Y_m_d")) unlink('tmp_files/'.$filename);
}
}
//echo $file_name;
}
if($screen_mode=='STAR') {
// DNA chart -> change base person to earliest father-line (Y-DNA) or mother-line (Mt-DNA) ancestor
$max_generation=100;
@$dnaDb = $db_functions->get_person($main_person);
$dnapers_cls = New person_cls;
$dnaname=$dnapers_cls->person_name($dnaDb);
$base_person_name = $dnaname["standard_name"]; // need these 4 in report_descendant.php
$base_person_sexe = $dnaDb->pers_sexe;
$base_person_famc = $dnaDb->pers_famc;
$base_person_gednr = $dnaDb->pers_gedcomnumber;
if($dna=="ydna" OR $dna=="ydnamark") {
while(isset($dnaDb->pers_famc) AND $dnaDb->pers_famc!="") {
@$dnaparDb = $db_functions->get_family($dnaDb->pers_famc);
if($dnaparDb->fam_man=="") break;
else {
$main_person = $dnaparDb->fam_man;
$family_id = $dnaDb->pers_famc;
@$dnaDb = $db_functions->get_person($dnaparDb->fam_man);
}
}
}
if($dna=="mtdna" OR $dna=="mtdnamark") {
while(isset($dnaDb->pers_famc) AND $dnaDb->pers_famc!="") {
@$dnaparDb = $db_functions->get_family($dnaDb->pers_famc);
if($dnaparDb->fam_woman=="") break;
else {
$main_person = $dnaparDb->fam_woman;
$family_id = $dnaDb->pers_famc;
@$dnaDb = $db_functions->get_person($dnaparDb->fam_woman);
}
}
}
}
// **************************
// *** Show single person ***
// **************************
if (!$family_id){
// starfieldchart is never called when there is no own fam so no need to mark this out
// *** Privacy filter ***
@$person_manDb = $db_functions->get_person($main_person);
// *** Use class to show person ***
$man_cls = New person_cls;
$man_cls->construct($person_manDb);
if($screen_mode=='PDF') {
// *** Show familysheet name: user's choice or default ***
$pdf->Cell(0,2," ",0,1);
$pdf->SetFont('Arial','BI',12);
$pdf->SetFillColor(196,242,107);
$treetext=show_tree_text($dataDb->tree_prefix, $selected_language);
$family_top=$treetext['family_top'];
if($family_top!='') {
$pdf->Cell(0,6,pdf_convert($family_top),0,1,'L',true);
}
else {
$pdf->Cell(0,6,pdf_convert(__('Family group sheet')),0,1,'L',true);
}
$pdf->SetFont('Arial','B',12);
$pdf->Write(8,$man_cls->name_extended("parent1"));
$pdf->SetFont('Arial','',12);
$pdf->Write(8,"\n");
$id='';
//$pdfdetails= pdf_convert($man_cls->person_data("parent1", $id));
$pdfdetails= $man_cls->person_data("parent1", $id);
if($pdfdetails) $pdf->pdfdisplay($pdfdetails,"parent");
}
elseif($screen_mode=='RTF') {
$rtf_text=strip_tags($man_cls->name_extended("parent1"),"<b><i>");
$sect->writeText($rtf_text, $arial12, new PHPRtfLite_ParFormat());
$id='';
$rtf_text=strip_tags($man_cls->person_data("parent1", $id),"<b><i>");
$sect->writeText($rtf_text, $arial12, $parSimple);
}
else {
// *** Add tip in person screen ***
if (!$bot_visit){
echo '<div class="print_version"><b>';
printf(__('TIP: use %s for other (ancestor and descendant) reports.'), '<img src="images/reports.gif">');
echo '</b><br><br></div>';
}
echo '<table class="humo standard">';
// *** Show person topline (top text, settings, favorite) ***
echo topline();
echo '<tr><td colspan="4">';
//*** Show person data ***
echo '<span class="parent1 fonts">'.$man_cls->name_extended("parent1");
$id='';
echo $man_cls->person_data("parent1", $id).'</span>';
echo '</td></tr>';
echo '</table>';
} // end if not pdf
}
// *******************
// *** Show family ***
// *******************
else{
if($screen_mode=='PDF') {
$pdf->SetFont('Arial','B',15);
$pdf->Ln(4);
$name=$pers_cls->person_name($persDb);
if(!$descendant_report==false) {
$pdf->MultiCell(0,10,__('Descendant report').__(' of ').$name["standard_name"],0,'C');
}
else {
$pdf->MultiCell(0,10,__('Family group sheet').__(' of ').$name["standard_name"],0,'C');
}
$pdf->Ln(4);
$pdf->SetFont('Arial','',12);
}
if($screen_mode!='STARSIZE') {
$descendant_family_id2[]=$family_id;
$descendant_main_person2[]=$main_person;
}
if($screen_mode=='STAR') {
$arraynr=0; //Индекс
}
//Установка количества поколений
// *** Nr. of generations ***
if($screen_mode=='STAR') {
if($chosengen != "All") { $max_generation=$chosengen-2; }
else { $max_generation=100; } // any impossibly high number, will anyway stop at last generation
}
if($screen_mode!='STARSIZE') {
try { // only prepare location statement if table exists otherwise PDO throws exception!
$result = $dbh->query("SELECT 1 FROM humo_location LIMIT 1");
} catch (Exception $e) {
// We got an exception == table not found
$result = FALSE;
}
if($result !== FALSE) {
$location_prep=$dbh->prepare("SELECT * FROM humo_location where location_location =?");
$location_prep->bindParam(1,$location_var);
}
$old_stat_prep=$dbh->prepare("UPDATE humo_families SET fam_counter=? WHERE fam_tree_id='".$tree_id."' AND fam_gedcomnumber=?");
$old_stat_prep->bindParam(1,$fam_counter_var);
$old_stat_prep->bindParam(2,$fam_gednr_var);
//Перебор поколений
for ($generateIndex=0; $generateIndex<=$max_generation; $generateIndex++){
$descendant_family_id2[]=0;
$descendant_main_person[2]=0;
if (!isset($descendant_family_id2[1])){ break; }
// *** Copy array ***
unset ($descendant_family_id);
$descendant_family_id=$descendant_family_id2;
unset ($descendant_family_id2);
unset ($descendant_main_person);
$descendant_main_person=$descendant_main_person2;
unset ($descendant_main_person2);
if($screen_mode=='STAR') {
if($generateIndex!=0) {
if(isset($genarray[$arraynr])) {
$temppar=$genarray[$arraynr]["par"];
}
while(isset($genarray[$temppar]["gen"]) AND $genarray[$temppar]["gen"]==$generateIndex-1) {
$lst_in_array += $genarray[$temppar]["nrc"];
$temppar++;
}
}
$nrchldingen=0;
}
else {
if ($descendant_report==true){
if($screen_mode=='PDF') {
$pdf->SetLeftMargin(10);
$pdf->Cell(0,2,"",0,1);
$pdf->SetFont('Arial','BI',14);
$pdf->SetFillColor(200,220,255);
if($pdf->GetY() > 250) { $pdf->AddPage(); $pdf->SetY(20); }
$pdf->Cell(0,8,pdf_convert(__('generation ')).$number_roman[$generateIndex+1],0,1,'C',true);
$pdf->SetFont('Arial','',12);
}
elseif($screen_mode=='RTF') {
$rtf_text=__('generation ').$number_roman[$generateIndex+1];
$sect->writeText($rtf_text, $arial14, $parHead);
}
else {
echo '<div class="standard_header fonts">'.__('generation ').$number_roman[$generateIndex+1].'</div>';
}
}
}
//Проход по семьям в текущем поколении.
// *** Nr of families in one generation
for ($familyIndex=0; $familyIndex<=count($descendant_family_id); $familyIndex++){
if($screen_mode=='STAR') {
//Для людей без семьи устанавливаем количество детей в 0.
while (isset($genarray[$arraynr]["non"]) AND $genarray[$arraynr]["non"]==1
AND isset($genarray[$arraynr]["gen"]) AND $genarray[$arraynr]["gen"]==$generateIndex) {
$genarray[$arraynr]["nrc"]==0;
$arraynr++;
}
}
if ($descendant_family_id[$familyIndex]==''){ break; } //Семьи закончились
$family_id_loop=$descendant_family_id[$familyIndex]; //Текущая семья
$main_person=$descendant_main_person[$familyIndex];
$family_nr=1;
// *** Count marriages of man ***
$familyDb = $db_functions->get_family($family_id_loop);
$parent1=''; $parent2=''; $change_main_person=false;
// *** Standard main person is the father ***
if ($familyDb->fam_man){
$parent1=$familyDb->fam_man;
}
// *** After clicking the mother, the mother is main person ***
if ($familyDb->fam_woman==$main_person){
$parent1=$familyDb->fam_woman;
$change_main_person=true;
}
// *** Check for parent1: N.N. ***
if ($parent1){
// *** Save man families in array ***
$personDb = $db_functions->get_person($parent1);
$marriage_array=explode(";",$personDb->pers_fams);
$count_marr=substr_count($personDb->pers_fams, ";");
}
else{
$marriage_array[0]=$family_id_loop;
$count_marr="0";
}
// *** Loop multiple marriages of main_person ***
for ($parent1_marr=0; $parent1_marr<=$count_marr; $parent1_marr++){
$id=$marriage_array[$parent1_marr];
@$familyDb = $db_functions->get_family($id);
// *** Don't count search bots, crawlers etc. ***
if (!$bot_visit){
// *** Update (old) statistics counter ***
$fam_counter=$familyDb->fam_counter+1;
$fam_counter_var = $fam_counter;
$fam_gednr_var = $id;
$old_stat_prep->execute();
// *** Extended statistics, first check if table exists ***
@$statistics = $dbh->query("SELECT * FROM humo_stat_date LIMIT 0,1");
if ($statistics AND $descendant_report==false AND $user['group_statistics']=='j'){
$datasql = $dbh->query("SELECT * FROM humo_trees WHERE tree_prefix='".$tree_prefix_quoted."'");
$datasqlDb = $datasql->fetch(PDO::FETCH_OBJ);
$stat_easy_id=$datasqlDb->tree_id.'-'.$familyDb->fam_gedcomnumber.'-'.$familyDb->fam_man.'-'.$familyDb->fam_woman;
$update_sql="INSERT INTO humo_stat_date SET
stat_easy_id='".$stat_easy_id."',
stat_ip_address='".$_SERVER['REMOTE_ADDR']."',
stat_user_agent='".$_SERVER['HTTP_USER_AGENT']."',
stat_tree_id='".$datasqlDb->tree_id."',
stat_gedcom_fam='".$familyDb->fam_gedcomnumber."',
stat_gedcom_man='".$familyDb->fam_man."',
stat_gedcom_woman='".$familyDb->fam_woman."',
stat_date_stat='".date("Y-m-d H:i")."',
stat_date_linux='".time()."'";
$result = $dbh->query($update_sql);
}
}
// *** Privacy filter man and woman ***
@$person_manDb = $db_functions->get_person($familyDb->fam_man);
// *** Process man using a class ***
$man_cls = New person_cls;
$man_cls->construct($person_manDb);
@$person_womanDb = $db_functions->get_person($familyDb->fam_woman);
// *** Process woman using a class ***
$woman_cls = New person_cls;
$woman_cls->construct($person_womanDb);
// *** Process marriage using a class ***
$marriage_cls = New marriage_cls;
$marriage_cls->construct($familyDb, $man_cls->privacy, $woman_cls->privacy);
$family_privacy=$marriage_cls->privacy;
// *******************************************************************
// *** Show family ***
// *******************************************************************
if($screen_mode!='STAR') {
// *** Interne link voor descendant_report ***
if ($descendant_report==true){
// *** Interne link (Romeins number_generation) ***
if($screen_mode=='PDF') {
// put internal PDF link to family
$pdf->Cell(0,1," ",0,1);
$romannr=$number_roman[$generateIndex+1].'-'.$number_generation[$familyIndex+1];
if(isset($link[$romannr])) {
$pdf->SetLink($link[$romannr],-1); //link to this family from child with "volgt"
}
$parlink[$id]=$pdf->Addlink();
$pdf->SetLink($parlink[$id],-1); // link to this family from parents
}
elseif($screen_mode=='RTF') {
//$rtf_text=$number_roman[$descendant_loop+1].'-'.$number_generation[$descendant_loop2+1].' ';
//$sect->writeText($rtf_text, $arial12, new PHPRtfLite_ParFormat());
}
else {
echo '<a name="'.$number_roman[$generateIndex+1].'-'.$number_generation[$familyIndex+1].'">';
echo ' </a>';
}
}
if($screen_mode=='PDF') {
// Show "Family Page", user's choice or default
$pdf->SetLeftMargin(10);
$pdf->Cell(0,2," ",0,1);
if($pdf->GetY() > 260 AND $familyIndex!=0) {
// move to next page so family sheet banner won't be last on page
// but if we are in first family in generation, the gen banner
// is already checked so no need here
$pdf->AddPage(); $pdf->SetY(20);
}
$pdf->SetFont('Arial','BI',12);
$pdf->SetFillColor(186,244,193);
$treetext=show_tree_text($dataDb->tree_prefix, $selected_language);
$family_top=$treetext['family_top'];
if($family_top!='') {
$pdf->SetLeftMargin(10);
$pdf->Cell(0,6,pdf_convert($family_top),0,1,'L',true);
}
else {
$pdf->SetLeftMargin(10);
$pdf->Cell(0,6,pdf_convert(__('Family group sheet')),0,1,'L',true);
}
$pdf->SetFont('Arial','',12);
}
elseif($screen_mode=='RTF') {
$sect->addEmptyParagraph($fontSmall, $parBlack);
$rtf_text=$treetext['family_top'];
if($rtf_text!='')
$sect->writeText($rtf_text, $arial14, $parHead);
else
$sect->writeText(__('Family group sheet'), $arial14, $parHead);
}
else {
// *** Add tip in family screen ***
if (!$bot_visit AND $generateIndex==0 AND $parent1_marr==0){
echo '<div class="print_version"><b>';
printf(__('TIP: use %s for other (ancestor and descendant) reports.'), '<img src="images/reports.gif">');
echo '</b><br><br></div>';
}
echo '<table class="humo standard">';
// *** Show family top line (family top text, settings, favorite) ***
echo topline();
echo '<tr><td colspan="4">';
} //end "if not pdf"
} // end if not STAR
// *************************************************************
// *** Parent1 (normally the father) ***
// *************************************************************
if ($familyDb->fam_kind!='PRO-GEN'){ //onecht kind, woman without man
if ($family_nr==1){
//*** Show data of man ***
if($screen_mode=='') {
echo '<div class="parent1 fonts">';
// *** Show roman number in descendant_report ***
if ($descendant_report==true){
echo '<b>'.$number_roman[$generateIndex+1].'-'.$number_generation[$familyIndex+1].'</b> '; }
}
if($screen_mode=='PDF') {
if ($descendant_report==true) {
$pdf->Write(8,$number_roman[$generateIndex+1].'-'.$number_generation[$familyIndex+1]." "); }
}
if($screen_mode=='RTF') {
$rtf_text=' <b>'.$number_roman[$generateIndex+1].'-'.$number_generation[$familyIndex+1].'</b> ';
//$sect->writeText($rtf_text, $arial12, new PHPRtfLite_ParFormat());
$sect->writeText($rtf_text, $arial12);
}
if ($change_main_person==true){
if($screen_mode=='') {
echo $woman_cls->name_extended("parent1");
echo $woman_cls->person_data("parent1", $id);
// *** Change page title ***
if ($generateIndex==0 AND $familyIndex==0){
echo '<script type="text/javascript">';
$name = $woman_cls->person_name($person_womanDb);
echo 'document.title = "'.__('Family Page').': '.
$name["index_name"].'";';
echo '</script>';
}
}
if($screen_mode=='PDF') {
// PDF rendering of name + details
unset ($templ_person);
if(!isset($person_womanDb->pers_sexe)) { $pers_sexe = "?";}
else $pers_sexe = $person_womanDb->pers_sexe;
$pdf->writename($pers_sexe,$pdf->GetX()+5,$woman_cls->name_extended("parent1"),"long");
$pdf->SetLeftMargin($indent);
$pdfdetails= $woman_cls->person_data("parent1", $id);
if($pdfdetails) {
$pdf->pdfdisplay($pdfdetails,"parent1");
}
$pdf->SetLeftMargin($indent-5);
}
if($screen_mode=='RTF') {
// *** Start new line ***
$sect->writeText('', $arial12, new PHPRtfLite_ParFormat());
// *** RTF person pictures in JPG, because Word doesn't support GIF pictures... ***
if ($person_womanDb->pers_sexe=="M")
$sect->addImage('images/man.jpg', null);
elseif ($person_womanDb->pers_sexe=="F")
$sect->addImage(CMS_ROOTPATH.'images/woman.jpg', null);
else
$sect->addImage(CMS_ROOTPATH.'images/unknown.jpg', null);
$rtf_text=strip_tags($woman_cls->name_extended("parent1"),"<b><i>");
//$sect->writeText($rtf_text, $arial12, new PHPRtfLite_ParFormat());
$sect->writeText($rtf_text, $arial12);
$id='';
$rtf_text=strip_tags($woman_cls->person_data("parent1", $id),"<b><i>");
$sect->writeText($rtf_text, $arial12, $parSimple);
$result = show_media($person_womanDb,'');
if(isset($result[1]) AND count($result[1])>0) {
$break=0; $textarr = Array(); $goodpics=FALSE;
foreach($result[1] as $key => $value) {
if (strpos($key,"path")!==FALSE) {
$type = substr($result[1][$key],-3);
if($type=="jpg" OR $type=="png") {
if($goodpics==FALSE) { //found 1st pic - make table
$table = $sect->addTable();
$table->addRow(0.1);
$table->addColumnsList(array(5,5,5));
$goodpics=TRUE;
}
$break++;
$cell = $table->getCell(1,$break);
$imageFile = $value;
$image = $cell->addImage($imageFile);
$txtkey = str_replace("pic_path","pic_text",$key);
if(isset($result[1][$txtkey])) {
$textarr[]=$result[1][$txtkey];
}
else { $textarr[]=" "; }
}
}
if($break==3) break; // max 3 pics
}
$break1=0;
if(count($textarr)>0) {
$table->addRow(0.1); //add row only if there is photo text
foreach($textarr as $value) {
$break1++;
$cell = $table->getCell(2, $break1);
$cell->writeText($value);
}
}
}
}
if($screen_mode=='STAR') {
//Начальное поколение
if($generateIndex==0) {
$name=$woman_cls->person_name($person_womanDb);
$genarray[$arraynr]["nam"]=$name["standard_name"].$name["colour_mark"];
$genarray[$arraynr]["init"]=$name["initials"];
$genarray[$arraynr]["short"]=$name["short_firstname"];
$genarray[$arraynr]["sex"]="v";
$genarray[$arraynr]["fams"]=$id;
$genarray[$arraynr]["gednr"]=$person_womanDb->pers_gedcomnumber;
$genarray[$arraynr]["2nd"]=0;
if($dna=="mtdnamark" OR $dna=="mtdna") { $genarray[$arraynr]["dna"]=1; }
else $genarray[$arraynr]["dna"]="no";
}
}
}
else{
if($screen_mode=='') {
echo $man_cls->name_extended("parent1");
echo $man_cls->person_data("parent1", $id);
// *** Change page title ***
if ($generateIndex==0 AND $familyIndex==0){
echo '<script type="text/javascript">';
$name = $man_cls->person_name($person_manDb);
echo 'document.title = "'.__('Family Page').': '.
$name["index_name"].'";';
echo '</script>';
}
}
if($screen_mode=='PDF') {
// PDF rendering of name + details
unset ($templ_person);
if(!isset($person_manDb->pers_sexe)) { $pers_sexe = "?";}
else $pers_sexe = $person_manDb->pers_sexe;
$pdf->writename($pers_sexe,$pdf->GetX()+5,$man_cls->name_extended("parent1"),"long");
$pdf->SetLeftMargin($indent);
$pdfdetails= $man_cls->person_data("parent1", $id);
if($pdfdetails) {
$pdf->pdfdisplay($pdfdetails,"parent1");
}
$pdf->SetLeftMargin($indent-5);
}
if($screen_mode=='RTF') {
// *** Start new line ***