Example #1
0
                     if ($parents) {
                         print_sosa_family($famid, $pid, $i);
                     } elseif ($i == 1) {
                         // show empty family only if it is the first and only one
                         print_sosa_family('', $pid, $i);
                     }
                 }
             }
         }
     }
     break;
 case 2:
     // Individual list
     $treeid = ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS);
     echo '<div class="center">';
     print_indi_table($treeid, $pgv_lang["ancestry_chart"] . ' : ' . PrintReady($controller->name), 'sosa');
     echo '</div>';
     break;
 case 3:
     // Family list
     $treeid = ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS - 1);
     $famlist = array();
     foreach ($treeid as $pid) {
         $person = Person::getInstance($pid);
         if (is_null($person)) {
             continue;
         }
         foreach ($person->getChildFamilies() as $famc) {
             $famlist[$famc->getXref()] = $famc;
         }
     }
 function PrintResults()
 {
     global $pgv_lang;
     require_once 'includes/functions/functions_print_lists.php';
     $ret = true;
     if (count($this->myindilist) > 0) {
         echo '<br /><div class="center">';
         uasort($this->myindilist, array('GedcomRecord', 'Compare'));
         print_indi_table($this->myindilist, $pgv_lang["individuals"] . " @ " . PrintReady(get_gedcom_setting(PGV_GEDCOM, 'title'), true));
         print "</div>";
     } else {
         $ret = false;
         if ($this->isPostBack) {
             echo '<br /><div class="warning" style=" text-align: center;"><i>', $pgv_lang['no_results'], '</i><br /></div>';
         }
     }
     return $ret;
 }
Example #3
0
    case 1:
        //-- booklet
        if ($show_full == 0) {
            echo '<span class="details2">', $pgv_lang['charts_click_box'], '</span><br /><br />';
        }
        $show_cousins = true;
        $famids = find_sfamily_ids($controller->pid);
        if (count($famids)) {
            $controller->print_child_family($controller->descPerson, $controller->generations);
        }
        break;
    case 2:
        //-- Individual list
        $descendants = indi_desc($controller->descPerson, $controller->generations, array());
        echo '<div class="center">';
        print_indi_table($descendants, $pgv_lang['descend_chart'] . ' : ' . PrintReady($controller->name));
        echo '</div>';
        break;
    case 3:
        //-- Family list
        $descendants = fam_desc($controller->descPerson, $controller->generations, array());
        echo '<div class="center">';
        print_fam_table($descendants, $pgv_lang['descend_chart'] . ' : ' . PrintReady($controller->name));
        echo '</div>';
        break;
}
print_footer();
function indi_desc($person, $n, $array)
{
    if ($n < 0) {
        return $array;
Example #4
0
 function printResults()
 {
     include_once "includes/functions/functions_print_lists.php";
     global $GEDCOM, $GEDCOMS, $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $pgv_lang, $global_facts;
     //-- all privacy settings must be global if we are going to load up privacy files
     global $SHOW_DEAD_PEOPLE, $SHOW_LIVING_NAMES, $SHOW_SOURCES, $MAX_ALIVE_AGE, $USE_RELATIONSHIP_PRIVACY, $MAX_RELATION_PATH_LENGTH;
     global $CHECK_MARRIAGE_RELATIONS, $PRIVACY_BY_YEAR, $PRIVACY_BY_RESN, $SHOW_PRIVATE_RELATIONSHIPS, $person_privacy, $user_privacy;
     global $global_facts, $person_facts;
     $somethingPrinted = false;
     // whether anything printed
     // ---- section to search and display results on a general keyword search
     if ($this->action == "general" || $this->action == "soundex" || $this->action == "replace") {
         if ($this->myindilist || $this->myfamlist || $this->mysourcelist || $this->mynotelist) {
             echo '<br />';
             $OLD_GEDCOM = $GEDCOM;
             // Split individuals by gedcom
             foreach ($this->sgeds as $gedcom) {
                 $datalist = array();
                 foreach ($this->myindilist as $individual) {
                     if ($individual->getGedId() == get_id_from_gedcom($gedcom)) {
                         $datalist[] = $individual;
                     }
                 }
                 if ($datalist) {
                     $somethingPrinted = true;
                     usort($datalist, array('GedcomRecord', 'Compare'));
                     $GEDCOM = $gedcom;
                     print_indi_table($datalist, $pgv_lang['individuals'] . ' : &laquo;' . $this->myquery . '&raquo; @ ' . PrintReady($GEDCOMS[$gedcom]['title'], true));
                 }
             }
             // Split families by gedcom
             foreach ($this->sgeds as $gedcom) {
                 $datalist = array();
                 foreach ($this->myfamlist as $family) {
                     if ($family->getGedId() == get_id_from_gedcom($gedcom)) {
                         $datalist[] = $family;
                     }
                 }
                 if ($datalist) {
                     $somethingPrinted = true;
                     usort($datalist, array('GedcomRecord', 'Compare'));
                     $GEDCOM = $gedcom;
                     print_fam_table($datalist, $pgv_lang['families'] . ' : &laquo;' . $this->myquery . '&raquo; @ ' . PrintReady($GEDCOMS[$gedcom]['title'], true));
                 }
             }
             // Split sources by gedcom
             foreach ($this->sgeds as $gedcom) {
                 $datalist = array();
                 foreach ($this->mysourcelist as $source) {
                     if ($source->getGedId() == get_id_from_gedcom($gedcom)) {
                         $datalist[] = $source;
                     }
                 }
                 if ($datalist) {
                     $somethingPrinted = true;
                     usort($datalist, array('GedcomRecord', 'Compare'));
                     $GEDCOM = $gedcom;
                     print_sour_table($datalist, $pgv_lang['sources'] . ' : &laquo;' . $this->myquery . '&raquo; @ ' . PrintReady($GEDCOMS[$gedcom]['title'], true));
                 }
             }
             // Split notes by gedcom
             foreach ($this->sgeds as $gedcom) {
                 $datalist = array();
                 foreach ($this->mynotelist as $note) {
                     if ($note->getGedId() == get_id_from_gedcom($gedcom)) {
                         $datalist[] = $note;
                     }
                 }
                 if ($datalist) {
                     $somethingPrinted = true;
                     usort($datalist, array('GedcomRecord', 'Compare'));
                     $GEDCOM = $gedcom;
                     print_note_table($datalist, $pgv_lang['notes'] . ' : &laquo;' . $this->myquery . '&raquo; @ ' . PrintReady($GEDCOMS[$gedcom]['title'], true));
                 }
             }
             $GEDCOM = $OLD_GEDCOM;
         } else {
             if (isset($this->query)) {
                 print "<br /><div class=\"warning\" style=\" text-align: center;\"><i>" . $pgv_lang["no_results"] . "</i><br />";
                 if (!isset($this->srindi) && !isset($this->srfams) && !isset($this->srsour) && !isset($this->srnote)) {
                     print "<i>" . $pgv_lang["no_search_for"] . "</i><br />";
                 }
                 echo '</div>';
             }
         }
         // Prints the Paged Results: << 1 2 3 4 >> links if there are more than $this->resultsPerPage results
         if ($this->resultsPerPage >= 1 && $this->totalGeneralResults > $this->resultsPerPage) {
             $this->printPageResultsLinks($this->inputFieldNames, $this->totalGeneralResults, $this->resultsPerPage);
         }
     }
     // ----- section to search and display results for multisite
     if ($this->action == "multisite") {
         // Only Display 5 results per 2 sites if the total results per page is 10
         $sitesChecked = 0;
         $i = 0;
         foreach ($this->Sites as $server) {
             $siteName = "server" . $i;
             if (isset($_REQUEST["{$siteName}"])) {
                 $sitesChecked++;
             }
             $i++;
         }
         if ($sitesChecked >= 1) {
             $this->multiResultsPerPage = $this->resultsPerPage / $sitesChecked;
             if (!empty($this->Sites) && count($this->Sites) > 0) {
                 $no_results_found = false;
                 // Start output here, because from the indi's we may have printed some fams which need the column header.
                 print "<br />";
                 print "<div class=\"center\">";
                 if (isset($this->multisiteResults) && count($this->multisiteResults) > 0) {
                     $this->totalResults = 0;
                     $this->multiTotalResults = 0;
                     $somethingPrinted = true;
                     foreach ($this->multisiteResults as $key => $siteResults) {
                         include_once 'includes/classes/class_serviceclient.php';
                         $serviceClient = ServiceClient::getInstance($key);
                         $siteName = $serviceClient->getServiceTitle();
                         $siteURL = dirname($serviceClient->getURL());
                         print "<table id=\"multiResultsOutTbl\" class=\"list_table, {$TEXT_DIRECTION}\" align=\"center\">";
                         if (isset($siteResults) && !empty($siteResults->persons)) {
                             $displayed_once = false;
                             $personlist = $siteResults->persons;
                             /***************************************************** PAGING HERE **********************************************************************/
                             //set the total results and only get the results for this page
                             $this->multiTotalResults += count($personlist);
                             if ($this->totalResults < $this->multiTotalResults) {
                                 $this->totalResults = $this->multiTotalResults;
                             }
                             $personlist = $this->getPagedResults($personlist, $this->multiResultsPerPage);
                             $pageResultsNum = 0;
                             foreach ($personlist as $index => $person) {
                                 //if there is a name to display then diplay it
                                 if (!empty($person->gedcomName)) {
                                     if (!$displayed_once) {
                                         if (!$no_results_found) {
                                             $no_results_found = true;
                                             print "<tr><td class=\"list_label\" colspan=\"2\" width=\"100%\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["indis"]["large"] . "\" border=\"0\" width=\"25\" alt=\"\" /> " . $pgv_lang["people"] . "</td></tr>";
                                             print "<tr><td><table id=\"multiResultsInTbl\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" ><tr>";
                                         }
                                         $displayed_once = true;
                                         print "<td class=\"list_label\" colspan=\"2\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" >" . $pgv_lang["site_list"] . "<a href=\"" . encode_url($siteURL) . "\" target=\"_blank\">" . $siteName . "</a>" . $pgv_lang["site_had"] . "</td></tr>";
                                     }
                                     print "<tr><td class=\"list_value {$TEXT_DIRECTION}\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" valign=\"center\" ><ul>";
                                     print "<li class=\"{$TEXT_DIRECTION}\" dir=\"{$TEXT_DIRECTION}\">";
                                     print "<a href=\"" . encode_url("{$siteURL}/individual.php?pid={$person->PID}&ged={$serviceClient->gedfile}") . "\" target=\"_blank\">";
                                     $pageResultsNum += 1;
                                     print "<b>" . $person->getFullName() . "</b>";
                                     if (!empty($person->PID)) {
                                         print " (" . $person->PID . ")";
                                     }
                                     if (!empty($person->birthDate) || !empty($person->birthPlace)) {
                                         print " -- <i>";
                                         if (!empty($person->birthDate)) {
                                             print " " . $person->birthDate;
                                         }
                                         if (!empty($person->birthPlace)) {
                                             print " " . $person->birthPlace;
                                         }
                                         print "</i>";
                                     }
                                     print "</a></li></ul></td>";
                                     /*******************************  Remote Links Per Result *************************************************/
                                     if (PGV_USER_CAN_EDIT) {
                                         print "<td class=\"list_value {$TEXT_DIRECTION}\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" >" . "<ul style=\"list-style: NONE\"><li><a href=\"javascript:;\" " . "onclick=\"return open_link('" . $key . "', '" . $person->PID . "', '" . $person->getFullName() . "');\">" . "<b>" . $pgv_lang["title_search_link"] . "</b></a></ul></li></td></tr>\n";
                                     }
                                 }
                             }
                             print "</table>";
                             print "\n\t\t&nbsp;</td></tr></table>";
                         }
                         if ($this->multiTotalResults > 0) {
                             print "</tr><tr><td align=\"left\">Displaying individuals ";
                             print $this->multiResultsPerPage * $this->resultsPageNum + 1 . " " . $pgv_lang["search_to"] . " " . ($this->multiResultsPerPage * $this->resultsPageNum + $pageResultsNum);
                             print " " . $pgv_lang["of"] . " " . $this->multiTotalResults . "</td></tr></table>";
                             $this->multiTotalResults = 0;
                         } else {
                             print "</tr></table>";
                         }
                     }
                     print "</table>";
                 }
                 echo '</div>';
                 if (!$no_results_found && $this->multiTotalResults == 0 && (isset($this->multiquery) || isset($this->name) || isset($this->birthdate) || isset($this->birthplace) || isset($this->deathdate) || isset($this->deathplace) || isset($this->gender))) {
                     print "<table align=\"center\" \\><td class=\"warning\" style=\" text-align: center;\"><font color=\"red\"><b><i>" . $pgv_lang["no_results"] . "</i></b></font><br /></td></tr></table>";
                 }
             }
         } else {
             if ($sitesChecked < 1 && $this->isPostBack) {
                 print "<table align=\"center\" \\><tr><td class=\"warning\" style=\" text-align: center;\"><font color=\"red\"><b><i>" . $pgv_lang["no_search_site"] . "</i></b></font><br /></td></tr></table>";
             }
         }
         print "</table>";
         // Prints the Paged Results: << 1 2 3 4 >> links if there are more than $this->resultsPerPage results
         if ($this->resultsPerPage > 1 && $this->totalResults > $this->resultsPerPage) {
             $this->printPageResultsLinks($this->inputFieldNames, $this->totalResults, $this->multiResultsPerPage);
         }
     }
     return $somethingPrinted;
     // whether anything printed
 }