<?php 
session_start();
//mysql_connect("localhost","root","vertrigo") or die("Error Connecting Server");
//mysql_select_db("sm") or die("Error Opening Database");
include 'dbc.php';


$today=date("Y-m-d");
echo "<h1 align=center> Select Teacher Data Report </h1>";
if($_POST['delete']) // from button name="delete"
	{
		$checkbox = $_POST['checkbox']; //from name="checkbox[]"
		$countCheck = count($_POST['checkbox']);
		
		for($i=0;$i<$countCheck;$i++)
		{
			$del_id  = $checkbox[$i];
			$userid=$_SESSION["userid"];
			$complain=$_POST["remarks"];
			$today=date("Y-m-d");
			$sql = "SELECT * FROM teacher where id = '$del_id' and user_id = '$userid'";
$result=$conn->query($sql);
$app1 = $result->fetch_assoc();
   							
							$std_name=$app1["tech_name"];
							
							$cell_1=$app1["cell_no"];
							
							
				$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="Individual_Sms.php">Back</a>