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


$userid=$_SESSION["userid"];
$complain=$_POST["remarks"];
$month_name=$_POST["month_name"];
$sql = "SELECT * FROM paidsalary where month_name='$month_name' and user_id='$userid'";
$result1=$conn->query($sql);
    
  while($test = $result1->fetch_assoc())
{
 $tech_name=$test['tech_name'] ;
 $teacher_id=$test['teacher_id'] ;
 $monthly_salary=$test['monthly_salary'] ;
 $totalded=$test['totalded'] ;
 $pdays=$test['pdays'] ;
 $gsalary=$test['gsalary'] ;
 $gsalary=round($gsalary,0);
 $totalallow=$test['totalallow'] ;
  $netsalary=$test['netsalary'] ;
  $netsalary=round($netsalary,0);
 
 $sql2 = "SELECT * FROM teacher where teacher_id = '$teacher_id' and  user_id='$userid'";
$result2=$conn->query($sql2);
$row2 = $result2->fetch_assoc();
				
				$cell_1=$row2['cell_no'] ;
	
	$type = "xml";
$id = "923217274210";
$pass = "alishan123";
$lang = "English";
$mask = "ALERTS";
// Data for text message
$to = $cell_1; 

$message = "Month:" . $month_name . ":" . $tech_name . ":Basic Salary:" . $monthly_salary . ":Total Days:" . $pdays . ":Total Deduction:" . $totalded  . ":Total Allownces:" . $totalallow . ":Net Salary" . $netsalary; 
$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);

}
	
	echo "Message Send";

 

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