<?php  ?><form name="form1" method="post" action="">
<label>jawwal number </label>
 <input type="hidden" name="optg" value="1">
   <input type="text" name="mobile" id="mobile">
  <input type="submit" name="submit" id="submit" value="Submit">
</form>
 <?php 
 
 
 if($_REQUEST['optg']==1){
 $date_from=date("Y-m-d G:i:s");
require_once "HTTP/Request.php";
include('library/Requests.php');	 
		// http://ns4.mit.bz/PalLandingPageAPI/sms/sub/generateCode
		   // http://ns15.mit.bz/PalLandingPageAPI/sms/sub/generateCode
	$URL = 'http://ns8.mit.bz/PalLandingPageAPI/sms/sub/generateCode'; 
	  
	$req =new HTTP_Request("");
	$req->setURL($URL);
	$req->setMethod("POST");
	$req->addHeader("Content-Type", "application/x-www-form-urlencoded"
	 );
	 
	 
		   $req->addPostData("operatorCode",'59');
		     $req->addPostData("msisdn",$_REQUEST['mobile']);
			  $req->addPostData("serviceId","1748");
	
	
	 $response = $req->sendRequest();
	 $responseBody = $req->getResponseBody();
	  

$data = json_decode($responseBody,true);
print_r($data);

$date_to=date("Y-m-d G:i:s");


 ?><br>
<br>
<?php echo($date_from ." --- ".$date_to); } ?>

<br>
<br>
<br>

<form name="form1" method="post" action="">
<label>code </label>
 <input type="hidden" name="optc" value="1">
   <input type="text" name="code" id="code">
   <input type="text" name="mobile" value="<?php  echo($_REQUEST['mobile']);?>">
  <input type="submit" name="submit" id="submit" value="Submit">
</form><?php if($_REQUEST['optc']==1){
 $date_from=date("Y-m-d G:i:s");
require_once "HTTP/Request.php";
include('library/Requests.php');	 

//http://ns4.mit.bz/PalLandingPageAPI/sms/sub/subMsisdn
	$URL = 'http://ns8.mit.bz/PalLandingPageAPI/sms/sub/subMsisdn'; 
	  
	$req =new HTTP_Request("");
	$req->setURL($URL);
	$req->setMethod("POST");
	$req->addHeader("Content-Type", "application/x-www-form-urlencoded"
	 );
	 
	 
		   $req->addPostData("operatorCode",'59');
		     $req->addPostData("code",$_REQUEST['code']);
			  $req->addPostData("msisdn",$_REQUEST['mobile']);
			  
			  
			  $req->addPostData("serviceId","1748");
	
	
	 $response = $req->sendRequest();
	 $responseBody = $req->getResponseBody();
	  

$data = json_decode($responseBody,true);
print_r($data);

$date_to=date("Y-m-d G:i:s");





 ?><br>
<br>
<?php echo($date_from ." --- ".$date_to); } ?>  