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

date_default_timezone_set("Asia/Karachi");
$today=date("Y-m-d");

$userid=$_SESSION["userid"];
$username=$_SESSION["username"];
$adm_no=$_POST["adm_no"];
$sess1=$_POST["sess1"];
$month1=$_POST["month1"];
$adm_date=$_POST["adm_date"];
$dob=$_POST["dob"];
$class_name=$_POST["class_name"];
$cls_sec=$_POST["cls_sec"];
$std_name=$_POST["std_name"];
$fname=$_POST["fname"];
$fnic=$_POST["fnic"];
$mnic=$_POST["mnic"];
$cell_1=$_POST["cell_1"];
$cell_2=$_POST["cell_2"];
$gender=$_POST["gender"];
$address=$_POST["address"];
$remarks=$_POST["remarks"];
$gname=$_POST["gname"];
$gnic=$_POST["gnic"];
$cell_3=$_POST["cell_3"];
$job=$_POST["job"];
$regfee=$_POST["regfee"];

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


$sql = "Insert into inq (id,date,adm_no,sess1,month,adm_date,dob,class_name,cls_sec,std_name,fname,fnic,mnic,cell_1,cell_2,address,remarks,user_id,gname,sec_fee,job) values (null,'$adm_date','$adm_no','$sess1','$month1','$adm_date','$dob','$class_name','$cls_sec','$std_name','$fname','$fnic','$mnic','$cell_1','$cell_2','$address','$remarks','$userid','$username','$regfee','$job')";
$conn->query($sql);
$sql6 = "Insert into rec_fee (id,date,due_date,adm_no,portal_id,std_name,fname,class_name,cls_sec,cell_1,user_id,month_period,rec_date,fee1rec,username) values (null,'$adm_date','$adm_date','$adm_no','$adm_no','$std_name','$fname','$class_name','$cls_sec','$cell_1','$userid','$my','$adm_date','$regfee','$username')";
$conn->query($sql6);





/*$type = "xml"; 
$id = "rchalliedtaj"; 
$pass = "schooltajbagh786"; 
$lang = "English"; 
$mask = "Allied-TajB";               
// Data for text message 
$to = $cell_1; 
$message =  $std_name . ":Dear Parents: Thank you for visiting our prestigious institute K.M School System(Regd.)
Best wishes and good luck. <br> K.M.S.S"; 
$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); 

*/

header("location:Add_Inquiry.php");

?>
