Example #1
0
 function lAddLogEntry($bSuccess, $strUserName)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     if ($bSuccess) {
         if (is_null($this->el_lUserID)) {
             screamForHelp('UNITIALIZED CLASS</b><br>error on <b>line:</b> ' . __LINE__ . '<br><b>file:</b> ' . __FILE__ . '<br><b>function:</b> ' . __FUNCTION__);
         }
     }
     $sqlStr = 'INSERT INTO admin_usage_log
       SET
            el_lUserID         = ' . strDBValueConvert_INT($this->el_lUserID) . ',
            el_str_Remote_Addr = ' . strPrepStr(@$_SERVER['REMOTE_ADDR']) . ',
            el_strUserName     = '******',
            el_bLoginSuccessful= ' . ($bSuccess ? '1' : '0') . ',
            el_str_Remote_Host = ' . strPrepStr(@$_SERVER['REMOTE_HOST']) . ',
            el_str_Remote_Port = ' . strPrepStr(@$_SERVER['REMOTE_PORT']) . ';';
     $query = $this->db->query($sqlStr);
     return $this->db->insert_id();
 }
 private function updateHMMailContact($lMC_PID, $lHMID)
 {
     //-----------------------------------------------------------------
     //
     //-----------------------------------------------------------------
     global $glUserID;
     $sqlStr = "UPDATE lists_hon_mem\n         SET\n            ghm_lLastUpdateID  = {$glUserID},\n            ghm_lMailContactID = " . strDBValueConvert_INT($lMC_PID) . "\n          WHERE ghm_lKeyID={$lHMID};";
     $query = $this->db->query($sqlStr);
 }
 public function addRemoveHonoreeToSponsorship($lSponID, $lHonPID)
 {
     //---------------------------------------------------------------------
     // set $lHonPID to null to remove honoree
     //---------------------------------------------------------------------
     global $glUserID;
     $sqlStr = 'UPDATE sponsor
         SET sp_lHonoreeID = ' . strDBValueConvert_INT($lHonPID) . ",\n               sp_lLastUpdateID={$glUserID}\n            WHERE sp_lKeyID={$lSponID};";
     $this->db->query($sqlStr);
 }
 function sqlCommonTermAddEdit()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $glUserID;
     $term =& $this->terms[0];
     $strOut = '
         crs_bCompareBool  = ' . strDBValueConvert_BOOL($term->bCompareBool) . ',
         crs_lCompVal      = ' . strDBValueConvert_INT($term->lCompVal) . ',
         crs_curCompVal    = ' . strDBValueConvert_SNG($term->curCompVal, 2) . ',
         crs_strCompVal    = ' . strDBValueConvert_String($term->strCompVal) . ',
         crs_dteCompVal    = ' . strDBValueConvert_String($term->mdteCompVal) . ",\n            crs_lCompareOpt   = {$term->lCompareOpt},\n            crs_lSortIDX      = {$term->lSortIDX},\n            crs_lLastUpdateID = {$glUserID},\n            crs_dteLastUpdate = NOW()\n            ";
     return $strOut;
 }
 private function strCommonFieldSQL()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $glUserID;
     $ufield =& $this->fields[0];
     return ' 
         pff_strFieldNameUser = '******',
         pff_strFieldNotes    = ' . strPrepStr($ufield->strFieldNotes) . ',
         pff_bCheckDef        = ' . strDBValueConvert_BOOL($ufield->pff_bCheckDef) . ',
         pff_curDef           = ' . strDBValueConvert_SNG($ufield->pff_curDef, 2) . ',
         pff_strTxtDef        = ' . strDBValueConvert_String($ufield->pff_strTxtDef) . ',
         pff_lDef             = ' . strDBValueConvert_INT($ufield->pff_lDef) . ",\n            pff_lCurrencyACO     = " . (int) $ufield->pff_lCurrencyACO . ",\n            pff_bPrefilled       = " . ($ufield->bPrefilled ? '1' : '0') . ",\n            pff_bHidden          = " . ($ufield->pff_bHidden ? '1' : '0') . ",\n            pff_bRequired        = " . ($ufield->pff_bRequired ? '1' : '0') . ",\n            pff_lLastUpdateID    = {$glUserID},\n            pff_dteLastUpdate    = NOW() ";
 }
 private function strCommonGiftSQL()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $glUserID;
     $gift = $this->gifts[0];
     return 'gi_lCampID       = ' . $gift->gc_lKeyID . ',
         gi_lLastUpdateID = ' . $glUserID . ',
         gi_bGIK          = ' . ($gift->gi_bGIK ? '1' : '0') . ',
         gi_lSponsorID    = ' . strDBValueConvert_INT($gift->gi_lSponsorID) . ',
         gi_curAmnt       = ' . number_format($gift->gi_curAmnt, 2, '.', '') . ',
         gi_lACOID        = ' . $gift->lACOID . ',
         gi_dteDonation   = ' . strPrepStr($gift->mdteDonation) . ',
         gi_lAttributedTo = ' . strDBValueConvert_INT($gift->gi_lAttributedTo) . ',
         gi_lGIK_ID       = ' . strDBValueConvert_INT($gift->gi_lGIK_ID) . ',
         gi_lPledgeID     = ' . strDBValueConvert_INT($gift->lPledgeID) . ',
         gi_strNotes      = ' . strPrepStr($gift->strNotes) . ',
         gi_strCheckNum   = ' . strPrepStr($gift->gi_strCheckNum) . ',
         gi_lPaymentType  = ' . $gift->gi_lPaymentType . ',
         gi_lMajorGiftCat = ' . $gift->gi_lMajorGiftCat . ' ';
 }
 public function lCreateNewPeopleRec()
 {
     //-----------------------------------------------------------------------
     //
     //-----------------------------------------------------------------------
     global $glUserID, $glChapterID;
     $clsUFC = new muser_fields_create();
     $lHID = $this->people[0]->lHouseholdID;
     $sqlStr = "INSERT INTO people_names\n        SET\n             pe_lChapterID   = {$glChapterID},\n             pe_lHouseholdID = " . strDBValueConvert_INT($lHID) . ",\n             pe_lOriginID    = {$glUserID},\n             pe_dteOrigin    = NOW(), " . $this->strPeopleSQLCommon() . ';';
     $query = $this->db->query($sqlStr);
     $this->people[0]->lKeyID = $lKeyID = $this->db->insert_id();
     //------------------------------------------------------------
     // if not part of a household, make person head of household
     //------------------------------------------------------------
     if ($lHID == 0) {
         $sqlStr = "UPDATE people_names\n             SET\n                pe_lHouseholdID={$lKeyID}\n             WHERE pe_lKeyID={$lKeyID};";
         $this->db->query($sqlStr);
     }
     //--------------------------------------------------------
     // create blank/default records for all the personalized
     // people tables
     //--------------------------------------------------------
     $clsUFC->enumTType = CENUM_CONTEXT_PEOPLE;
     $clsUFC->loadTablesViaTType();
     if ($clsUFC->lNumTables > 0) {
         foreach ($clsUFC->userTables as $clsTable) {
             $clsUFC->createSingleEmptyRec($clsTable, $lKeyID);
         }
     }
     return $lKeyID;
 }