<?php
session_start();
$rolenumber=$_SESSION["rolenumber"];
include("connect.php");
$phone=$_POST["phone"];
$amount=$_POST["amount"];
$transid=$_POST["transid"];
$identifier=$_POST["identifier"];
$platform=$_POST["platform"];

/*$result_clo=$dbh->query("select * from clo where transactionid='$transid' and identifier='$identifier' ");
$row_clo=$result_clo->fetchObject(); $count_clo=$result_clo->rowCount();

if($count_clo>0){
$amount=$row_clo->totalamount;
$phone=$_POST["phone"];
$platform=$_POST["platform"];*/

$tel=$phone;
if(substr($tel,0,1)=="0"){$ftel=substr(str_replace(' ','',$tel),1);}
elseif(substr($tel,0,3)=="256"){$ftel=substr(str_replace(' ','',$tel),3);}
elseif(substr($tel,0,4)=="+256"){$ftel=substr(str_replace(' ','',$tel),4);}
else{$ftel=$tel;}

/*$result_other=$dbh->query("select * from other_numbers where phoneno='$ftel' and rolenumber='$rolenumber' and status='1' ");
$count_other=$result_other->rowCount();
if($count_other==0){$insert_other=$dbh->query("insert into other_numbers (identifier,rolenumber,phoneno) values('$identifier','$rolenumber','$ftel')");}*/

$url = "https://payments.kinglinepress.com/submit_payment.php?amount=".$amount."&phone=".$phone."&platform=".$platform."";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/6.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 
$resultz = curl_exec ($ch); 
echo $resultz;




?>