<?php
session_start();
if (isset($_POST['uniqueID'])) {
    $uniqueID = $_POST['uniqueID'];
    $loggedInUserName = $_SESSION['userId'];
    $loggedInUserID = $_SESSION['userName'];
    $claimChangesUpdatedBy = $loggedInUserID . "," . $loggedInUserName;

    $obj = new UndoClaimStatus();
    $obj->undoChangesMadetoClaimStatus($uniqueID, $claimChangesUpdatedBy);
} else {
    echo "no result found";
}
class UndoClaimStatus
{

    function __construct()
    {

        require_once dirname(__DIR__) . '../../php/DB_Connect.php';
        $objectOfDBClass = new DB_conncect();
        $this->db = $objectOfDBClass->connectToDB();
    }
    function undoChangesMadetoClaimStatus($uniqueID, $claimChangesUpdatedBy)
    {
        $claimStatus = CLAIM_TL_APPROVED;
        $query = $this->db->prepare("UPDATE `tesf-2` SET  `CLAIM_STATUS`=? , `CLAIM_STATUS_UPDATED_BY`=? WHERE `UNIQUE_ID`=?");
        $query->bind_param("iss", $claimStatus, $claimChangesUpdatedBy, $uniqueID);
        $query->execute();
    }
}
?>
