<?php
header('Content-type: application/json');
include '../../config/database.php';
function _command($gid,$products,$status){
	$conn = _connectDB();
	$sql = "UPDATE groupline SET groupline_status_5min='".$status."' WHERE groupline_products_5min='".$products."' AND groupline_key='".$gid."'";
	$result = $conn->query($sql);
	$res = ['status'=>true];
	return $res;
}
if(isset($_GET)){
	if(isset($_GET['gid']) AND isset($_GET['p']) AND isset($_GET['s'])){
		$gid = $_GET['gid'];
		$products = $_GET['p'];
		$status = $_GET['s'];
		echo json_encode(_command($gid,$products,$status));
	}else{echo json_encode(['status'=>false]);}
}else{echo json_encode(['status'=>false]);}