<?php
session_start();
include_once "../config.php";
require_once '../database1.php';
require_once "../check_admin.php";

$id='';
if(isset($_GET['id']))
{
	$id=$_GET['id'];
}
class CovertInvoice extends database
{
	public function index($id)
	{
		$where['cl_id'] = $id;
		$data['cl_invoice']=1;
		return $this->update('tb_checkout', $data, $where);
	}

}


$obj = new CovertInvoice();
$res = $obj->index($id);

if(!$res)
{
	http_response_code(404);
	echo json_encode(array('error_text' => 'Something Went Wrong'));
	exit;
}

http_response_code(200);
	echo json_encode(array('error_text' => 'Updated Successfully'));
	exit;