<?php
include_once "../../includes/config.php";
include_once "../../includes/database.php";
include_once "../../includes/validation.php";
include_once "../../includes/Helper.php";
include_once "../../includes/ajax/check_session_ajax.php";
require_once '../../includes/ajax/check_edit_page_ajax.php';

include_once "../../includes/auth.php";
$auth = array('manager');
$authRes = checkAuth($auth, $user);
if(!$authRes)
{
    http_response_code(401);
	echo json_encode(array('error_text' => 'Authntication Error'));
	exit;
}

include_once "../../includes/ajax/check_paid_ajax.php";

class complete extends database
{
    public function index($id, $userID, $companyID)
    {
        $data['cl_status']='Pending';
        $where['cl_id'] = $id;
        $where['cl_user_id'] = $userID;
        $where['cl_company_id'] = $companyID;
        return $this->update('tb_order', $data, $where);
    }
	
  
}


$update = new complete();

$msg = "";
$res = $update->index($id, $user['cl_id'], $user['cl_user_id']);
if($res)
{
    http_response_code(200);
    echo json_encode('Changed Successfully');
    exit;
}
                
http_response_code(500);
echo json_encode('Something went wrong');
exit;
?>