$bd = mysqli_connect('localhost','admin','hfKJbTkMW9UWJjTCb7Xr','sms');

echo "string";
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
if (isset($_POST['sbt'])) {
	$se_phone = $_POST['se_phone'];
	$phone = str_replace('+', '', $_POST['phone']);
	$text = $_POST['text'];
	$time = time();
	$link = "https://voip.a1call.me/api/message?_login=bulgakov_test_sms&_password=oG0kOzuQ&source_name=GiftSMS&destination_number=$phone&body=$text&require_dlr=1";
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $link);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$result = json_decode(curl_exec($ch),1);
	curl_close($ch);
	$req_time = time();
	$stats = $result['data']['attributes']['status'];
	$id = $result['data']['id'];
	$query = "INSERT INTO `request`(`time`, `status`, `number`, `service_id`) VALUES ('$req_time','$stats','$phone','$id')";
	echo $query;
	mysqli_query($bd,$query);
}