$sGroupName = $aRow[0]; $iRoleListID = $aRow[1]; // Get the selected role name if ($iRoleID > 0) { $sSQL = "SELECT lst_OptionName FROM list_lst WHERE lst_ID = " . $iRoleListID . " AND lst_OptionID = " . $iRoleID; $rsTemp = RunQuery($sSQL); $aRow = mysql_fetch_array($rsTemp); $sRoleName = $aRow[0]; } elseif (isset($_POST['GroupRoleEnable'])) { $sSQL = "SELECT lst_OptionName,lst_OptionID FROM list_lst WHERE lst_ID = " . $iRoleListID; $rsTemp = RunQuery($sSQL); while ($aRow = mysql_fetch_array($rsTemp)) { $aRoleNames[$aRow[1]] = $aRow[0]; } } $pdf = new PDF_Directory(); // Read in report settings from database $rsConfig = mysql_query("SELECT cfg_name, IFNULL(cfg_value, cfg_default) AS value FROM config_cfg WHERE cfg_section='ChurchInfoReport'"); if ($rsConfig) { while (list($cfg_name, $cfg_value) = mysql_fetch_row($rsConfig)) { $pdf->{$cfg_name} = $cfg_value; } } // See if this group has special properties. $sSQL = "SELECT * FROM groupprop_master WHERE grp_ID = " . $iGroupID . " ORDER BY prop_ID"; $rsProps = RunQuery($sSQL); $bHasProps = mysql_num_rows($rsProps) > 0; $sSQL = "SELECT * FROM person_per\n\t\t\tLEFT JOIN family_fam ON per_fam_ID = fam_ID "; if ($bHasProps) { $sSQL .= "LEFT JOIN groupprop_" . $iGroupID . " ON groupprop_" . $iGroupID . ".per_ID = person_per.per_ID "; }
$bDirFamilyEmail = isset($_POST["bDirFamilyEmail"]); $bDirPersonalPhone = isset($_POST["bDirPersonalPhone"]); $bDirPersonalWork = isset($_POST["bDirPersonalWork"]); $bDirPersonalCell = isset($_POST["bDirPersonalCell"]); $bDirPersonalEmail = isset($_POST["bDirPersonalEmail"]); $bDirPersonalWorkEmail = isset($_POST["bDirPersonalWorkEmail"]); $sChurchName = FilterInput($_POST["sChurchName"]); $sDirectoryDisclaimer = FilterInput($_POST["sDirectoryDisclaimer"]); $sChurchAddress = FilterInput($_POST["sChurchAddress"]); $sChurchCity = FilterInput($_POST["sChurchCity"]); $sChurchState = FilterInput($_POST["sChurchState"]); $sChurchZip = FilterInput($_POST["sChurchZip"]); $sChurchPhone = FilterInput($_POST["sChurchPhone"]); $bDirUseTitlePage = isset($_POST["bDirUseTitlePage"]); // Instantiate the directory class and build the report. $pdf = new PDF_Directory(); if ($bDirUseTitlePage) { $pdf->TitlePage(); } if (strlen($sDirClassifications)) { $sClassQualifier = "AND per_cls_ID in (" . $sDirClassifications . ")"; } if (!empty($_POST["GroupID"])) { $sGroupTable = ", person2group2role_p2g2r"; $count = 0; foreach ($_POST["GroupID"] as $Grp) { $aGroups[$count++] = FilterInput($Grp, 'int'); } $sGroupsList = implode(",", $aGroups); $sWhereExt .= "AND per_ID = p2g2r_per_ID AND p2g2r_grp_ID in (" . $sGroupsList . ")"; // This is used by per-role queries to remove duplicate rows from people assigned multiple groups.
$sChurchZip = FilterInput($_POST["sChurchZip"]); $sChurchPhone = FilterInput($_POST["sChurchPhone"]); $bDirUseTitlePage = isset($_POST["bDirUseTitlePage"]); $bNumberofColumns = FilterInput($_POST["NumCols"]); $bPageSize = FilterInput($_POST["PageSize"]); $bFontSz = FilterInput($_POST["FSize"]); $bLineSp = $bFontSz / 3; if ($bPageSize == "letter") { $bPageSize = "letter"; } else { $bPageSize = "legal"; } //echo "ncols={$bNumberofColumns} page size={$bPageSize}"; // Instantiate the directory class and build the report. //echo "font sz = {$bFontSz} and line sp={$bLineSp}"; $pdf = new PDF_Directory($bNumberofColumns, $bPageSize, $bFontSz, $bLineSp); // Get the list of custom person fields $sSQL = "SELECT person_custom_master.* FROM person_custom_master ORDER BY custom_Order"; $rsCustomFields = RunQuery($sSQL); $numCustomFields = mysql_num_rows($rsCustomFields); if ($numCustomFields > 0) { while ($rowCustomField = mysql_fetch_array($rsCustomFields, MYSQL_ASSOC)) { $pdf->AddCustomField($rowCustomField['custom_Order'], isset($_POST["bCustom" . $rowCustomField['custom_Order']])); } } // Read in report settings from database $rsConfig = mysql_query("SELECT cfg_name, IFNULL(cfg_value, cfg_default) AS value FROM config_cfg WHERE cfg_section='ChurchInfoReport'"); if ($rsConfig) { while (list($cfg_name, $cfg_value) = mysql_fetch_row($rsConfig)) { $pdf->{$cfg_name} = $cfg_value; }
if (FilterInput($_GET["Family"], 'int') != "") { $sFamilyID = FilterInput($_GET["Family"], 'int'); } $sChurchName = $NamaJemaat; // $sDirectoryDisclaimer = FilterInput($_POST["sDirectoryDisclaimer"]); $sChurchAddress = $AlamatJemaat; $sChurchCity = $KotaJemaat; $sChurchState = $StateJemaat; $sChurchZip = $ZipJemaat; $sChurchPhone = $PhoneJemaat; $bDirUseTitlePage = isset($_POST["bDirUseTitlePage"]); if (isset($_GET["bDirUseTitlePage"]) != "") { $bDirUseTitlePage = isset($_GET["bDirUseTitlePage"]); } // Instantiate the directory class and build the report. $pdf = new PDF_Directory(); // Get Family Data $sSQL = "SELECT * from family_fam where fam_ID = " . $sFamilyID; $rsFamily = RunQuery($sSQL); $aRow = mysql_fetch_array($rsFamily); extract($aRow); $sSQL = "SELECT * from person_per LEFT JOIN person_custom on person_custom.per_ID = person_per.per_ID where per_fam_ID = " . $sFamilyID . " order by per_fmr_ID"; $rsPersonInFam = RunQuery($sSQL); if ($bDirUseTitlePage) { $pdf->TitlePage(); } while ($aPersonInFam = mysql_fetch_array($rsPersonInFam)) { extract($aPersonInFam); $sName = $per_LastName . ", " . $per_FirstName . " " . $per_MiddleName; $aName .= $sName . "\n"; $numlines++;