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