<?php 
include "scrinit.php";
require("dbconnect.php");
if (isset($_POST['adsynd']))
{   
    $snd=$_POST['syndx'];
	//$id=$_POST['nextid'];
	$pmp=$_POST['pmpx'];
	$teach=$_POST['teachx'];
	
	$sql = $dbcon->prepare("INSERT INTO syndkath (pmp,kathigitis,synd) values (?,?,?) ");
	$sql->execute([$pmp,$teach,$snd]);	
	$sql = $dbcon->prepare("INSERT INTO syndcodes (synd) values (?) ");
	$sql->execute([$snd]);
}	
echo '<script type="text/javascript">';
   echo 'alert("Η Συνδιδασκαλία καταχωρήθηκε")';
   echo '</script>';	
   $time = 0.2; //Time (in seconds) to wait. 
   $url = "addsynd.php";//Location to send to. 
   header("Refresh: $time; url=$url");