/**
 * Get the raw designations dropdown
 *
 * @param  int  company id
 *
 * @return array  the key-value paired designations
 */
function erp_hr_get_designation_dropdown_raw()
{
    $designations = erp_hr_get_designations();
    $dropdown = array(0 => __('- Select Designation -', 'wp-erp'));
    if ($designations) {
        foreach ($designations as $key => $designation) {
            $dropdown[$designation->id] = stripslashes($designation->title);
        }
    }
    return $dropdown;
}
Example #2
0
_e('HR Management', '$domain');
?>
</h2>

    <div class="erp-single-container">

        <div class="erp-area-left">

            <?php 
if (current_user_can('erp_create_employee')) {
    ?>

                <?php 
    $employees = erp_hr_get_employees();
    $departments = erp_hr_get_departments();
    $designations = erp_hr_get_designations();
    ?>

                <div class="badge-container">
                    <div class="badge-wrap badge-green">
                        <div class="badge-inner">
                            <h3><?php 
    echo number_format_i18n(count($employees), 0);
    ?>
</h3>
                            <p><?php 
    _e('Employees', 'wp-erp');
    ?>
</p>
                        </div>
Example #3
0
/**
 * Get the raw designations dropdown
 *
 * @param  int  company id
 *
 * @return array  the key-value paired designations
 */
function erp_hr_get_designation_dropdown_raw($select_text = '')
{
    $select_text = empty($select_text) ? __('- Select Designation -', 'wp-erp') : $select_text;
    $designations = erp_hr_get_designations();
    $dropdown = array('-1' => $select_text);
    if ($designations) {
        foreach ($designations as $key => $designation) {
            $dropdown[$designation->id] = stripslashes($designation->title);
        }
    }
    return $dropdown;
}
 /**
  * Prepare the class items
  *
  * @return void
  */
 function prepare_items()
 {
     $columns = $this->get_columns();
     $hidden = array();
     $sortable = $this->get_sortable_columns();
     $this->_column_headers = array($columns, $hidden, $sortable);
     $per_page = 20;
     $current_page = $this->get_pagenum();
     $offset = ($current_page - 1) * $per_page;
     $this->page_status = isset($_GET['status']) ? sanitize_text_field($_GET['status']) : '2';
     // only ncessary because we have sample data
     $args = array('offset' => $offset, 'number' => $per_page);
     if (isset($_REQUEST['orderby']) && isset($_REQUEST['order'])) {
         $args['orderby'] = 'title';
         $args['order'] = $_REQUEST['order'];
     }
     $this->items = erp_hr_get_designations($args);
     $this->set_pagination_args(array('total_items' => erp_hr_count_designation($args), 'per_page' => $per_page));
 }