<?php
session_start();
if ($_SESSION['islogin']=='' ) { 
  echo "ΠΡΕΠΕΙ ΝΑ ΕΓΓΡΑΦΕΙΤΕ ΓΙΑ ΝΑ ΧΡΗΣΙΜΟΠΟΙΗΣΕΤΕ ΤΟ ΣΥΣΤΗΜΑ"."<BR>";
  sleep(3);
  header("Location: loginguest.php"); 
  exit();
  }
include "logo.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<script language="JavaScript" type="text/javascript">
//  Bind the event handler to the "submit" JavaScript event
$('form').submit(function () {

    // Get the Login Name value and trim it
    var pname = $.trim($('#pname').val());

    // Check if empty of not
    if (pname === '') {
        alert('Text-field is empty.');
        return false;
    }
});
</script>


<?php
include "dbconnect.php";

$usr=$_SESSION['usr'];
$usr1=rtrim($usr,'!');
$dayk=$_POST['day'];
	$yeark=$_POST['year'];
	$monthk=$_POST['month'];
	echo $yeark."xx".$monthk."xx".$dayk."xx";
    $sql = mysqli_query($con,"SELECT * FROM allstudentinfo WHERE mitroo='$usr1' " );
	$row=mysqli_fetch_array($sql);
	$birthday=$row['birthdate'];
    $birth = explode("-", $birthday);
  echo $birthday;
     $y  = $birth[0];
     $m  = $birth[1];
     $d = $birth[2];
echo $y."xx".$m."xx".$d;
     if ($dayk==$d AND $monthk==$m AND $yeark==$y) 
	 {
	     
        echo "<br>"; echo "<br>";echo "<br>";
?>
<form  name="form2" method="post" action="checklog3.php" >
<fieldset style="width:400" align="left">
<LEGEND><b> ΕΓΓΡΑΦΗ ΓΟΝΕΑ/ΚΗΔΕΜΟΝΑ </b></LEGEND> 
<br>
<table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td width="160">ΟΝΟΜΑ</td>
<td width="20">:</td>
<td width="194"><input required name="pname" type="text" id="pname"></td>
<td width="160">ΕΠΙΘΕΤΟ</td>
<td width="20">:</td>
<td width="194"><input required name="sname" type="text" id="sname"></td>
</tr>
<tr>
<td width="160">ΚΙΝΗΤΟ ΤΗΛΕΦΩΝΟ</td>
<td width="20">:</td>
<td width="194"><input required name="mobn" type="text" id="mobn" size="15"></td>
</tr>
<tr>
<td width="160">ΗΛ. ΤΑΧΥΔΡΟΜΕΙΟ</td>
<td width="20">:</td>
<td width="194"><input  name="email" type="text" id="email" size="30"></td>
</tr>
<tr>
<td width="160">ΝΕΟΣ ΚΩΔΙΚΟΣ</td>
<td width="20">:</td>
<td width="194"><input required name="newpass" type="password" id="newpass" size="15"></td>
<td width="160">ΕΠΙΒΕΒΑΙΩΣΗ ΚΩΔΙΚΟΥ</td>
<td width="20">:</td>
<td width="194"><input required name="confpass" type="password" id="confpass" size="15" ></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input name="passch" type="submit" value="Πατήστε για εγγραφή"></td>
</tr>
</table>
</fieldset>
</form>

<?php


}
else
{
	ECHO "ΛΑΘΟΣ ΗΜΕΡΟΜΗΝΙΑ ΓΕΝΝΗΣΗΣ";
    sleep(1);
    header( "Location: loginguest.php" );
}

 ?>
 <br /><br /><br />

</body>
</html>