| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/HostingSpaces/admin/247sms.com/wwwroot/ |
Upload File : |
<?php
require 'lib/nusoap.php';
function RandomString($length) {
$original_string = array_merge(range(0,9));
$original_string = implode("", $original_string);
return substr(str_shuffle($original_string), 0, $length);
}
function adnolsoap( $msisdn,$message,$id,$networkid,$sDPServId)
{
//$msisdn ='2348138884002';
//$message ="Test again";
//$id = "27172028";
//$networkid = "MTN-NigeriaSDP";
//$sDPServId = "234012000006656";
$client = new nusoap_client('http://89.234.14.205/goal_alerts/GoalAlertService.asmx?wsdl', 'WSDL');
//check if there were any instantiation errors, and if so stop execution with an error message:
$error = $client->getError();
if ($error) {
die("client construction error: {$error}\n");
}
// $msisdn= "2348138884002";
//$message = "test from nosa";
//$id = "111133";
//$param = array('msisdn' => '2348138884002', 'message' => 'test message from nosa', 'id' => '376373' );
$origtext = array ("msisdn" =>$msisdn,
"message" => $message,
"id" => $id,
"network" => $networkid,
"sdpServId" => $sDPServId
);
echo $origtext;
$answer = $client->call('response', $origtext);
$error = $client->getError();
if ($error) {
////echo "error";
die();
}
//output the response (in the form of a multidimensional array) from the function call:
//print_r($answer);
$response= $answer[responseResult];
echo $response;
//exit;
return $response;
}//end of adnolsoap
function checkphonenumber( $query)
{
$cnt ="0";
$con=mysqli_connect("127.0.0.1","smsEngine","guEnaR28T","smartsmsrouter");
///Check connection
if (mysqli_connect_errno())
{
return '-1';
die();
}
if(!$result= mysqli_query($con,$query))
{
return "-2";
mysqli_close($con);
die();
}
if(mysqli_num_rows($result) > 0 )
{
return "1";
}
else
{
return "0";
}
}
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
function getexpirydate( $query)
{
$cnt ="0";
$con=mysqli_connect("127.0.0.1","smsEngine","guEnaR28T","smartsmsrouter");
///Check connection
if (mysqli_connect_errno())
{
return '-1';
die();
}
if(!$result= mysqli_query($con,$query))
{
return "-2";
mysqli_close($con);
die();
}
if(mysqli_num_rows($result) > 0 )
{
while($row = mysqli_fetch_assoc( $result )) {
$expirydate = $row['expirydate'];
return $expirydate;
}
}
mysqli_close($con);
}
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"
function provisionsubscriber( $query)
{
$cnt ="0";
$con=mysqli_connect("127.0.0.1","smsEngine","guEnaR28T","smartsmsrouter");
///Check connection
if (mysqli_connect_errno())
{
// //echo mysqli_error($con);
//echo "-1";
return '-2';
die();
}
//$query="update standingEng set team ='".$teamname."',p='". $play ."',w='". $won ."',d='". $drawn ."',l='". $loss ."',gd='". $gd ."',pts='". $pts ."',league='". $league ."' where sn=".$position;
if(!$result= mysqli_query($con,$query))
{
//echo mysqli_error($con);
//echo "Database error please try again";
mysqli_close($con);
return "-1";
}
else
{
$cnt= "0";
mysqli_close($con);
return $cnt;
}
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
$transid =trim($_GET["transid"]);
$msisdn =trim($_GET["msisdn"]);
$message =trim($_GET["message"]);
$Network =trim($_GET["Network"]);
$SDPServId =trim($_GET["SDPServId"]);
//$myresponse = adnolsoap( $msisdn,$messp,$transid,$Network,$SDPServId);
echo $transid;
//exit();
date_default_timezone_set('Africa/Lagos');
$mdate = date('Y-m-d H:i:s');
if(strlen($transid) ==0)
{
$transid = RandomString(4);
}
$query = "select * from goalsalertlogsadnol where transid ='". $transid."'";
$response = checkphonenumber ($query);
//echo $query;
//echo $response;
//exit();
if ($response =="1")
{
$transid = RandomString(4);
// $mess = "<swift>";
// $mess .= "<transid>". $transid . "</transid>";
// $mess .= "<status>error</status>";
// $mess .= "<errorcode>1000</errorcode>";
// $mess .= "<message>Duplicate TransID</message>";
// $mess .= "</swift>";
// echo $mess;
/// $query = "insert into goalsalertlogsadnol ( transid,message,msisdn,messageout,datesent)values('".$transid."' ,'".$message."','". $msisdn."','". $mess."','". date('Y-m-d H:i:s')."')";
// $myresponse = provisionsubscriber( $query);
// die();
}
if(strlen($msisdn) ==0)
{
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>error</status>";
$mess .= "<errorcode>1002</errorcode>";
$mess .= "<message>Blank MSISDN Received</message>";
$mess .= "</swift>";
//echo $mess;
$query = "insert into goalsalertlogsadnol ( transid,message,msisdn,messageout,datesent)values('".$transid."' ,'".$message."','". $msisdn."','". $mess."','". date('Y-m-d H:i:s')."')";
$myresponse = provisionsubscriber( $query);
die();
}
if(strlen($message) ==0)
{
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>error</status>";
$mess .= "<errorcode>1003</errorcode>";
$mess .= "<message>Blank Message Received</message>";
$mess .= "</swift>";
//echo $mess;
$query = "insert into goalsalertlogsadnol ( transid,message,msisdn,messageout,datesent)values('".$transid."' ,'".$message."','". $msisdn."','". $mess."','". date('Y-m-d H:i:s')."')";
$myresponse = provisionsubscriber( $query);
die();
}
if((strtoupper($message) == "P")|| (strtoupper($message) == "L") || (strtoupper($message) == "E") || (strtoupper($message) == "BALL") || (strtoupper($message) == "U") || (strtoupper($message) == "F") ){
$myleague = $message;
if (strtoupper($message) == "BALL")
{
$myleague = "P";
}
if (strtoupper($message) == "E")
{
$myleague = "P";
}
//check if subscriber already exists.
$query = "select * from goalalertsubsriberadnol where msisdn ='". $msisdn."' and league ='".$myleague."' limit 10";
$response = checkphonenumber ($query);
if ($response =="0")
{
//$expdate = date('Y-m-d', strtotime('+2 weeks'));
$expdate = date('d-m-Y', strtotime('+2 weeks'));
$expdate2 = date('Y-m-d H:i:s', strtotime('+2 weeks'));
if ((strtoupper($message) == "P") || (strtoupper($message) == "BALL") || (strtoupper($message) == "E")){
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>success</status>";
$mess .= "<errorcode>0</errorcode>";
$mess .= "<message>"."Dear subscriber, your subscription to Premiership GoalsAlert service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service"."</message>";
$mess .= "</swift>";
$messp = "Dear subscriber, your subscription to Premiership GoalsAlert service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service";
$query ="insert into goalalertsubsriberadnol ( transid,msisdn,message,league,datesent,expirydate,message_out,network,SDPserverid) values ('".$transid."' ,'".$msisdn. "','".$message."','P','".$mdate."','".$expdate2."','".$messp."','".$Network."','".$SDPServId."')";
}
if (strtoupper($message) == "L"){
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>success</status>";
$mess .= "<errorcode>0</errorcode>";
$mess .= "<message>"."Dear subscriber, your subscription to La Liga GoalsAlert service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service"."</message>";
$mess .= "</swift>";
$messp = "Dear subscriber, your subscription to La Liga GoalsAlert service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service";
$query ="insert into goalalertsubsriberadnol ( transid,msisdn,message,league,datesent,expirydate,message_out,network,SDPserverid) values ('".$transid."' ,'".$msisdn. "','".$message."','L','".$mdate."','".$expdate2."','".$messp."','".$Network."','".$SDPServId."')";
}
if (strtoupper($message) == "U"){
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>success</status>";
$mess .= "<errorcode>0</errorcode>";
$mess .= "<message>"."Dear subscriber, your subscription to UEFA GoalsAlert service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service"."</message>";
$mess .= "</swift>";
$messp = "Dear subscriber, your subscription to UEFA GoalsAlert service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service";
$query ="insert into goalalertsubsriberadnol ( transid,msisdn,message,league,datesent,expirydate,message_out,network,SDPserverid) values ('".$transid."' ,'".$msisdn. "','".$message."','U','".$mdate."','".$expdate2."','".$messp."','".$Network."','".$SDPServId."')";
}
if (strtoupper($message) == "F"){
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>success</status>";
$mess .= "<errorcode>0</errorcode>";
$mess .= "<message>"."Dear subscriber, your subscription to French Ligue1 GoalsAlert service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service"."</message>";
$mess .= "</swift>";
$messp = "Dear subscriber, your subscription to French Ligue1 service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service";
$query ="insert into goalalertsubsriberadnol ( transid,msisdn,message,league,datesent,expirydate,message_out,network,SDPserverid) values ('".$transid."' ,'".$msisdn. "','".$message."','F','".$mdate."','".$expdate2."','".$messp."','".$Network."','".$SDPServId."')";
}
}
else
{
//msisdn already exist
$myleague = $message;
if (strtoupper($message) == "BALL")
{
$myleague = "P";
}
$query = "select * from goalalertsubsriberadnol where msisdn ='".$msisdn."' and league ='".$myleague."' limit 10";
$response = getexpirydate($query);
if ($response < $mdate){
//$expdate = date('Y-m-d', strtotime('+2 weeks'));
$expdate = date('d-m-Y', strtotime('+2 weeks'));
$expdate2 = date('Y-m-d H:i:s', strtotime('+2 weeks'));
}
else{
$add_days = 14;
//$expdate = date('Y-m-d',strtotime($response.' +'.$add_days.' days'));
$expdate = date('d-m-Y',strtotime($response.' +'.$add_days.' days'));
$expdate2 = date('Y-m-d H:i:s',strtotime($response.' +'.$add_days.' days'));
}
if ((strtoupper($message) == "P") || (strtoupper($message) == "BALL")){
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>success</status>";
$mess .= "<errorcode>0</errorcode>";
$mess .= "<message>"."Dear subscriber, your subscription to Premiership GoalsAlert service has been renewed. Your subscription expires on ".$expdate.". Thks for using GoalsAlert service"."</message>";
$mess .= "</swift>";
$messp = "Dear subscriber, your subscription to Premiership GoalsAlert service has been renewed. Your subscription expires on ".$expdate.". Thks for using GoalAlert service";
}
if (strtoupper($message) == "L"){
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>success</status>";
$mess .= "<errorcode>0</errorcode>";
$mess .= "<message>"."Dear subscriber, your subscription to La Liga GoalsAlert service has been renewed. Your subscription expires on ".$expdate.". Thks for using GoalsAlert service"."</message>";
$mess .= "</swift>";
$messp = "Dear subscriber, your subscription to La Liga GoalsAlert service has been renewed. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service";
}
if (strtoupper($message) == "U"){
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>success</status>";
$mess .= "<errorcode>0</errorcode>";
$mess .= "<message>"."Dear subscriber, your subscription to UEFA GoalsAlert service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service"."</message>";
$mess .= "</swift>";
$messp = "Dear subscriber, your subscription to UEFA GoalsAlert service has been renewed. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service";
}
if (strtoupper($message) == "F"){
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>success</status>";
$mess .= "<errorcode>0</errorcode>";
$mess .= "<message>"."Dear subscriber, your subscription to French Ligue1 GoalsAlert service is successful. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service"."</message>";
$mess .= "</swift>";
$messp = "Dear subscriber, your subscription to French Ligue1 GoalsAlert service has been renewed. Your subscription expires on ".$expdate.". Thanks for using GoalsAlert service";
}
$query ="update goalalertsubsriberadnol set expirydate ='". $expdate2. "',Network='".$Network."',datesent='".$mdate."',SDPServerId='".$SDPServId."',message='".$message."',message_out='".$messp."' where msisdn ='". $msisdn. "' and league ='".$myleague."'";
}//end of else
//echo $query;
//exit();
$myresponse = provisionsubscriber( $query);
// echo $mess;
if ($myresponse =="0" ){
//echo $mess;
// echo $transid;
// exit();
//$myresponse = adnolsoap( $msisdn,$messp,$transid,$Network,$SDPServId);
echo $myresponse;
echo "james";
//exit();
//echo $myresponse;
}
else
{
// echo "nosblue";
// exit();
$query = "insert into goalserrorlogsadnol(transid,errorcode,description,datesent values('".$transid."' ,'".$response."','Provisioning Error','". date('Y-m-d H:i:s')."')";
$myresponse = provisionsubscriber( $query);
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>success</status>";
$mess .= "<errorcode>0</errorcode>";
$mess .= "<message>Dear subscriber, sorry we cannot subscriber you now. You will be contacted shortly about your subscription. Thanks.</message>";
$mess .= "</swift>";
$messp = "Dear subscriber, sorry we cannot subscribe you now. You will be contacted shortly about your subscription. Thanks";
echo $mess;
//$myresponse =adnolsoap( $msisdn,$messp,$transid,$Network,$SDPServId);
}
// $query = "insert into goalsalertlogsadnol ( transid,message,messageout,datesent) values('".$transid."' ,'".$message."','". $messp."','". date('Y-m-d H:i:s')."')";
$query = "insert into goalsalertlogsadnol ( transid,message,msisdn,messageout,datesent)values('".$transid."' ,'".$message."','". $msisdn."','". $messp."','". date('Y-m-d H:i:s')."')";
$myresponse = provisionsubscriber( $query);
}//end of provisioning subscriber
else
{
$mess = "<swift>";
$mess .= "<transid>". $transid . "</transid>";
$mess .= "<status>error</status>";
$mess .= "<errorcode>1004</errorcode>";
$mess .= "<message>Dear subscriber, you have sent invalid request, please send P, L, U or F to register for Premiership, La Liga, UEFA or French Ligue1 respectively.</message>";
$mess .= "</swift>";
//echo $mess;
// $query = "insert into goalsalertlogsadnol ( transid,message,messageout,datesent) values('".$transid."' ,'".$message."','". $mess."','". date('Y-m-d H:i:s')."')";
$query = "insert into goalsalertlogsadnol ( transid,message,msisdn,messageout,datesent)values('".$transid."' ,'".$message."','". $msisdn."','". $mess."','". date('Y-m-d H:i:s')."')";
$myresponse = provisionsubscriber( $query);
$messp ="Dear subscriber, you have sent invalid request, please send P, L, U or F to register for Premiership, La Liga, UEFA or French Ligue1 respectively.";
//$myresponse =adnolsoap( $msisdn,$messp,$transid,$Network,$SDPServId);
echo $myresponse."nosa";
echo $messp;
die();
}
?>