<?php
session_start();
require_once "../../../config.php";
require_once "../../../validation.php";
require_once "../../../Helper.php";
require_once '../../database1.php';

require_once "../../check_admin.php";

if(!isset($_GET['id']) || !is_numeric($_GET['id']))
{
    http_response_code(400);
    echo json_encode(array('error_text' => 'No input found'));
    exit;
}

$id = $_GET['id'];

class closeChat extends database
{
   	public function index($id)
    {
        return $this->update('tb_chat_customer', ['cl_status' => 'Closed'], ['cl_id' => $id]);
    }

}


$obj = new closeChat();   
$chats = $obj->index($id);


echo json_encode($chats);