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

date_default_timezone_set("Asia/Karachi");

$userid=$_SESSION["userid"];
$status=$_POST["status"];

$date=$_POST["date"];
$month_name=$_POST["month_name"];
$sess1=$_POST["sess1"];
  
  
  $sqlchallan = "SELECT * FROM teacher where user_id='$userid'";
$resultchallan=$conn->query($sqlchallan);
while($rowchallan = $resultchallan->fetch_assoc())
 
  {
  
$class_name=$rowchallan['class_name'];
$teacher_id=$rowchallan['teacher_id'];
$tech_name=$rowchallan['tech_name'];
$father_name=$rowchallan['father_name'];
$cell_no=$rowchallan['cell_no'];


$sql = "Insert into tech_attendence (id,date,teacher_id,tech_name,father_name,class_name,status,month_name,cell,user_id,sess1) values (null,'$date','$teacher_id','$tech_name','$father_name','$class_name','$status','$month_name','$cell_no','$userid','$sess1')";
$conn->query($sql);

 }
header("location:Open_Teacher_Attendance.php");

?>
