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


$userid=$_SESSION["userid"];
$complain=$_POST["complain"];
$bal1=$_POST["bal1"];
$sql = "select * from admission where user_id='$userid' and std_rollno = '$bal1'";
$admission=mysql_query($sql) or die("Error : " . mysql_error());
    
while($test=mysql_fetch_array($admission))
{
 $std_name=$test['std_name'] ;
				$std_rollno= $test['std_rollno'] ;					
				$father_name=$test['father_name'] ;
				$class_name=$test['class_name'] ;
				$cell_1=$test['cell_1'] ;
				$bal=$test['bal'] ;
	$type = "xml"; 
$id = "rchalliedch"; 
$pass = "classicgroup786"; 
$lang = "English"; 
$mask = "Allied C.G";    
// Data for text message 
$to = $cell_1; 
$message =  "Student Name::" . $std_name . "::Student Rollno::" . $std_rollno . "::Father Name::" . $father_name . "::Class::" . $class_name  . "::::" . $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="send_sms_outstanding.php">Back</a>