本文整理汇总了PHP中sapp_Global::getGMTformatdate方法的典型用法代码示例。如果您正苦于以下问题:PHP sapp_Global::getGMTformatdate方法的具体用法?PHP sapp_Global::getGMTformatdate怎么用?PHP sapp_Global::getGMTformatdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sapp_Global
的用法示例。
在下文中一共展示了sapp_Global::getGMTformatdate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getdata_user_report
public function getdata_user_report($search_arr, $per_page, $page_no, $sort_name, $sort_type)
{
if ($sort_name == 'isactive') {
$sort_name = "u.isactive";
}
if ($sort_name == 'createddate') {
$sort_name = "u.createddate";
}
$db = Zend_Db_Table::getDefaultAdapter();
$search_str = "";
$user_search = " where u.id != 1 ";
foreach ($search_arr as $key => $value) {
if ($value != '') {
if ($key != 'logindatetime') {
if ($key == 'createddate') {
$search_str .= " date(u." . $key . ") = '" . sapp_Global::change_date($value, 'database') . "' and";
} else {
if ($key == 'u.isactive') {
if ($value == 0) {
$search_str .= " u.isactive != 1";
} else {
$search_str .= " u.isactive = 1";
}
} else {
$search_str .= " " . $key . " = '" . $value . "' and";
}
}
}
}
}
if ($search_str != '') {
$search_str = trim($search_str, "and");
$search_str = " and " . $search_str;
}
$offset = $per_page * $page_no - $per_page;
$limit_str = " limit " . $per_page . " offset " . $offset;
$tot_query = "select date(max(logindatetime)) lastlog from main_users u\n left join main_userloginlog l on u.id = l.userid and l.userid != 1 and u.id != 1\n inner join main_roles r on r.id = u.emprole " . $user_search . " " . $search_str . "\n group by u.id ";
if (isset($search_arr['logindatetime']) && $search_arr['logindatetime'] != '') {
$tot_query = "select * from (" . $tot_query . ") res where date(lastlog) = '" . sapp_Global::change_date(sapp_Global::getGMTformatdate($search_arr['logindatetime']), 'database') . "' ";
}
$tot_result = $db->query($tot_query);
$count = $tot_result->rowCount();
$page_cnt = ceil($count / $per_page);
if ($sort_name != 'u.isactive') {
$query = "select u.userfullname,r.rolename,u.emailaddress,u.employeeId,date(max(logindatetime)) lastlog,\n if(u.isactive = 1,1,0) isactive,date(u.createddate) createdate from main_users u \n left join main_userloginlog l on u.id = l.userid and l.userid != 1 and u.id != 1\n inner join main_roles r on r.id = u.emprole " . $user_search . " " . $search_str . "\n group by u.id order by " . $sort_name . " " . $sort_type . " ";
} else {
if ($sort_type == 'DESC') {
$str = "when 0 then 0 when 1 then 1 when 2 then 0 when 3 then 0 when 4 then 0 when 5 then 0 else 99 end";
} else {
if ($sort_type == 'ASC') {
$str = "when 0 then 1 when 1 then 0 when 2 then 1 when 3 then 1 when 4 then 1 when 5 then 1 else 99 end";
}
}
$query = "select u.userfullname,r.rolename,u.emailaddress,u.employeeId,date(max(logindatetime)) lastlog,\n if(u.isactive = 1,1,0) isactive,date(u.createddate) createdate from main_users u \n left join main_userloginlog l on u.id = l.userid and l.userid != 1 and u.id != 1\n inner join main_roles r on r.id = u.emprole " . $user_search . " " . $search_str . "\n group by u.id order by case " . $sort_name . " " . $str . " ";
}
if (isset($search_arr['logindatetime']) && $search_arr['logindatetime'] != '') {
$query = "select * from (" . $query . ") res where date(lastlog) = '" . sapp_Global::change_date(sapp_Global::getGMTformatdate($search_arr['logindatetime']), 'database') . "' ";
}
$query .= " " . $limit_str;
$result = $db->query($query);
$data = $result->fetchAll();
return array('rows' => $data, 'page_cnt' => $page_cnt);
}
示例2: activitylogreportAction
//.........这里部分代码省略.........
$searchQuery .= ' log_details Like \'%"userid":"' . $username . '"%\' AND';
}
if ($this->_request->getParam('modifieddate') != '') {
$date = sapp_Global::change_date($this->_request->getParam('modifieddate'), 'database');
$date1 = str_replace('-', '/', $date);
$onedayafter = date('Y-m-d', strtotime($date1 . "+1 days"));
$onedaybefore = date('Y-m-d', strtotime($date1 . "-1 days"));
$searchQuery .= '(log_details Like "%' . $onedaybefore . '%" or log_details Like "%' . $date . '%" or log_details Like "%' . $onedayafter . '%")';
}
if ($searchQuery != '') {
$searchQuery = rtrim($searchQuery, " AND");
}
$activityLogData = $logmanager_model->getLogManagerDataReport('last_modifieddate', 'Desc', '', '', $searchQuery, array('*'));
/*looping jsonlogs */
if (count($activityLogData) > 0) {
$userArray = array();
$menuArray = array();
$logJsonArray = array();
$jsonCount = 0;
$index = 0;
foreach ($activityLogData as $activitylog) {
$logdetails = '{"testjson":[' . $activitylog['log_details'] . ']}';
$logarr = @get_object_vars(json_decode($logdetails));
if (!empty($logarr)) {
$logarr['testjson'] = array_reverse($logarr['testjson']);
$jsonCount = count($logarr['testjson']);
}
if ($jsonCount > 0 && isset($logarr['testjson']) && !empty($logarr['testjson'])) {
foreach ($logarr['testjson'] as $key => $curr) {
$currArray = @get_object_vars($curr);
/*userid and date check with form and json values*/
$flag = false;
if ($this->_request->getParam('modifieddate') != '') {
$currArrayTemp = sapp_Global::getGMTformatdate($currArray['date']);
$pos = strpos($currArrayTemp, $date);
$flag = $pos !== false ? false : true;
}
if ($this->_request->getParam('hiddenusername') != '' && $username != $currArray['userid'] || $flag) {
continue;
}
/*end userid and date check*/
$logJsonArray[$index]['userid'] = $currArray['userid'] != '' ? $currArray['userid'] : 1;
$logJsonArray[$index]['date'] = $currArray['date'];
$datesort[$index] = $currArray['date'];
// to sort by date
if (!in_array($currArray['userid'], $userArray)) {
array_push($userArray, $currArray['userid']);
}
if (isset($activitylog['menuId'])) {
if (!in_array($activitylog['menuId'], $menuArray)) {
array_push($menuArray, $activitylog['menuId']);
}
}
$logJsonArray[$index]['menu'] = $activitylog['menuId'];
$logJsonArray[$index]['action'] = $action[(string) $activitylog['user_action']];
$actionsort[$index] = $action[(string) $activitylog['user_action']];
$index++;
}
}
}
$menuNameArray = $activitylog_model->getMenuNamesByIds($menuArray);
$userNameArray = $activitylog_model->getuserNamesByIds($userArray);
$lastpage = ceil(count($logJsonArray) / $perPage);
$endIndex = intval($perPage);
if ($pageNo != 1) {
$startIndex = (intval($pageNo) - 1) * intval($perPage);
示例3: getGrid
/**
* This function gives all content for grid view.
* @parameters
* @param $sort = ascending or descending
* @param $by = name of field which to be sort
* @param $pageNo = page number
* @param $perPage = no.of records per page
* @param $searchData = search string
* @param $call = type of call like ajax.
* @return Array;
*/
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $p1, $p2, $p3, $p4, $p5)
{
$menu_model = new Default_Model_Menu();
$user_model = new Default_Model_Users();
$searchQuery = '';
$searchArray = array();
$data = array();
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
if (count($searchValues) > 0) {
foreach ($searchValues as $key => $val) {
if ($key == 'last_modifieddate') {
$searchQuery .= " " . $key . " like '%" . sapp_Global::getGMTformatdate(urldecode($val)) . "%' AND ";
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
}
$objName = 'logmanager';
$tableFields = array('action' => 'Action', 'menuName' => 'Menu Name', 'id' => 'ID', 'userfullname' => 'Last Modified By', 'profileimg' => 'Profile', 'employeeId' => 'Employee ID', 'menuUrl' => 'Url', 'user_action' => 'Action', 'key_flag' => 'Last Modified Record', 'last_modifieddate' => 'Last Modified Date');
$tablecontent = $this->getActivitylogData($sort, $by, $pageNo, $perPage, $searchQuery);
$menu_data = $menu_model->getMenusListForActivitylog();
$menu_arr = array();
foreach ($menu_data as $gkey => $gdata) {
$menu_arr[$gdata['menuname']] = $gdata['menuname'];
}
$user_data = $user_model->getUserListForActivitylog();
$user_arr = array();
foreach ($user_data as $gkey => $gdata) {
$user_arr[$gdata['userfullname']] = $gdata['userfullname'];
}
$useractionArray = array('1' => 'Add', '5' => 'Cancel', '3' => 'Delete', '2' => 'Edit');
$dataTmp = array('sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'menuName' => 'Activity log', 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'call' => $call, 'search_filters' => array('menuname' => array('type' => 'select', 'filter_data' => array('' => 'All') + $menu_arr), 'userfullname' => array('type' => 'select', 'filter_data' => array('' => 'All') + $user_arr), 'last_modifieddate' => array('type' => 'datepicker'), 'user_action' => array('type' => 'select', 'filter_data' => array('' => 'All') + $useractionArray)));
return $dataTmp;
}