当前位置: 首页>>代码示例>>PHP>>正文


PHP DCL_Sanitize::ToInt方法代码示例

本文整理汇总了PHP中DCL_Sanitize::ToInt方法的典型用法代码示例。如果您正苦于以下问题:PHP DCL_Sanitize::ToInt方法的具体用法?PHP DCL_Sanitize::ToInt怎么用?PHP DCL_Sanitize::ToInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DCL_Sanitize的用法示例。


在下文中一共展示了DCL_Sanitize::ToInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DisplayForm

 function DisplayForm($obj = '')
 {
     global $dcl_info, $g_oSec;
     $isEdit = is_object($obj);
     if (!$g_oSec->HasPerm(DCL_ENTITY_FAQTOPIC, $isEdit ? DCL_PERM_MODIFY : DCL_PERM_ADD)) {
         return PrintPermissionDenied();
     }
     $t =& CreateSmarty();
     $t->assign('IS_EDIT', $isEdit);
     if ($isEdit) {
         $t->assign('VAL_SEQ', $obj->seq);
         $t->assign('VAL_NAME', $obj->name);
         $t->assign('VAL_DESCRIPTION', $obj->description);
         $t->assign('VAL_FAQID', $obj->faqid);
         $t->assign('VAL_TOPICID', $obj->topicid);
     } else {
         if (($id = DCL_Sanitize::ToInt($_REQUEST['faqid'])) === null) {
             trigger_error('Data sanitize failed.');
             return;
         }
         $t->assign('TXT_TITLE', STR_FAQ_ADDFAQTOPIC);
         $t->assign('VAL_SEQ', '');
         $t->assign('VAL_NAME', '');
         $t->assign('VAL_DESCRIPTION', '');
         $t->assign('VAL_FAQID', $id);
     }
     SmartyDisplay($t, 'htmlFaqtopicsForm.tpl');
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:28,代码来源:class.htmlFaqtopics.inc.php

示例2: DisplayForm

 function DisplayForm($obj = '')
 {
     global $dcl_info, $g_oSec;
     $isEdit = is_object($obj);
     if (!$g_oSec->HasPerm(DCL_ENTITY_FAQQUESTION, $isEdit ? DCL_PERM_MODIFY : DCL_PERM_ADD)) {
         return PrintPermissionDenied();
     }
     $t =& CreateSmarty();
     $t->assign('IS_EDIT', $isEdit);
     if ($isEdit) {
         $t->assign('VAL_SEQ', $obj->seq);
         $t->assign('VAL_QUESTIONTEXT', $obj->questiontext);
         $t->assign('VAL_TOPICID', $obj->topicid);
         $t->assign('VAL_QUESTIONID', $obj->questionid);
     } else {
         if (($id = DCL_Sanitize::ToInt($_REQUEST['topicid'])) === null) {
             trigger_error('Data sanitize failed.');
             return;
         }
         $t->assign('VAL_SEQ', '');
         $t->assign('VAL_QUESTIONTEXT', '');
         $t->assign('VAL_TOPICID', $id);
     }
     SmartyDisplay($t, 'htmlFaqquestionsForm.tpl');
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:25,代码来源:class.htmlFaqquestions.inc.php

示例3: ListVersions

 function ListVersions()
 {
     // FIXME: application/x-javascript for Opera
     header('Content-Type: application/json');
     $product_id = @DCL_Sanitize::ToInt($_REQUEST['product_id']);
     if ($product_id === null) {
         exit;
     }
     $oDB = CreateObject('dcl.dbProductVersion');
     $aOptions = $oDB->GetOptions('product_version_id', 'product_version_text', 'active', isset($_REQUEST['active']) && $_REQUEST['active'] == 'Y', '', "product_id={$product_id}");
     $bFirst = true;
     echo '{';
     echo '"totalRecords":', count($aOptions), ',';
     echo '"data":[';
     for ($i = 0; $i < count($aOptions); $i++) {
         if ($i > 0) {
             echo ',';
         }
         echo '{';
         echo '"id":', $aOptions[$i]['product_version_id'], ',';
         echo '"text":"', str_replace('"', '\\"', str_replace("\\", "\\\\", $aOptions[$i]['product_version_text'])), '"';
         echo '}';
     }
     echo ']}';
     exit;
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:26,代码来源:class.jsonProductVersion.inc.php

示例4: ShowPage

 function ShowPage($sPage)
 {
     global $g_oSec, $dcl_info;
     commonHeader();
     if (($productid = DCL_Sanitize::ToInt($_REQUEST['id'])) === null) {
         trigger_error('Data sanitize failed.');
         return;
     }
     if (!$g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEW, $productid)) {
         return PrintPermissionDenied();
     }
     $this->oProduct =& CreateObject('dcl.dbProducts');
     if ($this->oProduct->Load($productid) == -1) {
         trigger_error('Could not find a product with an id of ' . $productid, E_USER_ERROR);
         return;
     }
     $this->oSmarty->assign('VAL_ID', $this->oProduct->id);
     $this->oSmarty->assign('VAL_NAME', $this->oProduct->name);
     $this->oSmarty->assign('PERM_VIEWWO', $g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_VIEW));
     $this->oSmarty->assign('PERM_VIEWTCK', $g_oSec->HasPerm(DCL_ENTITY_TICKET, DCL_PERM_VIEW));
     $this->oSmarty->assign('PERM_WIKI', $dcl_info['DCL_WIKI_ENABLED'] == 'Y' && $g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEWWIKI));
     $this->oSmarty->assign('PERM_EDIT', $g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_MODIFY));
     $this->oSmarty->assign('PERM_DELETE', $g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_DELETE));
     $this->oSmarty->assign('PERM_VERSIONS', $dcl_info['DCL_BUILD_MANAGER_ENABLED'] == 'Y' && $this->oProduct->is_versioned == 'Y');
     SmartyDisplay($this->oSmarty, $sPage);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:26,代码来源:class.htmlProductDashboard.inc.php

示例5: _SetActionFormOptions

 function _SetActionFormOptions()
 {
     global $g_oSec;
     $aLinks = array();
     if (($product_id = DCL_Sanitize::ToInt($_REQUEST['product_id'])) === null) {
         trigger_error('Data sanitize failed.');
         return;
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_PRODUCTMODULE, DCL_PERM_ADD)) {
         $aLinks[STR_CMMN_NEW] = menuLink('', 'menuAction=htmlProductModules.add&product_id=' . $product_id);
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEW)) {
         $aLinks['Detail'] = menuLink('', 'menuAction=boProducts.view&id=' . $product_id);
     }
     $this->_SetVar('hActionLinkSetLinks', '');
     $bFirst = true;
     foreach ($aLinks as $sText => $sLink) {
         if ($bFirst) {
             $bFirst = false;
         } else {
             $this->Template->parse('hActionLinkSetLinks', 'actionLinkSetSep', true);
         }
         $this->_SetVar('LNK_ACTIONVALUE', $sLink);
         $this->_SetVar('VAL_ACTIONVALUE', $sText);
         $this->Template->parse('hActionLinkSetLinks', 'actionLinkSetLink', true);
     }
     $this->Template->parse('hActionLinkSet', 'actionLinkSet');
     $this->Template->parse('hActions', 'actions');
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:29,代码来源:class.htmlProductModuleView.inc.php

示例6: HasChecklists

 function HasChecklists($id)
 {
     if (($id = DCL_Sanitize::ToInt($id)) == NULL) {
         trigger_error('Data sanitize failed.');
         return;
     }
     return $this->ExecuteScalar('select count(*) from dcl_chklst where dcl_chklst_tpl_id = ' . $id) > 0;
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:8,代码来源:class.dbChklstTpl.inc.php

示例7: ListMainContacts

 function ListMainContacts($org_id)
 {
     if (($org_id = DCL_Sanitize::ToInt($org_id)) === null) {
         return;
     }
     $sSQL = "SELECT DISTINCT C.last_name, C.first_name, C.contact_id\n\t\t\t\tFROM dcl_contact C \n\t\t\t\t" . $this->JoinKeyword . " dcl_contact_type_xref CTX ON C.contact_id = CTX.contact_id \n\t\t\t\t" . $this->JoinKeyword . " dcl_contact_type CT ON CTX.contact_type_id = CT.contact_type_id\n\t\t\t\t" . $this->JoinKeyword . " dcl_org_contact OC ON C.contact_id = OC.contact_id \n\t\t\t\tWHERE OC.org_id = {$org_id}\n\t\t\t\tAND CT.contact_type_is_main = 'Y' \n\t\t\t\tORDER BY C.last_name, C.first_name, C.contact_id";
     $this->Query($sSQL);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:8,代码来源:class.dbOrg.inc.php

示例8: ListByOrg

 function ListByOrg($org_id)
 {
     if (($org_id = DCL_Sanitize::ToInt($org_id)) === null) {
         trigger_error('Data sanitize failed.');
         return -1;
     }
     $sql = 'SELECT ' . $this->SelectAllColumns() . ' FROM ' . $this->TableName . ' WHERE org_id = ' . $org_id;
     return $this->Query($sql);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:9,代码来源:class.dbOrgAlias.inc.php

示例9: HasSpecificRole

 function HasSpecificRole($role_id)
 {
     // Checks the current user for specific role - should only be used by custom plugins
     if (($role_id = DCL_Sanitize::ToInt($role_id)) === null) {
         trigger_error('Data sanitize failed.');
         return false;
     }
     $oDB =& CreateObject('dcl.dbUserRole');
     return $oDB->HasSpecificRole($GLOBALS['DCLID'], $role_id);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:10,代码来源:class.boSecurity.inc.php

示例10: GetPrimaryUrl

 function GetPrimaryUrl($contact_id)
 {
     if (($contact_id = DCL_Sanitize::ToInt($contact_id)) === null) {
         trigger_error('Data sanitize failed.');
         return -1;
     }
     if ($this->Query("SELECT ut.url_type_name, u.url_addr FROM dcl_contact_url u, dcl_url_type ut WHERE u.url_type_id = ut.url_type_id AND u.contact_id = {$contact_id} AND preferred = 'Y'") != -1) {
         return $this->next_record();
     }
     return false;
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:11,代码来源:class.dbContactUrl.inc.php

示例11: GetPrimaryPhone

 function GetPrimaryPhone($iOrgID)
 {
     if (($iOrgID = DCL_Sanitize::ToInt($iOrgID)) === null) {
         trigger_error('Data sanitize failed.');
         return -1;
     }
     if ($this->Query("SELECT pt.phone_type_name, p.phone_number FROM dcl_org_phone p, dcl_phone_type pt WHERE p.phone_type_id = pt.phone_type_id AND p.org_id = {$iOrgID} AND preferred = 'Y'") != -1) {
         return $this->next_record();
     }
     return false;
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:11,代码来源:class.dbOrgPhone.inc.php

示例12: ListByContact

 function ListByContact($contact_id)
 {
     if (($contact_id = DCL_Sanitize::ToInt($contact_id)) === null) {
         trigger_error('Data sanitize failed.');
         return -1;
     }
     $sql = 'SELECT l.contact_license_id, l.contact_id, l.product_id, l.product_version, l.license_id, l.registered_on, l.expires_on, l.license_notes, p.name';
     $sql .= ' FROM ' . $this->TableName . ' l, products p WHERE l.contact_id = ' . $contact_id . ' AND p.id = l.product_id';
     $sql .= ' ORDER BY p.name, l.expires_on DESC, l.license_id';
     return $this->Query($sql);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:11,代码来源:class.dbContactLicense.inc.php

示例13: ListByContact

 function ListByContact($contact_id)
 {
     if (($contact_id = DCL_Sanitize::ToInt($contact_id)) === null) {
         trigger_error('Data sanitize failed.');
         return -1;
     }
     $sql = 'SELECT u.contact_type_id, u.contact_id, t.contact_type_name';
     $sql .= ' FROM dcl_contact_type_xref u, dcl_contact_type t WHERE u.contact_id = ' . $contact_id . ' AND t.contact_type_id = u.contact_type_id';
     $sql .= ' ORDER BY t.contact_type_name';
     return $this->Query($sql);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:11,代码来源:class.dbContactType.inc.php

示例14: ShowResults

 function ShowResults()
 {
     global $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     $begindate = @DCL_Sanitize::ToDateTime($_REQUEST['begindate'] . ' 00:00:00.00');
     $enddate = @DCL_Sanitize::ToDateTime($_REQUEST['enddate'] . ' 23:59:59.99');
     $responsible = DCL_Sanitize::ToInt($_REQUEST['responsible']);
     if ($begindate === null || $enddate === null) {
         commonHeader();
         trigger_error(STR_SEC_DATEERR, E_USER_ERROR);
         $this->Show(false);
         return;
     }
     $objDBPer =& CreateObject('dcl.dbPersonnel');
     $objDBSA =& CreateObject('dcl.dbSecAudit');
     $objDB = new DCLDb();
     $sCols = 'SA.id, ' . $objDBSA->ConvertTimestamp('SA.actionon', 'actionon') . ', SA.actiontxt, SA.actionparam';
     $sCols .= ', ' . $objDBPer->SelectAllColumns('Pers.');
     $sQuery = "SELECT {$sCols}\n\t\t\tFROM {$objDBSA->TableName} SA INNER JOIN {$objDBPer->TableName} Pers on \n\t\t\tSA.id = pers.id \n\t\t\tWHERE SA.actionon BETWEEN " . $objDBSA->DisplayToSQL($begindate) . ' and ' . $objDBSA->DisplayToSQL($enddate);
     if ($responsible == 0) {
         $respname = STR_SEC_ALLUSERS;
     } else {
         $objDBPer->Load($responsible);
         $respname = $objDBPer->short;
         $sQuery .= ' AND SA.id=' . $responsible;
     }
     $sQuery .= ' ORDER BY SA.actionon';
     $reportAr = null;
     if ($objDB->Query($sQuery) != -1) {
         if ($objDB->next_record()) {
             $idx = -1;
             do {
                 $idx++;
                 $reportAr[$idx][] = $objDB->f('short');
                 $reportAr[$idx][] = $objDB->FormatTimeStampForDisplay($objDB->f('actionon'));
                 $reportAr[$idx][] = $objDB->f('actiontxt');
                 $reportAr[$idx][] = $objDB->f('actionparam');
             } while ($objDB->next_record());
         } else {
             trigger_error(STR_SEC_RPTNODATA, E_USER_ERROR);
             $this->Show(false);
             return;
         }
     }
     $obj =& CreateObject('dcl.htmlSecAudit');
     if (!$obj->Render($reportAr, $begindate, $enddate, $respname)) {
         trigger_error(STR_SEC_RPTERROR, E_USER_ERROR);
         $this->Show(false);
         return;
     }
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:54,代码来源:class.boSecAudit.inc.php

示例15: GetPrimaryEmailByUserID

 function GetPrimaryEmailByUserID($iUserID)
 {
     if (($iUserID = DCL_Sanitize::ToInt($iUserID)) === null) {
         trigger_error('Data sanitize failed.');
         return -1;
     }
     if ($this->Query("SELECT et.email_type_name, e.email_addr FROM dcl_contact_email e, dcl_email_type et, personnel p WHERE p.contact_id = e.contact_id AND e.email_type_id = et.email_type_id AND p.id = {$iUserID} AND e.preferred = 'Y'") != -1) {
         return $this->next_record();
     }
     return false;
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:11,代码来源:class.dbContactEmail.inc.php


注:本文中的DCL_Sanitize::ToInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。