<?php 
session_start();
include 'dbc.php';

$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		 $my=$month_name . " " . $year;

$userid=$_SESSION["userid"];
$today=date("d-m-Y");
$today1=date("Y-m-d");
$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today1));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		 $my=$month_name . " " . $year;
$std_rollno=$_POST["std_rollno"];
$std_name=$_POST["std_name"];
$father_name=$_POST["father_name"];
$adate=$_POST["adate"];

$class_name=$_POST["class_name"];

$home_adress=$_POST["home_adress"];

$cell_1=$_POST["cell_1"];
$cell_2=$_POST["cell_2"];

$fno=$_POST["fno"];
  
   
   
$sql = "Insert into inq (id,date,std_rollno,std_name,father_name,class_name,home_adress,cell_1,cell_2,user_id,fno) values (null,'$adate','$std_rollno','$std_name','$father_name','$class_name','$home_adress','$cell_1','$cell_2','$userid','$fno')";
mysql_query($sql) or die("Error : " . mysql_error());
$type = "xml"; 
$id = "rchalainsch"; 
$pass = "alain786"; 
$lang = "English"; 
$mask = "AlainSchool";       
             
// Data for text message 
$to = $cell_1; 
$message = "Dear Parents: We warmly Welcome :". $std_name . ": to Dreamland International Schools Family. <br>
Together may we give our children the roots to grow and wings to fly.<br>
Best wishes and Good luck.<br>
Regards: Dreamland International Schools."; 
$message1 = "Dear Parents: We warmly Welcome :". $std_name . ": to Dreamland International Schools Family. <br>
Together may we give our children the roots to grow and wings to fly.<br>
Best wishes and Good luck.<br>
Regards: Dreamland International Schools.";
$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); 

$sql16 = "Insert into notice (id,date,month_name,sname,notice,total,user_id,cell_1) values (null,'$adate','$my','$std_name','$message1','1','$userid','$to')";
mysql_query($sql16) or die("Error : " . mysql_error());
header("location:inquiry_form.php");
/*$sql="Select * from agents where userid='$user_id'";
$data=mysql_query($sql) or die ("Error:" . mysql_error());
$userdata=mysql_fetch_array($data);
$email=$userdata["e_mail"];
mail($email . ",info@lalburj.com","Candidate Information","Candidate Data Posted Successfully","Passport No:" . $app_pp_no . " of " . $app_name . "Has been Posted Successfully By:" . $_SESSION["userid"]);*/
?>
