Esempio n. 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);
}
Esempio n. 2
0
function RemoveGroupFromPeopleCart($iGroupID)
{
    //Get all the members of this group
    $sSQL = "SELECT p2g2r_per_ID FROM person2group2role_p2g2r " . "WHERE p2g2r_grp_ID = " . $iGroupID;
    $rsGroupMembers = RunQuery($sSQL);
    //Loop through the recordset
    while ($aRow = mysql_fetch_array($rsGroupMembers)) {
        extract($aRow);
        //remove each person from the cart
        RemoveFromPeopleCart($p2g2r_per_ID);
    }
}
Esempio n. 3
0
// If Magic Quotes is turned off, do the same thing manually..
if (!$_SESSION['bHasMagicQuotes']) {
    foreach ($_REQUEST as $key => $value) {
        $value = addslashes($value);
    }
}
// Constants
$aPropTypes = array(1 => gettext("True / False"), 2 => gettext("Date"), 3 => gettext("Text Field (50 char)"), 4 => gettext("Text Field (100 char)"), 5 => gettext("Text Field (long)"), 6 => gettext("Year"), 7 => gettext("Season"), 8 => gettext("Number"), 9 => gettext("Person from Group"), 10 => gettext("Money"), 11 => gettext("Phone Number"), 12 => gettext("Custom Drop-Down List"));
// Are they adding anything to the People Cart?
if (isset($_GET["AddToPeopleCart"])) {
    AddToPeopleCart(FilterInput($_GET["AddToPeopleCart"], 'int'));
    $sGlobalMessage = gettext("Selected record successfully added to the Cart.");
}
// Are they removing anything from the People Cart?
if (isset($_GET["RemoveFromPeopleCart"])) {
    RemoveFromPeopleCart(FilterInput($_GET["RemoveFromPeopleCart"], 'int'));
    $sGlobalMessage = gettext("Selected record successfully removed from the Cart.");
}
// Are they emptying their cart?
if ($_GET["Action"] == "EmptyCart") {
    unset($_SESSION['aPeopleCart']);
    $sGlobalMessage = gettext("Your cart has been successfully emptied.");
}
if (isset($_POST["BulkAddToCart"])) {
    $aItemsToProcess = explode(",", $_POST["BulkAddToCart"]);
    if (isset($_POST["AndToCartSubmit"])) {
        if (isset($_SESSION['aPeopleCart'])) {
            $_SESSION['aPeopleCart'] = array_intersect($_SESSION['aPeopleCart'], $aItemsToProcess);
        }
    } elseif (isset($_POST["NotToCartSubmit"])) {
        if (isset($_SESSION['aPeopleCart'])) {