<?php 
session_start();
include 'dbc.php';
date_default_timezone_set("Asia/Karachi");
$today=date("Y-m-d");
$userid=$_SESSION["userid"];
$teacher=$_POST["teacher"];
$tdays=$_POST["tdays"];
$tpriods=$_POST["tpriods"];
$class_name=$_POST["class_name"];
$tsubject=$_POST["tsubject"];

$sql = "Insert into timetable (id,dname,pname,sname,cname,tname,user_id) values (null,'$tdays','$tpriods','$tsubject','$class_name','$teacher','$userid')";
$conn->query($sql);
//mysql_query($sql) or die("Error : " . mysql_error());



header("location:Time_Table.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"]);*/
?>
