<?php
  include "include/dbcon.php";
?>
<?php
    global $conn;

    $psid = $_POST["sid"];
	$starttime = "00:00:00";
	$endtime = "00:00:00";
?>
<?php
    $qreset = "DELETE FROM punchsys_timetable WHERE secid='$sid'";
    $rreset = mysqli_query($conn,$qreset);
?>
<?php
    for($iwk=0;$iwk<7;$iwk++){
        $query = "INSERT INTO punchsys_timetable VALUES (null,'$psid','$iwk','$starttime','$endtime')";
        mysqli_query($conn,$query);
    }
?>
<?php
  header("location: main.php?pg=sys&ac=sect&sid=$psid");
?>