<?php
session_start();
$menu=$_SESSION['menu'];
//include $menu;
include "logo.php";
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
td.right1{text-align: right;}
input.right{  text-align:right;  }
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:14px; }
<p style="font-size:14px;"></p>
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(function() {
 $("#tmimaid").bind("change", function() {
     $.ajax({
         url: "change.php",
         data: "tmimaid="+$("#tmimaid").val(),
         success: function(html) {
             $("#nameid").html(html);
         }
     });
 }); 
});

function popupCenter(pageURL, title, w, h) {
    var left = (screen.width / 2)  - (w / 2);
    var top  = (screen.height / 2) - (h / 2);
    var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=800, height=900, top='+top+', left='+left);
}
</script>
</head>
<body>

<?php
require "dbconnect.php";
$mes='';
$subj='';
$usr=$_SESSION['usr'];
$sql=mysqli_query($con,"SELECT email,phone_number FROM parents WHERE username='$usr'");
$row=mysqli_fetch_array($sql);
$email=$row['email'];
$mob=$row['phone_number'];
?>
<form  method="post" > 
<fieldset style="width: 600px; ">
<legend>ΑΠΟΣΤΟΛΗ ΜΗΝΥΜΑΤΟΣ ΣΤΟΝ Δ/ΤΗ</legend>
<br >
<?php
echo "Θέμα : "."<input type='text' name='subj' value='$subj' size='60' >"."<br >";
echo "<br >";
echo "Μήνυμα : "."<br >";
echo "<textarea name='mes' cols='80' rows='15'> $mes </textarea >"."<br >";
?>
<br >
<h4>Για απάντηση αφείστε email και τηλέφωνο</h4>
<?php
echo "email : "."<input type='text' name='email' value='$email' size='30' > ";
echo "  Κινητό τηλ. : "."<input type='text' name='mob' value='$mob' size='12' >"."<br >";
?>
<br ><br >
<input type="Submit" name="Submit" value="Αποστολή Μηνύματος" >
<br >
</fieldset>
<br >
</form>	

<?php
if (isset($_POST['Submit'])) 
{

$mes=$_POST['mes'];
$subj=$_POST['subj'];
$email=$_POST['email'];
$mob=$_POST['mob'];

//sending message
$to      = 'tasost@cytanet.com.cy';
$subject = $subj;
$message = $mes;
$headers = 'From:'.$email . "\r\n" .
    'Reply-To:'.$email."\r\n" .
    'X-Mailer: PHP/' . phpversion();


mail($to, $subject, $message, $headers);

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

</body>
</html> 