<?php
include "scrinit.php";
include "logo1.php";
date_default_timezone_set("Europe/Athens");

?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<script type="text/javascript" src="js/jquery-1.11.3-jquery.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<style>
.fset
{
    width:600px;
	background: #F5F9F0;
	border:2px solid green;
    -moz-border-radius:8px;
    -webkit-border-radius:8px;	
    border-radius:8px;	
}
.label1
{
display:inline-block;
width:150px;
margin-right:10px;
text-align:right;
}
.label2
{
display:inline-block;
width:130px;
margin-right:10px;
text-align:right;
}
.button {
  display: inline-block;
  padding: 8px 20px;
  font-size: 18px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  outline: none;
  color: #fff;
  background-color: #4CAF50;
  border: none;
  border-radius: 10px;
  box-shadow: 0 9px #999;
}

.button:hover {background-color: #D4AC0D}

.button:active {
  background-color: #3e8e41;
  box-shadow: 0 3px #666;
  transform: translateY(2px);
}

</style>
</head>
<body>

<?php
include "dbconnect.php";
$usr=$_SESSION['usr'];
$sql=mysqli_query($con, "SELECT distinct tmima from allstudentinfo WHERE tmima like 'Γ%' order by tmima");
$path1 = 'foto/'; 
$path = 'uploads/';
while ($row=mysqli_fetch_array($sql))
{
	
	$path1 = 'foto/'; 
	$path = 'uploads/';
	$tm=$row['tmima'];
	$dirname = $path1.$tm;
	if (!is_dir($dirname))
	{
    	mkdir($dirname);
	}

	$sqlx=mysqli_query($con, "SELECT mitroo,eponimo,onoma from allstudentinfo WHERE tmima='$tm' order by eponimo,onoma ");
	while ($rowx=mysqli_fetch_array($sqlx))
	{
		$path1 = 'foto/'.$tm.'/'; 
		$path = 'uploads/';
		$mitroo=$rowx['mitroo'];
		$name=$rowx['eponimo']." ".$row['onoma'];
		$imgf = $mitroo.'.jpg'; 	
		$path = $path.$imgf;
		$path1 = $path1.$imgf;
		echo $path." ".$path1;
		copy($path, $path1);

	}

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

</html>