<?php
header('Content-type: application/json');
include '../../config/database.php';
function _users_on_off($gid,$mode,$product){
	$conn = _connectDB();
	$sql = "UPDATE groupline SET groupline_welcome='".$mode."' WHERE groupline_products = '".$product."' and  groupline_key='".$gid."'";
	$result = $conn->query($sql);
	$res = ['status'=>true];
	return $res;
}
if(isset($_GET)){
	if(isset($_GET['gid'])){
		$gid = $_GET['gid'];
		$mode = $_GET['mode'];
		$p = $_GET['p'];
		echo json_encode(_users_on_off($gid,$mode,$p));
	}
}
