<?php // Configuration variables
session_start();
include 'dbc.php';


$userid=$_SESSION["userid"];
$complain=$_POST["remarks"];
$bal1=$_POST["start_value"];
$bal2=$_POST["end_value"];
$sql = "SELECT * FROM admission where bal > $bal1 and bal < $bal2 and user_id='$userid'";
$result1=$conn->query($sql);
    
  while($test = $result1->fetch_assoc())
{
 $std_name=$test['std_name'] ;
				
				$cell_1=$test['cell_1'] ;
				$bal=$test['bal'] ;
	$type = "xml"; 
$id = "rchalliedch"; 
$pass = "classicgroup786786"; 
$lang = "English"; 
$mask = "Allied C.G";    
// Data for text message 
$to = $cell_1; 
$message =  $std_name . ":Remaining Dues are:" . $bal . "::" . $complain;
$message = urlencode($message); 

// Prepare data for POST request 
$data = "id=".$id."&pass=".$pass."&msg=".$message."&to=".$to."&lang=".$lang."&mask=".$mask."&type=".$type;   
// Send the POST request with cURL 
$ch = curl_init('http://www.outreach.pk/api/sendsms.php/sendsms/url'); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
$result = curl_exec($ch); 
//This is the result from Outreach 

curl_close($ch); 
	

	 }
	echo "Message Send";

 

?> 
<a href="Fee_Sms.php">Back</a>