Пример #1
0
/**
 * Get policies as formatted for dropdown
 *
 * @return array
 */
function erp_hr_leave_get_policies_dropdown_raw()
{
    $policies = erp_hr_leave_get_policies();
    $dropdown = array();
    foreach ($policies as $policy) {
        $dropdown[$policy->id] = stripslashes($policy->name);
    }
    return $dropdown;
}
Пример #2
0
?>
</th>
                        <th class="col-"><?php 
_e('Leave Days', 'wp-erp');
?>
</th>
                        <th class="col-"><?php 
_e('Calendar Color', 'wp-erp');
?>
</th>
                    </tr>
                </tfoot>

                <tbody id="the-list">
                    <?php 
$policies = erp_hr_leave_get_policies();
if ($policies) {
    foreach ($policies as $num => $policy) {
        ?>
                            <tr class="<?php 
        echo $num % 2 == 0 ? 'alternate' : 'odd';
        ?>
" data-json='<?php 
        echo json_encode($policy);
        ?>
'>
                                <th scope="row" class="check-column">
                                    <input id="cb-select-1" type="checkbox" name="policy_id[]" value="<?php 
        echo $policy->id;
        ?>
">
Пример #3
0
 /**
  * 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'] = $_REQUEST['orderby'];
         $args['order'] = $_REQUEST['order'];
     }
     $this->items = erp_hr_leave_get_policies($args);
     $this->set_pagination_args(array('total_items' => erp_hr_count_leave_policies(), 'per_page' => $per_page));
 }