本文整理汇总了PHP中DCL_Sanitize::ToDateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP DCL_Sanitize::ToDateTime方法的具体用法?PHP DCL_Sanitize::ToDateTime怎么用?PHP DCL_Sanitize::ToDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DCL_Sanitize
的用法示例。
在下文中一共展示了DCL_Sanitize::ToDateTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
}