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


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

$message = "Student Name:" . $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="Attendance_Sms.php">Back</a>