本文整理汇总了PHP中sapp_Global::getDisplayDate方法的典型用法代码示例。如果您正苦于以下问题:PHP sapp_Global::getDisplayDate方法的具体用法?PHP sapp_Global::getDisplayDate怎么用?PHP sapp_Global::getDisplayDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sapp_Global
的用法示例。
在下文中一共展示了sapp_Global::getDisplayDate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTimeSummary
public static function getTimeSummary($time, $timeBase = false)
{
$timeBase = strtotime(sapp_Global::getDisplayDate(gmdate("Y-m-d H:i:s")));
if ($time <= $timeBase) {
$dif = $timeBase - $time;
if ($dif < 60) {
if ($dif < 2) {
return "1 second ago";
}
return $dif . " seconds ago";
}
if ($dif < 3600) {
if (floor($dif / 60) < 2) {
return "A minute ago";
}
return floor($dif / 60) . " minutes ago";
}
if (date("d n Y", $timeBase) == date("d n Y", $time)) {
return "Today at " . date("g:i A", $time);
}
if (date("n Y", $timeBase) == date("n Y", $time) && date("d", $timeBase) - date("d", $time) == 1) {
return "Yesterday at " . date("g:i A", $time);
}
if (date("Y", $time) == date("Y", $timeBase)) {
//changed by rakesh for making pm to PM
$finalDateFormat = date('F d, Y', $time) . " at " . date('h:i A', $time);
return $finalDateFormat;
}
} else {
$dif = $time - $timeBase;
if ($dif < 60) {
if ($dif < 2) {
return "1 second";
}
return $dif . " seconds";
}
if ($dif < 3600) {
if (floor($dif / 60) < 2) {
return "Less than a minute";
}
return floor($dif / 60) . " minutes";
}
if (date("d n Y", $timeBase + 86400) == date("d n Y", $time)) {
return "Tomorrow, at " . date("g:i A", $timeBase);
}
}
return date("F j, Y \\a\\t g:i A", $time);
}
示例2: generateGrid
//.........这里部分代码省略.........
if (isset($this->extra[$k]['value'])) {
$output .= $this->_parseExtra($k, $p);
} else {
if ($bodyCount == 0 && $jsFillFnName != '') {
$valToInclude = strlen(trim($p[$k])) > $characterlimit ? substr(trim($p[$k]), 0, $characterlimit) . ".." : trim($p[$k]);
$output .= "<a onclick= " . $jsFillFnName . "(\"/id/{$p['id']}\") href= 'javascript:void(0)' title='" . htmlentities(trim($p[$k]), ENT_QUOTES, "UTF-8") . "' >" . htmlentities($valToInclude, ENT_QUOTES, "UTF-8") . "</a>";
} else {
$p = (array) $p;
if (isset($p[$k])) {
$valToInclude = strlen(trim($p[$k])) > $characterlimit ? substr(trim($p[$k]), 0, $characterlimit) . ".." : trim($p[$k]);
if ($k == 'user_action') {
switch ($p[$k]) {
case '1':
$valToInclude = 'ADD';
break;
case '2':
$valToInclude = "Edit";
break;
case '3':
$valToInclude = "Delete";
break;
}
} else {
if ($k == 'userfullname') {
$errorImg = DOMAIN . 'public/media/images/profile_pic.png';
if (isset($p['profileimg']) && !empty($p['profileimg'])) {
$imageUrl = DOMAIN . 'public/uploads/profile/' . $p['profileimg'];
} else {
$imageUrl = DOMAIN . 'public/media/images/profile_pic.png';
}
$imgtag = '<img src="' . $imageUrl . '" onerror="this.src=\'' . $errorImg . '\'" class="pic-grid">';
} else {
if ($k == 'last_modifieddate' || $k == 'logindatetime') {
$valToInclude = sapp_Global::getDisplayDate($valToInclude);
} else {
if ($k == 'empipaddress' && $valToInclude == '::1') {
$valToInclude = '127.0.0.1';
}
}
}
}
if ($k == 'status' && $p[$k] == 'Complete' && $menuName == 'Employee Screening') {
$dataclass = 'class="greendata"';
} else {
$dataclass = '';
}
if ($k == 'user_action') {
switch ($p[$k]) {
case '1':
$menunamestr = $p['menuName'] . ' - Add';
$output .= "<a name='' class='' title='Add' onclick='displaydeptform(\"" . DOMAIN . "logmanager/view/id/" . $p['id'] . "\",\"" . $menunamestr . "\")'>Add</a>";
break;
case '2':
$menunamestr = $p['menuName'] . ' - Edit';
$output .= "<a name='' class='' title='Edit' onclick='displaydeptform(\"" . DOMAIN . "logmanager/view/id/" . $p['id'] . "\",\"" . $menunamestr . "\")'>Edit</a>";
break;
case '3':
$valToInclude = "Delete";
$output .= " <span " . $dataclass . " title='Delete' class='emp-name' >" . htmlentities($valToInclude, ENT_QUOTES, "UTF-8") . "</span>";
break;
case '5':
$valToInclude = "Cancel";
$output .= " <span " . $dataclass . " title='Cancel' class='emp-name' >" . htmlentities($valToInclude, ENT_QUOTES, "UTF-8") . "</span>";
break;
}
} else {
示例3: _packEvent
/**
* Packs message and priority into Event array
*
* @param string $message Message to log
* @param integer $priority Priority of message
* @return array Event array
*/
protected function _packEvent($message, $priority)
{
return array_merge(array('timestamp' => sapp_Global::getDisplayDate(gmdate($this->_timestampFormat)), 'message' => $message, 'priority' => $priority, 'priorityName' => $this->_priorities[$priority]), $this->_extras);
}
示例4: activitylogreportAction
public function activitylogreportAction()
{
try {
$activitylog_model = new Default_Model_Activitylog();
$logmanager_model = new Default_Model_Logmanager();
$dashboardcall = $this->_getParam('dashboardcall');
if ($dashboardcall == 'Yes') {
$perPage = DASHBOARD_PERPAGE;
} else {
$perPage = PERPAGE;
}
$selectFields = array('menuname' => 'Menu', 'username' => 'User Name', 'empId' => 'Employee ID', 'useraction' => 'Action', 'modifieddate' => 'Modified Date');
$selectColumns = array_keys($selectFields);
$action = array('1' => 'Add', '2' => 'Edit', '3' => 'Delete', '5' => 'Cancel');
$activityLogData = array();
$splitArray = array();
$pageNo = 1;
$order = $funorder = 'Desc';
$by = $sortby = 'last_modifieddate';
$searchData = '';
$lastpage = 0;
if ($this->getRequest()->getPost()) {
$this->_helper->layout->disableLayout();
}
if ($this->_request->getParam('pageNo') != '') {
$pageNo = intval($this->_request->getParam('pageNo'));
}
if ($this->_request->getParam('per_page') != '') {
$perPage = intval($this->_request->getParam('per_page'));
}
if ($this->_request->getParam('fields') != '') {
$selectColumns = explode(',', $this->_request->getParam('fields'));
}
$finalArray = array();
//POST with empty search fields
if ($this->_request->getParam('hiddenusername') == '' && $this->_request->getParam('menu') == '' && $this->_request->getParam('useraction') == '' && $this->_request->getParam('modifieddate') == '') {
if ($this->_request->getParam('sortby') != '') {
$by = $sortby = $this->_request->getParam('sortby');
$order = $funorder = $this->_request->getParam('order');
if ($sortby == 'userfullname') {
$by = '';
$usernameorder = $logmanager_model->getUsernameOrderForLog($order);
if (!empty($usernameorder)) {
$funorder = 'FIND_IN_SET(last_modifiedby,"' . $usernameorder . '")';
}
}
if ($sortby == 'employeeId') {
$by = '';
$empidorder = $logmanager_model->getEmpidOrderForLog($order);
if (!empty($empidorder)) {
$funorder = 'FIND_IN_SET(last_modifiedby,"' . $empidorder . '")';
}
}
if ($sortby == 'menuname') {
$by = '';
$menunameorder = $logmanager_model->getMenuOrderForLog($order);
if (!empty($menunameorder)) {
$funorder = 'FIND_IN_SET(menuId,"' . $menunameorder . '")';
}
}
}
$activityLogData = $logmanager_model->getLogManagerDataReport($by, $funorder, $pageNo, $perPage, $searchData, array('*'));
$activityLogCount = $activitylog_model->getLogManagerCount();
$menuArray = array();
$userArray = array();
if (count($activityLogData) > 0) {
$lastpage = ceil($activityLogCount / $perPage);
foreach ($activityLogData as $activitylog) {
if (isset($activitylog['menuId'])) {
if (!in_array($activitylog['menuId'], $menuArray)) {
array_push($menuArray, $activitylog['menuId']);
}
}
if (isset($activitylog['last_modifiedby'])) {
if (!in_array($activitylog['last_modifiedby'], $userArray)) {
array_push($userArray, $activitylog['last_modifiedby']);
}
}
}
}
$menuNameArray = $activitylog_model->getMenuNamesByIds($menuArray);
$userNameArray = $activitylog_model->getuserNamesByIds($userArray);
if (count($activityLogData) > 0) {
foreach ($activityLogData as $key => $activitylog) {
if (in_array('menuname', $selectColumns)) {
$finalArray[$key]['menuname'] = isset($menuNameArray[$activitylog['menuId']]) ? $menuNameArray[$activitylog['menuId']]['name'] : '';
}
if (in_array('username', $selectColumns)) {
$finalArray[$key]['username'] = isset($userNameArray[$activitylog['last_modifiedby']]) ? $userNameArray[$activitylog['last_modifiedby']]['userfullname'] : '';
}
if (in_array('empId', $selectColumns)) {
$finalArray[$key]['empId'] = isset($userNameArray[$activitylog['last_modifiedby']]) ? $userNameArray[$activitylog['last_modifiedby']]['employeeId'] : '';
}
if (in_array('useraction', $selectColumns)) {
$finalArray[$key]['useraction'] = $action[$activitylog['user_action']];
}
if (in_array('modifieddate', $selectColumns)) {
$finalArray[$key]['modifieddate'] = sapp_Global::getDisplayDate($activitylog['last_modifieddate']);
}
}
//.........这里部分代码省略.........
示例5: generateGrid
//.........这里部分代码省略.........
* Second Case - Grid field
* Keep 'default' case to allow display other Grids, normal.
*/
switch ($menuName) {
case 'CV Management':
switch ($k) {
case 'cand_resume':
if (!empty($valToInclude)) {
$output .= "<span " . $dataclass . " title='" . htmlentities(trim($p[$k]), ENT_QUOTES, "UTF-8") . "' ><a href='" . BASE_URL . $name . '/download/id/' . $p["id"] . "'>View Resume</a></span>";
}
break;
default:
$output .= "<span " . $dataclass . " title='" . htmlentities(trim($p[$k]), ENT_QUOTES, "UTF-8") . "' >" . htmlentities($valToInclude, ENT_QUOTES, "UTF-8") . "</span>";
break;
}
break;
// Strip HTML tags for 'description' field in Organization->Announcements grid
// Strip HTML tags for 'description' field in Organization->Announcements grid
case 'Announcements':
switch ($k) {
case 'description':
$output .= "<span " . $dataclass . " title='" . htmlentities(strip_tags(trim($p[$k])), ENT_QUOTES, "UTF-8") . "' >" . htmlentities($valToInclude, ENT_QUOTES, "UTF-8") . "</span>";
break;
default:
$output .= "<span " . $dataclass . " title='" . htmlentities(trim($p[$k]), ENT_QUOTES, "UTF-8") . "' >" . htmlentities($valToInclude, ENT_QUOTES, "UTF-8") . "</span>";
break;
}
break;
case 'View/Manage Policy Documents':
//case to handle file names in policy documents module
switch ($k) {
case 'description':
$output .= "<span " . $dataclass . " title='" . htmlentities(strip_tags(trim($p[$k])), ENT_QUOTES, "UTF-8") . "' >" . htmlentities($valToInclude, ENT_QUOTES, "UTF-8") . "</span>";
break;
case 'file_name':
$tmpFiles = json_decode($valToInclude);
if ($tmpFiles[0]) {
$strFileName = strlen($tmpFiles[0]->original_name) > 40 ? substr($tmpFiles[0]->original_name, 0, 37) . "..." : htmlentities($tmpFiles[0]->original_name, ENT_QUOTES, "UTF-8");
$output .= "<a target='_blank' title='" . htmlentities(strip_tags(trim($tmpFiles[0]->original_name)), ENT_QUOTES, "UTF-8") . "' href='" . POLICY_DOC_PATH . $tmpFiles[0]->new_name . "'>" . $strFileName . "</a>";
} else {
$output .= "<span " . $dataclass . "></span>";
}
break;
default:
$output .= "<span " . $dataclass . " title='" . htmlentities(trim($p[$k]), ENT_QUOTES, "UTF-8") . "' >" . htmlentities($valToInclude, ENT_QUOTES, "UTF-8") . "</span>";
break;
}
break;
case 'All Exit Procedures':
if ($k == 'createddate') {
$output .= "<span " . $dataclass . ">" . sapp_Global::getDisplayDate($p[$k]) . "</span>";
} else {
$output .= "<span " . $dataclass . " title='" . htmlentities(trim($p[$k]), ENT_QUOTES, "UTF-8") . "' >" . htmlentities($valToInclude, ENT_QUOTES, "UTF-8") . "</span>";
}
break;
default:
$output .= "<span " . $dataclass . " title='" . trim($p[$k]) . "' >" . htmlentities($valToInclude, ENT_QUOTES, "ISO-8859-1") . "</span>";
break;
}
// Customize grid fields data - END htmlentities(trim($p[$k]), ENT_QUOTES, "ISO-8859-1")
}
}
}
$dataclass = '';
$output .= "</td>";
$bodyCount++;
}
}
// Close the Table Row
$output .= "</tr>";
}
if ($ii == 0) {
$output .= "<tr><td colspan='{$colinr}' class='no-data-td'><p class='no-data'>No data found</p></td></tr>";
}
$output .= "</tbody>";
$output .= "</table>\n <script type='text/javascript' language='javascript'>\n \$(document).ready(function(){\n \n if(\$('.searchtxtbox_" . $name . "').is(':visible'))\n {\n \n \$('#search_tr_" . $name . "').show();\t\n }\n else \n \n \$('#search_tr_" . $name . "').hide();\t\n });\n </script> \n </div>";
// Attach Pagination
if ($paginator) {
$params = array();
$params['jsGridFnName'] = $jsGridFnname;
$params['perPage'] = $perPage;
$params['objname'] = $name;
$params['searchArray'] = $searchArray;
$params['formgrid'] = $formgrid;
$params['con'] = $con;
$params['dashboardcall'] = $dashboardCall;
$params['sortname'] = $sortname;
$params['by'] = $by;
/** for policy documents **/
$params['pd_category_id'] = $this->pd_category_id;
if (isset($empscreenTotalCount) && $perPage != 0) {
$empscreen_lastpage = ceil($empscreenTotalCount / $perPage);
$params['empscreen_lastpage'] = $empscreen_lastpage;
}
$output .= $this->view->paginationControl($paginator, 'Sliding', 'partials/pagination.phtml', $params);
}
$output .= "<script type='text/javascript' language='javascript'>\$('#{$name}').slimScrollHorizontal({\n\t\t\t\t\t\t\t\t\t alwaysVisible: false,\n\t\t\t\t\t\t\t\t\t start: 'left',\n\t\t\t\t\t\t\t\t\t position: 'bottom',\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t}).css({ background: '#ccc', paddingBottom: '10px' }); </script>";
$output .= "<script type='text/javascript' language='javascript'>\n\t\t\t\t\t\tvar id = \$('#columnId').val();\n\t\t\t\t\t\tvar coldata = \$('#'+id).val();\n\t\t\t\t\t\tvar focusID = \$('#columnId').val();\n var fval = \$('#'+focusID).attr('data-focus');\n if(fval == '' || fval == null)\n\t\t\t\t\t\t\$('#'+focusID).focus().val('').val(coldata);\n \n\t\t\t\t\t</script>";
return $output;
}