本文整理汇总了PHP中sapp_Global::_encrypt方法的典型用法代码示例。如果您正苦于以下问题:PHP sapp_Global::_encrypt方法的具体用法?PHP sapp_Global::_encrypt怎么用?PHP sapp_Global::_encrypt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sapp_Global
的用法示例。
在下文中一共展示了sapp_Global::_encrypt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<input type = 'hidden' value='<?php
echo $codeversion;
?>
' name='codeversion' id='codeversion'>
<input type = 'hidden' value='<?php
echo $dbversion;
?>
' name='dbversion' id='dbversion'>
<input type = 'hidden' value='<?php
echo $dbid;
?>
' name='dbid' id='dbid'>
<input type = 'hidden' value='<?php
echo $codeid;
?>
' name='codeid' id='codeid'>
</form>
<script>
document.getElementById('upgrade').submit();
</script>
<?php
}
} else {
header("Location: error.php?param=" . sapp_Global::_encrypt('db') . "");
exit;
}
} catch (Exception $e) {
header("Location: error.php?param=" . sapp_Global::_encrypt('error') . "");
exit;
}
//}
示例2: breadcrumbs
public function breadcrumbs($baseUrlString = '')
{
$request = Zend_Controller_Front::getInstance();
$params = $request->getRequest()->getParams();
$controllerName = $request->getRequest()->getControllerName();
$action_Name = $request->getRequest()->getActionName();
$tName = '';
$vName = '';
$tUrl = '';
$serviceUrl = '';
$burl = $controllerName . "/" . $action_Name;
/**
*
* For service request modifying the breadcrum based on t and v params
* @var t and @var v
*/
$param_t = isset($params['t']) ? sapp_Global::_decrypt($params['t']) : "";
$param_v = isset($params['v']) ? sapp_Global::_decrypt($params['v']) : "";
$service_menu = sapp_Helper::sd_menu_names();
$service_action_arr = sapp_Helper::sd_action_names();
if ($param_t != '' && isset($service_menu[$param_t])) {
$tName = $service_menu[$param_t] . ' Summary';
$tUrl = $baseUrlString . '/' . $controllerName . '/index/t/' . sapp_Global::_encrypt($param_t);
}
if ($param_v != '' && isset($service_action_arr[$param_v])) {
$vName = $service_action_arr[$param_v];
} else {
$vName = $action_Name != 'index' ? $action_Name : '';
}
if ($vName != '') {
if ($tName != '') {
$serviceUrl = '<a href=' . $tUrl . '>' . $tName . '</a><span class="arrows">›</span>';
}
$serviceUrl .= '<span>' . ucfirst($vName) . '</span>';
} else {
$serviceUrl = '<span>' . $tName . '</span>';
}
/**
* End modifying breadcrum for servicerequest.
*/
unset($params['module'], $params['controller'], $params['action']);
if (isset($params['error_handler'])) {
unset($params['error_handler']);
}
$id_name = '';
if (is_array($params) && !empty($params)) {
foreach ($params as $key => $value) {
if (!is_array($value)) {
$burl .= "/" . $key . "/" . $value;
}
}
$id_name = "yes";
}
$pageUrl = explode("/", $_SERVER['REQUEST_URI']);
$serverUrl = $_SERVER['HTTP_HOST'];
$reportsArr = array('leavesreport' => 'Leaves', 'holidaygroupreports' => 'Holidays', 'activeuser' => 'Active Users', 'employeereport' => 'Employees', 'rolesgroup' => 'Roles', 'emprolesgroup' => 'Employee Roles', 'userlogreport' => 'User Logs', 'activitylogreport' => 'Activity Logs', 'requisitionstatusreport' => 'Requisition');
$pageName = $controllerName;
$actionName = $action_Name;
$breadCrumbsData = '';
$mydetails_arr = array('jobhistory' => 'Employee Job History', 'certification' => 'Training & Certification Details', 'experience' => 'Experience Details', 'education' => 'Education Details', 'medicalclaims' => 'Medical Claims', 'leaves' => 'Employee Leaves', 'skills' => 'Employee Skills', 'communication' => 'Contact Details', 'communicationdetailsview' => 'Contact Details', 'disability' => 'Disability Details', 'disabilitydetailsview' => 'Disability Details', 'workeligibility' => 'Work Eligibility Details', 'workeligibilitydetailsview' => 'Work Eligibility Details', 'visa' => 'Visa and Immigration Details', 'visadetailsview' => 'Visa and Immigration Details', 'additionaldetails' => 'Additional Details', 'additionaldetailsview' => 'Additional Details', 'salarydetails' => 'Salary Details', 'salarydetailsview' => 'Salary Details', 'personal' => 'Personal Details', 'personaldetailsview' => 'Personal Details', 'creditcard' => 'Corporate Card Details', 'creditcarddetailsview' => 'Corporate Card Details', 'dependency' => 'Dependency Details', 'edit' => 'Edit');
$myemployees_arr = array('additionaldetailsview' => 'Additional Details', 'jobhistoryview' => 'Job History', 'perview' => 'Personal Details', 'expview' => 'Experience Details', 'eduview' => 'Education Details', 'skillsview' => 'Employee Skills', 'comview' => 'Contact Details', 'trainingview' => 'Training & Certification Details', 'view' => 'View');
if ($pageName == '' || $pageName == 'welcome') {
$breadCrumbsData .= '';
} else {
if ($pageName == 'dashboard') {
$breadCrumbsData = '<div class="breadcrumbs">';
if ($actionName == 'viewsettings') {
$breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Settings';
} else {
if ($actionName == 'viewprofile') {
$breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Profile';
} else {
if ($actionName == 'changepassword') {
$breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Change Password';
} else {
if ($actionName == 'emailsettings') {
$breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Email Settings';
} else {
if ($actionName == 'upgradeapplication') {
$breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Upgrade Application ';
}
}
}
}
}
$breadCrumbsData .= '</div>';
} else {
if ($pageName == 'configuresite') {
$breadCrumbsData = '<div class="breadcrumbs">';
$breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Configure Site';
$breadCrumbsData .= '</div>';
} else {
if ($pageName == 'managemenus') {
$breadCrumbsData = '<div class="breadcrumbs">';
$breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Manage Modules';
$breadCrumbsData .= '</div>';
} else {
if ($pageName == 'logmanager') {
$breadCrumbsData = '<div class="breadcrumbs">';
$breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Activity Log';
//.........这里部分代码省略.........
示例3: deletemanagergroupAction
/**
* This action is to delete a group which created by manager.
* @return json Array of status and message.
*/
public function deletemanagergroupAction()
{
$post_values = $this->getRequest()->getPost();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$result = array('status' => 'fail', 'msg' => 'Something went wrong, please try again.', 'empcount' => '', 'appraisalid' => '', 'managerid' => '');
if (count($post_values) > 0) {
$appraisal_id = $post_values['appraisal_id'];
$manager_id = $post_values['manager_id'];
$group_id = $post_values['group_id'];
if ($appraisal_id != '' && $manager_id != '' && $group_id != '') {
$trDb = Zend_Db_Table::getDefaultAdapter();
$trDb->beginTransaction();
try {
$app_manager_model = new Default_Model_Appraisalmanager();
$delete_manager_group = $app_manager_model->deletemanagergroup($appraisal_id, $manager_id, $group_id);
$EmpCountArr = $app_manager_model->getManagerGroupCount($appraisal_id, $loginUserId);
if (!empty($EmpCountArr)) {
$result['empcount'] = $EmpCountArr[0]['empcount'];
}
$trDb->commit();
$result['status'] = 'success';
$result['msg'] = "Group deleted successfully";
$result['appraisalid'] = sapp_Global::_encrypt($appraisal_id);
$result['managerid'] = sapp_Global::_encrypt($manager_id);
} catch (Exception $e) {
$trDb->rollBack();
$result['status'] = 'error';
$result['msg'] = $e->getMessage();
}
}
}
$this->_helper->json($result);
}
示例4: _parseExtra
/**
* Function that Parses Extra Column info
*
* Regex looks for {{field_name}}
*
* @param string $column
* @param array $p
* @return string
*/
public function _parseExtra($column, $p)
{
if (isset($this->extra[$column])) {
$val = '';
$characterlimit = 15;
if (isset($this->extra[$column]['characterlimit'])) {
$characterlimit = $this->extra[$column]['characterlimit'];
}
preg_match_all('/\\{\\{(.*?)\\}\\}/', $this->extra[$column]['value'], $matches);
if (count($matches[1]) > 0) {
$matches[1] = array_unique($matches[1]);
$a = $this->extra[$column]['value'];
foreach ($matches[1] as $match) {
$p = (array) $p;
$replaced_str = $p[$match];
if ($this->encrypt_status == 'yes') {
$replaced_str = sapp_Global::_encrypt($p[$match]);
}
$a = str_replace('{{' . $match . '}}', $replaced_str, $a);
preg_match_all('/\\[\\[(.*?)\\]\\]/', $a, $newMaches);
if (count($newMaches[1]) > 0) {
foreach ($newMaches[1] as $matchNew) {
$valToInclude = strlen($p[$matchNew]) > $characterlimit ? substr($p[$matchNew], 0, $characterlimit) . ".." : $p[$matchNew];
$a = str_replace('[[' . $matchNew . ']]', $valToInclude, $a);
}
}
}
$val = $a;
}
return $val;
}
return '';
}
示例5: 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', 26 => 'In Progress', 27 => 'Duplicate', 28 => 'Need more Info', 29 => 'Team Tickets');
$status_search_arr = array(4 => " date_add(date(r.createddate),interval 10 day) < date(now())", 5 => " date_add(date(r.createddate),interval 10 day) = date(now()) ", 6 => " (r.status = 'To management approve' or r.status = 'To manager approve') ", 7 => " (r.status = 'Manager approved' or r.status = 'Management Approved' or r.status = 'Manager rejected' or r.status = 'Management Rejected') ", 8 => " (r.status = 'Manager approved' or r.status = 'Management Approved' or r.status = 'Manager rejected' or r.status = 'Management Rejected') ", 9 => " (r.status = 'To management approve' or r.status = 'To manager approve') ", 10 => " (r.reporting_manager_id = '" . $loginUserId . "' and r.status ='To manager approve') ", 12 => " (r.status = 'Approved' or r.status = 'Rejected') ", 14 => " (r.status = 'Manager approved' or r.status = 'Manager rejected') ", 15 => " (r.status != 'Cancelled' and r.status != 'Closed') ", 17 => " (r.status not in ('Closed','Cancelled','Rejected')) ", 20 => " (r.status = 'Manager approved' or r.status = 'Management Approved') ", 21 => " (r.status = 'Manager rejected' or r.status = 'Management Rejected')", 22 => " (r.status = 'Closed' or r.status = 'Rejected')", 26 => " (r.status = 'In Progress')", 27 => " (r.status = 'Duplicate')", 28 => " (r.status = 'Need more Info')", 29 => " (usr.reporting_manager = " . $loginUserId . ")");
$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 = " r.status = '" . $status_value_arr[$status_value] . "'";
} else {
$newsearchQuery = $status_search_arr[$status_value];
}
if ($searchQuery != '') {
$searchQuery .= " and " . $newsearchQuery;
} else {
$searchQuery .= $newsearchQuery;
}
}
//My Action Summary menu item grid types
if ($grid_type == 2 || $grid_type == 4 || $grid_type == 5 || $grid_type == 6 || $grid_type == 8) {
//if (strpos($searchQuery, 'Open') !== false) {
// is Current Login user is Admin for 1 or more business units
$currentuserIsAdmin = $this->getAdminServiceDeskIds($loginUserId);
if ($currentuserIsAdmin != "0") {
if ($searchQuery != '') {
if (strpos($searchQuery, 'Open') !== false) {
$searchQuery .= " AND (r.service_desk_id in (" . $currentuserIsAdmin . "))";
} else {
$searchQuery .= " OR (r.service_desk_id in (" . $currentuserIsAdmin . "))";
}
} else {
$searchQuery .= "(r.service_desk_id in (" . $currentuserIsAdmin . "))";
}
}
//else {
// is Current Login user is Executor for 1 or more service tickets
$currentuserIsExecutor = $this->IsExecutorForActiveTickets($loginUserId);
if ($currentuserIsExecutor != "0") {
if ($searchQuery != '') {
$searchQuery .= " and (find_in_set(" . $loginUserId . ",r.executor_id)) " . "and (r.status not in ('Closed','Rejected'))";
} else {
$searchQuery .= " (find_in_set(" . $loginUserId . ",r.executor_id)) " . "and (r.status not in ('Closed','Rejected'))";
}
}
//}
//}
}
$objName = 'servicerequests';
$tableFields = array('action' => 'Action', 'ticket_number' => 'Ticket#', 'service_desk_name' => 'Category', 'service_request_name' => 'Request Type', 'priority' => 'Priority', 'status' => 'Status', 'description' => 'Description', 'raised_by_name' => 'Raised By', 'createddate' => 'Raised On', 'executor_id' => 'Allocate', 'executor_name' => 'Executor');
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' => DOMAIN . 'servicerequests/view/id/{{id}}/t/' . sapp_Global::_encrypt($grid_type) . ($status_value != '' ? "/v/" . sapp_Global::_encrypt($status_value) : ""), 'add_link' => DOMAIN . '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;
}
示例6: performancesteps
public function performancesteps($perfArray)
{
$request = Zend_Controller_Front::getInstance();
$controllerName = $request->getRequest()->getControllerName();
$actionName = $request->getRequest()->getActionName();
$step1_link = "";
$step2_link = '';
$step3_link = '';
if ($perfArray['appraisalid'] != '') {
if ($perfArray['context'] == 'edit') {
$step1_link = BASE_URL . "appraisalinit/edit/id/" . $perfArray['appraisalid'];
$step2_link = BASE_URL . "appraisalinit/confmanagers/i/" . sapp_Global::_encrypt($perfArray['appraisalid']);
if ($perfArray['step2status'] == 'Completed') {
$step3_link = BASE_URL . "appraisalinit/assigngroups/i/" . sapp_Global::_encrypt($perfArray['appraisalid']);
}
} else {
$step1_link = BASE_URL . "appraisalinit/view/id/" . $perfArray['appraisalid'];
$step2_link = BASE_URL . "appraisalinit/viewconfmanagers/i/" . sapp_Global::_encrypt($perfArray['appraisalid']);
if ($perfArray['step2status'] == 'Completed') {
$step3_link = BASE_URL . "appraisalinit/viewassigngroups/i/" . sapp_Global::_encrypt($perfArray['appraisalid']);
}
}
}
?>
<script type="text/javascript" src="<?php
echo MEDIA_PATH;
?>
js/pa.js"></script>
<div class="per_steps">
<ul class="toggle_ul">
<li id="initstep_1" class="step_1 incomplete" ><div class="step_round">Step<span class="num_txt">1</span></div>
<div class="left_tab_content">
<div class="completed_icon"></div>
<h3 class="tab_title">Initialization</h3>
<span class="tab_txt">Initialize appraisal for a department or a business unit and enable to managers or employees</span>
<?php
if ($perfArray['step1status'] == 'Completed') {
?>
<div class="status_txt complete_status"><?php
echo $perfArray['step1status'];
?>
</div>
<?php
} else {
?>
<div class="status_txt in_progress"><?php
echo $perfArray['step1status'];
?>
</div>
<?php
}
?>
</div>
</li>
<li id="initstep_2" class="step_2 incomplete"><div class="step_round">Step<span class="num_txt">2</span></div>
<div class="left_tab_content">
<div class="completed_icon"></div>
<h3 class="tab_title">Configure Line Managers</h3>
<span class="tab_txt">Configure line managers by using the existing organization hierarchy or by assigning line managers to employees manually </span>
<?php
if ($perfArray['step2status'] == 'Completed') {
?>
<div class="status_txt complete_status"><?php
echo $perfArray['step2status'];
?>
</div>
<?php
} else {
?>
<div class="status_txt in_progress"><?php
echo $perfArray['step2status'];
?>
</div>
<?php
}
?>
</div>
</li>
<li id="initstep_3" class="step_3 incomplete"><div class="step_round">Step<span class="num_txt">3</span></div>
<div class="left_tab_content">
<div class="completed_icon"></div>
<h3 class="tab_title">Configure Appraisal Parameters</h3>
<span class="tab_txt">Set the appraisal parameters for all the employees or for an employee group for a department or a business unit</span>
<?php
if ($perfArray['step3status'] == 'Completed') {
?>
<div class="status_txt complete_status"><?php
echo $perfArray['step3status'];
?>
</div>
<?php
} else {
?>
<div class="status_txt in_progress"><?php
echo $perfArray['step3status'];
?>
</div>
//.........这里部分代码省略.........
示例7: generateGrid
//.........这里部分代码省略.........
$display = 'display: block;';
} else {
$display = 'display: none;';
}
if (is_array($searchArray)) {
if (array_key_exists($key, $searchArray)) {
$sText = $searchArray[$key];
} else {
$sText = '';
}
}
if (isset($search_filters[$key])) {
$search_function = 'getsearchdata("' . $name . '","",this.id,event';
$output .= sapp_Global::grid_data($search_filters, $key, $name, $display, $sText, $tabindx, $search_function);
} else {
$output .= "<input tabIndex={$tabindx} type='text' name='{$name}' id='{$key}' style='{$display}' class='searchtxtbox_{$name} table_inputs grid_search_inputs' value='{$sText}' onkeydown='getsearchdata(\"{$name}\",\"\",this.id,event,\"text\")' />";
}
}
}
} else {
//For Sort Icons....
if ($key == $sortStr) {
$output .= $sortIconStr;
}
$output .= $value;
}
$output .= "</th>";
$colinr++;
$tabindx++;
}
//end of for each loop
}
if ($grid_type != '') {
$output .= "<input type='hidden' id='service_grid' value='" . sapp_Global::_encrypt($grid_type) . "' />";
}
if ($status_value != '') {
$output .= "<input type='hidden' id='service_grid_status' value='" . sapp_Global::_encrypt($status_value) . "' />";
}
$output .= "</tr></thead>";
$output .= "<tbody>";
// Start Looping Data
$ii = 0;
foreach ($paginator as $p) {
$cell_color = $ii % 2 == 0 ? "row1" : "row2";
$ii++;
$bodyCount = 0;
//$output.="<tr onclick='window.location=\"" . $this->_parseString($view_link, $p) . "\"' class='$cell_color cursor'>";
$output .= "<tr class='{$cell_color} '>";
// Reset Fields Array to Top
if (!empty($fields)) {
reset($fields);
foreach ($fields as $k => $v) {
$tdclass = '';
// Look for additional attributes
$characterlimit = 40;
if (is_array($v)) {
$class = @$v['class'] != '' ? 'class="' . $v['class'] . '" ' : '';
$align = @$v['align'] != '' ? 'align="' . $v['align'] . '" ' : '';
$valign = @$v['valign'] != '' ? 'valign="' . $v['valign'] . '" ' : '';
if (isset($v['characterlimit'])) {
$characterlimit = $v['characterlimit'];
}
$output .= "<td {$tdclass}{$align}{$valign}>";
} else {
if ($k == 'description' && $menuName == 'Screening Types') {
$characterlimit = 80;
示例8:
<li><div class="folderstructure"><?php
echo $path;
?>
</div><div class="status_no"></div><div class="clear"></div></li>
<?php
}
}
?>
</ul>
</div>
<?php
if ($cnt == 0) {
?>
<button name="next" id="next" type="button" onclick="window.location='index.php?s=<?php
echo sapp_Global::_encrypt(2);
?>
';">Next</button>
<?php
}
?>
</form>
<script type="text/javascript">
$(document).ready(function(){
<?php
if ($cnt == 0) {
?>
示例9: getGrid
/**
*
* @param type $sort
* @param type $by
* @param type $perPage
* @param type $pageNo
* @param type $searchData
* @param type $call
* @param type $dashboardcall
* @param type $statusid
* @param type $a1
* @param type $a2
* @param type $a3
* @return type
*/
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");
}
}
$sarray = array('Approved' => 2, 'Rejected' => 3, 'Closed' => 4, 'On hold' => 5, 'In process' => 7);
if ($statusid != '' && is_numeric($statusid)) {
if ($statusid == 1) {
$queryflag = 'Approved';
} else {
if ($statusid == 2) {
$queryflag = 'Approved';
} else {
if ($statusid == 3) {
$queryflag = 'Rejected';
} else {
if ($statusid == 4) {
$queryflag = 'Closed';
} else {
if ($statusid == 5) {
$queryflag = 'On hold';
} else {
if ($statusid == 7) {
$queryflag = 'In process';
}
}
}
}
}
}
$statusidstring = sapp_Global::_encrypt($statusid);
} else {
$statusid = 2;
$queryflag = 'Approved';
$statusidstring = sapp_Global::_encrypt('2');
}
$objName = 'approvedrequisitions';
$tableFields = array('action' => 'Action', 'requisition_code' => 'Requisition Code', 'jobtitle_name' => 'Job Title', 'createdby_name' => 'Raised By', 'reporting_manager_name' => 'Reporting Manager', 'r.createdon' => 'Raised On', 'onboard_date' => 'Due Date', 'hrexecutive_name' => 'Recruit Panel');
$search_filters = array('r.createdon' => array('type' => 'datepicker'), 'onboard_date' => array('type' => 'datepicker'));
if ($dashboardcall == 'Yes') {
$tableFields['req_status'] = "Status";
$search_filters['req_status'] = array('type' => 'select', 'filter_data' => array('Approved' => 'Approved', 'Closed' => 'Closed', 'On hold' => 'On hold', 'In process' => 'In process'));
$statusid = 2;
$queryflag = 'Approved';
$statusidstring = sapp_Global::_encrypt('2');
if (isset($searchArray['req_status'])) {
$queryflag = $searchArray['req_status'];
$statusidstring = sapp_Global::_encrypt($sarray[$queryflag]);
$statusid = $sarray[$queryflag];
}
}
$tablecontent = $requi_model->getRequisitionData($sort, $by, $pageNo, $perPage, $searchQuery, $loginUserId, $loginuserGroup, 2, $queryflag);
$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' => 'Approved Requisitions', 'formgrid' => 'true', 'unitId' => $statusidstring, 'call' => $call, 'dashboardcall' => $dashboardcall, 'search_filters' => $search_filters);
if (($statusid == 4 || $statusid == 6) && ($loginuserGroup == HR_GROUP || $loginuserGroup == '')) {
$dataTmp = $dataTmp + array('defined_actions' => array('view'));
}
return $dataTmp;
}
示例10: getGrid
//.........这里部分代码省略.........
$managerstring = "true";
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
foreach ($searchValues as $key => $val) {
if ($key != 'leavestatus') {
if ($key == 'reportingmanagername') {
$searchQuery .= " u.userfullname like '%" . $val . "%' AND ";
} else {
if ($key == 'employeename') {
$searchQuery .= " mu.userfullname like '%" . $val . "%' AND ";
} else {
if ($key == 'applieddate') {
$searchQuery .= " l.createddate like '%" . sapp_Global::change_date($val, 'database') . "%' AND ";
} else {
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");
}
$statusid = '';
if ($queryflag != '') {
$statusid = $queryflag;
if ($statusid == 1) {
$queryflag = 'pending';
} else {
if ($statusid == 2) {
$queryflag = 'approved';
} else {
if ($statusid == 3) {
$queryflag = 'rejected';
} else {
if ($statusid == 4) {
$queryflag = 'cancel';
}
}
}
}
} else {
$queryflag = 'approved';
}
$tableFields = array('action' => 'Action', 'employeename' => 'Leave applied by', 'leavetype' => 'Leave type', 'leaveday' => 'Leave duration', 'from_date' => 'From date', 'to_date' => 'To date', 'reason' => 'Reason', 'reportingmanagername' => 'Reporting Manager', 'appliedleavescount' => 'Leave count', 'applieddate' => 'Applied On');
$leave_arr = array('' => 'All', 1 => 'Full Day', 2 => 'Half Day');
$search_filters = array('from_date' => array('type' => 'datepicker'), 'to_date' => array('type' => 'datepicker'), 'applieddate' => array('type' => 'datepicker'), 'leaveday' => array('type' => 'select', 'filter_data' => $leave_arr));
/* This is for dashboard call.
Here one additional column Status is build by passing it to table fields
*/
if ($dashboardcall == 'Yes') {
$tableFields['leavestatus'] = "Status";
$search_filters['leavestatus'] = array('type' => 'select', 'filter_data' => array('pending' => 'Pending for approval', 'approved' => 'Approved', 'rejected' => 'Rejected', 'cancel' => 'Cancelled'));
if (isset($searchArray['leavestatus'])) {
$queryflag = $searchArray['leavestatus'];
if ($queryflag == '') {
$queryflag = 'pending';
}
}
}
$tablecontent = $this->getLeaveStatusHistory($sort, $by, $pageNo, $perPage, $searchQuery, $queryflag, $loginUserId, $managerstring);
if (isset($queryflag) && $queryflag != '') {
$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, 'add' => 'add', 'formgrid' => $formgrid, 'unitId' => sapp_Global::_encrypt($statusid), 'call' => $call, 'dashboardcall' => $dashboardcall, 'search_filters' => $search_filters);
} else {
if ($searchData != '' && $searchData != 'undefined') {
$searchValues = json_decode($searchData);
foreach ($searchValues as $key => $val) {
if ($key == 'reportingmanagername') {
$searchQuery .= " u.userfullname like '%" . $val . "%' AND ";
} else {
if ($key == 'applieddate') {
$searchQuery .= " l.createddate like '%" . sapp_Global::change_date($val, 'database') . "%' AND ";
} else {
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");
}
$tableFields = array('action' => 'Action', 'leavetype' => 'Leave type', 'leaveday' => 'Leave duration', 'from_date' => 'From date', 'to_date' => 'To date', 'reason' => 'Reason', "reportingmanagername" => "Reporting Manager", 'appliedleavescount' => 'Leave count', 'applieddate' => 'Applied On');
$leave_arr = array('' => 'All', 1 => 'Full Day', 2 => 'Half Day');
$tablecontent = $this->getLeaveStatusHistory($sort, $by, $pageNo, $perPage, $searchQuery, $queryflag, $loginUserId);
$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('from_date' => array('type' => 'datepicker'), 'to_date' => array('type' => 'datepicker'), 'applieddate' => array('type' => 'datepicker'), 'leaveday' => array('type' => 'select', 'filter_data' => $leave_arr)));
}
}
return $dataTmp;
}
示例11: changestatusAction
/**
*
*/
public function changestatusAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$id = $this->_request->getParam('objid');
$status = $this->_getParam('status', null);
$grid_type = $this->_getParam('grid_type', null);
$messages['message'] = '';
$messages['msgtype'] = '';
$actionflag = 3;
if ($id != '') {
$sd_req_model = new Default_Model_Servicerequests();
$grid_type_arr = $sd_req_model->getGridtypearr_rev();
$display_status = array('Cancelled' => 'cancelled', 'To manager approve' => ' sent for manager approve ', 'To management approve' => ' sent for approve', 'Closed' => 'closed');
$data = array('status' => $status, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'modifiedby' => $loginUserId);
if ($status != 'Cancelled') {
$data['executor_id'] = $loginUserId;
}
if ($status == 'To manager approve') {
$reporting_manager = $sd_req_model->getReptId($id);
if ($reporting_manager != '') {
$data['reporting_manager_id'] = $reporting_manager;
}
if ($reporting_manager != "" && $reporting_manager == $loginUserId) {
$messages['message'] = 'Service desk request cannot be sent for manager approve.';
$messages['msgtype'] = 'error';
$messages['flagtype'] = 'dont_redirect';
$messages['grid_type'] = sapp_Global::_encrypt($grid_type_arr[$grid_type]);
$this->_helper->json($messages);
}
} else {
if ($status == 'To management approve') {
$approver_arr = $sd_req_model->getApprovers($id, 'request');
$data = $data + $approver_arr;
}
}
$where = array('id=?' => $id);
$trDb = Zend_Db_Table::getDefaultAdapter();
// starting transaction
$trDb->beginTransaction();
try {
$Id = $sd_req_model->SaveorUpdateRequestData($data, $where);
if ($Id == 'update') {
$result = sapp_Global::logManager(SERVICEDESKREQUEST, $actionflag, $loginUserId, $id);
if ($status != 'Cancelled') {
$this->send_req_mails($id);
}
$messages['message'] = 'Service desk request ' . $display_status[$status] . ' successfully.';
$messages['msgtype'] = 'success';
$messages['flagtype'] = 'sd_request';
$messages['grid_type'] = sapp_Global::_encrypt($grid_type_arr[$grid_type]);
} else {
$messages['message'] = 'Service desk request cannot be ' . $display_status[$status] . '.';
$messages['msgtype'] = 'error';
$messages['flagtype'] = 'sd_request';
$messages['grid_type'] = sapp_Global::_encrypt($grid_type_arr[$grid_type]);
}
$trDb->commit();
} catch (Exception $e) {
$trDb->rollBack();
$messages['message'] = 'Service desk request cannot be ' . $display_status[$status] . '.';
$messages['msgtype'] = 'error';
$messages['flagtype'] = 'sd_request';
$messages['grid_type'] = sapp_Global::_encrypt($grid_type_arr[$grid_type]);
}
} else {
$messages['message'] = 'Service desk request cannot be ' . $display_status[$status] . '.';
$messages['msgtype'] = 'error';
$messages['flagtype'] = 'sd_request';
$messages['grid_type'] = sapp_Global::_encrypt($grid_type_arr[$grid_type]);
}
$this->_helper->json($messages);
}
示例12: savemngrorghierarchyAction
public function savemngrorghierarchyAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$app_init_model = new Default_Model_Appraisalinit();
$ques_temp_model = new Default_Model_Appraisalqstemp();
$ques_org_model = new Default_Model_Appraisalqsmain();
$app_rating_model = new Default_Model_Appraisalratings();
// $init_id = $this->_getParam('init_id',null);
$init_param = $this->_getParam('i', null);
$init_id = sapp_Global::_decrypt($init_param);
$init_data = $app_init_model->getConfigData($init_id);
if (count($init_data) > 0) {
$init_data = $init_data[0];
}
$this->view->init_id = $init_id;
$this->view->init_data = $init_data;
$this->view->msg_arr = array();
$ratingsflag = 'false';
$checkRatingsExists = $app_rating_model->getAppraisalRatingsbyInitId($init_id);
if (!empty($checkRatingsExists)) {
$ratingsflag = 'true';
}
$red_result = "";
$type_arr = array('line' => 1, 'report' => 2);
$trDb = Zend_Db_Table::getDefaultAdapter();
//get manager ids as comma seperated string
$manager_ids = $this->_getParam('mid', null);
//break the manager ids into array
$mngr_ids_array = explode(',', $manager_ids);
$get_managers_data = array();
$get_managers_data = $app_init_model->getManagers_report($init_id);
$final_managers_data = array();
//get the managers data and build an array with manager id as key
if (isset($get_managers_data) && count($get_managers_data) > 0) {
foreach ($get_managers_data as $data) {
$mngr_id = isset($data['user_id']) ? $data['user_id'] : 0;
$final_managers_data[$mngr_id] = $data;
}
}
if (isset($mngr_ids_array) && count($mngr_ids_array) > 0) {
$choose_option = 'report';
foreach ($mngr_ids_array as $mngr) {
$tot_ids = array();
$context = 'add';
$content = array();
$content = $app_init_model->getdisplayacontentreportacc($init_id, $mngr);
if ($context == 'add') {
$init_sdata = array('manager_level_type' => $type_arr[$choose_option]);
$app_result = array();
$app_result = $app_init_model->SaveorUpdateAppraisalInitData($init_sdata, " id = " . $init_id);
$qresult = '';
if ($app_result === 'update') {
if (count($content) > 0) {
foreach ($content as $cont) {
if (is_numeric($cont['user_id'])) {
array_push($tot_ids, $cont['user_id']);
}
}
}
$line_str_arr = array();
$line_str_arr['line_manager_1'] = $mngr;
if (count($tot_ids) > 0) {
foreach ($tot_ids as $emp_id) {
$qdata = array('pa_initialization_id' => $init_id, 'manager_levels' => 1, 'employee_id' => $emp_id, 'module_flag' => 1, 'createdby' => $loginUserId, 'createdby_role' => $loginuserRole, 'createdby_group' => $loginuserGroup, 'modifiedby' => $loginUserId, 'modifiedby_role' => $loginuserRole, 'modifiedby_group' => $loginuserGroup, 'createddate' => gmdate("Y-m-d H:i:s"), 'modifieddate' => gmdate("Y-m-d H:i:s"), 'isactive' => 1);
$qdata = array_merge($qdata, $line_str_arr);
if ($init_data['initialize_status'] == 1) {
$qresult = $ques_org_model->SaveorUpdatePrivilegeData($qdata, '');
} else {
$qresult = $ques_temp_model->SaveorUpdateData($qdata, '');
}
}
}
}
if ($qresult !== '' && $app_result !== '') {
$red_result = 'saved';
}
$message = "Appraisal process updated successfully";
}
}
if ($red_result === 'saved') {
$message = "Appraisal process updated successfully";
$this->_helper->FlashMessenger()->setNamespace('conf_success')->addMessage($message);
$this->_redirect('appraisalinit/confmanagers/i/' . sapp_Global::_encrypt($init_id));
}
}
$this->view->ratingsflag = $ratingsflag;
$this->render('configuremanagers');
}
示例13: indexAction
public function indexAction()
{
$candidatesmodel = new Default_Model_Shortlistedcandidates();
$call = $this->_getParam('call');
if ($call == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$dashboardcall = $this->_getParam('dashboardcall');
$queryflag = '';
$refresh = $this->_getParam('refresh');
$data = array();
$searchQuery = '';
$searchArray = array();
$tablecontent = '';
if ($call == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$view = Zend_Layout::getMvcInstance()->getView();
$statusidstring = $this->_request->getParam('status');
$unitId = '';
if (!isset($statusidstring) || $statusidstring == '') {
$unitId = $this->_request->getParam('unitId');
$statusidstring = $unitId;
}
$formgrid = 'false';
if (isset($unitId) && $unitId != '') {
$formgrid = 'true';
}
$statusid = sapp_Global::_decrypt($statusidstring);
$queryflag = '';
unset($_SESSION['short_status']);
if ($statusid != '' && is_numeric($statusid)) {
$_SESSION['short_status'] = $statusidstring;
if ($statusid == 0) {
$queryflag = 'All';
} else {
if ($statusid == 2) {
$queryflag = 'Selected';
} else {
if ($statusid == 3) {
$queryflag = 'Rejected';
} else {
if ($statusid == 4) {
$queryflag = 'Offered';
} else {
if ($statusid == 5) {
$queryflag = 'Offer Accepted';
} else {
if ($statusid == 6) {
$queryflag = 'Joined';
} else {
if ($statusid == 7) {
$queryflag = 'On Hold';
} else {
if ($statusid == 8) {
$queryflag = 'Yet to offer';
} else {
if ($statusid == 9) {
$queryflag = 'Offer Declined';
}
}
}
}
}
}
}
}
}
// else if ($statusid == 1)
// $queryflag = 'Shortlisted';
} else {
$queryflag = 'All';
$statusid = 0;
$statusidstring = sapp_Global::_encrypt('0');
}
if ($refresh == 'refresh') {
if ($dashboardcall == 'Yes') {
$perPage = DASHBOARD_PERPAGE;
} else {
$perPage = PERPAGE;
}
$sort = 'DESC';
$by = 'c.modifieddate';
$pageNo = 1;
$searchData = '';
$searchQuery = '';
$searchArray = array();
} else {
$sort = $this->_getParam('sort') != '' ? $this->_getParam('sort') : 'DESC';
$by = $this->_getParam('by') != '' ? $this->_getParam('by') : 'c.modifieddate';
if ($dashboardcall == 'Yes') {
$perPage = $this->_getParam('per_page', DASHBOARD_PERPAGE);
} else {
$perPage = $this->_getParam('per_page', PERPAGE);
}
//.........这里部分代码省略.........
示例14: sd_url_builder
/**
* This function helps to build URL to service desk.
* @param int $grid_type = type of grid
* @param int $status = status of service desk.
* @return string Formatted URL.
*/
public static function sd_url_builder($grid_type, $status)
{
if ($status == '') {
return BASE_URL . "/servicerequests/index/t/" . sapp_Global::_encrypt($grid_type);
} else {
return BASE_URL . "/servicerequests/index/t/" . sapp_Global::_encrypt($grid_type) . "/v/" . sapp_Global::_encrypt($status);
}
}
示例15: indexAction
public function indexAction()
{
$empscreeningModel = new Default_Model_Empscreening();
$call = $this->_getParam('call');
if ($call == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$view = Zend_Layout::getMvcInstance()->getView();
$objname = $this->_getParam('objname');
$refresh = $this->_getParam('refresh');
$data = array();
$searchQuery = '';
$searchArray = array();
$tablecontent = '';
$dashboardcall = $this->_getParam('dashboardcall');
$statusidstring = $this->_request->getParam('status');
$unitId = '';
if (!isset($statusidstring) || $statusidstring == '') {
$unitId = $this->_request->getParam('unitId');
$statusidstring = $unitId;
}
$formgrid = 'true';
if (isset($unitId) && $unitId != '') {
$formgrid = 'true';
}
$statusid = sapp_Global::_decrypt($statusidstring);
if ($statusid != '1' && $statusid != '2') {
$statusidstring = sapp_Global::_encrypt(1);
}
$queryflag = '';
unset($_SESSION['emp_status']);
if ($statusid != '') {
$_SESSION['emp_status'] = $statusidstring;
if ($statusid == '1') {
$queryflag = '1';
$this->view->ermsg = '';
} else {
if ($statusid == '2') {
$queryflag = '2';
$this->view->ermsg = '';
} else {
$this->view->ermsg = 'nodata';
$queryflag = '1';
}
}
} else {
$queryflag = '1';
}
if ($refresh == 'refresh') {
if ($dashboardcall == 'Yes') {
$perPage = DASHBOARD_PERPAGE;
} else {
$perPage = PERPAGE;
}
$sort = 'DESC';
$by = 'me.modifieddate';
$pageNo = 1;
$searchData = '';
$searchQuery = '';
$searchArray = '';
} else {
$sort = $this->_getParam('sort') != '' ? $this->_getParam('sort') : 'DESC';
$by = $this->_getParam('by') != '' ? $this->_getParam('by') : 'me.modifieddate';
if ($dashboardcall == 'Yes') {
$perPage = $this->_getParam('per_page', DASHBOARD_PERPAGE);
} else {
$perPage = $this->_getParam('per_page', PERPAGE);
}
$pageNo = $this->_getParam('page', 1);
$searchData = $this->_getParam('searchData');
$searchData = rtrim($searchData, ',');
$searchData = $this->_getParam('searchData');
}
$dataTmp = $empscreeningModel->getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $queryflag, $statusidstring, $formgrid, $unitId);
array_push($data, $dataTmp);
$this->view->dataArray = $data;
$this->view->call = $call;
$this->view->statusidstring = $statusidstring;
$this->view->messages = $this->_helper->flashMessenger->getMessages();
}