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; }
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; }
/** * 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); }
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; }
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; }
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); }
/** * 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); }
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; }
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; }
/** * Check if a username is a Ldap user * * @param string $username * @return boolean */ public function login($postarray) { if (isset($postarray['employeeid']) && $postarray['employeeid'] != '' && isset($postarray['password']) && $postarray['password'] != '') { $result = array(); $employeeid = $postarray['employeeid']; $password = md5($postarray['password']); $check = $this->isActiveUser($employeeid, $password); if (!empty($check) && $check[0]['count'] == 1) { $result = $this->getUserObject($employeeid, $password); //$uploadpath = array('imagepath' => USER_UPLOAD_PATH.'/'.$result[0]['profileimg']); $uploadpath = array('imagepath' => sapp_Global::_getHostBaseURL() . "public/uploads/profile/" . $result[0]['profileimg']); $resultarray = array_merge($result[0], $uploadpath); $data = array('status' => '1', 'message' => 'Success', 'result' => $resultarray); } else { $userStatusArr = $this->getActiveStatus($employeeid, $password); if (!empty($userStatusArr)) { $userStatus = $userStatusArr[0]['status']; $islockaccount = $userStatusArr[0]['isaccountlock']; if ($userStatus == 0) { $data = array('status' => '0', 'message' => 'Login failed. Employee has been inactivated from the organization.', 'result' => ''); } else { if ($userStatus == 2) { $data = array('status' => '0', 'message' => 'Login failed. Employee has resigned from the organization.', 'result' => ''); } else { if ($userStatus == 3) { $data = array('status' => '0', 'message' => 'Login failed. Employee has left the organization.', 'result' => ''); } else { if ($userStatus == 4) { $data = array('status' => '0', 'message' => 'Login failed. Employee has been suspended from the organization.', 'result' => ''); } else { if ($userStatus == 5) { $data = array('message' => 'Login failed. Employee deleted.', 'result' => ''); } else { if ($islockaccount == 1) { $data = array('status' => '0', 'message' => 'Login failed. Employee has been locked.', 'result' => ''); } } } } } } } else { $data = array('status' => '0', 'message' => 'Invalid credentials given', 'result' => ''); } } } else { if ($postarray['employeeid'] == '') { $data = array('status' => '0', 'message' => 'Employee Id cannot be empty.', 'result' => $result); } else { if ($postarray['password'] == '') { $data = array('status' => '0', 'message' => 'Password cannot be empty.', 'result' => $result); } } } //echo "<pre>";print_r($data);exit; return $data; }
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] : "--"; } }
public function indexAction() { $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; $loginuserRole = $auth->getStorage()->read()->emprole; $loginuserGroup = $auth->getStorage()->read()->group_id; } $addpermission = 'No'; $editpermission = 'No'; $structureModel = new Default_Model_Structure(); $orgData = $structureModel->getOrgData(); $heirarchyModel = new Default_Model_Heirarchy(); $levelsdata = $heirarchyModel->getlevelsusernames(); $baseUrl = $this->getBaseurl(); $emps = $heirarchyModel->getAllEmployees(); $vEmps = $heirarchyModel->getVAllEmployees(); $output = ''; $empData = array(); if (count($emps) > 0) { foreach ($emps as $empRecord) { $empData[] = array('id' => $empRecord['id'], 'name' => ucwords($empRecord['name']), 'profileimg' => $empRecord['profileimg']); } } $editpermission = sapp_Global::_checkprivileges(HEIRARCHY, $loginuserGroup, $loginuserRole, 'edit'); $addpermission = sapp_Global::_checkprivileges(HEIRARCHY, $loginuserGroup, $loginuserRole, 'add'); $dataArr = array(); $tmplevelsdata = $levelsdata; $parentArr = array(); for ($i = 0; $i < sizeof($levelsdata); $i++) { $parentArr[] = $levelsdata[$i]['parent']; } $parentArr = array_unique($parentArr); $parr = array(); foreach ($parentArr as $parent) { foreach ($tmplevelsdata as $data) { if ($data['parent'] == $parent) { $parr[$parent][] = array('userid' => $data['userid'], 'userfullname' => $data['userfullname'], 'profileimg' => $data['profileimg'], 'level_number' => $data['level_number'], 'parent' => $data['parent'], 'jobtitlename' => $data['jobtitlename']); } } } if (!empty($parr)) { $output = "<ul id='org' style='display:none;'>"; $output .= "<li>\r\n\t\t\t\t\t\t<i></i>\t\r\n\t\t\t\t\t\t<p class='tags-ctrl'>\t\t\t\t\t\t \r\n\t\t\t\t\t\t <img class='main-img' border='0' src='" . $baseUrl . "/public/uploads/profile/" . $parr[key($parr)][0]['profileimg'] . "' onerror='this.src=\"" . $baseUrl . "/public/media/images/hierarchy-deafult-pic.jpg\"' />\r\n\t\t\t\t\t\t <span class='main-name' title='" . ucwords($parr[key($parr)][0]['userfullname']) . "' id='" . $parr[key($parr)][0]['userid'] . "'>" . $parr[key($parr)][0]['userfullname'] . "</span>\r\n\t\t\t\t\t\t <span class='main-name' title='" . ucwords($parr[key($parr)][0]['jobtitlename']) . "'>" . $parr[key($parr)][0]['jobtitlename'] . "</span>\r\n\t\t\t\t\t\t </p>"; $output .= $this->hasChildNoEdit($parr[key($parr)][0]['userid'], $parr); $output .= " </li></ul>"; } $this->view->output = $output; $this->view->allEmpdata = $vEmps; $this->view->empData = $empData; $this->view->orgData = $orgData; $this->view->editpermission = $editpermission; $this->view->addpermission = $addpermission; }
public function preDispatch() { $session = sapp_Global::_readSession(); if (!isset($session)) { if ($this->getRequest()->isXmlHttpRequest()) { echo Zend_Json::encode(array('login' => 'failed')); die; } else { $this->_redirect(''); } } }
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; }
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] : "--"; } }
public function getgroupEmails($sort, $by, $pageNo, $perPage, $searchQuery) { $where = "e.isactive = 1"; if ($searchQuery) { $where .= " AND " . $searchQuery; } if (!sapp_Global::_isactivemodule(RESOURCEREQUISITION)) { $where .= " AND eg.group_code <> 'REQ_HR' AND eg.group_code <> 'REQ_MGMT' "; } if (!sapp_Global::_isactivemodule(BGCHECKS)) { $where .= " AND eg.group_code <> 'BG_CHECKS_HR' AND eg.group_code <> 'BG_CHECKS_MNGMNT' "; } $emailContactsdata = $this->select()->setIntegrityCheck(false)->from(array('e' => 'main_emailcontacts'))->joinInner(array('eg' => 'main_emailgroups'), "eg.id = e.group_id and eg.isactive = 1", array('group_name' => 'eg.group_name'))->joinInner(array('bu' => 'main_businessunits'), "bu.id = e.business_unit_id and bu.isactive = 1", array('unitname' => "if(bu.id = 0,'',bu.unitname)"))->where($where)->order("{$by} {$sort}")->limitPage($pageNo, $perPage); return $emailContactsdata; }
public function preDispatch() { $auth = Zend_Auth::getInstance(); $session = sapp_Global::_readSession(); if (!isset($session)) { if ($this->getRequest()->isXmlHttpRequest()) { echo Zend_Json::encode(array('login' => 'failed')); die; } else { $this->_redirect(''); } } $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('activitylogreport', 'html')->initContext(); }
/** * 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; }
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; }
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $a = '', $b = '', $c = '', $d = '') { $searchQuery = ''; $searchArray = array(); $data = array(); if ($searchData != '' && $searchData != 'undefined') { $searchValues = json_decode($searchData); foreach ($searchValues as $key => $val) { $sval = $val; $val = mysql_real_escape_string($val); if ($key == 'fin_year') { $searchQuery .= " concat(from_year,'-',to_year) like '%" . $val . "%' AND "; } else { if ($key == 'app_period') { $searchQuery .= " lower(case when fi.ff_mode = 'Quarterly' then concat('Q',fi.ff_period) when fi.ff_mode = 'Half-yearly' then concat('H',fi.ff_period) when fi.ff_mode = 'Yearly' then 'Yearly' end) like '%" . strtoupper($val) . "%' AND "; } else { if ($key == 'ff_due_date') { $searchQuery .= " " . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND "; } else { if ($key == 'ff_process_status') { if ($val == 1) { $searchQuery .= " initialize_status = 2 AND "; } if ($val == 2) { $searchQuery .= " enable_to = 0 AND "; } if ($val == 3) { $searchQuery .= " enable_to = 1 AND "; } } else { $searchQuery .= $key . " like '%" . $val . "%' AND "; } } } } } $searchQuery = rtrim($searchQuery, " AND"); } $objName = 'feedforwardinit'; $tableFields = array('action' => 'Action', 'unitname' => 'Business Unit', 'deptname' => 'Department', 'fin_year' => 'Financial Year', 'ff_mode' => 'Mode', 'app_period' => 'Period', 'ff_due_date' => 'Due Date', 'status' => 'Appraisal Status', 'ff_process_status' => 'Process Status'); $tablecontent = $this->getFeedforwardInitData($sort, $by, $pageNo, $perPage, $searchQuery); $dataTmp = array('sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'add' => 'add', 'call' => $call, 'dashboardcall' => $dashboardcall, 'actionparam' => 'yes', 'search_filters' => array('status' => array('type' => 'select', 'filter_data' => array('' => 'All', '1' => 'Open', '2' => 'Closed')), 'ff_mode' => array('type' => 'select', 'filter_data' => array('' => 'All', 'Quarterly' => 'Quarterly', 'Half-yearly' => 'Half-yearly', 'Yearly' => 'Yearly')), 'ff_due_date' => array('type' => 'datepicker'), 'ff_process_status' => array('type' => 'select', 'filter_data' => array('' => 'All', '1' => 'Initialize later', '2' => 'Appraisal employees', '3' => 'All employees')))); return $dataTmp; }
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $unitId, $a = '', $b = '', $c = '') { $searchQuery = ''; $searchArray = array(); $data = array(); if ($searchData != '' && $searchData != 'undefined') { $searchValues = json_decode($searchData); foreach ($searchValues as $key => $val) { if ($key == 'timezone') { $searchQuery .= " tz." . $key . " like '%" . $val . "%' AND "; } else { if ($key == 'unitname') { $searchQuery .= " b." . $key . " like '%" . $val . "%' AND "; } else { if ($key == 'depthead') { $searchQuery .= " u.userfullname like '%" . $val . "%' AND "; } else { if ($key == 'startdate') { $searchQuery .= " d." . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND "; } else { $searchQuery .= " d." . $key . " like '%" . $val . "%' AND "; } } } } $searchArray[$key] = $val; } $searchQuery = rtrim($searchQuery, " AND"); } $objName = 'departments'; $tableFields = array('action' => 'Action', 'deptname' => 'Name', 'deptcode' => 'Code', 'startdate' => 'Started On', 'depthead' => 'Department Head', 'timezone' => 'Time Zone', 'unitname' => 'Business Unit'); $tablecontent = $this->getDepartmentsData($sort, $by, $pageNo, $perPage, $searchQuery, $unitId); if (isset($unitId) && $unitId != '') { $formgrid = 'true'; } else { $formgrid = ''; } $dataTmp = array('sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'formgrid' => $formgrid, 'unitId' => $unitId, 'dashboardcall' => $dashboardcall, 'call' => $call, 'search_filters' => array('startdate' => array('type' => 'datepicker'))); return $dataTmp; }
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 == 'year_skill_last_used') { $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 **/ /* Purpose:TO get drop down for search filters.Getting all competency levels from main_competencylevel table. Modified Date : 21/10/2013. Modified By: Yamini. */ $empcompetencyLevelsArr = $this->empcompetencylevels($exParam1); $levelsArr = array(); if (!empty($empcompetencyLevelsArr)) { for ($i = 0; $i < sizeof($empcompetencyLevelsArr); $i++) { $levelsArr[$empcompetencyLevelsArr[$i]['id']] = $empcompetencyLevelsArr[$i]['competencylevel']; } } $objName = 'empskills'; $tableFields = array('action' => 'Action', 'skillname' => 'Skill', 'yearsofexp' => 'Years of Experience', 'competencylevelid' => 'Competency Level', 'year_skill_last_used' => 'Skill Last Used Year'); $tablecontent = $this->getEmpSkillsData($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' => 'Skills', 'formgrid' => 'true', 'unitId' => $exParam1, 'dashboardcall' => $dashboardcall, 'call' => $call, 'context' => $exParam2, 'search_filters' => array('competencylevelid' => array('type' => 'select', 'filter_data' => array('' => 'All') + $levelsArr), 'year_skill_last_used' => array('type' => 'datepicker'))); return $dataTmp; }
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $a = '', $b = '', $c = '', $d = '') { $searchQuery = ''; $searchArray = array(); $data = array(); if ($searchData != '' && $searchData != 'undefined') { $searchValues = json_decode($searchData); foreach ($searchValues as $key => $val) { if ($key == 'start_date' || $key == 'end_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 = 'currencyconverter'; $tableFields = array('action' => 'Action', 'basecurrtext' => 'Base Currency', 'targetcurrtext' => 'Target Currency', 'exchangerate' => 'Exchange Rate', 'start_date' => 'Active Start Date', 'end_date' => 'Active End Date', 'description' => 'Description'); $tablecontent = $this->getCurrencyConverterData($sort, $by, $pageNo, $perPage, $searchQuery); $dataTmp = array('sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'add' => 'add', 'call' => $call, 'dashboardcall' => $dashboardcall, 'search_filters' => array('start_date' => array('type' => 'datepicker'), 'end_date' => array('type' => 'datepicker'))); return $dataTmp; }
public function getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $a = '', $b = '', $c = '', $d = '') { $searchQuery = ''; $searchArray = array(); $data = array(); if ($searchData != '' && $searchData != 'undefined') { $searchValues = json_decode($searchData); foreach ($searchValues as $key => $val) { $searchAlias = ' '; if ($key == 'city') { $searchAlias = " c."; } if ($key == 'state') { $searchAlias = " s."; } if ($key == 'country') { $searchAlias = " cn."; } if ($key == 'timezone') { $searchAlias = " tz."; } if ($key == 'startdate') { $searchQuery .= " " . $key . " like '%" . sapp_Global::change_date(urldecode($val), 'database') . "%' AND "; } else { $searchQuery .= $searchAlias . $key . " like '%" . urldecode($val) . "%' AND "; } $searchArray[$key] = urldecode($val); } $searchQuery = rtrim($searchQuery, " AND"); } $objName = 'businessunits'; $tableFields = array('action' => 'Action', 'unitname' => 'Name', 'unitcode' => 'Code', 'startdate' => 'Started On', 'address1' => 'Street Address', 'city' => 'City', 'state' => 'State', 'country' => 'Country', 'timezone' => 'Time zone'); $tablecontent = $this->getBusinessUnitsData($sort, $by, $pageNo, $perPage, $searchQuery); $dataTmp = array('sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'call' => $call, 'dashboardcall' => $dashboardcall, 'search_filters' => array('startdate' => array('type' => 'datepicker'))); return $dataTmp; }
public function deleteAction() { $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; } $id = $this->_request->getParam('objid'); $messages['message'] = ''; $actionflag = 3; if ($id) { $assignmententryreasoncodemodel = new Default_Model_Assignmententryreasoncode(); $data = array('isactive' => 0); $where = array('id=?' => $id); $Id = $assignmententryreasoncodemodel->SaveorUpdateAssignmentEntryData($data, $where); if ($Id == 'update') { $menuID = ASSIGNMENTENTRYREASONCODE; $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id); $messages['message'] = 'Assignment entry reason code deleted successfully.'; } else { $messages['message'] = 'Assignment entry reason code cannot be deleted.'; } } else { $messages['message'] = 'Assignment entry reason code cannot be deleted.'; } $this->_helper->json($messages); }
public function saveorginfo($form, $loginUserId, $wizardData) { $orgInfoModel = new Default_Model_Organisationinfo(); $wizard_model = new Default_Model_Wizard(); $id = $this->getRequest()->getParam('id'); $imagerror = $this->_request->getParam('imgerr'); $imagepath = $this->_request->getParam('org_image_value'); $imgerrmsg = $this->_request->getParam('imgerrmsg'); $pphnumber = $this->_request->getParam('phonenumber'); $sphnumber = $this->_request->getParam('secondaryphone'); $org_startdate = sapp_Global::change_date($this->_request->getParam('org_startdate'), 'database'); $flag = 'true'; if (isset($imagepath) && $imagepath != '') { $imageArr = explode('.', $imagepath); if (sizeof($imageArr) > 1) { $imagename = $imageArr[0]; $imageext = $imageArr[1]; $extArr = array('gif', 'jpg', 'jpeg', 'png'); if (!in_array($imageext, $extArr)) { $msgarray['org_image_value'] = 'Please upload an appropriate image file.'; $flag = 'false'; } } else { $msgarray['org_image_value'] = 'Please upload an appropriate image file.'; $flag = 'false'; } } if ($imagerror == 'error') { if ($imgerrmsg != '' && $imgerrmsg != 'undefined') { $msgarray['org_image_value'] = $imgerrmsg; } else { $msgarray['org_image_value'] = 'Please upload an appropriate image file.'; } $flag = 'false'; } if ($pphnumber == $sphnumber && $sphnumber != '' && $pphnumber != '') { $msgarray['secondaryphone'] = 'Please enter different phone number.'; $flag = 'false'; } if ($form->isValid($this->_request->getPost()) && $flag != 'false') { $domain = $this->_request->getParam('domain'); $domain = implode(',', $domain); $date = new Zend_Date(); $data = array('organisationname' => trim($this->_request->getParam('organisationname')), 'domain' => trim($domain), 'website' => trim($this->_request->getParam('website')), 'org_image' => $imagepath, 'orgdescription' => trim($this->_request->getParam('orgdescription')), 'totalemployees' => trim($this->_request->getParam('totalemployees')), 'org_startdate' => $org_startdate != '' ? $org_startdate : NULL, 'phonenumber' => trim($this->_request->getParam('phonenumber')), 'secondaryphone' => trim($this->_request->getParam('secondaryphone')), 'faxnumber' => trim($this->_request->getParam('faxnumber')), 'country' => trim((int) $this->_request->getParam('country')), 'state' => trim(intval($this->_request->getParam('state'))), 'city' => trim(intval($this->_request->getParam('city'))), 'address1' => trim($this->_request->getParam('address1')), 'address2' => trim($this->_request->getParam('address2')), 'address3' => trim($this->_request->getParam('address3')), 'description' => trim($this->_request->getParam('description')), 'designation' => trim($this->_request->getParam('jobtitle_id', null)), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s")); $db = Zend_Db_Table::getDefaultAdapter(); $db->beginTransaction(); try { $path = IMAGE_UPLOAD_PATH; $imagepath = $this->_request->getParam('org_image_value'); $filecopy = 'success'; if ($imagepath != '') { $filecopy = 'error'; if (file_exists(USER_PREVIEW_UPLOAD_PATH . '//' . $imagepath)) { try { if (copy(USER_PREVIEW_UPLOAD_PATH . '//' . $imagepath, $path . '//' . $imagepath)) { $filecopy = 'success'; } unlink(USER_PREVIEW_UPLOAD_PATH . '//' . $imagepath); } catch (Exception $e) { echo $msgarray['org_image_value'] = $e->getMessage(); exit; } } } $where = array('id=?' => $id); if ($imagepath == '') { unset($data['org_image']); } else { if ($filecopy == 'error') { unset($data['org_image']); } } if ($id != '') { $where = array('id=?' => $id); $actionflag = 2; } else { $data['createdby'] = $loginUserId; $data['createddate'] = gmdate("Y-m-d H:i:s"); $data['isactive'] = 1; $where = ''; $actionflag = 1; } $Id = $orgInfoModel->SaveorUpdateData($data, $where); $menuID = ORGANISATIONINFO; try { if ($Id != '' && $Id != 'update') { $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $Id); } else { $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id); } } catch (Exception $e) { echo $e->getMessage(); } $wizardarray = array('org_details' => 2, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s")); if ($wizardData['site_config'] == 2) { $wizardarray['iscomplete'] = 2; } $wizard_model->SaveorUpdateWizardData($wizardarray, ''); $location_data = array('country' => trim((int) $this->_request->getParam('country')), 'state' => trim(intval($this->_request->getParam('state'))), 'city' => trim(intval($this->_request->getParam('city'))), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s")); $LocationId = $wizard_model->SaveorUpdateWizardData($location_data, ''); $db->commit(); if ($filecopy == 'success') { $this->_helper->getHelper("FlashMessenger")->addMessage("Organization information saved successfully."); } else { $this->_helper->getHelper("FlashMessenger")->addMessage("Organization information saved successfully but failed to upload the logo."); } $this->_redirect('wizard/configureorganisation'); } catch (Exception $e) { $db->rollBack(); $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Something went wrong,please try again later.")); $this->_redirect('wizard/configureorganisation'); } } else { $messages = $form->getMessages(); foreach ($messages as $key => $val) { foreach ($val as $key2 => $val2) { $msgarray[$key] = $val2; break; } } //echo '<pre>';print_r($messages);exit; return $msgarray; } }
public function uploadsaveAction() { $user_id = sapp_Global::_readSession('id'); $filedata = array(); // Validate file with size greater than default(Upload Max Filesize)limit $default_max_upload_filesize = 2 * pow(10, 6); if ($_FILES["myfile"]["size"] == 0 || $_FILES["myfile"]["size"] > $default_max_upload_filesize) { $this->_helper->json(array('error' => 'filesize')); } else { if (isset($_FILES["myfile"])) { $fileName = $_FILES["myfile"]["name"]; $fileName = preg_replace('/[^a-zA-Z0-9.\']/', '_', $fileName); $newName = time() . '_' . $user_id . '_' . str_replace(' ', '_', $fileName); $filedata['original_name'] = $fileName; $filedata['new_name'] = $newName; if (isset($_POST["doc_id"]) && $_POST["doc_id"] != '') { move_uploaded_file($_FILES["myfile"]["tmp_name"], EMP_DOC_UPLOAD_PATH . $newName); } else { move_uploaded_file($_FILES["myfile"]["tmp_name"], EMP_DOC_TEMP_UPLOAD_PATH . $newName); } $this->_helper->json(array('filedata' => $filedata)); } } }
public function downloadreportAction() { $file_name = $this->_getParam('file_name', NULL); if (!empty($file_name)) { $file = BASE_PATH . '/downloads/reports/' . $this->_getParam('file_name'); $status = sapp_Global::downloadReport($file); } }
public function multipleresumeAction() { $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; $loginUserId = trim($loginUserId); } $priv_check = sapp_Global::_checkprivileges(CANDIDATEDETAILS, '', $auth->getStorage()->read()->emprole, 'add'); if ($priv_check == 'Yes') { $msgarray = $req_options = array(); $form = new Default_Form_Multipleresume(); $form->setAction(DOMAIN . 'candidatedetails/multipleresume'); // To show list of requisitions to user $req_model = new Default_Model_Requisition(); $req_data = $req_model->getRequisitionsForCV("'Approved','In process'"); foreach ($req_data as $req) { $req_options[$req['id']] = $req['requisition_code'] . ' - ' . $req['jobtitlename']; } if (count($req_options) == 0) { $msgarray['requisition_id'] = "No active requisitions are found."; } $form->requisition_id->addMultiOptions(array('' => 'Select Requisition ID') + $req_options); $form_post_status = $this->_request->getPost(); if ($form_post_status) { $candidate_firstname = $this->_getParam('candidate_firstname', null); $candidate_lastname = $this->_getParam('candidate_lastname', null); $cand_resumes = $this->_getParam('cand_resume', null); if ($form->isValid($form_post_status)) { $cand_details_model = new Default_Model_Candidatedetails(); $requisition_id = $this->_getParam('requisition_id', null); $cand_status = $this->_getParam('cand_status', null); $req_records = $cand_details_model->getcountofrecords($requisition_id); $curr_date = gmdate("Y-m-d H:i:s"); if (empty($req_records)) { $rdata = array('req_status' => 'In process', 'modifiedby' => $loginUserId, 'modifiedon' => $curr_date); $rwhere = ' id = ' . $requisition_id; $req_model->SaveorUpdateRequisitionData($rdata, $rwhere); } // To insert records in a single query $records = array(); foreach ($candidate_firstname as $key => $candidate_fname) { $cfull_name = $candidate_fname . ' ' . $candidate_lastname[$key]; $records[] = "({$requisition_id}, '{$candidate_fname}','{$candidate_lastname[$key]}','{$cfull_name}', '{$cand_resumes[$key]}', '{$cand_status}', 1, {$loginUserId}, {$loginUserId}, '{$curr_date}', '{$curr_date}')"; } $data_fields = array('requisition_id', 'candidate_firstname', 'candidate_lastname', 'candidate_name', 'cand_resume', 'cand_status', 'isactive', 'createdby', 'modifiedby', 'createddate', 'modifieddate'); $last_insert_id = $cand_details_model->insertMultipleRecords($data_fields, $records); // Log status to Log manager and redirect to Resource Pooling list page. if ($last_insert_id != '') { $menumodel = new Default_Model_Menu(); $objidArr = $menumodel->getMenuObjID('/candidatedetails'); $objID = $objidArr[0]['id']; $log_status = sapp_Global::logManager($objID, 1, $loginUserId, $last_insert_id); //$this->_helper->FlashMessenger()->setNamespace('success')->addMessage('Candidate details added successfully.'); $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Candidate details added successfully.")); $this->_redirect('/candidatedetails'); } } else { // To handle server validation, when Javascript is disabled $messages = $form->getMessages(); foreach ($messages as $key => $val) { foreach ($val as $key2 => $val2) { $msgarray[$key] = $val2; break; } } $form->setDefault('candidate_firstname', $candidate_firstname[0]); $form->setDefault('cand_resume', ''); } } $this->view->form = $form; $this->view->msgarray = $msgarray; } else { $this->_redirect('error'); } }
public function welcomeAction() { $auth = Zend_Auth::getInstance(); $businessunit_id = ''; $department_id = ''; if ($auth->hasIdentity()) { $businessunit_id = $auth->getStorage()->read()->businessunit_id; $department_id = $auth->getStorage()->read()->department_id; $loginUserId = $auth->getStorage()->read()->id; $loginuserRole = $auth->getStorage()->read()->emprole; } $widgetsModel = new Default_Model_Widgets(); // Birthdays & Announcements $birthdaysRes = $widgetsModel->getTodaysBirthdays($businessunit_id, $department_id); $upcomingBirthdyas = $widgetsModel->getUpcomingBirthdays($businessunit_id, $department_id); $this->view->todyasBirthdays = $birthdaysRes; $this->view->upcomingBirthdyas = $upcomingBirthdyas; // Announcements - START $announcementsModel = new Default_Model_Announcements(); $announcementsData = $announcementsModel->getAllByBusiAndDeptId(); $this->view->announcementsData = $announcementsData; // Announcements - END //Widgets formats //Interview Schedules = 'format1'; //My Service Request = 'format2'; //Request Pending Approval = 'format3'; //Leaves Available = 'format4'; //My Leaves This Month = 'format5'; //Leave Management Options = 'format6'; //My details = 'format7'; $menuIdsArr = array(57 => 'format1', 10 => 'format5', 11 => 'format5', 20 => 'format5', 21 => 'format5', 14 => 'format4', 23 => 'format2', 32 => 'format7', 34 => 'format4', 35 => 'format5', 41 => 'format5', 42 => 'format5', 45 => 'format3', 54 => 'format4', 55 => 'format5', 56 => 'format4', 61 => 'format3', 65 => 'format3', 44 => 'format6', 43 => 'format5', 80 => 'format5', 86 => 'format5', 87 => 'format5', 88 => 'format5', 89 => 'format5', 90 => 'format5', 91 => 'format5', 92 => 'format5', 93 => 'format5', 100 => 'format5', 101 => 'format5', 102 => 'format5', 103 => 'format5', 107 => 'format5', 108 => 'format5', 110 => 'format5', 111 => 'format5', 114 => 'format5', 115 => 'format5', 116 => 'format5', 117 => 'format5', 118 => 'format5', 120 => 'format5', 121 => 'format5', 123 => 'format5', 124 => 'format5', 125 => 'format5', 126 => 'format5', 127 => 'format5', 128 => 'format5', 132 => 'format5', 136 => 'format5', 140 => 'format5', 143 => 'format3', 144 => 'format5', 145 => 'format5', 146 => 'format5', 148 => 'format3', 150 => 'format5', 151 => 'format5', 152 => 'format5', 154 => 'format4', 155 => 'format5', 165 => 'format5', 166 => 'format5', 62 => 'format3', 63 => 'format3', 64 => 'format3', 68 => 'format3', 69 => 'format3', 85 => 'format3', 131 => 'format5', 134 => 'format3', 135 => 'format3', 138 => 'format3', 139 => 'format3', 140 => 'format5', 142 => 'format5', 151 => 'format5', 154 => 'format6', 158 => 'format5', 159 => 'format5', 160 => '', 161 => 'format3', 165 => 'format5', 166 => 'format5', 167 => 'format6', 168 => '', 174 => 'format5', 169 => 'format3', 170 => 'format3', 172 => 'format5', 174 => 'format5'); $getMenuIds = $widgetsModel->getWidgets($loginUserId, $loginuserRole); $htmlcontent = ''; $tmpHtml1 = ""; $tmpHtml5 = ""; $tmpHtml2 = ""; $tmpHtml3 = ""; $tmpHtml4 = ""; $format = ''; if (!empty($getMenuIds)) { //$i,j for css color changing for widgets $i = 1; $j = 1; foreach ($getMenuIds as $getMenuIdArr) { $i = $i >= 5 ? $i - 4 : $i; // I for format 2,3,4 $j = $i >= 5 ? $j - 4 : $j; // J for format 5 $menuId = $getMenuIdArr['id']; $url = $getMenuIdArr['url']; $format = isset($menuIdsArr[$menuId]) ? $menuIdsArr[$menuId] : ''; if ($menuId == 57) { $tmpHtml1 = sapp_Global::format1($url); } else { if ($format == 'format2') { $tmpHtml2 .= sapp_Global::format2($menuId, $i, $url); $i++; } else { if ($format == 'format3') { $tmpHtml2 .= sapp_Global::format3($menuId, $i, $url); $i++; } else { if ($format == 'format4') { $tmpHtml2 .= sapp_Global::format4($menuId, $i, $url); $i++; } else { if ($format == 'format5') { $tmpHtml5 .= sapp_Global::format5($menuId, $j, $url); $j++; } else { if ($format == 'format6') { $tmpHtml5 .= sapp_Global::format6($menuId, $url); $j++; } else { if ($format != '') { $htmlcontent .= sapp_Global::format7($menuId, $url); } else { if ($format == '') { $htmlcontent = ''; } } } } } } } } } //$htmlcontent = '<div class="left_dashboard">'.$tmpHtml1.$tmpHtml2.$tmpHtml4.$tmpHtml3.$tmpHtml5.$htmlcontent.'</div>'; $htmlcontent = '<div class="left_dashboard">' . $tmpHtml1 . $tmpHtml2 . '<div class="clear"></div>' . $tmpHtml5 . $htmlcontent . '</div>'; } $this->view->htmlcontent = $htmlcontent; }