예제 #1
0
function DeletePerson($iPersonID)
{
    // Remove person from all groups they belonged to
    $sSQL = "SELECT p2g2r_grp_ID FROM person2group2role_p2g2r WHERE p2g2r_per_ID = " . $iPersonID;
    $rsAssignedGroups = RunQuery($sSQL);
    while ($aRow = mysql_fetch_array($rsAssignedGroups)) {
        extract($aRow);
        RemoveFromGroup($iPersonID, $p2g2r_grp_ID);
    }
    // Remove custom field data
    $sSQL = "DELETE FROM person_custom WHERE per_ID = " . $iPersonID;
    RunQuery($sSQL);
    // Remove note data
    $sSQL = "DELETE FROM note_nte WHERE nte_per_ID = " . $iPersonID;
    RunQuery($sSQL);
    // Delete the Person record
    $sSQL = "DELETE FROM person_per WHERE per_ID = " . $iPersonID;
    RunQuery($sSQL);
    // Remove person property data
    $sSQL = "SELECT pro_ID FROM property_pro WHERE pro_Class='p'";
    $rsProps = RunQuery($sSQL);
    while ($aRow = mysql_fetch_row($rsProps)) {
        $sSQL = "DELETE FROM record2property_r2p WHERE r2p_pro_ID = " . $aRow[0] . " AND r2p_record_ID = " . $iPersonID;
        RunQuery($sSQL);
    }
    // Delete any User record
    // $sSQL = "DELETE FROM user_usr WHERE usr_per_ID = " . $iPersonID;
    // RunQuery($sSQL);
    // Make sure person was not in the cart
    RemoveFromPeopleCart($iPersonID);
}
예제 #2
0
function GenerateLabels(&$pdf, $mode, $bOnlyComplete = false)
{
    if ($mode == "indiv") {
        $sSQL = "SELECT * FROM person_per LEFT JOIN family_fam ON person_per.per_fam_ID = family_fam.fam_ID WHERE per_ID IN (" . ConvertCartToString($_SESSION['aPeopleCart']) . ") ORDER BY per_LastName";
    } else {
        $sSQL = "(SELECT *, 0  AS memberCount FROM person_per  LEFT JOIN family_fam ON per_fam_ID = fam_ID WHERE per_fam_ID = 0 AND per_ID in ( " . ConvertCartToString($_SESSION['aPeopleCart']) . " ))\n\t\tUNION (SELECT *, COUNT(*) AS memberCount FROM person_per  LEFT JOIN family_fam ON per_fam_ID = fam_ID WHERE per_fam_ID > 0 AND per_ID in ( " . ConvertCartToString($_SESSION['aPeopleCart']) . " ) GROUP BY per_fam_ID HAVING memberCount = 1)\n\t\tUNION (SELECT *, COUNT(*) AS memberCount FROM person_per  LEFT JOIN family_fam ON per_fam_ID = fam_ID WHERE per_fam_ID > 0 AND per_ID in ( " . ConvertCartToString($_SESSION['aPeopleCart']) . " ) GROUP BY per_fam_ID HAVING memberCount > 1)";
    }
    $rsCartItems = RunQuery($sSQL);
    while ($aRow = mysql_fetch_array($rsCartItems)) {
        $sRowClass = AlternateRowStyle($sRowClass);
        if ($aRow['memberCount'] > 1 && $mode == "fam") {
            $sName = $aRow['fam_Name'] . " Family";
        } else {
            $sName = FormatFullName($aRow['per_Title'], $aRow['per_FirstName'], "", $aRow['per_LastName'], $aRow['per_Suffix'], 1);
        }
        SelectWhichAddress($sAddress1, $sAddress2, $aRow['per_Address1'], $aRow['per_Address2'], $aRow['fam_Address1'], $aRow['fam_Address2'], false);
        $sCity = SelectWhichInfo($aRow['per_City'], $aRow['fam_City'], False);
        $sState = SelectWhichInfo($aRow['per_State'], $aRow['fam_State'], False);
        $sZip = SelectWhichInfo($aRow['per_Zip'], $aRow['fam_Zip'], False);
        $sAddress = $sAddress1;
        if ($sAddress2 != "") {
            $sAddress .= "\n" . $sAddress2;
        }
        if (!$bOnlyComplete || strlen($sAddress) && strlen($sCity) && strlen($sState) && strlen($sZip)) {
            $pdf->Add_PDF_Label(sprintf("%s\n%s\n%s, %s %s", $sName, $sAddress, $sCity, $sState, $sZip));
        }
    }
}
예제 #3
0
function TranslateMenuOptions()
{
    foreach (array('Main', 'Log Off', 'Change My Password', 'Change My Settings', 'Admin', 'Edit Users', 'Add New User', 'Edit Custom Person Fields', 'Edit Donation Funds', 'Backup Database', 'CSV Import', 'Access report', 'Edit General Settings', 'Edit Report Settings', 'Edit User Default Settings', 'Envelope Manager', 'Please select this option to register ChurchInfo after configuring.', 'People/Families', 'Add New Person', 'View All Persons', 'Classification Manager', '---------------------------', 'Edit volunteer opportunities', 'Add New Family', 'View All Families', 'Family Geographic Utilties', 'Family Map', 'Family Roles Manager', 'Events', 'List Church Events', 'Add Church Event', 'List Event Types', 'Check-in and Check-out', 'Deposit', 'Create New Deposit', 'View All Deposits', 'Deposit Reports', 'Edit Deposit Slip', 'Cart', 'List Cart Items', 'Empty Cart', 'Empty Cart to Group', 'Empty Cart to Family', 'Empty Cart to Event', 'Data/Reports', 'CSV Export Records', 'Query Menu', 'Reports Menu', 'Groups', 'List Groups', 'Add a New Group', 'Edit Group Types', 'Group Assignment Helper', 'Properties', 'People Properties', 'Family Properties', 'Group Properties', 'Property Types', 'Help', 'About ChurchInfo', 'Wiki Documentation', 'People', 'Families', 'Geographic features', 'Groups', 'Finances', 'Reports', 'Administration', 'Cart', 'Properties', 'Notes', 'Custom Fields', 'Classifications', 'Canvass Support', 'Events', 'Menu Options', 'Edit Custom Family Fields') as $str) {
        $sSQL = "update menuconfig_mcf set content='" . gettext($str) . "' where content_english='" . $str . "'";
        RunQuery($sSQL);
    }
}
예제 #4
0
function EnvelopeAssignAllFamilies($bMembersOnly)
{
    $sSQL = "SELECT per_fam_ID, per_LastName FROM person_per";
    if ($bMembersOnly) {
        $sSQL .= " WHERE per_cls_ID=" . FindMemberClassID();
    }
    $sSQL .= " ORDER BY per_LastName";
    $rsPeople = RunQuery($sSQL);
    $ind = 0;
    $famArr = array();
    while ($aRow = mysql_fetch_array($rsPeople)) {
        extract($aRow);
        $famArr[$ind++] = $per_fam_ID;
    }
    $famUnique = array_unique($famArr);
    $envelopeNo = 1;
    foreach ($famUnique as $oneFam) {
        $sSQL = "UPDATE family_fam SET fam_Envelope='" . $envelopeNo++ . "' WHERE fam_ID='" . $oneFam . "';";
        RunQuery($sSQL);
    }
    if ($bMembersOnly) {
        return gettext("Assigned envelope numbers to all families with at least one member.");
    } else {
        return gettext("Assigned envelope numbers to all families.");
    }
}
예제 #5
0
function insertledgerlogitem($lliLedgerlogID, $lliLedgerID, $lliAmount)
{
    $ledgerlogitemID = uniqid('1');
    $sql = "INSERT INTO ledgerlogitem(ledgerlogitemID,lliLedgerID, lliLedgerlogID,lliAmount) VALUES ";
    $sql .= "('{$ledgerlogitemID}','{$lliLedgerID}','{$lliLedgerlogID}',0{$lliAmount})";
    RunQuery($sql);
}
 public function getNext()
 {
     global $config;
     if (!$this->result) {
         return FALSE;
     }
     $row = mysql_fetch_assoc($this->result);
     if (!$row) {
         return FALSE;
     }
     if ($this->result) {
         $query = "SELECT AVG(price) AS MarketPrice FROM `" . $config['table prefix'] . "LogSales` WHERE " . "`itemId` = " . (int) $row['itemId'] . " AND " . "`itemDamage` = " . (int) $row['itemDamage'] . " AND " . "IFNULL (`enchantments`, '') = '" . mysql_san($row['enchantments']) . "' AND " . "`logType` =      'sale'" . "ORDER BY `id` DESC LIMIT 10";
         $this->result_price = RunQuery($query, __FILE__, __LINE__);
     }
     if ($this->result_price) {
         $row_price = mysql_fetch_assoc($this->result_price);
         if ($row_price) {
             $marketPrice = $row_price['MarketPrice'];
             $marketPrice_total = $marketPrice * $row['qty'];
         } else {
             $marketPrice = "--";
             $marketPrice_total = "--";
         }
     }
     // new item dao
     return new ItemDAO($row['id'], $row['itemId'], $row['itemDamage'], $row['itemData'], $row['qty'], FormatPrice($marketPrice), FormatPrice($marketPrice_total), $row['enchantments']);
 }
예제 #7
0
파일: GeoPage.php 프로젝트: jwigal/emcommdb
function FamilyInfoByDistance($iFamily)
{
    // Handle the degenerate case of no family selected by just making the array without
    // distance and bearing data, and don't bother to sort it.
    if ($iFamily) {
        // Get info for the selected family
        $sSQL = "SELECT fam_ID as selected_fam_ID, fam_Name as selected_fam_Name, fam_Address1 as selected_fam_Address1, fam_City as selected_fam_City, fam_State as selected_fam_State, fam_Zip as selected_fam_Zip, fam_Latitude as selected_fam_Latitude, fam_Longitude as selected_fam_Longitude from family_fam WHERE fam_ID=" . $iFamily;
        $rsFamilies = RunQuery($sSQL);
        extract(mysql_fetch_array($rsFamilies));
    }
    // Compute distance and bearing from the selected family to all other families
    $sSQL = "SELECT fam_ID, fam_Name, fam_Address1, fam_City, fam_State, fam_Zip, fam_Latitude, fam_Longitude from family_fam";
    $rsFamilies = RunQuery($sSQL);
    while ($aFam = mysql_fetch_array($rsFamilies)) {
        extract($aFam);
        if ($iFamily) {
            $results[$fam_ID]["Distance"] = floatval(LatLonDistance($selected_fam_Latitude, $selected_fam_Longitude, $fam_Latitude, $fam_Longitude));
            $results[$fam_ID]["Bearing"] = LatLonBearing($selected_fam_Latitude, $selected_fam_Longitude, $fam_Latitude, $fam_Longitude);
        }
        $results[$fam_ID]["fam_Name"] = $fam_Name;
        $results[$fam_ID]["fam_Address1"] = $fam_Address1;
        $results[$fam_ID]["fam_City"] = $fam_City;
        $results[$fam_ID]["fam_State"] = $fam_State;
        $results[$fam_ID]["fam_Zip"] = $fam_Zip;
        $results[$fam_ID]["fam_Latitude"] = $fam_Latitude;
        $results[$fam_ID]["fam_Longitude"] = $fam_Longitude;
        $results[$fam_ID]["fam_ID"] = $fam_ID;
    }
    if ($iFamily) {
        $resultsByDistance = SortByDistance($results);
    } else {
        $resultsByDistance = $results;
    }
    return $resultsByDistance;
}
예제 #8
0
function RunFreeQuery()
{
    global $cnInfoCentral;
    global $aRowClass;
    global $rsQueryResults;
    global $sSQL;
    global $iQueryID;
    //Run the SQL
    $rsQueryResults = RunQuery($sSQL);
    if (mysql_error() != "") {
        echo gettext("An error occured: ") . mysql_errno() . "--" . mysql_error();
    } else {
        $sRowClass = "RowColorA";
        echo "<table align=\"center\" cellpadding=\"5\" cellspacing=\"0\">";
        echo "<tr class=\"" . $sRowClass . "\">";
        //Loop through the fields and write the header row
        for ($iCount = 0; $iCount < mysql_num_fields($rsQueryResults); $iCount++) {
            echo "<td align=\"center\"><b>" . mysql_field_name($rsQueryResults, $iCount) . "</b></td>";
        }
        echo "</tr>";
        //Loop through the recordsert
        while ($aRow = mysql_fetch_array($rsQueryResults)) {
            $sRowClass = AlternateRowStyle($sRowClass);
            echo "<tr class=\"" . $sRowClass . "\">";
            //Loop through the fields and write each one
            for ($iCount = 0; $iCount < mysql_num_fields($rsQueryResults); $iCount++) {
                echo "<td align=\"center\">" . $aRow[$iCount] . "</td>";
            }
            echo "</tr>";
        }
        echo "</table>";
        echo "<br><p class=\"ShadedBox\" style=\"border-style: solid; margin-left: 50px; margin-right: 50 px; border-width: 1px;\"><span class=\"SmallText\">" . str_replace(Chr(13), "<br>", htmlspecialchars($sSQL)) . "</span></p>";
    }
}
예제 #9
0
function DeleteTableBackup($tn)
{
    $sSQL = "DROP TABLE IF EXISTS {$tn}" . "_backup";
    if (!RunQuery($sSQL, FALSE)) {
        return false;
    }
    return true;
}
예제 #10
0
 public static function addLog($logType, $saleType, $sellerName, $buyerName, $Item, $price, $allowBids, $currentWinner, $alert = 0)
 {
     global $config;
     $query = "INSERT INTO `" . $config['table prefix'] . "LogSales` ( " . "`logType`, `saleType`, `timestamp`, `itemType`, `itemId`, `itemDamage`, `itemTitle`, `enchantments`, `seller`, `buyer`, `qty`, `price`, `alert` ) VALUES ( " . ($logType == self::LOG_NEW || $logType == self::LOG_SALE || $logType == self::LOG_CANCEL ? "'" . mysql_san($logType) . "'" : 'NULL') . ", " . ($saleType == self::SALE_BUYNOW || $saleType == self::SALE_AUCTION ? "'" . mysql_san($saleType) . "'" : 'NULL') . ", " . "NOW(), " . "'" . mysql_san($Item->getItemType()) . "', " . (int) $Item->getItemId() . ", " . (int) $Item->getItemDamage() . ", " . "'" . mysql_san($Item->getItemTitle()) . "', " . "'" . mysql_san($Item->getEnchantmentsCompressed()) . "', " . ($sellerName == NULL ? 'NULL' : "'" . mysql_san($sellerName) . "'") . ", " . ($buyerName == NULL ? 'NULL' : "'" . mysql_san($buyerName) . "'") . ", " . (int) $Item->getItemQty() . ", " . (double) $price . ", " . (int) $alert . " )";
     $result = RunQuery($query, __FILE__, __LINE__);
     if (!$result || mysql_affected_rows() == 0) {
         echo '<p style="color: red;">Error logging sale!</p>';
         exit;
     }
 }
예제 #11
0
 protected function doQuery($WHERE)
 {
     global $config;
     if (empty($WHERE)) {
         $this->result = FALSE;
         return;
     }
     $query = "SELECT `id`, `itemId`, `itemDamage`, `qty`, `enchantments` " . "FROM `" . $config['table prefix'] . "Items` " . "WHERE " . $WHERE . " ORDER BY `id` ASC";
     $this->result = RunQuery($query, __FILE__, __LINE__);
 }
예제 #12
0
function TranslateMenuOptions()
{
    $sSQL = "SELECT content_english from menuconfig_mcf";
    $rsMenuOptions = RunQuery($sSQL);
    while ($myrow = mysql_fetch_row($rsMenuOptions)) {
        $optStr = $myrow[0];
        $sSQL = "update menuconfig_mcf set content='" . gettext($optStr) . "' where content_english='" . $optStr . "'";
        RunQuery($sSQL);
    }
}
예제 #13
0
파일: MenuEditor.php 프로젝트: dschwen/CRM
function AdjustOrder($sAdjParent, $iDelOrder)
{
    $sSQL = "SELECT mid, sortorder FROM menuconfig_mcf WHERE parent = '{$sAdjParent}' AND sortorder > {$iDelOrder} ORDER BY sortorder";
    $rsTemp = RunQuery($sSQL);
    while ($aRow = mysql_fetch_array($rsTemp)) {
        extract($aRow);
        $sSQL = "UPDATE menuconfig_mcf SET sortorder = ({$sortorder} - 1) WHERE mid = {$mid}";
        RunQuery($sSQL);
    }
}
예제 #14
0
function MakeSalutationUtility($famID)
{
    // Make it put the name if there is only one individual in the family
    // Make it put two first names and the last name when there are exactly two people in the family (e.g. "Nathaniel and Jeanette Brooks")
    // Make it put two whole names where there are exactly two people with different names (e.g. "Doug Philbrook and Karen Andrews")
    // When there are more than two people in the family I don't have any way to know which people are children, so I would have to just use the family name (e.g. "Grossman Family").
    $sSQL = "SELECT * FROM family_fam WHERE fam_ID=" . $famID;
    $rsFamInfo = RunQuery($sSQL);
    if (mysql_num_rows($rsFamInfo) == 0) {
        return "Invalid Family" . $famID;
    }
    $aFam = mysql_fetch_array($rsFamInfo);
    extract($aFam);
    $sSQL = "SELECT * FROM person_per WHERE per_fam_ID=" . $famID . " ORDER BY per_fmr_ID";
    $rsMembers = RunQuery($sSQL);
    $numMembers = mysql_num_rows($rsMembers);
    $numChildren = 0;
    $indNotChild = 0;
    for ($ind = 0; $ind < $numMembers; $ind++) {
        $member = mysql_fetch_array($rsMembers);
        extract($member);
        if ($per_fmr_ID == 3) {
            $numChildren++;
        } else {
            $aNotChildren[$indNotChild++] = $member;
        }
    }
    $numNotChildren = $numMembers - $numChildren;
    if ($numNotChildren == 1) {
        extract($aNotChildren[0]);
        return $per_FirstName . " " . $per_LastName;
    } else {
        if ($numNotChildren == 2) {
            $firstMember = mysql_fetch_array($rsMembers);
            extract($aNotChildren[0]);
            $firstFirstName = $per_FirstName;
            $firstLastName = $per_LastName;
            $secondMember = mysql_fetch_array($rsMembers);
            extract($aNotChildren[1]);
            $secondFirstName = $per_FirstName;
            $secondLastName = $per_LastName;
            if ($firstLastName == $secondLastName) {
                return $firstFirstName . " & " . $secondFirstName . " " . $firstLastName;
            } else {
                return $firstFirstName . " " . $firstLastName . " & " . $secondFirstName . " " . $secondLastName;
            }
        } else {
            return $fam_Name . " Family";
        }
    }
}
예제 #15
0
function GetGroupArray($iGroupID)
{
    //Get the Properties assigned to this Group
    $sSQL = "SELECT pro_Name, pro_ID, pro_Prompt, r2p_Value, prt_Name, pro_prt_ID\n\t\t   FROM record2property_r2p\n\t\t   LEFT JOIN property_pro ON pro_ID = r2p_pro_ID\n\t\t   LEFT JOIN propertytype_prt ON propertytype_prt.prt_ID = property_pro.pro_prt_ID\n\t\t   WHERE pro_Class = 'g' AND r2p_record_ID = " . $iGroupID . " ORDER BY prt_Name, pro_Name";
    $rsAssignedProperties = RunQuery($sSQL);
    // Get the group's role list ID
    $sSQL = "SELECT grp_RoleListID,grp_hasSpecialProps FROM group_grp WHERE grp_ID =" . $iGroupID;
    $aTemp = mysql_fetch_array(RunQuery($sSQL));
    $iRoleListID = $aTemp[0];
    $bHasSpecialProps = $aTemp[1] == "true";
    // Get the roles
    $sSQL = "SELECT * FROM list_lst WHERE lst_ID = " . $iRoleListID . " ORDER BY lst_OptionSequence";
    $rsRoles = RunQuery($sSQL);
    $numRoles = mysql_num_rows($rsRoles);
    // Get the members of the groups along with their family data
    $sSQL = "SELECT per_ID, per_FirstName, per_MiddleName, per_LastName, per_Title, \n                   per_Suffix, per_Address1, per_Address2, per_City, per_State, \n                   per_Zip, per_HomePhone, per_Country, per_Email, per_BirthMonth, per_BirthDay, per_BirthYear, \n                   fam_ID, fam_Address1, fam_Address2, fam_City, fam_State, fam_Zip, fam_Country, fam_HomePhone, \n                   fam_Email, lst_OptionName\n\t\t\t   FROM person_per\n\t\t\t   LEFT JOIN person2group2role_p2g2r ON per_ID = p2g2r_per_ID\n\t\t\t   LEFT JOIN list_lst ON p2g2r_rle_ID = lst_OptionID AND lst_ID = {$iRoleListID}\n\t\t\t   LEFT JOIN group_grp ON grp_ID = p2g2r_grp_ID\n\t\t\t   LEFT JOIN family_fam ON per_fam_ID = family_fam.fam_ID\n\t\t   WHERE p2g2r_grp_ID = " . $iGroupID . " ORDER BY per_LastName, per_FirstName";
    $rsGroupMembers = RunQuery($sSQL);
    $row = 0;
    while ($aGroupMember = mysql_fetch_array($rsGroupMembers)) {
        $ret[$row++] = $aGroupMember;
    }
    return $ret;
}
예제 #16
0
파일: Checkin.php 프로젝트: jwigal/emcommdb
function loadperson($iPersonID)
{
    $sSQL = "SELECT a.*, family_fam.*, cls.lst_OptionName AS sClassName, fmr.lst_OptionName AS sFamRole, b.per_FirstName AS EnteredFirstName,\n\t\t\t\t\tb.Per_LastName AS EnteredLastName, c.per_FirstName AS EditedFirstName, c.per_LastName AS EditedLastName\n\t\t\t\tFROM person_per a\n\t\t\t\tLEFT JOIN family_fam ON a.per_fam_ID = family_fam.fam_ID\n\t\t\t\tLEFT JOIN list_lst cls ON a.per_cls_ID = cls.lst_OptionID AND cls.lst_ID = 1\n\t\t\t\tLEFT JOIN list_lst fmr ON a.per_fmr_ID = fmr.lst_OptionID AND fmr.lst_ID = 2\n\t\t\t\tLEFT JOIN person_per b ON a.per_EnteredBy = b.per_ID\n\t\t\t\tLEFT JOIN person_per c ON a.per_EditedBy = c.per_ID\n\t\t\t\tWHERE a.per_ID = " . $iPersonID;
    $rsPerson = RunQuery($sSQL);
    extract(mysql_fetch_array($rsPerson));
    // Get the lists of custom person fields
    $sSQL = "SELECT person_custom_master.* FROM person_custom_master\n\t\t\t\tWHERE custom_Side = 'left' ORDER BY custom_Order";
    $rsLeftCustomFields = RunQuery($sSQL);
    $sSQL = "SELECT person_custom_master.* FROM person_custom_master\n\t\t\t\tWHERE custom_Side = 'right' ORDER BY custom_Order";
    $rsRightCustomFields = RunQuery($sSQL);
    // Get the custom field data for this person.
    $sSQL = "SELECT * FROM person_custom WHERE per_ID = " . $iPersonID;
    $rsCustomData = RunQuery($sSQL);
    $aCustomData = mysql_fetch_array($rsCustomData, MYSQL_BOTH);
    // Get the notes for this person
    $sSQL = "SELECT nte_Private, nte_ID, nte_Text, nte_DateEntered, nte_EnteredBy, nte_DateLastEdited, nte_EditedBy, a.per_FirstName AS EnteredFirstName, a.Per_LastName AS EnteredLastName, b.per_FirstName AS EditedFirstName, b.per_LastName AS EditedLastName ";
    $sSQL .= "FROM note_nte ";
    $sSQL .= "LEFT JOIN person_per a ON nte_EnteredBy = a.per_ID ";
    $sSQL .= "LEFT JOIN person_per b ON nte_EditedBy = b.per_ID ";
    $sSQL .= "WHERE nte_per_ID = " . $iPersonID;
    // Admins should see all notes, private or not.  Otherwise, only get notes marked non-private or private to the current user.
    if (!$_SESSION['bAdmin']) {
        $sSQL .= " AND (nte_Private = 0 OR nte_Private = " . $_SESSION['iUserID'] . ")";
    }
    $rsNotes = RunQuery($sSQL);
    echo "<font size=\"4\"><b>";
    echo FormatFullName($per_Title, $per_FirstName, $per_MiddleName, $per_LastName, $per_Suffix, 0);
    echo "</font></b><br>";
    if ($fam_ID != "") {
        echo "<font size=\"2\">(";
        if ($sFamRole != "") {
            echo $sFamRole;
        } else {
            echo gettext("Member");
        }
        echo gettext(" of the") . " <a href=\"FamilyView.php?FamilyID=" . $fam_ID . "\">" . $fam_Name . "</a>" . gettext(" family)") . "</font><br><br>";
    } else {
        echo gettext("(No assigned family)") . "<br><br>";
    }
    echo "<div class=\"TinyShadedBox\">";
    echo "<font size=\"3\">";
    if ($sAddress1 != "") {
        echo $sAddress1 . "<br>";
    }
    if ($sAddress2 != "") {
        echo $sAddress2 . "<br>";
    }
    if ($sCity != "") {
        echo $sCity . ", ";
    }
    if ($sState != "") {
        echo $sState;
    }
    if ($sZip != "") {
        echo " " . $sZip;
    }
    if ($sCountry != "") {
        echo "<br>" . $sCountry;
    }
    echo "</font>";
    echo "</div>";
    // Strip tags in case they were added for family inherited data
    $sAddress1 = strip_tags($sAddress1);
    $sCity = strip_tags($sCity);
    $sState = strip_tags($sState);
    $sCountry = strip_tags($sCountry);
    // Upload photo
    if (isset($_POST["UploadPhoto"]) && ($_SESSION['bAddRecords'] || $bOkToEdit)) {
        if ($_FILES['Photo']['name'] == "") {
            $PhotoError = gettext("No photo selected for uploading.");
        } elseif ($_FILES['Photo']['type'] != "image/pjpeg" && $_FILES['Photo']['type'] != "image/jpeg") {
            $PhotoError = gettext("Only jpeg photos can be uploaded.");
        } else {
            // Create the thumbnail used by PersonView
            chmod($_FILES['Photo']['tmp_name'], 0777);
            $srcImage = imagecreatefromjpeg($_FILES['Photo']['tmp_name']);
            $src_w = imageSX($srcImage);
            $src_h = imageSY($srcImage);
            // Calculate thumbnail's height and width (a "maxpect" algorithm)
            $dst_max_w = 200;
            $dst_max_h = 350;
            if ($src_w > $dst_max_w) {
                $thumb_w = $dst_max_w;
                $thumb_h = $src_h * ($dst_max_w / $src_w);
                if ($thumb_h > $dst_max_h) {
                    $thumb_h = $dst_max_h;
                    $thumb_w = $src_w * ($dst_max_h / $src_h);
                }
            } elseif ($src_h > $dst_max_h) {
                $thumb_h = $dst_max_h;
                $thumb_w = $src_w * ($dst_max_h / $src_h);
                if ($thumb_w > $dst_max_w) {
                    $thumb_w = $dst_max_w;
                    $thumb_h = $src_h * ($dst_max_w / $src_w);
                }
            } else {
                if ($src_w > $src_h) {
                    $thumb_w = $dst_max_w;
                    $thumb_h = $src_h * ($dst_max_w / $src_w);
                } elseif ($src_w < $src_h) {
                    $thumb_h = $dst_max_h;
                    $thumb_w = $src_w * ($dst_max_h / $src_h);
                } else {
                    if ($dst_max_w >= $dst_max_h) {
                        $thumb_w = $dst_max_h;
                        $thumb_h = $dst_max_h;
                    } else {
                        $thumb_w = $dst_max_w;
                        $thumb_h = $dst_max_w;
                    }
                }
            }
            $dstImage = ImageCreateTrueColor($thumb_w, $thumb_h);
            imagecopyresampled($dstImage, $srcImage, 0, 0, 0, 0, $thumb_w, $thumb_h, $src_w, $src_h);
            imagejpeg($dstImage, "Images/Person/thumbnails/" . $iPersonID . ".jpg");
            imagedestroy($dstImage);
            imagedestroy($srcImage);
            move_uploaded_file($_FILES['Photo']['tmp_name'], "Images/Person/" . $iPersonID . ".jpg");
        }
    } elseif (isset($_POST["DeletePhoto"]) && $_SESSION['bDeleteRecords']) {
        unlink("Images/Person/" . $iPersonID . ".jpg");
        unlink("Images/Person/thumbnails/" . $iPersonID . ".jpg");
    }
    // Display photo or upload from file
    $photoFile = "Images/Person/thumbnails/" . $iPersonID . ".jpg";
    if (file_exists($photoFile)) {
        echo '<a target="_blank" href="Images/Person/' . $iPersonID . '.jpg">';
        echo '<img border="1" src="' . $photoFile . '"></a>';
        /*			if ($bOkToEdit) {
        				echo '
        					<form method="post"
        					action="PersonView.php?PersonID=' . $iPersonID . '">
        					<br>
        					<input type="submit" class="icTinyButton" 
        					value="' . gettext("Delete Photo") . '" name="DeletePhoto">
        					</form>';
        				}
        */
    } else {
        // Some old / M$ browsers can't handle PNG's correctly.
        if ($bDefectiveBrowser) {
            echo '<img border="0" src="Images/NoPhoto.gif"><br><br><br>';
        } else {
            echo '<img border="0" src="Images/NoPhoto.png"><br><br><br>';
        }
        /*
        			if ($bOkToEdit) {
        				if (isset($PhotoError))
        					echo '<span style="color: red;">' . $PhotoError . '</span><br>';
        
        				echo '
        					<form method="post" 
        					action="PersonView.php?PersonID=' . $iPersonID . '" 
        					enctype="multipart/form-data">
        					<input class="icTinyButton" type="file" name="Photo">
        					<input type="submit" class="icTinyButton" 
        					value="' . gettext("Upload Photo") . '" name="UploadPhoto">
        					</form>';
        			}
        */
    }
}
예제 #17
0
파일: EmailSend.php 프로젝트: dschwen/CRM
function SendEmail($sSubject, $sMessage, $attachName, $hasAttach, $sRecipient)
{
    global $sSendType;
    global $sFromEmailAddress;
    global $sFromName;
    global $sLangCode;
    global $sLanguagePath;
    global $sSMTPAuth;
    global $sSMTPUser;
    global $sSMTPPass;
    global $sSMTPHost;
    global $sSERVERNAME;
    global $sUSER;
    global $sPASSWORD;
    global $sDATABASE;
    global $sSQL_ERP;
    global $sSQL_EMP;
    $iUserID = $_SESSION['iUserID'];
    // Retrieve UserID for faster access
    // Store these queries in variables. (called on every loop iteration)
    $sSQLGetEmail = 'SELECT * FROM email_recipient_pending_erp ' . "WHERE erp_usr_id='{$iUserID}' " . 'ORDER BY erp_num_attempt, erp_id LIMIT 1';
    // Just run this one ahead of time to get the message subject and body
    $sSQL = 'SELECT * FROM email_message_pending_emp';
    extract(mysql_fetch_array(RunQuery($sSQL)));
    // Keep track of how long this script has been running.  To avoid server
    // and browser timeouts break out of loop every $sLoopTimeout seconds and
    // redirect back to EmailSend.php with meta refresh until finished.
    $tStartTime = time();
    $mail = new PHPMailer();
    // Set the language for PHPMailer
    $mail->SetLanguage($sLangCode, $sLanguagePath);
    if ($mail->IsError()) {
        echo 'PHPMailer Error with SetLanguage().  Other errors (if any) may not report.<br>';
    }
    $mail->CharSet = 'utf-8';
    $mail->From = $sFromEmailAddress;
    // From email address (User Settings)
    $mail->FromName = $sFromName;
    // From name (User Settings)
    if ($hasAttach) {
        $mail->AddAttachment("tmp_attach/" . $attachName);
    }
    if (strtolower($sSendType) == 'smtp') {
        $mail->IsSMTP();
        // tell the class to use SMTP
        $mail->SMTPKeepAlive = true;
        // keep connection open until last email sent
        $mail->SMTPAuth = $sSMTPAuth;
        // Server requires authentication
        if ($sSMTPAuth) {
            $mail->Username = $sSMTPUser;
            // SMTP username
            $mail->Password = $sSMTPPass;
            // SMTP password
        }
        $delimeter = strpos($sSMTPHost, ':');
        if ($delimeter === FALSE) {
            $sSMTPPort = 25;
            // Default port number
        } else {
            $sSMTPPort = substr($sSMTPHost, $delimeter + 1);
            $sSMTPHost = substr($sSMTPHost, 0, $delimeter);
        }
        if (is_int($sSMTPPort)) {
            $mail->Port = $sSMTPPort;
        } else {
            $mail->Port = 25;
        }
        $mail->Host = $sSMTPHost;
        // SMTP server name
    } else {
        $mail->IsSendmail();
        // tell the class to use Sendmail
    }
    $bContinue = TRUE;
    $sLoopTimeout = 30;
    // Break out of loop if this time is exceeded
    $iMaxAttempts = 3;
    // Error out if an email address fails 3 times
    while ($bContinue) {
        // Three ways to get out of this loop
        // 1.  We're finished sending email
        // 2.  Time exceeds $sLoopTimeout
        // 3.  Something strange happens
        //        (maybe user tries to send from multiple sessions
        //         causing counts and timestamps to 'misbehave' )
        $tTimeStamp = date('Y-m-d H:i:s');
        $mail->Subject = $sSubject;
        $mail->Body = $sMessage;
        if ($sRecipient == 'get_recipients_from_mysql') {
            $rsEmailAddress = RunQuery($sSQLGetEmail);
            // This query has limit one to pick up one recipient
            $aRow = mysql_fetch_array($rsEmailAddress);
            extract($aRow);
            $mail->AddAddress($erp_email_address);
        } else {
            $erp_email_address = $sRecipient;
            $mail->AddAddress($erp_email_address);
            $bContinue = FALSE;
            // Just sending one email
        }
        if (!$mail->Send()) {
            // failed- make a note in the log and the recipient record
            if ($sRecipient == 'get_recipients_from_mysql') {
                $sMsg = "Failed sending to: {$erp_email_address} ";
                $sMsg .= $mail->ErrorInfo;
                echo "{$sMsg}<br>\n";
                AddToEmailLog($sMsg, $iUserID);
                // Increment the number of attempts for this message
                $erp_num_attempt++;
                $sSQL = 'UPDATE email_recipient_pending_erp ' . "SET erp_num_attempt='{$erp_num_attempt}' ," . "    erp_failed_time='{$tTimeStamp}' " . "WHERE erp_id='{$erp_id}'";
                RunQuery($sSQL);
                // Check if we've maxed out retry attempts
                if ($erp_num_attempt < $iMaxAttempts) {
                    echo "Pausing 15 seconds after failure<br>\n";
                    AddToEmailLog('Pausing 15 seconds after failure', $iUserID);
                    sleep(15);
                    // Delay 15 seconds on failure
                    // The mail server may be having a temporary problem
                } else {
                    $_SESSION['sEmailState'] = 'error';
                    $bContinue = FALSE;
                    $sMsg = 'Too many failures. Giving up. You may try to resume later.';
                    AddToEmailLog($sMsg, $iUserID);
                }
            } else {
                $sMsg = "Failed sending to: {$sRecipient} ";
                $sMsg .= $mail->ErrorInfo;
                echo "{$sMsg}<br>\n";
                AddToEmailLog($sMsg, $iUserID);
            }
        } else {
            if ($sRecipient == 'get_recipients_from_mysql') {
                echo "<b>{$erp_email_address}</b> Sent! <br>\n";
                $sMsg = "Email sent to: {$erp_email_address}";
                AddToEmailLog($sMsg, $iUserID);
                // Delete this record from the recipient list
                $sSQL = 'DELETE FROM email_recipient_pending_erp ' . "WHERE erp_email_address='{$erp_email_address}'";
                RunQuery($sSQL);
            } else {
                echo "<b>{$sRecipient}</b> Sent! <br>\n";
                $sMsg = "Email sent to: {$erp_email_address}";
                AddToEmailLog($sMsg, $iUserID);
            }
        }
        $mail->ClearAddresses();
        $mail->ClearBCCs();
        // Are we done?
        extract(mysql_fetch_array(RunQuery($sSQL_ERP)));
        // this query counts remaining recipient records
        if ($sRecipient == 'get_recipients_from_mysql' && $countrecipients == 0) {
            $bContinue = FALSE;
            $_SESSION['sEmailState'] = 'finish';
            AddToEmailLog('Job Finished', $iUserID);
        }
        if (time() - $tStartTime > $sLoopTimeout) {
            // bail out of this loop if we've taken more than $sLoopTimeout seconds.
            // The meta refresh will reload this page so we can pick up where
            // we left off
            $bContinue = FALSE;
        }
    }
    if (strtolower($sSendType) == 'smtp') {
        $mail->SmtpClose();
    }
}
예제 #18
0
function DisplayParameterForm()
{
    global $rsParameters;
    global $iQueryID;
    global $aErrorText;
    global $cnInfoCentral;
    //Start the form and the table
    echo '<form method="post" action="QueryView.php?QueryID=' . $iQueryID . '">';
    echo '<table align="center" cellpadding="5" cellspacing="1" border="0">';
    //Loop through the parameters and display an entry box for each one
    if (mysql_num_rows($rsParameters)) {
        mysql_data_seek($rsParameters, 0);
    }
    while ($aRow = mysql_fetch_array($rsParameters)) {
        extract($aRow);
        //Begin the row, giving the name of the parameter
        echo "<tr>";
        echo "<td class=\"LabelColumn\">" . $qrp_Name . ":</td>";
        //Determine the type of parameter we're dealing with
        switch ($qrp_Type) {
            //Standard INPUT box
            case 0:
                //Begin the table cell, disoplay the INPUT tag, close the table cell
                echo "<td class=\"TextColumn\">";
                echo "<input size=\"" . $qrp_InputBoxSize . "\" name=\"" . $qrp_Alias . "\" type=\"text\" value=\"" . $qrp_Default . "\">";
                echo "</td>";
                break;
                //SELECT box with OPTION tags supplied in the queryparameteroptions_qpo table
            //SELECT box with OPTION tags supplied in the queryparameteroptions_qpo table
            case 1:
                //Get the query parameter options for this parameter
                $sSQL = "SELECT * FROM queryparameteroptions_qpo WHERE qpo_qrp_ID = " . $qrp_ID;
                $rsParameterOptions = RunQuery($sSQL);
                //Begin the table cell and the SELECT tag
                echo "<td class=\"TextColumn\">";
                echo "<select name=\"" . $qrp_Alias . "\">";
                //Loop through the parameter options
                while ($ThisRow = mysql_Fetch_array($rsParameterOptions)) {
                    extract($ThisRow);
                    //Display the OPTION tag
                    echo "<option value=\"" . $qpo_Value . "\">" . $qpo_Display . "</option>";
                }
                //Close the SELECT tag and table cell
                echo "</select>";
                echo "</td>";
                break;
                //SELECT box with OPTION tags provided via a SQL query
            //SELECT box with OPTION tags provided via a SQL query
            case 2:
                //Run the SQL to get the options
                $rsParameterOptions = RunQuery($qrp_OptionSQL);
                echo "<td class=\"TextColumn\">";
                echo "<select name=\"" . $qrp_Alias . "\">";
                while ($ThisRow = mysql_Fetch_array($rsParameterOptions)) {
                    extract($ThisRow);
                    echo "<option value=\"" . $Value . "\">" . $Display . "</option>";
                }
                //Close the SELECT tag and table cell
                echo "</select>";
                echo "</td>";
                break;
        }
        //Display the query description and close the row
        echo "<td  valign=\"top\" class=\"SmallText\">" . $qrp_Description . "</td>";
        echo "</tr>";
        //If we are re-rendering this form due to a validation error, display the error
        if (isset($aErrorText[$qrp_Alias])) {
            echo "<tr><td colspan=\"3\" style=\"color: red;\">" . $aErrorText[$qrp_Alias] . "</td></tr>";
        }
    }
    ?>
	
	<td colspan="3" align="center">
		<br>
		<input class="icButton" type="Submit" value="<?php 
    echo gettext("Execute Query");
    ?>
" name="Submit">
	</p>

	</table>

	</form>

	<?php 
}
예제 #19
0
        $this->MultiCell(0, 5, $text);
        // set width to 0 prints to right margin
        $this->_CurLine += $numlines;
    }
}
// Instantiate the directory class and build the report.
$pdf = new PDF_EnvelopeReport();
// 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;
    }
}
$sSQL = "SELECT fam_ID, fam_Envelope FROM family_fam WHERE fam_Envelope>0 ORDER BY fam_Envelope";
$rsRecords = RunQuery($sSQL);
while ($aRow = mysql_fetch_array($rsRecords)) {
    $OutStr = "";
    extract($aRow);
    $OutStr = $pdf->sGetFamilyString($aRow);
    // Count the number of lines in the output string
    if (strlen($OutStr)) {
        $numlines = substr_count($OutStr, "\n");
    } else {
        $numlines = 0;
    }
    $pdf->Add_Record($OutStr, $numlines);
}
header('Pragma: public');
// Needed for IE when using a shared SSL certificate
if ($iPDFOutputType == 1) {
예제 #20
0
        } elseif (in_array($_SERVER['SERVER_PORT'], $aHTTPSports)) {
            $_SESSION['bSecureServer'] = true;
        } else {
            echo "Invalid server port number.  Check Config.php";
            exit;
        }
        $_SESSION['iServerPort'] = $_SERVER['SERVER_PORT'];
        // If PHP's magic quotes setting is turned off, we want to use a workaround to ensure security.
        $_SESSION['bHasMagicQuotes'] = get_magic_quotes_gpc();
        // Redirect to the Menu
        Redirect("Menu.php");
    }
}
// Get all the users in the system
$sSQL = "SELECT per_FirstName, per_LastName, per_Title, per_Suffix, per_MiddleName, user_usr.* FROM user_usr, person_per WHERE per_ID = usr_per_ID ORDER BY per_LastName";
$rsUsers = RunQuery($sSQL);
// Set the page title and include HTML header
?>

<html>
<head>
	<link rel="stylesheet" type="text/css" href="css/login.css">
	<title><?php 
echo gettext("smjGPIB: Login - sistem manajemen jemaat GPIB");
?>
</title>
</head>
<body>
<div id="header"></div>
<div id="breadcrumbs"></div>
<div id="contents">
예제 #21
0
 $tName = FilterInput($_POST["Name"]);
 $tDescription = FilterInput($_POST["Description"]);
 $nDuration = FilterInput($_POST["Duration"]);
 // Validate Date
 if (strlen($dDate) > 0) {
     list($iYear, $iMonth, $iDay) = sscanf($dDate, "%04d-%02d-%02d");
     if (!checkdate($iMonth, $iDay, $iYear)) {
         $sDateError = "<span style=\"color: red; \">" . gettext("Not a valid Date") . "</span>";
         $bErrorFlag = true;
     }
 }
 //If no errors, then let's update...
 if (!$bErrorFlag) {
     //Get all the members of this group
     $sSQL = "SELECT * FROM person_per, person2group2role_p2g2r WHERE per_ID = p2g2r_per_ID AND p2g2r_grp_ID = " . $iGroupID;
     $rsGroupMembers = RunQuery($sSQL);
     $calDbId = mysql_select_db($sWEBCALENDARDB);
     $q = "SELECT MAX(cal_id) AS calID FROM webcal_entry";
     $rsEventID = mysql_query($q);
     extract(mysql_fetch_array($rsEventID));
     $calID = $calID + 1;
     // Move the meeting date/time from here to UTC for storage
     $timezoneHere = new DateTimeZone(date_default_timezone_get());
     $timezoneUTC = new DateTimeZone('UTC');
     $dateTimeMeeting = new DateTime($dDate . $iHour . ":" . $iMinutes, $timezoneHere);
     $dateTimeMeeting->setTimezone($timezoneUTC);
     $dDate = $dateTimeMeeting->format('Y-m-d');
     $iHour = $dateTimeMeeting->format('H');
     $iMinutes = $dateTimeMeeting->format('i');
     $datestr = sprintf("%04d%02d%02d", substr($dDate, 0, 4), substr($dDate, 5, 2), substr($dDate, 8, 2));
     $timestr = sprintf("%02d%02d00", $iHour, $iMinutes);
예제 #22
0
} else {
    if (strlen($iPropertyID) != 0) {
        //Get the data on this property
        $sSQL = "SELECT * FROM property_pro WHERE pro_ID = " . $iPropertyID;
        $rsProperty = mysql_fetch_array(RunQuery($sSQL));
        extract($rsProperty);
        //Assign values locally
        $sName = $pro_Name;
        $sDescription = $pro_Description;
        $iType = $pro_prt_ID;
        $sPrompt = $pro_Prompt;
    }
}
//Get the Property Types
$sSQL = "SELECT * FROM propertytype_prt WHERE prt_Class = '" . $sType . "' ORDER BY prt_Name";
$rsPropertyTypes = RunQuery($sSQL);
require "Include/Header.php";
?>

<form method="post" action="PropertyEditor.php?PropertyID=<?php 
echo $iPropertyID;
?>
&Type=<?php 
echo $sType;
?>
">

<table cellpadding="4">
	<tr>
		<td valign="top" align="right"><b><?php 
echo gettext("Type:");
예제 #23
0
            $permission = "FALSE";
        } else {
            $permission = "TRUE";
        }
        // Save new setting
        $sSQL = "UPDATE userconfig_ucfg " . "SET ucfg_value='{$value}', ucfg_permission='{$permission}' " . "WHERE ucfg_id='{$id}' AND ucfg_per_id='0' ";
        $rsUpdate = RunQuery($sSQL);
        next($type);
    }
}
// Set the page title and include HTML header
$sPageTitle = gettext("Default User Settings");
require "Include/Header.php";
// Get settings
$sSQL = "SELECT * FROM userconfig_ucfg WHERE ucfg_per_id='0' ORDER BY ucfg_id";
$rsConfigs = RunQuery($sSQL);
// Table Headings
echo "<form method=post action=SettingsUser.php>";
echo "Set Permission True to give new users the ability to change their current value.<BR>";
echo "<table cellpadding=3 align=left>";
echo "<tr><td><h3>Permission</h3></td>\n    <td><h3>" . gettext("Variable name") . "</h3></td>\n\t<td><h3>Current Value</h3></td>\n\t<td><h3>Notes</h3></td></tr>";
$r = 1;
// List Individual Settings
while (list($ucfg_per_id, $ucfg_id, $ucfg_name, $ucfg_value, $ucfg_type, $ucfg_tooltip, $ucfg_permission) = mysql_fetch_row($rsConfigs)) {
    // Cancel, Save Buttons every 13 rows
    if ($r == 13) {
        echo "<tr><td>&nbsp;</td>\n\t\t\t<td><input type=submit class=icButton name=save value=\"" . gettext("Save Settings") . "\">\n\t\t\t<input type=submit class=icButton name=cancel value=\"" . gettext("Cancel") . "\">\n\t\t\t</td></tr>";
        $r = 1;
    }
    // Default Permissions
    if ($ucfg_permission == 'TRUE') {
예제 #24
0
?>

<p>
<span class="MediumText"><u><?php 
echo gettext("Event Attendance");
?>
</u></span>
<br>
<?php 
echo gettext("Generate attendance -AND- non-attendance reports for events");
?>
<br>
<?php 
//$sSQL = "SELECT * FROM event_types";
$sSQL = "SELECT DISTINCT event_types.* FROM event_types RIGHT JOIN events_event ON event_types.type_id=events_event.event_type ORDER BY type_id ";
$rsOpps = RunQuery($sSQL);
$numRows = mysql_num_rows($rsOpps);
// List all events
for ($row = 1; $row <= $numRows; $row++) {
    $aRow = mysql_fetch_array($rsOpps);
    extract($aRow);
    echo '&nbsp;&nbsp;&nbsp;<a href="EventAttendance.php?Action=List&Event=' . $type_id . '&Type=' . gettext($type_name) . '" title="List All ' . gettext($type_name) . ' Events"><strong>' . gettext($type_name) . '</strong></a>' . "<br>\n";
}
?>
</p>


<?php 
if ($bUSAddressVerification) {
    echo '<p>';
    echo '<a class="MediumText" href="USISTAddressVerification.php">';
예제 #25
0
<?php

require "../Include/Config.php";
require "../Include/Functions.php";
// Get all the groups
$sSQL = "select grp.grp_Name sundayschoolClass, kid.per_ID kidId, kid.per_FirstName firstName, kid.per_LastName LastName, kid.per_BirthDay birthDay,  kid.per_BirthMonth birthMonth, kid.per_BirthYear birthYear, kid.per_CellPhone mobilePhone,\nfam.fam_HomePhone homePhone,\ndad.per_FirstName dadFirstName, dad.per_LastName dadLastName, dad.per_CellPhone dadCellPhone, dad.per_Email dadEmail,\nmom.per_FirstName momFirstName, mom.per_LastName momLastName, mom.per_CellPhone momCellPhone, mom.per_Email momEmail,\nfam.fam_Email famEmail, fam.fam_Address1 Address1, fam.fam_Address2 Address2, fam.fam_City city, fam.fam_State state, fam.fam_Zip zip\n\nfrom person_per kid, family_fam fam\nleft Join person_per dad on fam.fam_id = dad.per_fam_id and dad.per_Gender = 1 and dad.per_fmr_ID = 1\nleft join person_per mom on fam.fam_id = mom.per_fam_id and mom.per_Gender = 2 and mom.per_fmr_ID = 2\n,`group_grp` grp, `person2group2role_p2g2r` person_grp  \n\nwhere kid.per_fam_id = fam.fam_ID and person_grp.p2g2r_rle_ID = 2 and kid.per_cls_ID = 2 and\ngrp_Type = 4 and grp.grp_ID = person_grp.p2g2r_grp_ID  and person_grp.p2g2r_per_ID = kid.per_ID\norder by grp.grp_Name, fam.fam_Name";
$rsKids = RunQuery($sSQL);
$sSQL = "select kid.per_ID kidId, kid.per_FirstName firstName, kid.per_LastName LastName, kid.per_BirthDay birthDay,  kid.per_BirthMonth birthMonth, kid.per_BirthYear birthYear, kid.per_CellPhone mobilePhone,\nfam.fam_Address1 Address1, fam.fam_Address2 Address2, fam.fam_City city, fam.fam_State state, fam.fam_Zip zip\nfrom person_per kid, family_fam fam\nwhere per_fam_id = fam.fam_ID and per_cls_ID = 2 and kid.per_fmr_ID = 3 and\n\tper_ID not in\n\t(select per_id from person_per,`group_grp` grp, `person2group2role_p2g2r` person_grp\n\t\twhere person_grp.p2g2r_rle_ID = 2 and grp_Type = 4 and grp.grp_ID = person_grp.p2g2r_grp_ID  and person_grp.p2g2r_per_ID = kid.per_ID)";
$rsKidsMissing = RunQuery($sSQL);
// Set the page title and include HTML header
$sPageTitle = gettext("Sunday School Class List");
require "../Include/Header.php";
?>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/plug-ins/3cfcc339e89/integration/bootstrap/3/dataTables.bootstrap.css">
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/plug-ins/3cfcc339e89/integration/bootstrap/3/dataTables.bootstrap.js"></script>

<div class="box">
	<div class="box-header">
		<h3 class="box-title">Current Sunday School Kids</h3>
	</div><!-- /.box-header -->
	<div class="box-body table-responsive">
		<table id="sundayschool" class="table table-striped table-bordered" cellspacing="0" width="100%">
			<thead>
			<tr>
				<th></th>
				<th>Class</th>
				<th>First Name</th>
				<th>Last Name</th>
				<th>Birth Date</th>
				<th>Age</th>
예제 #26
0
 $summaryFundX = 15;
 $summaryMethodX = 55;
 $summaryFromX = 80;
 $summaryMemoX = 120;
 $summaryAmountX = 185;
 $summaryIntervalY = 4;
 // Get the list of funds
 $sSQL = "SELECT fun_ID,fun_Name,fun_Description,fun_Active FROM donationfund_fun";
 if ($editorMode == 0) {
     $sSQL .= " WHERE fun_Active = 'true'";
 }
 // New donations should show only active funds.
 $rsFunds = RunQuery($sSQL);
 //Get the payments for this deposit slip
 $sSQL = "SELECT plg_plgID, plg_FYID, plg_date, plg_amount, plg_method, plg_CheckNo, \n\t         plg_comment, a.fam_Name AS FamilyName, b.fun_Name AS fundName\n\t\t\t FROM pledge_plg\n\t\t\t LEFT JOIN family_fam a ON plg_FamID = a.fam_ID\n\t\t\t LEFT JOIN donationfund_fun b ON plg_fundID = b.fun_ID\n\t\t\t WHERE plg_PledgeOrPayment = 'Payment' AND plg_depID = " . $iDepositSlipID . " ORDER BY pledge_plg.plg_method DESC, pledge_plg.plg_date";
 $rsPledges = RunQuery($sSQL);
 $pdf->SetFont('Times', 'B', 10);
 $pdf->SetXY($curX, $curY);
 $pdf->Write(8, 'Chk No.');
 $pdf->SetXY($curX + $summaryFundX, $curY);
 $pdf->Write(8, 'Fund');
 $pdf->SetXY($curX + $summaryMethodX, $curY);
 $pdf->Write(8, 'PmtMethod');
 $pdf->SetXY($curX + $summaryFromX, $curY);
 $pdf->Write(8, 'Rcd From');
 $pdf->SetXY($curX + $summaryMemoX, $curY);
 $pdf->Write(8, 'Memo');
 $pdf->SetXY($curX + $summaryAmountX - 5, $curY);
 $pdf->Write(8, 'Amount');
 $curY += 2 * $summaryIntervalY;
 $totalAmount = 0;
예제 #27
0
function FindMemberClassID()
{
    //Get Classifications
    $sSQL = "SELECT * FROM list_lst WHERE lst_ID = 1 ORDER BY lst_OptionSequence";
    $rsClassifications = RunQuery($sSQL);
    while ($aRow = mysql_fetch_array($rsClassifications)) {
        extract($aRow);
        if ($lst_OptionName == gettext("Member")) {
            return $lst_OptionID;
        }
    }
    return 1;
    // Should not get here, but if we do get here use the default value.
}
예제 #28
0
     } else {
         if ($sAction == 'down') {
             $newRow = ++$iRowNum;
         }
     }
 } else {
     $swapRow = $iRowNum;
     $newRow = $iRowNum;
 }
 if (array_key_exists($swapRow, $aIDFields)) {
     $sSQL = "UPDATE volunteeropportunity_vol\n\t               SET vol_Order = '" . $newRow . "' " . "WHERE vol_ID = '" . $aIDFields[$swapRow] . "';";
     RunQuery($sSQL);
 }
 if (array_key_exists($newRow, $aIDFields)) {
     $sSQL = "UPDATE volunteeropportunity_vol\n\t               SET vol_Order = '" . $swapRow . "' " . "WHERE vol_ID = '" . $aIDFields[$newRow] . "';";
     RunQuery($sSQL);
 }
 // now update internal data to match
 if (array_key_exists($swapRow, $aIDFields)) {
     $saveID = $aIDFields[$swapRow];
     $saveName = $aNameFields[$swapRow];
     $saveDesc = $aDescFields[$swapRow];
     $aIDFields[$newRow] = $saveID;
     $aNameFields[$newRow] = $saveName;
     $aDescFields[$newRow] = $saveDesc;
 }
 if (array_key_exists($newRow, $aIDFields)) {
     $aIDFields[$swapRow] = $aIDFields[$newRow];
     $aNameFields[$swapRow] = $aNameFields[$newRow];
     $aDescFields[$swapRow] = $aDescFields[$newRow];
 }
예제 #29
0
파일: GroupEditor.php 프로젝트: dschwen/CRM
        $aRow = mysql_fetch_array($rsGroup);
        $iGroupID = $aRow["grp_ID"];
        $iGroupType = $aRow["grp_Type"];
        $iDefaultRole = $aRow["grp_DefaultRole"];
        $iRoleListID = $aRow["grp_RoleListID"];
        $sName = $aRow["grp_Name"];
        $sDescription = $aRow["grp_Description"];
        $bHasSpecialProps = $aRow["grp_hasSpecialProps"] == 'true';
    }
}
// Get Group Types for the drop-down
$sSQL = "SELECT * FROM list_lst WHERE lst_ID = 3 ORDER BY lst_OptionSequence";
$rsGroupTypes = RunQuery($sSQL);
//Group Group Role List
$sSQL = "SELECT * FROM group_grp WHERE grp_RoleListID > 0 ORDER BY grp_Name";
$rsGroupRoleSeed = RunQuery($sSQL);
require "Include/Header.php";
?>

<script language="javascript">
bStatus = false;

function confirmDelete() {
	if (!bStatus) {
		bStatus = confirm(<?php 
echo "'" . gettext("Are you sure you want to remove the group-specific person properties?  All group member properties data will be lost!") . "'";
?>
);
		document.GroupEdit.UseGroupProps.checked = !bStatus;
	}
	else
예제 #30
0
    RunQuery($sSQL, FALSE);
    // False means do not stop on error
    break;
}
// End of for
$sError = mysql_error();
$sSQL_Last = $sSQL;
// Let's check if MySQL database is in sync with PHP code
$sSQL = 'SELECT * FROM version_ver ORDER BY ver_ID DESC';
$aRow = mysql_fetch_array(RunQuery($sSQL));
extract($aRow);
if ($ver_version == $sVersion) {
    // We're good.  Clean up by dropping the
    // temporary tables
    $sSQL = "DROP TABLE IF EXISTS `tempconfig_tcfg`, `templist_tlst`, ";
    $sSQL .= "`tempuserconfig_tucfg`, `temp_person_custom_master`";
    RunQuery($sSQL, TRUE);
} else {
    // An error occured.  Clean up by restoring
    // tables to their original condition by using
    // the temporary tables.
    $sSQL = "DROP TABLE IF EXISTS `config_cfg`, `list_lst`, ";
    $sSQL .= "`userconfig_ucfg`, `person_custom_master`";
    RunQuery($sSQL, TRUE);
    $sSQL = "RENAME TABLE `tempconfig_tcfg`           TO `config_cfg`, ";
    $sSQL .= "             `templist_tlst`             TO `list_lst`, ";
    $sSQL .= "             `tempuserconfig_tucfg`      TO `userconfig_ucfg`, ";
    $sSQL .= "             `temp_person_custom_master` TO `person_custom_master`";
    RunQuery($sSQL, TRUE);
}
$sSQL = $sSQL_Last;