本文整理汇总了PHP中strPrepStr函数的典型用法代码示例。如果您正苦于以下问题:PHP strPrepStr函数的具体用法?PHP strPrepStr怎么用?PHP strPrepStr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strPrepStr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: people_biz_search
function people_biz_search($strSearch, $lLimit = 30)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
$lLen = strlen($strSearch);
$sqlStr = 'SELECT pe_strLName, pe_strFName, pe_bBiz, pe_lKeyID, pe_strAddr1
FROM people_names
WHERE NOT pe_bRetired
AND LEFT(pe_strLName, ' . $lLen . ')=' . strPrepStr($strSearch) . "\n ORDER BY pe_strLName, pe_strFName, pe_lKeyID\n LIMIT 0, {$lLimit};";
$query = $this->db->query($sqlStr);
$this->lNumRows = $query->num_rows();
if ($this->lNumRows > 0) {
$idx = 0;
$this->results = array();
foreach ($query->result() as $row) {
$this->results[$idx] = new stdClass();
$r =& $this->results[$idx];
$r->lKeyID = $row->pe_lKeyID;
$r->strFName = $row->pe_strFName;
$r->strLName = $row->pe_strLName;
$r->bBiz = $row->pe_bBiz;
$r->strAddr1 = $row->pe_strAddr1;
if ($r->bBiz) {
$r->strSafeName = htmlspecialchars($r->strLName) . ' (business)';
} else {
$r->strSafeName = htmlspecialchars($r->strLName . ', ' . $r->strFName);
}
++$idx;
}
}
}
示例2: lSaveObject
function lSaveObject(&$theObject)
{
$prepedObject = strPrepStr(serialize($theObject));
$sqlStr = "INSERT INTO serial_objects SET so_object= {$prepedObject};";
$this->db->query($sqlStr);
return $this->db->insert_id();
}
示例3: loadCustomFormsViaType
function loadCustomFormsViaType($enumType)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
$this->strWhereExtra = ' AND cf_enumContextType= ' . strPrepStr($enumType) . ' ';
$this->loadCustomForms();
}
示例4: loadVolRegFormsViaHash
function loadVolRegFormsViaHash($strHash)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
$this->strWhereExtra = ' AND vreg_strURLHash=' . strPrepStr($strHash) . ' ';
$this->loadVolRegForms();
}
示例5: lDocsGrouped
function lDocsGrouped(&$lNumContextGroups, &$contextGroups)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
$sqlWhere = 'AND di_enumEntryType=' . strPrepStr(CENUM_IMGDOC_ENTRY_PDF) . ' ';
$this->lGroupedImageDocCnt($sqlWhere, 'di_enumContextType', $lNumContextGroups, $contextGroups);
}
示例6: updateEventDate
public function updateEventDate($lEventDateID, $dteEvent, $bmysqlDate = false)
{
//-----------------------------------------------------------------------
//
//-----------------------------------------------------------------------
if ($bmysqlDate) {
$strEDate = strPrepStr($dteEvent);
} else {
$strEDate = strPrepDate($dteEvent);
}
$sqlStr = "UPDATE vol_events_dates\n SET\n ved_dteEvent = {$strEDate}\n WHERE ved_lKeyID={$lEventDateID};";
$this->db->query($sqlStr);
}
示例7: strNameWhereClauseViaLetter
function strNameWhereClauseViaLetter($strFieldName, $strDirLetter)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
if ($strDirLetter == '*') {
$strWhereName = ' ';
} elseif ($strDirLetter == '#') {
$strWhereName = ' AND ((LEFT(' . $strFieldName . ',1) < "A") OR (LEFT(' . $strFieldName . ',1) > "Z")) ';
} else {
$strWhereName = ' AND (LEFT(' . $strFieldName . ',1)=' . strPrepStr($strDirLetter) . ') ';
}
return $strWhereName;
}
示例8: loadUFSchemaViaAttachTypeUserTabName
function loadUFSchemaViaAttachTypeUserTabName($enumAttachType, $strUserTabName, &$lTableID, $bFreakIfNotFound = false)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
$this->sqlWhereExtra = ' AND pft_enumAttachType = ' . strPrepStr($enumAttachType) . '
AND pft_strUserTableName = ' . strPrepStr($strUserTabName) . ' ';
$this->loadUFSchema();
if ($bFreakIfNotFound && $this->lNumTables == 0) {
screamForHelp($strUserTabName . ': user table not found<br>error on line <b> -- ' . __LINE__ . ' --</b>,<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__);
}
// technique to get first key value
// http://stackoverflow.com/questions/4095796/php-how-to-get-associative-array-key-from-numeric-index
reset($this->schema);
$lTableID = key($this->schema);
}
示例9: addEditS2
function addEditS2()
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
if (!bTestForURLHack('editPeopleBizVol')) {
return;
}
$displayData = array();
$this->load->helper('js/simple_search');
$this->load->model('util/msearch_single_generic', 'clsSearch');
$this->load->model('people/mpeople', 'clsPeople');
$this->clsSearch->strSearchTerm = $strSearch = trim($_POST['txtSearch']);
//-----------------------------
// search display setup
//-----------------------------
$this->clsSearch->enumSearchType = CENUM_CONTEXT_PEOPLE;
$this->clsSearch->strSearchLabel = 'People';
$this->clsSearch->bShowKeyID = true;
$this->clsSearch->strIDLabel = 'peopleID: ';
$this->clsSearch->bShowLink = false;
$this->clsSearch->bShowSelect = true;
$this->clsSearch->bShowEnumSearchType = false;
$this->clsSearch->strDisplayTitle = '<br>Please select the person to add as a volunteer</b><br>';
// landing page for selection
$this->clsSearch->strPathSelection = 'volunteers/vol_add_edit/addNewS3/';
$this->clsSearch->strTitleSelection = 'Select person';
// landing page for "back"
$this->clsSearch->strPathSearchAgain = 'volunteers/vol_add_edit/addEditS1';
$this->clsSearch->strTitleSearchAgain = 'Search again...';
$lLeftCnt = strlen($strSearch);
$this->clsSearch->strWhereExtra = " AND LEFT(pe_strLName, {$lLeftCnt})=" . strPrepStr($strSearch) . ' ';
// run search
$displayData['strSearchLabel'] = 'Searching for ' . $this->clsSearch->enumSearchType . ' that begin with <b><i>"' . htmlspecialchars($strSearch) . '"</b></i><br>';
$this->clsSearch->searchNewVolunteer();
$displayData['strHTMLSearchResults'] = $this->clsSearch->strHTML_SearchResults();
//-----------------------------
// breadcrumbs & page setup
//-----------------------------
$displayData['title'] = CS_PROGNAME . ' | Add new volunteer';
$displayData['pageTitle'] = anchor('main/menu/vols', 'Volunteers', 'class="breadcrumb"') . ' | Add New Volunteers';
$displayData['mainTemplate'] = 'vols/search_sel_person_view';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$this->load->vars($displayData);
$this->load->view('template');
}
示例10: searchHH
function searchHH($strSearch)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
$displayData = array();
if (!bTestForURLHack('dataEntryPeopleBizVol')) {
return;
}
$this->load->model('util/msearch_single_generic', 'clsSearch');
$this->load->model('people/mpeople', 'clsPeople');
//-----------------------------
// search display setup
//-----------------------------
$this->clsSearch->enumSearchType = CENUM_CONTEXT_HOUSEHOLD;
$this->clsSearch->strSearchLabel = 'Household';
$this->clsSearch->bShowKeyID = true;
$this->clsSearch->bShowSelect = true;
$this->clsSearch->bShowEnumSearchType = false;
$this->clsSearch->strDisplayTitle = '<br>Please select the household for the new person</b><br>';
// landing page for selection
$this->clsSearch->strPathSelection = 'people/people_add_new/addNewS3/';
$this->clsSearch->strTitleSelection = 'Select household';
// landing page for "back"
$this->clsSearch->strPathSearchAgain = 'people/people_add_new/selCon';
$this->clsSearch->strTitleSearchAgain = 'Search again...';
$lLeftCnt = strlen($strSearch);
$this->clsSearch->strSearchTerm = $strSearch;
$this->clsSearch->strWhereExtra = " AND LEFT(pe_strLName, {$lLeftCnt})=" . strPrepStr($strSearch) . " ";
$this->clsSearch->strIDLabel = 'household ID: ';
$this->clsSearch->bShowLink = false;
// run search
$displayData['strSearchLabel'] = 'Searching for ' . $this->clsSearch->enumSearchType . ' that begin with <b><i>"' . htmlspecialchars($strSearch) . '"</b></i><br>';
// $this->clsSearch->searchPeople();
$this->clsSearch->searchHousehold();
$displayData['strHTMLSearchResults'] = $this->clsSearch->strHTML_SearchResults();
//-----------------------------
// breadcrumbs & page setup
//-----------------------------
$displayData['title'] = CS_PROGNAME . ' | Select Household';
$displayData['pageTitle'] = anchor('main/menu/people', 'People', 'class="breadcrumb"') . ' | ' . anchor('people/people_add_new/selCon', 'Add New', 'class="breadcrumb"') . ' | Select Household';
$displayData['mainTemplate'] = 'people/search_sel_household_view';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$this->load->vars($displayData);
$this->load->view('template');
}
示例11: addRecycleEntry
function addRecycleEntry()
{
//-----------------------------------------------------------------------
//
//-----------------------------------------------------------------------
global $glUserID;
$varGroupID = is_null($this->lGroupID) ? 0 : $this->lGroupID;
$sqlStr = "INSERT INTO recycle_bin\n SET\n rb_lGroupID = {$varGroupID},\n rb_enumRecycleType = " . strPrepStr($this->enumRecycleType) . ',
rb_strDescription = ' . strPrepStr(substr($this->strNotes, 0, 255)) . ',
rb_strTable = ' . strPrepStr($this->strTable) . ',
rb_strKeyIDFN = ' . strPrepStr($this->strKeyIDFN) . ',
rb_strRetireFN = ' . strPrepStr($this->strRetireFN) . ",\n rb_lForeignID = {$this->lForeignID},\n rb_lOriginID = {$glUserID},\n rb_lLastUpdateID = {$glUserID},\n rb_dteOrigin = NOW(),\n rb_dteLastUpdate = NOW();";
$query = $this->db->query($sqlStr);
if (is_null($this->lGroupID)) {
$this->lGroupID = $lKeyID = mysql_insert_id();
$sqlStr = "UPDATE recycle_bin SET rb_lGroupID={$lKeyID} WHERE rb_lKeyID={$lKeyID};";
$query = $this->db->query($sqlStr);
}
}
示例12: bVerifyUniqueText
public function bVerifyUniqueText($strTestText, $strTxtFN, $lKeyExclude, $strKeyFN, $bExcludeRetired, $strRetiredFN, $bQualSubGroup1, $lKeySubGroup1, $strSubGroupFN_1, $bQualSubGroup2, $lKeySubGroup2, $strSubGroupFN_2, $strTableName)
{
//---------------------------------------------------------------------
// return true if the text entry is not already in the database.
// Inputs:
// $strTestText - text to test against
// $strTxtFN - field name of the text field
// $lKeyExclude - exclusion key value (if testing for uniqueness but want to exclude
// the current entry (for updates))
// $strKeyFN - the field name of the key
// $bExcludeRetired - if true, exclude retired table entries from the test
// $strRetiredFN - field name of retired entry flag (assumed to be boolean)
// $strTableName - the database table name
//
// $bQualSubGroup1/2, $lKeySubGroup1/2, $strSubGroupFN_1/2
// - if true, qualify the search to records that have matching
// key values
//---------------------------------------------------------------------
$strQual1 = $strQual2 = '';
if ($bQualSubGroup1) {
if (is_numeric($lKeySubGroup1)) {
$strQual1 = "AND ({$strSubGroupFN_1} = {$lKeySubGroup1}) ";
} else {
$strQual1 = "AND ({$strSubGroupFN_1} = " . strPrepStr($lKeySubGroup1) . ') ';
}
}
if ($bQualSubGroup2) {
if (is_numeric($lKeySubGroup2)) {
$strQual2 = "AND ({$strSubGroupFN_2} = {$lKeySubGroup2}) ";
} else {
$strQual2 = "AND ({$strSubGroupFN_2} = " . strPrepStr($lKeySubGroup2) . ') ';
}
}
$sqlStr = "SELECT count({$strKeyFN}) as lNumMatch\n FROM {$strTableName}\n WHERE ucase({$strTxtFN})=" . strPrepStr(strtoupper($strTestText)) . "\n AND {$strKeyFN}<>{$lKeyExclude}\n {$strQual1}\n {$strQual2} " . ($bExcludeRetired ? "AND ({$strRetiredFN}=0) " : '') . ';';
$query = $this->db->query($sqlStr);
if ($query->num_rows() == 0) {
screamForHelp('Unexpected SQL error - forms/util/util_VerifyUnique.php/bVerifyUniqueText');
} else {
$row = $query->row();
return $row->lNumMatch == 0;
}
}
示例13: lAddLogEntry
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 = ' . strPrepStr($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();
}
示例14: sqlCommonCustomFormAddEdit
function sqlCommonCustomFormAddEdit(&$fContext, &$rRec, $enumContext)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
global $glUserID;
// internal fields
$sqlStr = $fContext->strFNPrefix . 'strFormName = ' . strPrepStr($rRec->strFormName) . ', ' . "\n" . $fContext->strFNPrefix . 'strDescription = ' . strPrepStr($rRec->strDescription) . ', ' . "\n";
if ($fContext->bVolReg) {
$sqlStr .= $fContext->strFNPrefix . 'strContactEmail = ' . strPrepStr($rRec->strContactEmail) . ', ' . "\n";
$sqlStr .= '
vreg_strCSSFN = ' . strPrepStr($rRec->strCSSFN) . ',
vreg_lLogoImageID = ' . (is_null($rRec->lLogoImageID) ? 'null' : $rRec->lLogoImageID) . ',
vreg_lVolGroupID = ' . (is_null($rRec->lVolGroupID) ? 'null' : $rRec->lVolGroupID) . ',
vreg_bCaptchaRequired = ' . ($rRec->bCaptchaRequired ? '1' : '0') . ', ' . "\n";
// form registration permissions
$sqlStr .= '
vreg_bPermEditContact = ' . ($rRec->bPermEditContact ? '1' : '0') . ',
vreg_bPermPassReset = ' . ($rRec->bPermPassReset ? '1' : '0') . ',
vreg_bPermViewGiftHistory = ' . ($rRec->bPermViewGiftHistory ? '1' : '0') . ',
vreg_bPermEditJobSkills = ' . ($rRec->bPermEditJobSkills ? '1' : '0') . ',
vreg_bPermViewHrsHistory = ' . ($rRec->bPermViewHrsHistory ? '1' : '0') . ',
vreg_bPermAddVolHours = ' . ($rRec->bPermAddVolHours ? '1' : '0') . ',
vreg_bVolShiftSignup = ' . ($rRec->bVolShiftSignup ? '1' : '0') . ',
vreg_strBannerOrg = ' . strPrepStr($rRec->strBannerOrg) . ",\n";
// Standard Fields - show
$sqlStr .= $fContext->strFNPrefix . 'bShowFName = ' . ($rRec->bShowFName ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bShowLName = ' . ($rRec->bShowLName ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bShowAddr = ' . ($rRec->bShowAddr ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bShowEmail = ' . ($rRec->bShowEmail ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bShowPhone = ' . ($rRec->bShowPhone ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bShowCell = ' . ($rRec->bShowCell ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bShowBDay = ' . ($rRec->bShowBDay ? '1' : '0') . ",\n";
// Standard Fields - required
$sqlStr .= $fContext->strFNPrefix . 'bFNameRequired = ' . ($rRec->bFNameRequired ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bLNameRequired = ' . ($rRec->bLNameRequired ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bAddrRequired = ' . ($rRec->bAddrRequired ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bEmailRequired = ' . ($rRec->bEmailRequired ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bPhoneRequired = ' . ($rRec->bPhoneRequired ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bCellRequired = ' . ($rRec->bCellRequired ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bBDateRequired = ' . ($rRec->bBDateRequired ? '1' : '0') . ",\n";
// Disclaimer
$sqlStr .= $fContext->strFNPrefix . 'bShowDisclaimer = ' . ($rRec->bShowDisclaimer ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'bDisclaimerAckRqrd = ' . ($rRec->bDisclaimerAckRqrd ? '1' : '0') . ",\n" . $fContext->strFNPrefix . 'strDisclaimerAck = ' . strPrepStr($rRec->strDisclaimerAck) . ",\n" . $fContext->strFNPrefix . 'strDisclaimer = ' . strPrepStr($rRec->strDisclaimer) . ",\n";
} else {
$sqlStr .= $fContext->strFNPrefix . 'enumContextType = ' . strPrepStr($enumContext) . ",\n" . $fContext->strFNPrefix . 'strVerificationModule = ' . strPrepStr($rRec->strVerificationModule) . ",\n" . $fContext->strFNPrefix . 'strVModEntryPoint = ' . strPrepStr($rRec->strVModEntryPoint) . ",\n";
}
// top banner
$sqlStr .= $fContext->strFNPrefix . 'strBannerTitle = ' . strPrepStr($rRec->strBannerTitle) . ",\n" . $fContext->strFNPrefix . 'strSubmissionText = ' . strPrepStr($rRec->strSubmissionText) . ",\n" . $fContext->strFNPrefix . 'strIntro = ' . strPrepStr($rRec->strIntro) . ",\n";
// timestamp
$sqlStr .= $fContext->strFNPrefix . 'lLastUpdateID = ' . $glUserID . ",\n" . $fContext->strFNPrefix . "dteLastUpdate=NOW() \n";
return $sqlStr;
}
示例15: searchSelected
private function searchSelected(&$displayData, $lPID, $strTitle, $strSearch)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
$this->load->model('util/msearch_single_generic', 'clsSearch');
//-----------------------------
// search display setup
//-----------------------------
$this->clsSearch->enumSearchType = CENUM_CONTEXT_PEOPLE;
$this->clsSearch->strSearchLabel = 'People';
$this->clsSearch->bShowKeyID = true;
$this->clsSearch->bShowSelect = true;
$this->clsSearch->strIDLabel = 'peopleID: ';
$this->clsSearch->bShowLink = false;
$this->clsSearch->bShowEnumSearchType = false;
$this->clsSearch->strDisplayTitle = '<br>Please select the person for this new relationship</b><br>';
// landing page for selection
$this->clsSearch->strPathSelection = 'people/relationships/setRelType/' . $lPID . '/';
$this->clsSearch->strTitleSelection = 'Select person';
// landing page for "back"
$this->clsSearch->strPathSearchAgain = 'people/relationships/addEditS1/' . $lPID;
$this->clsSearch->strTitleSearchAgain = 'Search again...';
$lLeftCnt = strlen($strSearch);
$this->clsSearch->strSearchTerm = $strSearch;
$this->clsSearch->strWhereExtra = " AND (pe_lKeyID != {$lPID})\n AND LEFT(pe_strLName, {$lLeftCnt})=" . strPrepStr($strSearch) . " ";
// run search
$displayData['strSearchLabel'] = 'Searching for ' . $this->clsSearch->enumSearchType . ' that begin with <b><i>"' . htmlspecialchars($strSearch) . '"</b></i><br>';
$this->clsSearch->searchPeople();
$displayData['strHTMLSearchResults'] = $this->clsSearch->strHTML_SearchResults();
//-----------------------------
// breadcrumbs & page setup
//-----------------------------
$displayData['title'] = CS_PROGNAME . ' | Relationships';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['mainTemplate'] = 'people/search_sel_person_view';
$this->load->vars($displayData);
$this->load->view('template');
}