<?php
header('Content-type: application/json');
include '../config/database.php';
function _command($gid,$products,$version){
	$conn = _connectDB();
	$sql = "UPDATE groupline SET groupline_version='".$version."' WHERE groupline_products='".$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['v'])){
		$gid = $_GET['gid'];
		$products = $_GET['p'];
		$version = $_GET['v'];
		echo json_encode(_command($gid,$products,$version));
	}else{echo json_encode(['status'=>false]);}
}else{echo json_encode(['status'=>false]);}