<?php
include "scrinit.php";
include $menu;
?>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">

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=900, height=300, top='+top+', left='+left);
}

function calculateTotal()
{
   var theForm = document.forms["theform"];
    //Get a reference to the TextBox
    var q = theForm.elements["pr"];
    var tot =0;
    //If the textbox is not blank
    if(q.value!="")
    {
        tot = parseInt(quantity.value);
    }
return howmany;alert("Να επιλέξετε μόνο 1 μάθημα");
}
</script>


<style type="text/css">
input.right{  text-align:right;  }
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:10pt; }
</style>
</head>
<body>

<br><h3> ΑΞΙΟΛΟΓΗΣΗ ΜΑΘΗΜΑΤΟΣ </h3>
<?php
require "dbconnect.php"; 
$dt=$_SESSION['dt'];
$name = $_SESSION['n'];
$usr=$_SESSION['usr'];
$access=$_SESSION['access'];
echo "<b>"." ΗΜΕΡΟΜΗΝΙΑ : "."</b>".$dt."<br>";
$p1=30;
$p2=30;

If (isset($_POST['pososta']))
{
	$p1=$_POST['p1'];
	$p2=$_POST['p2'];
	$p3=$_POST['p3'];
	$p4=$_POST['p4'];
}
echo "<br>";
echo "ΑΞΙΟΛΟΓΗΣΗ ΚΑΘΗΓΗΤΗ: 60% ΤΟΥ ΤΕΛΙΚΟΥ ΒΑΘΜΟΥ"."<br>";
?>
<form method='post'>
<p>ΔΙΑΓΩΝΙΣΜΑΤΑ:<input type='text'  name='p1' value='<?php echo $p1; ?>' min=0 max=60 size='3'></p>
<p>ΠΡΟΦΟΡΙΚΟΣ:&nbsp;&nbsp;&nbsp;&nbsp;<input type='text'  name='p2' value='<?php echo $p2; ?>' min=0 max=60 size='3'></p>
<p>ΚΑΤ'ΟΙΚΟΝ:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text'  name='p3' value='<?php echo $p3; ?>' min=0 max=60 size='3'></p>
<p>ΣΥΜΜΕΤΟΧΗ:&nbsp;&nbsp;&nbsp;&nbsp;<input type='text'  name='p4' value='<?php echo $p4; ?>' min=0 max=60 size='3'></p>
<br>
<input type="submit" name="pososta" value="Καταχώριση Ποσοστών" >
</form>

<?php
$q=mysqli_query($con,"select * from kodikoimathimatos where pmp='$usr' and kodikos IN (select subject from aksinfo)");
echo "<table class='myTable' >";
if ($kod[i]=='Νέα')
{
	echo "<tr style='border:1px solid black' bgcolor='#d6ff73' >
   <th >Α/Α</th>
   <th>ΚΩΔ ΜΑΘΗΜ.</th>
   <th>ΜΑΘΗΜΑ</th>
   <th>ΛΟΓΟΤΕΧΝΙΑ</th>
   <th>ΕΚΘΕΣΗ</th>
   <th>ΑΓΝΩΣΤΟ</th>
   <th>ΠΡΟΦΟΡΙΚΗ ΑΞΙΟΛ</th>
   <th></th>
   <th>Κατ οίκον εργασία</th>
   <th>Συμμετοχή</th>
   <th></th>
   <th>Ατομική Πρόοδος</th>
   <th>Εξωδιδακτικές Δρ.</th>
   <th>Εργαστήριο</th>
   <th>Εργασία-project<th>
   </tr>";
}
else
{
echo "<tr style='border:1px solid black' bgcolor='#d6ff73' >
   <th>Α/Α</th>
   <th>ΚΩΔ ΜΑΘΗΜ.</th>
   <th>ΜΑΘΗΜΑ</th>
   <th>ΓΡΑΠΤH ΑΞΙΟΛΟΓ</th>
   <th>ΠΡΟΦΟΡΙΚΗ ΑΞΙΟΛ</th>
   <th></th>
   <th>Κατ οίκον εργασία</th>
   <th>Συμμετοχή</th>
   <th></th>
   <th>Ατομική Πρόοδος</th>
   <th>Εξωδιδακτικές Δρ.</th>
   <th>Εργαστήριο</th>
   <th>Εργασία-project<th>
   </tr>";
}

?>
<form method='post'>
<?php    
$i=1;
while ($row=mysqli_fetch_array($q)) 
{
	$tp=$row['mathima'];
	$kod=$row['kodikos'];
    echo "<tr>";
	echo "<td>" .$i."</td>";
	echo "<td>" .$tp."</td>";
	echo "<td>" .$kod."</td>";
    echo "<td align='center'>". "<input class='right' type='text'  name='p1[$i]' value='$p1' min=0 max=100 size='3'>"."</td>";
	echo "<td align='center'>". "<input class='right' type='text'  name='p2[$i]' value='$p2' min=0 max=100 size='3'>"."</td>";
	echo "<td></td>";
	echo "<td align='center'>". "<input class='right' type='text'  name='p3[$i]' value='$p3' min=0 max=100 size='3'>"."</td>";
	echo "<td align='center'>". "<input class='right' type='text'  name='p4[$i]' value='$p4' min=0 max=100 size='3'>"."</td>";
    echo "<td></td>";
	echo "<td align='center'>". "<input class='right' type='text'  name='ppro3[$i]' value='$ppro3' min=0 max=100 size='3'>"."</td>";
	echo "<td align='center'>". "<input class='right' type='text'  name='ppro4[$i]' value='$ppro4' min=0 max=100 size='3'>"."</td>";
	echo "<td align='center'>". "<input class='right' type='text'  name='ppro5[$i]' value='$ppro5' min=0 max=100 size='3'>"."</td>";
	echo "<td align='center'>". "<input class='right' type='text'  name='ppro6[$i]' value='$ppro6' min=0 max=100 size='3'>"."</td>";
   $i++;
   }
 echo "</tr>";
echo "</table>"; 
   
?>
<input type="submit" name="subper" value="Καταχώριση Ποσοστών" >
</form>

<?php
If (isset($_POST['mathsub']))
{
   $subj=ltrim($_POST['mathsub']);
   echo "<br>"."ΜΑΘΗΜΑ: ".$subj."<br>";  
   $result = mysqli_query($con,"SELECT * FROM aksiologiseis WHERE BINARY ltrim(subject)='$subj'  " ); 
   $c = mysqli_num_rows($result);
   if ($c == 0)
   {
	 $result=mysqli_query($con,"select * from aksiologiseis where BINARY subject='ΟΛΑ'");   
   }
  ?>
 <form method='post' name='theform' id='theform'> 
 <?php

If (isset($_POST['subper']))
{
   $percent=$_POST['pr'];
    foreach ($pr as $p){ 		  
	echo "<br>"."ΜΑΘΗΜΑ: ".$p."<br>";}	
}

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

</body>
</html>