Exemplo n.º 1
0
 public function removeClient($lClientID)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $glUserID;
     $sqlStr = "UPDATE client_records\n           SET\n              cr_lLastUpdateID = {$glUserID},\n              cr_bRetired = 1\n           WHERE cr_lKeyID={$lClientID};";
     $query = $this->db->query($sqlStr);
     // remove group membership
     $clsGroups = new mgroups();
     $clsGroups->removeMemFromAllGroups(CENUM_CONTEXT_CLIENT, $lClientID);
     // delete client entries in personalized tables
     $uf = new muser_fields();
     $uf->deleteForeignViaUFTableType(CENUM_CONTEXT_CLIENT, $lClientID);
     $uf->deleteForeignViaUFTableType(CENUM_CONTEXT_CPROGENROLL, $lClientID);
     $uf->deleteForeignViaUFTableType(CENUM_CONTEXT_CPROGATTEND, $lClientID);
     $uf->deleteForeignViaUFTableType(CENUM_CONTEXT_CPREPOST, $lClientID);
 }
Exemplo n.º 2
0
 public function retireSingleGift($lGiftID, $lGroupID)
 {
     //---------------------------------------------------------------------
     // $lGroupID is the recyle bin group id; set to null if deleting
     // a single gift
     //---------------------------------------------------------------------
     global $glUserID;
     $sqlStr = "UPDATE gifts\n         SET\n            gi_bRetired=1,\n            gi_lLastUpdateID={$glUserID}\n         WHERE gi_lKeyID={$lGiftID};";
     $this->db->query($sqlStr);
     // if this is a silent auction donation,
     // remove gift ID
     $sqlStr = "UPDATE gifts_auctions_packages\n         SET\n            ap_lGiftID       = NULL,\n            ap_lLastUpdateID = {$glUserID}\n         WHERE ap_lGiftID = {$lGiftID};";
     $this->db->query($sqlStr);
     $uf = new muser_fields();
     $uf->deleteForeignViaUFTableType(CENUM_CONTEXT_GIFT, $lGiftID);
     $this->logGiftRetire($lGiftID, $lGroupID);
 }
 public function retireSingleSponsorship($lSponID, &$lGroupID)
 {
     //---------------------------------------------------------------------
     // $lGroupID is the recyle bin group id; set to null if deleting
     // a single gift
     //---------------------------------------------------------------------
     global $glUserID;
     $sqlStr = "UPDATE sponsor\n         SET\n            sp_bRetired=1,\n            sp_lLastUpdateID={$glUserID}\n         WHERE sp_lKeyID={$lSponID};";
     $this->db->query($sqlStr);
     $this->logSponsorshipRetire($lSponID, $lGroupID);
     // remove UF table entries
     $uf = new muser_fields();
     $uf->deleteForeignViaUFTableType(CENUM_CONTEXT_SPONSORSHIP, $lSponID);
 }
Exemplo n.º 4
0
 public function removePersonBiz($bBiz = false)
 {
     //-----------------------------------------------------------------------
     // caller must first set
     //    $this->lPeopleID (set to bizID if business)
     //
     // note that both businesses and people are removed from this routine
     //-----------------------------------------------------------------------
     global $glUserID;
     if (is_null($this->lPeopleID)) {
         screamForHelp('PEOPLE ID NOT SET!<br>error on <b>line:</b> ' . __LINE__ . '<br><b>file: </b>' . __FILE__ . '<br><b>function: </b>' . __FUNCTION__);
     }
     $lPID = $this->lPeopleID;
     $sqlStr = "UPDATE people_names\n            SET\n               pe_bRetired=1,\n               pe_lLastUpdateID={$glUserID}\n            WHERE pe_lKeyID={$lPID};";
     $this->db->query($sqlStr);
     $lGroupID = null;
     $this->logPeopleRetire($lGroupID);
     //-----------------------------
     // remove associated gifts
     //-----------------------------
     $clsGifts = new mdonations();
     $clsGifts->retireGiftsViaPID($lPID, $lGroupID);
     //---------------------------------
     // remove associated sponsorships
     //---------------------------------
     $clsSpon = new msponsorship();
     $clsSpon->retireSponsorshipsViaPID($lPID, $lGroupID);
     //---------------------------------
     // remove business contacts
     //---------------------------------
     $clsBiz = new mbiz();
     $clsBiz->lPID = $lPID;
     $clsBiz->deleteBizContact(false, true, false, $lGroupID);
     //---------------------------------
     // remove group membership
     //---------------------------------
     $clsGroups = new mgroups();
     $clsGroups->removeMemFromAllGroups($bBiz ? CENUM_CONTEXT_BIZ : CENUM_CONTEXT_PEOPLE, $lPID);
     // delete people/biz entries in personalized tables
     $uf = new muser_fields();
     $uf->deleteForeignViaUFTableType(CENUM_CONTEXT_PEOPLE, $lPID);
     $uf->deleteForeignViaUFTableType(CENUM_CONTEXT_BIZ, $lPID);
     $uf->deleteForeignViaUFTableType(CENUM_CONTEXT_VOLUNTEER, $lPID);
 }