本文整理汇总了PHP中sapp_Global::change_date方法的典型用法代码示例。如果您正苦于以下问题:PHP sapp_Global::change_date方法的具体用法?PHP sapp_Global::change_date怎么用?PHP sapp_Global::change_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sapp_Global
的用法示例。
在下文中一共展示了sapp_Global::change_date方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGrid
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $exParam1 = '', $exParam2 = '', $exParam3 = '', $exParam4 = '')
{
$searchQuery = '';
$tablecontent = '';
$level_opt = array();
$searchArray = array();
$data = array();
$id = '';
$dataTmp = array();
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
foreach ($searchValues as $key => $val) {
if ($key == 'from_date' || $key == 'to_date') {
$searchQuery .= " " . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND ";
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
/** search from grid - END * */
$objName = 'educationdetails';
$tableFields = array('action' => 'Action', 'educationlevel' => 'Education Level', 'institution_name' => 'Institution Name', 'course' => 'Course', 'from_date' => 'From', "to_date" => "To", "percentage" => "Percentage");
$tablecontent = $this->geteducationdetails($sort, $by, $pageNo, $perPage, $searchQuery, $exParam1);
$educationlevelcodemodel = new Default_Model_Educationlevelcode();
$educationlevelArr = $educationlevelcodemodel->getEducationlevelData();
if (!empty($educationlevelArr)) {
foreach ($educationlevelArr as $educationlevelres) {
$level_opt[$educationlevelres['id']] = $educationlevelres['educationlevelcode'];
}
}
$dataTmp = array('userid' => $exParam1, 'sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getEmployeeAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'dashboardcall' => $dashboardcall, 'add' => 'add', 'menuName' => 'Education', 'formgrid' => 'true', 'unitId' => $exParam1, 'call' => $call, 'context' => $exParam2, 'search_filters' => array('from_date' => array('type' => 'datepicker'), 'to_date' => array('type' => 'datepicker'), 'educationlevel' => array('type' => 'select', 'filter_data' => array('' => 'All') + $level_opt)));
return $dataTmp;
}
示例2: getGrid
public function getGrid($sort, $by, $pageNo, $perPage, $searchData, $call, $dashboardcall, $exParam1 = '', $exParam2 = '', $exParam3 = '', $exParam4 = '')
{
$searchQuery = '';
$tablecontent = '';
$searchArray = array();
$data = array();
$id = '';
$dataTmp = array();
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
foreach ($searchValues as $key => $val) {
if ($key == 'from_date' || $key == 'to_date') {
$searchQuery .= " " . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND ";
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
/** search from grid - END * */
$objName = 'experiencedetails';
$tableFields = array('action' => 'Action', 'comp_name' => 'Company Name', 'designation' => 'Designation', 'from_date' => 'From', 'to_date' => 'To');
$tablecontent = $this->getexperiencedetailsData($sort, $by, $pageNo, $perPage, $searchQuery, $exParam1);
$dataTmp = array('userid' => $exParam1, 'sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getEmployeeAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'dashboardcall' => $dashboardcall, 'add' => 'add', 'menuName' => 'Experience', 'formgrid' => 'true', 'unitId' => $exParam1, 'call' => $call, 'context' => $exParam2, 'search_filters' => array('from_date' => array('type' => 'datepicker'), 'to_date' => array('type' => 'datepicker')));
return $dataTmp;
}
示例3: getGrid
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $exParam1 = '', $exParam2 = '', $exParam3 = '', $exParam4 = '')
{
$searchQuery = '';
$searchArray = array();
$data = array();
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
foreach ($searchValues as $key => $val) {
if ($key == 'department') {
$searchQuery .= " d.deptname like '%" . $val . "%' AND ";
} else {
if ($key == 'client_id') {
$searchQuery .= " c.client_name like '%" . $val . "%' AND ";
} else {
if ($key == 'start_date') {
$searchQuery .= " " . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND ";
} else {
if ($key == 'year_skill_last_used') {
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
}
}
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
$objName = 'empjobhistory';
$tableFields = array('action' => 'Action', 'department' => 'Department', 'client_id' => 'Client', 'start_date' => 'From', 'end_date' => 'To');
$tablecontent = $this->getEmpJobHistoryData($sort, $by, $pageNo, $perPage, $searchQuery, $exParam1);
$bool_arr = array('' => 'All', 1 => 'Yes', 2 => 'No');
$dataTmp = array('userid' => $exParam1, 'sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getEmployeeAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'add' => 'add', 'menuName' => 'Job history', 'formgrid' => 'true', 'unitId' => $exParam1, 'call' => $call, 'context' => $exParam2, 'search_filters' => array('active_company' => array('type' => 'select', 'filter_data' => $bool_arr), 'start_date' => array('type' => 'datepicker'), 'end_date' => array('type' => 'datepicker')));
return $dataTmp;
}
示例4: getGrid
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $exParam1 = '', $exParam2 = '', $exParam3 = '', $exParam4 = '')
{
$searchQuery = '';
$tablecontent = '';
$searchArray = array();
$data = array();
$id = '';
$dataTmp = array();
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
foreach ($searchValues as $key => $val) {
if ($key == 'expected_date_join') {
$searchQuery .= " " . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND ";
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
/** search from grid - END **/
$objName = 'medicalclaims';
$tableFields = array('action' => 'Action', 'injury_type' => 'Medical Claim Type', 'leaveappliedbyemployee_days' => 'Approved Leaves', 'leavebyemployeer_days' => 'Employee Applied Leaves', 'expected_date_join' => 'Date of Joining');
$tablecontent = $this->getempmedicalclaimdetails($sort, $by, $pageNo, $perPage, $searchQuery, $exParam1);
$dataTmp = array('userid' => $exParam1, 'sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getEmployeeAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'add' => 'add', 'menuName' => 'Medical Claims', 'formgrid' => 'true', 'unitId' => $exParam1, 'call' => $call, 'context' => $exParam2, 'dashboardcall' => $dashboardcall, 'search_filters' => array('injury_type' => array('type' => 'select', 'filter_data' => array('' => 'All', 1 => 'Paternity', 2 => 'Maternity', 3 => 'Disability', 4 => 'Injury')), 'expected_date_join' => array('type' => 'datepicker')));
return $dataTmp;
}
示例5: get_sd_report
public function get_sd_report($param_arr, $per_page, $page_no, $sort_name, $sort_type)
{
$search_str = "isactive = 1 ";
foreach ($param_arr as $key => $value) {
if ($value != '') {
if ($key == 'raised_date') {
$search_str .= " and DATE(createddate) = '" . sapp_Global::change_date($value, 'database') . "'";
} else {
$search_str .= " and " . $key . " = '" . $value . "'";
}
}
}
$offset = $per_page * $page_no - $per_page;
$db = Zend_Db_Table::getDefaultAdapter();
$limit_str = " limit " . $per_page . " offset " . $offset;
$count_query = "select count(*) cnt from main_sd_requests_summary where " . $search_str;
$count_result = $db->query($count_query);
$count_row = $count_result->fetch();
$count = $count_row['cnt'];
$page_cnt = ceil($count / $per_page);
$query = "select *,DATE_FORMAT(createddate,'" . DATEFORMAT_MYSQL . "') as createddate from main_sd_requests_summary where " . $search_str . " order by " . $sort_name . " " . $sort_type . " " . $limit_str;
$result = $db->query($query);
$rows = $result->fetchAll();
return array('rows' => $rows, 'page_cnt' => $page_cnt);
}
示例6: getdata_emp_report
/**
* This function is used to get data in employees report.
* @param array $param_arr = array of parameters.
* @param integer $per_page = no.of records per page
* @param integer $page_no = page number
* @param string $sort_name = name of the column to be sort
* @param string $sort_type = descending or ascending
* @return array Array of all employees.
*/
public function getdata_emp_report($param_arr, $per_page, $page_no, $sort_name, $sort_type)
{
$search_str = " e.isactive != 5 ";
foreach ($param_arr as $key => $value) {
if ($value != '') {
if ($key == 'date_of_joining') {
$search_str .= " and " . $key . " = '" . sapp_Global::change_date($value, 'database') . "'";
}
if ($key == 'businessunit_id' || $key === 'department_id') {
if (is_array($value)) {
$search_str .= " and " . $key . " in (" . implode(',', $value) . ")";
}
} else {
$search_str .= " and " . $key . " = '" . $value . "'";
}
}
}
$offset = $per_page * $page_no - $per_page;
$db = Zend_Db_Table::getDefaultAdapter();
$limit_str = " limit " . $per_page . " offset " . $offset;
$count_query = "select count(*) cnt from main_employees_summary e where " . $search_str;
$count_result = $db->query($count_query);
$count_row = $count_result->fetch();
$count = $count_row['cnt'];
$page_cnt = ceil($count / $per_page);
$query = "select e.*,es.salary,p.freqtype,c.currencyname " . " from main_employees_summary e left join main_empsalarydetails es on es.user_id = e.user_id " . " left join main_currency c on c.id = es.currencyid " . " left join main_payfrequency p on p.id = es.salarytype " . "where " . $search_str . " " . "order by " . $sort_name . " " . $sort_type . " " . $limit_str;
$result = $db->query($query);
$rows = $result->fetchAll();
return array('rows' => $rows, 'page_cnt' => $page_cnt);
}
示例7: getGrid
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $statusid, $a1, $a2, $a3)
{
$searchQuery = '';
$searchArray = array();
$data = array();
$requi_model = new Default_Model_Requisition();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
if (count($searchValues) > 0) {
foreach ($searchValues as $key => $val) {
if ($key == 'onboard_date' || $key == 'r.createdon') {
$searchQuery .= " date(" . $key . ") = '" . sapp_Global::change_date($val, 'database') . "' AND ";
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
}
$objName = 'rejectedrequisitions';
$tableFields = array('action' => 'Action', 'requisition_code' => 'Requisition Code', 'jobtitle_name' => 'Job Title', 'createdby_name' => 'Raised By', 'reporting_manager_name' => 'Reporting Manager', 'req_no_positions' => 'No. of Positions', 'filled_positions' => 'Filled Positions', 'r.createdon' => 'Raised On', 'onboard_date' => 'Due Date');
$tablecontent = $requi_model->getRequisitionData($sort, $by, $pageNo, $perPage, $searchQuery, $loginUserId, $loginuserGroup, 3);
$dataTmp = array('sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'add' => 'add', 'searchArray' => $searchArray, 'menuName' => 'Rejected Requisitions', 'call' => $call, 'dashboardcall' => $dashboardcall, 'search_filters' => array('r.createdon' => array('type' => 'datepicker'), 'onboard_date' => array('type' => 'datepicker')));
return $dataTmp;
}
示例8: getdata_emp_report
/**
* This function is used to get data in employees report.
* @param array $param_arr = array of parameters.
* @param integer $per_page = no.of records per page
* @param integer $page_no = page number
* @param string $sort_name = name of the column to be sort
* @param string $sort_type = descending or ascending
* @return array Array of all employees.
*/
public function getdata_emp_report($param_arr, $per_page, $page_no, $sort_name, $sort_type)
{
$search_str = "isactive != 5 ";
foreach ($param_arr as $key => $value) {
if ($value != '') {
if ($key == 'date_of_joining') {
$search_str .= " and " . $key . " = '" . sapp_Global::change_date($value, 'database') . "'";
} else {
$search_str .= " and " . $key . " = '" . $value . "'";
}
}
}
$offset = $per_page * $page_no - $per_page;
$db = Zend_Db_Table::getDefaultAdapter();
$limit_str = " limit " . $per_page . " offset " . $offset;
$count_query = "select count(*) cnt from main_employees_summary where " . $search_str;
$count_result = $db->query($count_query);
$count_row = $count_result->fetch();
$count = $count_row['cnt'];
$page_cnt = ceil($count / $per_page);
$query = "select * from main_employees_summary where " . $search_str . " order by " . $sort_name . " " . $sort_type . " " . $limit_str;
$result = $db->query($query);
$rows = $result->fetchAll();
return array('rows' => $rows, 'page_cnt' => $page_cnt);
}
示例9: getGrid
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $exParam1 = '', $exParam2 = '', $exParam3 = '', $exParam4 = '')
{
$searchQuery = '';
$tablecontent = '';
$searchArray = array();
$data = array();
$dataTmp = array();
/** search from grid - START **/
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
foreach ($searchValues as $key => $val) {
if ($key == 'visa_expiry_date') {
$searchQuery .= " " . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND ";
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
/** search from grid - END **/
$objName = 'visaandimmigrationdetails';
$tableFields = array('action' => 'Action', 'passport_number' => 'Passport Number', 'passport_expiry_date' => 'Passport Expiry Date', 'visa_number' => 'Visa Number', 'visa_expiry_date' => 'Visa Expiry Date', 'inine_status' => 'Inine Status', 'ininetyfour_status' => 'Ininetyfour Status');
$tablecontent = $this->getEmpVisaDetails($sort, $by, $pageNo, $perPage, $searchQuery, $exParam1);
$dataTmp = array('userid' => $exParam1, 'sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getEmployeeAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'add' => 'add', 'menuName' => 'Visa and Immigration', 'formgrid' => 'true', 'unitId' => $exParam1, 'dashboardcall' => $dashboardcall, 'call' => $call, 'context' => $exParam2, 'search_filters' => array('passport_expiry_date' => array('type' => 'datepicker'), 'visa_expiry_date' => array('type' => 'datepicker')));
return $dataTmp;
}
示例10: displayData
public function displayData($emp_data, $column_key)
{
if ($column_key == 'created_on') {
echo isset($emp_data['created_on']) ? sapp_Global::change_date($emp_data['created_on'], "view") : "";
} elseif ($column_key == 'onboard_date') {
echo isset($emp_data['onboard_date']) ? sapp_Global::change_date($emp_data['onboard_date'], "view") : "";
} else {
echo isset($emp_data[$column_key]) && !empty($emp_data[$column_key]) ? $emp_data[$column_key] : "--";
}
}
示例11: getGrid
/**
* This function gives all content for grid view.
* @param string $sort = ascending or descending
* @param string $by = name of field which to be sort
* @param integer $pageNo = page number
* @param integer $perPage = no.of records per page
* @param array $searchData = search string
* @param string $call = type of call like ajax.
* @return array Array of data.
*/
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $grid_type, $status_value, $p4, $p5)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$status_value_arr = array(1 => 'Open', 2 => 'Closed', 3 => 'Cancelled', 4 => 'Overdue', 5 => 'Duetoday', 6 => 'To approve', 7 => 'Approved', 8 => 'Rec_pending', 9 => 'Rec_wapproval', 10 => 'Rec_toapprove', 11 => 'To approve', 12 => 'App_approved', 13 => 'To manager approve', 14 => 'Rept_approved', 15 => 'Req_pending', 16 => 'Rejected', 17 => 'Raiser_open', 18 => 'Manager approved', 19 => 'Manager rejected', 20 => 'Rec_app_approved', 21 => 'Rec_app_rejected', 22 => 'Rec_app_closed', 23 => 'To management approve', 24 => 'Management approved', 25 => 'Management rejected');
$status_search_arr = array(6 => " (status = 'To management approve' or status = 'To manager approve') ", 9 => " (status = 'To management approve' or status = 'To manager approve') ", 7 => " (status = 'Manager approved' or status = 'Management Approved' or status = 'Manager rejected' or status = 'Management Rejected') ", 8 => " (status = 'Manager approved' or status = 'Management Approved' or status = 'Manager rejected' or status = 'Management Rejected') ", 10 => " (reporting_manager_id = '" . $loginUserId . "' and status ='To manager approve') ", 12 => " (status = 'Approved' or status = 'Rejected') ", 14 => " (status = 'Manager approved' or status = 'Manager rejected') ", 15 => " (status != 'Cancelled' and status != 'Closed') ", 5 => " date_add(date(r.createddate),interval 10 day) = date(now()) ", 4 => " date_add(date(r.createddate),interval 10 day) < date(now())", 17 => " ( status not in ('Closed','Cancelled','Rejected')) ", 20 => " (status = 'Manager approved' or status = 'Management Approved') ", 21 => " (status = 'Manager rejected' or status = 'Management Rejected')", 22 => " (status = 'Closed' or status = 'Rejected')");
$grid_type_arr = $this->getGridtypearr();
$grid_type = sapp_Global::_decrypt($grid_type);
$status_value = sapp_Global::_decrypt($status_value);
$searchQuery = '';
$searchArray = array();
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
if (count($searchValues) > 0) {
foreach ($searchValues as $key => $val) {
if ($key == 'createddate') {
$searchQuery .= " date(" . $key . ") = '" . sapp_Global::change_date($val, 'database') . "' AND ";
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
}
if (is_numeric($status_value) && $status_value > 0 && array_key_exists($status_value, $status_value_arr)) {
if (!array_key_exists($status_value, $status_search_arr)) {
$newsearchQuery = " status = '" . $status_value_arr[$status_value] . "'";
} else {
$newsearchQuery = $status_search_arr[$status_value];
}
if ($searchQuery != '') {
$searchQuery .= " and " . $newsearchQuery;
} else {
$searchQuery .= $newsearchQuery;
}
}
$objName = 'servicerequests';
$tableFields = array('action' => 'Action', 'ticket_number' => 'Ticket#', 'service_desk_name' => 'Category', 'service_request_name' => 'Request Type', 'priority' => 'Priority', 'description' => 'Description', 'raised_by_name' => 'Raised By', 'createddate' => 'Raised On', 'status' => 'Status');
if ($status_value != '') {
unset($tableFields['status']);
}
$bool_arr = array('' => 'All', 1 => 'Low', 2 => 'Medium', 3 => 'High');
$tablecontent = $this->getRequestData($sort, $by, $pageNo, $perPage, $searchQuery, $grid_type, $status_value);
$menu_name_arr = $this->getServicemenunames();
$menuName = $menu_name_arr[$grid_type];
$dataTmp = array('sort' => $sort, 'by' => $by, 'menuName' => $menuName, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent['table_content'], 'row_count' => $tablecontent['count'], 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'call' => $call, 'grid_type' => $grid_type, 'status_value' => $status_value, 'view_link' => BASE_URL . 'servicerequests/view/id/{{id}}/t/' . sapp_Global::_encrypt($grid_type) . ($status_value != '' ? "/v/" . sapp_Global::_encrypt($status_value) : ""), 'add_link' => BASE_URL . 'servicerequests/add/t/' . sapp_Global::_encrypt($grid_type) . ($status_value != '' ? "/v/" . sapp_Global::_encrypt($status_value) : ""), 'dashboardcall' => $dashboardcall, 'search_filters' => array('priority' => array('type' => 'select', 'filter_data' => $bool_arr), 'createddate' => array('type' => 'datepicker')));
if ($grid_type_arr[$grid_type] == 'request') {
$dataTmp['add'] = 'add';
}
return $dataTmp;
}
示例12: isValid
public function isValid($value)
{
$this->_setValue($value);
$today = date('Y-m-d');
$final_val = sapp_Global::change_date($value, 'database');
// expecting $value to be YYYY-MM-DD
if ($final_val <= $today) {
$this->_error(self::DATE_INVALID);
return false;
}
return true;
}
示例13: displayData
public function displayData($emp_data, $column_key)
{
$base_url = BASE_URL;
if ($column_key == 'created_on') {
echo isset($emp_data['created_on']) ? sapp_Global::change_date($emp_data['created_on'], "view") : "";
} elseif ($column_key == 'onboard_date') {
echo isset($emp_data['onboard_date']) ? sapp_Global::change_date($emp_data['onboard_date'], "view") : "";
} elseif ($column_key == 'Show_Report') {
echo "<a href='{$base_url}/reports/requisitionhistoryreportdetail/id/{$emp_data[req_id]}' target='_blank' >Show Report</a>";
} else {
echo isset($emp_data[$column_key]) && !empty($emp_data[$column_key]) ? $emp_data[$column_key] : "--";
}
}
示例14: getUserLoginLogGrid
/**
* 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 getUserLoginLogGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $p1, $p2, $p3, $p4, $p5)
{
$group_model = new Default_Model_Groups();
$role_model = new Default_Model_Roles();
$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 == 'userfullname' || $key == 'employeeId' || $key == 'emailaddress' || $key == 'empipaddress') {
$searchQuery .= " r." . $key . " like '%" . $val . "%' AND ";
} else {
if ($key == 'logindatetime') {
$searchQuery .= " " . $key . " like '%" . sapp_Global::change_date(urldecode($val), 'database') . "%' AND ";
} else {
if ($key == 'rolename') {
$searchQuery .= " ro." . $key . " like '%" . $val . "%' AND ";
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
}
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
}
$objName = 'userloginlog';
$tableFields = array('action' => 'Action', 'userfullname' => 'User', 'profileimg' => 'Profile', 'employeeId' => 'Employee ID', 'group_name' => 'Group', 'rolename' => 'Role', 'emailaddress' => 'Email', 'logindatetime' => 'Login Time', 'empipaddress' => 'Ip Address');
$tablecontent = $this->getUserLoginLogData($sort, $by, $pageNo, $perPage, $searchQuery);
$group_data = $group_model->getGroupsListForUserLoginLog();
$group_arr = array();
foreach ($group_data as $gkey => $gdata) {
$group_arr[$gdata['group_name']] = $gdata['group_name'];
}
$role_data = $role_model->getRoleListForUserLoginLog();
$role_arr = array();
foreach ($role_data as $gkey => $gdata) {
$role_arr[$gdata['rolename']] = $gdata['rolename'];
}
$dataTmp = array('sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'menuName' => 'User log', 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'call' => $call, 'search_filters' => array('group_name' => array('type' => 'select', 'filter_data' => array('' => 'All') + $group_arr), 'rolename' => array('type' => 'select', 'filter_data' => array('' => 'All') + $role_arr), 'logindatetime' => array('type' => 'datepicker')));
return $dataTmp;
}
示例15: getGrid
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $exParam1 = '', $exParam2 = '', $exParam3 = '', $exParam4 = '')
{
$searchQuery = '';
$tablecontent = '';
$searchArray = array();
$data = array();
$dataTmp = array();
/** search from grid - START **/
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
foreach ($searchValues as $key => $val) {
if ($key == 'from_date') {
$searchQuery .= " " . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND ";
} else {
if ($key == 'to_date') {
$searchQuery .= " " . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND ";
} else {
$searchQuery .= " " . $key . " like '%" . $val . "%' AND ";
}
}
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery, " AND");
}
$objName = 'empadditionaldetails';
$tableFields = array('action' => 'Action', 'military_status' => 'Served in Military', 'branch_service' => 'Branch of Service', 'from_date' => 'From', 'to_date' => 'To', 'veteran_status' => 'Veteran Status', 'military_servicetype' => 'Service Type');
$tablecontent = $this->getEmpAdditionalsData($sort, $by, $pageNo, $perPage, $searchQuery, $exParam1);
$bool_arr = array('' => 'All', 1 => 'Yes', 2 => 'No');
$empVeteranStatusArr = $this->empveteranstatus($exParam1);
$veteranstatusArr = array();
if (!empty($empVeteranStatusArr)) {
for ($i = 0; $i < sizeof($empVeteranStatusArr); $i++) {
$veteranstatusArr[$empVeteranStatusArr[$i]['id']] = $empVeteranStatusArr[$i]['veteranstatus'];
}
}
$empMiltitaryStatusArr = $this->empmilitarystatus($exParam1);
$militarystatusArr = array();
if (!empty($empMiltitaryStatusArr)) {
for ($i = 0; $i < sizeof($empMiltitaryStatusArr); $i++) {
$militarystatusArr[$empMiltitaryStatusArr[$i]['id']] = $empMiltitaryStatusArr[$i]['militaryservicetype'];
}
}
$dataTmp = array('userid' => $exParam1, 'sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getEmployeeAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'add' => 'add', 'menuName' => 'Additional Details', 'formgrid' => 'true', 'unitId' => $exParam1, 'dashboardcall' => $dashboardcall, 'call' => $call, 'context' => $exParam2, 'search_filters' => array('military_status' => array('type' => 'select', 'filter_data' => $bool_arr), 'military_servicetype' => array('type' => 'select', 'filter_data' => array('' => 'All') + $militarystatusArr), 'veteran_status' => array('type' => 'select', 'filter_data' => array('' => 'All') + $veteranstatusArr), 'from_date' => array('type' => 'datepicker', 'yearrange' => 'yearrange'), 'to_date' => array('type' => 'datepicker', 'yearrange' => 'yearrange')));
return $dataTmp;
}