コード例 #1
0
ファイル: report.php プロジェクト: YuriyRusinov/reper
        <th> Должность</th>
        <th> Место командировки</th>
        <th> Контактный телефон(или места куда убыл)</th>
        <th> Цель командировки</th>
        <th> Время убытия</th>
        <th> Время прибытия</th>
        <th> Комментарий</th>
        <th> &nbsp;</th>
    </tr>
    <?php 
    $odd = false;
    for ($i = 0; $i < count($coms); $i++) {
        $odd = !$odd;
        $empl = new employee();
        $empl->id_employee = $coms[$i]['employee_id'];
        $empl->Load();
        ?>
                <tr <?php 
        echo $odd ? 'class="odd"' : '';
        ?>
>
                    <th><?php 
        echo $i + 1;
        ?>
.</th>
                   
                    <td><?php 
        echo htmlspecialchars($coms[$i]['date']);
        ?>
</td>
                    <td><?php 
コード例 #2
0
ファイル: table.php プロジェクト: YuriyRusinov/reper
    $employees = get_employee_in_dep($department_id, $sort_dir);
    $employees = array_slice($employees, $from, LIMIT_EMPLOYEE_ON_PAGE);
    $page_break = get_page_break(SITE_URI_ROOT . $STORAGE['module'] . '/' . $STORAGE['action'] . '/', $all_num, $from, LIMIT_EMPLOYEE_ON_PAGE, LIMIT_PAGE_ON_PAGE, $additional_vars, 'Aclick');
}
$dep = new department();
$emp = new employee();
for ($i = 0; $i < count($employees); $i++) {
    $dep->Init();
    $dep->id_department = $employees[$i]['department_id'];
    $dep->Load();
    $n = 0;
    $employees[$i]['department'] = array();
    $employees[$i]['department'][$n]['dep'] = $dep->name;
    if ($dep->head_id != 0) {
        $emp->id_employee = $dep->head_id;
        $emp->Load();
        $employees[$i]['department'][$n]['head'] = $emp->name;
    } else {
        $employees[$i]['department'][$n]['head'] = '';
    }
    while ($dep->parent_id != 0) {
        $n++;
        $dep->id_department = $dep->parent_id;
        $dep->Load();
        $employees[$i]['department'][$n]['dep'] = $dep->name;
        if ($dep->head_id != 0) {
            $emp->id_employee = $dep->head_id;
            $emp->Load();
            $employees[$i]['department'][$n]['head'] = $emp->name;
        } else {
            $employees[$i]['department'][$n]['head'] = '';
コード例 #3
0
ファイル: delete.php プロジェクト: YuriyRusinov/reper
<?php

$page_title = 'Удаление данных о сотруднике';
$errors = array();
$id = intval(get_request_variable('id', 0));
$_REQUEST['callback'] = get_request_variable('callback', '');
$employee = new employee();
$employee->id_employee = $id;
if ($id > 0) {
    if ($employee->Load()) {
        $errors = $employee->IsValidData();
        if (!$errors) {
            //set flag to not active
            $employee->delete_flag = 'yes';
            $employee->Save();
        }
    }
}
include SITE_FILE_ROOT . 'template/simple_header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/simple_footer.php';
コード例 #4
0
ファイル: detail.php プロジェクト: YuriyRusinov/reper
<?php

$page_title = 'Просмотр данных сотрудника';
$id = intval(get_request_variable('id', 0));
$employee = new employee();
$employee->id_employee = $id;
if ($id > 0) {
    if (!$employee->Load()) {
        $employee->id_employee = 0;
    }
}
$department_name = '---';
if ($employee->department_id > 0) {
    $department = new department();
    $department->id_department = $employee->department_id;
    if ($department->Load()) {
        $department_name = $department->name;
    }
}
$head = new employee();
if ($employee->head_id > 0) {
    $head->id_employee = $employee->head_id;
    $head->Load();
}
include SITE_FILE_ROOT . 'template/simple_header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/simple_footer.php';
コード例 #5
0
ファイル: edit.php プロジェクト: YuriyRusinov/reper
$department_id = intval(get_request_variable('department_id', 0));
$head_id = intval(get_request_variable('head_id', 0));
$enabled_employee_roles = get_request_variable('enabled_employee_roles', array());
$post = get_request_variable('post', '');
$birthday = get_request_variable('birthday', '');
$home_address = get_request_variable('home_address', '');
$office_phone = get_request_variable('office_phone', '');
$home_phone = get_request_variable('home_phone', '');
$cellular = get_request_variable('cellular', '');
$room = get_request_variable('room', '');
$save = get_request_variable('save', '');
$_REQUEST['callback'] = get_request_variable('callback', '');
$employee = new employee();
$employee->id_employee = $id;
if ($id > 0) {
    if (!$employee->Load()) {
        $employee->id_employee = 0;
    }
}
if ($save) {
    $employee->department_id = $department_id;
    $employee->head_id = $head_id;
    if ($employee->department_id === 0) {
        $employee->department_id = null;
    }
    if ($employee->head_id === 0) {
        $employee->head_id = null;
    }
    $employee->name = $name;
    $employee->active_flag = $active_flag;
    $employee->delete_flag = $delete_flag;