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


$userid=$_SESSION["userid"];
$complain=$_POST["remarks"];
$month_name=$_POST["month_name"];
$sql = "SELECT * FROM issueslip where monthname='$month_name' and status='unpaid' and user_id='$userid'";
$result1=$conn->query($sql);
    
  while($test = $result1->fetch_assoc())
{
 $std_name=$test['std_name'] ;
				
				$cell_1=$test['cell_1'] ;
	$type = "xml";
$id = "923217274210";
$pass = "alishan123";
$lang = "English";
$mask = "ALERTS";
// Data for text message
$to = $cell_1; 

$message = $std_name . ":"  . $complain; 
$message = urlencode($message);
// Prepare data for POST request
$data = "user=".$id."&password=".$pass."&message=".$message."&to=".$to."&mask=".$mask;
// Send the POST request with cURL
$ch = curl_init('https://panel.prosms.pk/api/quick/message'); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//curl_setopt($ch, CURLOPT_HTTPHEADER,	array('Content-Type: application/soap+xml', 'charset=utf-8'));
$result = curl_exec($ch); curl_close($ch);



	  
	 }
	

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