本文整理匯總了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;
}
}