<?php
include("../config/config.php");
include("../conn.php");
$userAccount = "MARAFIQ";
$BSValue = '';
$applicationType = "18";
$result = mysqli_query($conn, "SELECT password,userSender,start_ip,end_ip FROM cpanel");
$row = mysqli_fetch_assoc($result);
$passAccount = $row["password"];
$userSender = $row["userSender"];

if(!empty($row['start_ip']) && !empty($row['end_ip'])) {
	$start_ip_explode = explode(".",$row['start_ip']);
	$end_ip_explode = explode(".",$row['end_ip']);
	$start3 = $start_ip_explode[3];
	$end0 = $end_ip_explode[0];
	$end1 = $end_ip_explode[1];
	$end2 = $end_ip_explode[2];
	$end3 = $end_ip_explode[3];
		
	if(!empty($_SERVER['REMOTE_ADDR']))
	{
		$ipNow = $_SERVER['REMOTE_ADDR'];
		$ipNowExplode = explode(".",$ipNow);
		$ipNow0 = $ipNowExplode[0];
		$ipNow1 = $ipNowExplode[1]; 
		$ipNow2 = $ipNowExplode[2]; 
		$ipNow3 = $ipNowExplode[3];
		if($end0!=$ipNow0 || $end1!=$ipNow1 || $end2!=$ipNow2 || $ipNow3 > $end3 || $ipNow3 < $start3)
		{
			echo "404";
			exit;
		}
	}
} 

include("function/functionUnicode.php");
include("function/checkSendPorts.php");
if(curlTest() == 5){
	include("../functions/curlSMS.php");
	$spilter = 1;
}
elseif(fsockopenTest() == 6){
	include("../functions/fsockopen.php");
	$spilter = 1;
}
elseif(fopenTest() == 6){
	include("../functions/fopenSMS.php");
	$spilter = 120;
}
else
	exit;
include("function/function.php");
include("../functions/insertMsg.php");
?>