/**
     * Render extra filtering option in
     * top of the table
     *
     * @since 0.1
     *
     * @param  string $which
     *
     * @return void
     */
    function extra_tablenav($which)
    {
        if ($which != 'top') {
            return;
        }
        $selected_desingnation = isset($_GET['filter_designation']) ? $_GET['filter_designation'] : 0;
        $selected_department = isset($_GET['filter_department']) ? $_GET['filter_department'] : 0;
        $selected_type = isset($_GET['filter_employment_type']) ? $_GET['filter_employment_type'] : '';
        ?>
        <div class="alignleft actions">

            <label class="screen-reader-text" for="new_role"><?php 
        _e('Filter by Designation', 'wp-erp');
        ?>
</label>
            <select name="filter_designation" id="filter_designation">
                <?php 
        echo erp_hr_get_designation_dropdown($selected_desingnation);
        ?>
            </select>

            <label class="screen-reader-text" for="new_role"><?php 
        _e('Filter by Designation', 'wp-erp');
        ?>
</label>
            <select name="filter_department" id="filter_department">
                <?php 
        echo erp_hr_get_departments_dropdown($selected_department);
        ?>
            </select>

            <label class="screen-reader-text" for="new_role"><?php 
        _e('Filter by Employment Type', 'wp-erp');
        ?>
</label>
            <select name="filter_employment_type" id="filter_employment_type">
                <option value="-1"><?php 
        _e('- Select Employment Type -', 'wp-erp');
        ?>
</option>
                <?php 
        $types = erp_hr_get_employee_types();
        foreach ($types as $key => $title) {
            echo sprintf("<option value='%s'%s>%s</option>\n", $key, selected($selected_type, $key, false), $title);
        }
        ?>
            </select>

            <?php 
        submit_button(__('Filter'), 'button', 'filter_employee', false);
        echo '</div>';
    }
Esempio n. 2
0
?>

        <span class="field">
            <select name="lead" id="dept-lead">
                <?php 
echo erp_hr_get_employees_dropdown();
?>
            </select>
        </span>
    </div>

    <div class="row">
        <?php 
erp_html_form_label(__('Parent Department', 'wp-erp'), 'parent-dept');
?>

        <span class="field">
            <select name="parent" id="dept-parent">
                <?php 
echo erp_hr_get_departments_dropdown();
?>
            </select>
        </span>
    </div>

    <?php 
wp_nonce_field('erp-new-dept');
?>
    <input type="hidden" name="action" id="dept-action" value="erp-hr-new-dept">
    <input type="hidden" name="dept_id" id="dept-id" value="0">
</div>