<?php
session_start();
$menu = $_SESSION['menu'];
if ($_SESSION['islogin']=='' ) { 
  echo "ΠΡΕΠΕΙ ΝΑ ΕΓΓΡΑΦΕΙΤΕ ΓΙΑ ΝΑ ΧΡΗΣΙΜΟΠΟΙΗΣΕΤΕ ΤΟ ΣΥΣΤΗΜΑ"."<BR>";
  sleep(3);
  header("Location: loginguest.php"); /* Redirect browser */
  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>

<?php
include "dbconnect.php";
$usr=$_SESSION['usr'];


$sql=mysqli_query($con, "SELECT * FROM parents where username='$usr'");
if (mysqli_num_rows($sql)>0)
{
	$row=mysqli_fetch_array($sql);
    $pn = $row['name'];
	$ar=explode(" ",$pn);
	$pname=$ar[0];$sname=$ar[1];
    $mobn = $row['phone_number'];
    $email = $row['email'];

?>
<form  name="form3" method="POST" action="parentinfoin.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="sname" type="text" id="sname" value=<?php echo $sname; ?> ></td>
<td width="160">ΕΠΙΘΕΤΟ</td>
<td width="20">:</td>
<td width="194"><input required name="pname" type="text" id="pname" value=<?php echo $pname; ?>></td>
</tr>
<tr>
<td width="160">ΚΙΝΗΤΟ ΤΗΛΕΦΩΝΟ</td>
<td width="20">:</td>
<td width="194"><input required name="mobn" type="text"  size="15" value=<?php echo $mobn; ?> ></td>
</tr>
<tr>
<td width="160">ΗΛ. ΤΑΧΥΔΡΟΜΕΙΟ</td>
<td width="20">:</td>
<td width="194"><input  name="email" type="text" size="30" value=<?php echo $email; ?> ></td>
</tr>

<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input name="passch1" type="submit" value="Πατήστε για αλλαγή στοιχείων"></td>
</tr>
</table>
</fieldset>
</form>

<?php

}
 ?>
 <br /><br /><br />
<a  href=<?php echo $menu;?> style="color:blue "  > <button> Επιστροφή στο Μενού   </a> 

</body>
</html>