<?php 
$results = hrm_Settings::getInstance()->conditional_query_val('hrm_personal_language', $field = '*', $compare = array('emp_id' => $employer_id));
$language_labels = hrm_Settings::getInstance()->hrm_query('hrm_language');
unset($language_labels['total_row']);
foreach ($language_labels as $key => $language_label) {
    $label[$language_label->id] = $language_label->name;
}
foreach ($results as $key => $value) {
    if ($results['total_row'] == 0 || $key === 'total_row') {
        continue;
    }
    if (!isset($label[$value->language_id])) {
        continue;
    }
    $body[] = array('<input name="hrm_check[' . $value->id . ']" value="" type="checkbox">', '<a href="#" class="hrm-editable" data-table_option="hrm_personal_language"  data-id=' . $value->id . '>' . $label[$value->language_id] . '<a>', hrm_Employee::getInstance()->fluency($value->fluency), hrm_Employee::getInstance()->competency($value->competency), $value->comments);
    $td_attr[] = array('class="check-column"');
}
$table = array();
$table['head'] = array('<input type="checkbox">', __('Language', 'hrm'), __('Fluency', 'hrm'), __('Competency', 'hrm'), __('Comments', 'hrm'));
$table['body'] = isset($body) ? $body : array();
$table['td_attr'] = isset($td_attr) ? $td_attr : array();
$table['th_attr'] = array('class="check-column"');
$table['table_attr'] = array('class' => 'widefat');
$table['table'] = 'hrm_personal_language';
$table['action'] = 'hrm_delete';
$table['tab'] = $tab;
$table['subtab'] = $subtab;
echo hrm_Settings::getInstance()->table($table);
$url = hrm_Settings::getInstance()->get_current_page_url($page, $tab, $subtab) . '&employee_id=' . $employer_id;
$file_path = urlencode(__FILE__);
<?php

if (hrm_current_user_role() == 'hrm_employee') {
    $employer_id = get_current_user_id();
} else {
    $employer_id = isset($_GET['employee_id']) ? $_GET['employee_id'] : '';
}
$result = hrm_Employee::getInstance()->current_user_task($employer_id, $subtab);
$results = hrm_Employee::getInstance()->current_user_task($employer_id, $subtab);
foreach ($results as $id => $projects) {
    ?>
		<h1><?php 
    echo $projects['p_title'];
    ?>
</h1>
	<?php 
    unset($projects['p_title']);
    foreach ($projects as $key => $project) {
        if (!isset($project['t_t'])) {
            continue;
        }
        $task_budget = get_post_meta($project['tID'], '_task_budget', true);
        $task_budget = empty($task_budget) ? '0' : $task_budget;
        $currency = get_post_meta($project['pID'], '_currency_symbol', true);
        ?>

			<div>
				<input type="checkbox" class="hrm-complete-task" value="<?php 
        echo $project['tID'];
        ?>
">
        echo $value->routing;
        ?>
</p>
            <p><strong><?php 
        _e('Deposit Amount', 'hrm');
        ?>
</strong><?php 
        echo $value->dipo_amount;
        ?>
</p>
        </div>

        <?php 
    }
    $nameid = $page == 'hrm_pim' ? '<input name="hrm_check[' . $value->id . ']" value="" type="checkbox">' : '';
    $body[] = array($nameid, '<a href="#" class="hrm-editable" data-table_option="hrm_salary"  data-id=' . $value->id . '>' . $pay_grade_label[$value->pay_grade] . '<a>', $value->component, hrm_Employee::getInstance()->pay_frequency($value->frequency), $value->currency, $value->amount, $value->comments, $deposit);
    $td_attr[] = array('class="check-column"');
}
$input_field = $page == 'hrm_pim' ? '<input type="checkbox">' : '';
$table = array();
$table['head'] = array($input_field, __('Pay Grade', 'hrm'), __('Salary Component', 'hrm'), __('Pay Frequency', 'hrm'), __('Currency', 'hrm'), __('Amount', 'hrm'), __('Comments', 'hrm'), __('Direct Deposit Details', 'hrm'));
$table['body'] = isset($body) ? $body : array();
$table['td_attr'] = isset($td_attr) ? $td_attr : array();
$table['th_attr'] = array('class="check-column"');
$table['table_attr'] = array('class' => 'widefat');
$table['table'] = 'hrm_salary';
$table['action'] = 'hrm_delete';
$table['tab'] = $tab;
$table['subtab'] = $subtab;
if ($page == 'hrm_employee') {
    $table['add_button'] = false;
Пример #4
0
 function delete_employee()
 {
     check_ajax_referer('hrm_nonce');
     $postdata = $_POST;
     if (!isset($postdata['hrm_check']) || !is_array($postdata['hrm_check'])) {
         wp_send_json_error(array('success_msg' => __('Failed to deletet employee', 'hrm')));
     }
     $delete_user = false;
     if (hrm_user_can_access($postdata['tab'], null, 'delete')) {
         $delete_user = hrm_Employee::getInstance()->delete_employee($postdata['hrm_check']);
     } else {
         wp_send_json_error(array('error_msg' => __('You do not have permission deletet employee', 'hrm')));
     }
     if ($delete_user) {
         $page = $_POST['page'];
         $tab = $_POST['tab'];
         $subtab = $_POST['subtab'];
         $req_frm = urldecode($_POST['req_frm']);
         ob_start();
         require_once $req_frm;
         wp_send_json_success(array('content' => ob_get_clean(), 'success_msg' => __('Successfully deletet employee', 'hrm')));
     } else {
         wp_send_json_error(array('error_msg' => __('Failed to deletet employee', 'hrm')));
     }
 }