Beispiel #1
0
 <a href="<?php 
echo admin_url('admin.php?page=erp-accounting-vendors&action=new');
?>
" class="add-new-h2"><?php 
_e('Add New', 'erp-accounting');
?>
</a></h2>

    <?php 
if (isset($_GET['msg'])) {
    switch ($_GET['msg']) {
        case 'update':
            erp_html_show_notice(__('Vendor info has been updated!', 'erp-accounting'));
            break;
        case 'new':
            erp_html_show_notice(__('New vendor has been added!', 'erp-accounting'));
            break;
    }
}
?>

    <form method="post">
        <input type="hidden" name="page" value="ttest_list_table">

        <?php 
$list_table = new WeDevs\ERP\Accounting\Vendor_List_Table();
$list_table->prepare_items();
$list_table->search_box('search', 'search_id');
$list_table->display();
?>
    </form>
if ('assignment' == $active_tab) {
    ?>

        <p class="description">
            <?php 
    _e('Assign a leave policy to employees.', 'wp-erp');
    ?>
        </p>

        <?php 
    $errors = array('invalid-policy' => __('Error: Please select a leave policy.', 'wp-erp'), 'invalid-period' => __('Error: Please select a valid period.', 'wp-erp'), 'invalid-employee' => __('Error: Please select an employee.', 'wp-erp'));
    if (isset($_GET['affected'])) {
        erp_html_show_notice(sprintf(__('%d Employee(s) has been entitled to this leave policy.', 'wp-erp'), $_GET['affected']));
    }
    if (isset($_GET['error']) && array_key_exists($_GET['error'], $errors)) {
        erp_html_show_notice($errors[$_GET['error']], 'error');
    }
    ?>

        <form action="" method="post">

            <ul class="erp-list separated">
            <?php 
    erp_html_form_input(array('label' => __('Assignment', 'wp-erp'), 'name' => 'assignment_to', 'type' => 'checkbox', 'help' => __('Assign to multiple employees', 'wp-erp'), 'tag' => 'li'));
    erp_html_form_input(array('label' => __('Leave Policy', 'wp-erp'), 'name' => 'leave_policy', 'type' => 'select', 'class' => 'chosen-select', 'tag' => 'li', 'required' => true, 'options' => array(0 => __('- Select -', 'wp-erp')) + erp_hr_leave_get_policies_dropdown_raw()));
    erp_html_form_input(array('label' => __('Leave Period', 'wp-erp'), 'name' => 'leave_period', 'type' => 'select', 'tag' => 'li', 'required' => true, 'class' => 'chosen-select', 'options' => array($cur_year => sprintf('%s - %s', erp_format_date('01-01-' . $cur_year), erp_format_date('31-12-' . $cur_year)), $cur_year + 1 => sprintf('%s - %s', erp_format_date('01-01-' . ($cur_year + 1)), erp_format_date('31-12-' . ($cur_year + 1))))));
    erp_html_form_input(array('label' => __('Employee', 'wp-erp'), 'name' => 'single_employee', 'type' => 'select', 'class' => 'chosen-select show-if-single', 'tag' => 'li', 'options' => erp_hr_get_employees_dropdown_raw()));
    erp_html_form_input(array('label' => __('Location', 'wp-erp'), 'name' => 'location', 'type' => 'select', 'class' => 'chosen-select show-if-multiple', 'tag' => 'li', 'options' => erp_company_get_location_dropdown_raw(__('All Locations', 'wp-erp'))));
    erp_html_form_input(array('label' => __('Department', 'wp-erp'), 'name' => 'department', 'type' => 'select', 'class' => 'chosen-select show-if-multiple', 'tag' => 'li', 'options' => erp_hr_get_departments_dropdown_raw(__('All Departments', 'wp-erp'))));
    erp_html_form_input(array('label' => __('Comment', 'wp-erp'), 'name' => 'comment', 'type' => 'textarea', 'tag' => 'li', 'placeholder' => __('Optional Comment', 'wp-erp')));
    ?>
Beispiel #3
0
<div class="wrap erp erp-hr-leave-request-new">
    <h2><?php 
_e('New Leave Request', 'wp-erp');
?>
</h2>

    <?php 
if (isset($_GET['msg'])) {
    if ($_GET['msg'] == 'submitted') {
        erp_html_show_notice(__('Leave request has been submitted successfully.', 'wp-erp'));
    } elseif ($_GET['msg'] == 'error') {
        erp_html_show_notice(__('Something went wrong.', 'wp-erp'), 'error');
    }
}
?>

    <form action="" method="post">

        <ul class="erp-list blur blocked" style="width: 400px;">

            <?php 
if (current_user_can('manage_options')) {
    ?>
                <li>
                    <?php 
    erp_html_form_input(array('label' => __('Employee', 'wp-erp'), 'name' => 'employee_id', 'value' => '', 'required' => true, 'type' => 'select', 'options' => erp_hr_get_employees_dropdown_raw()));
    ?>
                </li>
            <?php 
}
?>