<?php
include "scrinit.php";
include $menu;
?><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:11px; }

.fieldset1
{
    width:900px;
	background: #F5F9F0;
	border:2px solid green;
    -moz-border-radius:4px;
    -webkit-border-radius:4px;	
    border-radius:4px;	
}
.fieldset2
{
    width:431px;
	background: #F0FFF0;
	border:2px solid green;
    -moz-border-radius:4px;
    -webkit-border-radius:4px;	
    border-radius:4px;	
}
.fieldset3
{
    width:500px;
	background: #F0FFF0;
	border:2px solid green;
    -moz-border-radius:4px;
    -webkit-border-radius:4px;	
    border-radius:4px;	
}
.fieldset4
{
    width:540px;
	background: #FFDAB9;
	border:2px solid green;
    -moz-border-radius:4px;
    -webkit-border-radius:4px;	
    border-radius:4px;	
}
.fieldset5
{
    width:165px;
	border:2px solid green;
    -moz-border-radius:4px;
    -webkit-border-radius:4px;	
    border-radius:4px;	
}
.fieldset6
{
    width:900px;
	background: #F0FFF0;
	border:2px solid green;
    -moz-border-radius:4px;
    -webkit-border-radius:4px;	
    border-radius:4px;	
}
.label1
{
display:inline-block;
width:95px;
margin-right:10px;
text-align:right;
}
.label2
{
display:inline-block;
width:150px;
margin-right:10px;
text-align:right;
}
</style>
<h3> ΕΙΔΙΚΗ ΑΓΩΓΗ </h2>
<?php
require "dbconnect.php";
$usr=$_SESSION['usr'];

if (isset($_POST['nameid'])) {$mitr=$_POST['nameid'];}

$sql = mysqli_query($con,"SELECT * FROM allstudentinfo WHERE mitroo='$mitr'  " );
$row = mysqli_fetch_array($sql);
$stname=$row['eponimo']." ".$row['onoma'];
$tmimaid=$row['tmima'];
$omp=$row['omp'];
$pateras=$row['pateras'];
$katpatera=$row['katpatera'];
$epapatera=$row['epapatera'];
$kpatera=$row['kpatera'];
$mitera=$row['mitera'];
$katmiteras=$row['katmiteras'];
$epamiteras=$row['epamiteras'];
$kmiteras=$row['kmiteras'];
$epokidemona=$row['epokidemona'];
$onokidemona=$row['onokidemona'];
$address=$row['address'];
$poli=$row['poli'];
$tk=$row['tk'];
$sms=$row['sms'];
$stathero=$row['sthathero'];
$ektopismenos=$row['ektopismenos'];
$birthplace=$row['birthplace'];
$birthday=$row['birthday'];
$nationality=$row['nationality'];
$religion=$row['religion'];
$stathero=$row['sthathero'];
$politekni=$row['politekni'];
$identity=$row['identity'];
$passport=$row['passport'];

?>
<fieldset fieldset class="fieldset1" disabled >
<legend> <?php echo "<b>".$stname." (".$mitr." )"."</b>"; ?> </legend>

<?php
$sql = $dbcon->prepare("SELECT v.voi_id,v.yt,t.Name FROM voithos as v,teachers as t WHERE v.Class_id=? AND v.voi_id=t.PMP");
$sql->execute([$tmimaid]);
$row=$sql->fetch(PDO::FETCH_ASSOC);
$vdname=$row['Name'];
$yt=$row['yt'];
$sql1 = mysqli_query($con,"SELECT Name FROM teachers WHERE PMP='$yt' " );
$row1 = mysqli_fetch_array($sql1);
$ytname=$row1['Name'];
?>
<br>
<label class="label1" >ΤΜΗΜΑ:</label><input type='text' size='4' value = "<?php echo $tmimaid; ?>" /><?php echo str_repeat("&nbsp",14);?>
&nbsp&nbsp&nbsp&nbspΟΜΠ/ΚΑΤΕΥΘΥΝΣΗ:<input type='text' size='4' value = "<?php echo $omp; ?>" /></p>
<label class="label1" > ΒΟΗΘΟΣ:</label><input type='text' size='20' value = "<?php echo $vdname; ?>" />
<label class="label1" > ΥΠΕΥΘΥΝΟΣ:</label><input type='text' size='20' value = "<?php echo $ytname; ?>" />

</p>

<?php
$sql = mysqli_query($con,"SELECT * FROM problimata WHERE mitroo='$mitr'  " );
$c=mysqli_num_rows($sql);
if ($c <> 0)
{
$row = mysqli_fetch_array($sql);
$problima=$row['problima'];
$stirixi=$row['stiriksi'];
$aporos=$row['aporos'];
$sxolio=$row['sxolia'];
$dief1=$row['dief1'];
$dief2=$row['dief2'];
$dief3=$row['dief3'];
$dief4=$row['dief4'];
$dief5=$row['dief5'];
$dief6=$row['dief6'];
}
$apalg=$stir=$pera=$pers=array();
$sql = mysqli_query($con,"SELECT * FROM apallagesm WHERE mitroo='$mitr'  " );
$c=mysqli_num_rows($sql);
if ($c > 0)
{
	$i=1;
	while($row=mysqli_fetch_array($sql))
	{
		$apalg[$i]=$row['mathima'];
		$pera[$i]=$row['per'];
		$i++;
	}
}
$sql = mysqli_query($con,"SELECT * FROM stiriksim WHERE mitroo='$mitr'  " );
$c=mysqli_num_rows($sql);
if ($c <> 0)
{
	$i=1;
	while($row=mysqli_fetch_array($sql))
	{
		$stir[$i]=$row['mathima'];
		$pers[$i]=$row['per'];
		$i++;
	}
}
?>
<label class="label1" >ΚΑΤΑΓΩΓΗ:</label><input type='text' name='birthplace' size='20' value = "<?php echo $birthplace; ?>" />
<label class="label1" >ΕΘΝΙΚΟΤΗΤΑ:</label><input type='text' name='nationality' size='20' value = "<?php echo $nationality; ?>" />
<label class="label1" >ΘΡΗΣΚΕΙΑ:</label><input type='text' name='religion' size='20' value = "<?php echo $religion; ?>" /></p>
<label class="label1" >ΗΜΕΡ. ΓΕΝΝΗΣΗΣ:</label><input type='text' name='birthday' size='20' value = "<?php echo $birthday; ?>" />  
<label class="label1" >ΤΑΥΤΟΤΗΤΑ:</label><input type='text' name='identity' size='20' value = "<?php echo $identity; ?>" />
<label class="label1" >ΔΙΑΒΑΤΗΡΙΟ:</label><input type='text' name='passport' size='20' value = "<?php echo $passport; ?>" /></p> 
<label class="label1" >ΠΟΛΚΝΟΣ/Η :</label><input type='text' name='politekni' size='3' value = "<?php if ($politekni==1){echo 'NAI';}else{echo 'OXI';} ?>" /><?php echo str_repeat("&nbsp",19);?>
&nbsp&nbsp&nbsp&nbspΕΚΤΟΠΙΣΜΕΝΟΣ:<input type='text' name='ektopismenos' size='20' value = "<?php echo $ektopismenos; ?>" /></p>
</fieldset>
<br>

<form  name="problems" action="problimata2.php" method="post" >
<?php
echo "<table>
<tr style='border:0px' bgcolor=#81DAF5 >
</tr>";
?>
<tr>
<td>

<fieldset fieldset class="fieldset3" >
<legend> <?php echo "<b>"."ΙΔΙΑΙΤΕΡΕΣ ΠΛΗΡΟΦΟΡΙΕΣ / ΠΡΟΒΛΗΜΑΤΑ"."</b>"; ?> </legend>
<table>
<tr>
<td>
ΠΕΡΙΓΡΑΦΗ:<br>
<textarea name='problima' rows="6" cols="60"><?php echo $problima; ?></textarea>
</td>
<td> </td>
<td> 
ΣΧΟΛΙΑ / ΕΝΕΡΓΕΙΕΣ:<br>
<textarea name='sxolio' rows="6" cols="60" > <?php echo $sxolio; ?></textarea>
</td>
</tr>
<tr><td colspan=2> <?php echo " ";?> <br></td></tr>
<tr>
<td colspan=2>
<b>ΑΠΟΡΟΣ :</b>
<Input type = 'Radio' Name ='aporos' value= '1' <?php if ($aporos==1) {echo "checked";}else{echo "";}?> >ΝΑΙ
<Input type = 'Radio' Name ='aporos' value= '0' <?php if ($aporos==0) {echo "checked";}else{echo "";}?> >OXI
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b>ΕΙΔΙΚΗ ΑΓΩΓΗ: </b>
<Input type = 'Radio' Name ='stirixi' value= '1' <?php if ($stirixi==1) {echo "checked";}else{echo "";}?> >ΝΑΙ
<Input type = 'Radio' Name ='stirixi' value= '0' <?php if ($stirixi==0) {echo "checked";}else{echo "";}?> >OXI
<br><br>
</td>
</tr>
</table>
</fieldset>

<tr>
<td>
<br>
<fieldset fieldset class="fieldset6" >
<legend> <?php echo "<b>"."ΑΠΑΛΛΑΓΕΣ-ΣΤΗΡΙΞΕΙΣ-ΔΙΕΥΚΟΛΥΝΣΕΙΣ"."</b>"; ?> </legend>
<table>
<tr>
<td>
<?php
echo "<table style='width:300px' class='myTable' >
<tr style='border:1px solid black' bgcolor='#66CC99' >
<th>Α/Α</th>
<th>ΑΠΑΛΛΑΓΗ/ΑΠΟΣΥΡΣΗ ΑΠΟ ΜΑΘΗΜΑ</th>
<th>ΠΕΡ.</th>
</tr>";
$i=1;
while($i<=5)
 {
 echo "<tr>";
 echo "<td>" .$i;
 //$pera[$i]=2;
 ?>
   <td>
  <select name="apallagi[]" >
  <option value='' > </option>
  <option value='ΓΥΜΝΑΣΤΙΚΗ ΕΝΔ.' <?php if($apalg[$i]=='ΓΥΜΝΑΣΤΙΚΗ ΕΝΔ.'){echo 'selected';}?> >ΓΥΜΝΑΣΤΙΚΗ ΕΝΔ.</option>   
  <option value='ΑΡΧΑΙΑ' <?php if($apalg[$i]=='ΑΡΧΑΙΑ'){echo 'selected';}?>>ΑΡΧΑΙΑ</option> 
  <option value='2η ΞΕΝΗ ΓΛΩΣΣΑ' <?php if($apalg[$i]=='2η ΞΕΝΗ ΓΛΩΣΣΑ'){echo 'selected';}?>>2η ΞΕΝΗ ΓΛΩΣΣΑ</option> 
  <option value='ΙΣΤΟΡΙΑ' <?php if($apalg[$i]=='ΙΣΤΟΡΙΑ'){echo 'selected';}?>>ΙΣΤΟΡΙΑ</option>
  <option value='ΦΥΣΙΚΗ' <?php if($apalg[$i]=='ΦΥΣΙΚΗ'){echo 'selected';}?>>ΦΥΣΙΚΗ</option> 
  <option value='ΘΡΗΣΚΕΥΤΙΚΑ' <?php if($apalg[$i]=='ΘΡΗΣΚΕΥΤΙΚΑ'){echo 'selected';}?>>ΘΡΗΣΚΕΥΤΙΚΑ</option> 
  <option value='ΤΕΧΝΟΛΟΓΙΑ' <?php if($apalg[$i]=='ΤΕΧΝΟΛΟΓΙΑ'){echo 'selected';}?>>ΤΕΧΝΟΛΟΓΙΑ</option>
  </select>
  <td><input type='text' name='perda[]'  size='4' value=<?php echo $pera[$i];?> ></td>
  <?php 
  echo "</tr>";
  $i++;
 }
echo "</table>";
?>

  
</td>
<td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp  </td>
<td>
<?php
echo "<table style='width:300px' class='myTable' >
<tr style='border:1px solid black' bgcolor='#66CC99' >
<th>Α/Α</th>
<th>ΜΑΘΗΜΑ ΣΤΗΡΙΞΗΣ</th>
<th>ΠΕΡ.</th>
</tr>";
$i=1;
while($i<=5)
 {
 echo "<tr>";
 echo "<td>" .$i;
 //$pers[$i]=1;
 ?>
 <td>
<select name="stiriksi[]" >
<option value='' > </option>
<option value='ΜΑΘΗΜΑΤΙΚΑ κκ' <?php if($stir[$i]=='ΜΑΘΗΜΑΤΙΚΑ κκ'){echo 'selected';}?> >ΜΑΘΗΜΑΤΙΚΑ κκ</option>
<option value='ΜΑΘΗΜΑΤΙΚΑ ΚΑΤ' <?php if($stir[$i]=='ΜΑΘΗΜΑΤΙΚΑ ΚΑΤ'){echo 'selected';}?>>ΜΑΘΗΜΑΤΙΚΑ ΚΑΤ</option>   
<option value='ΝΕΑ ΕΛΛΗΝΙΚΑ' <?php if($stir[$i]=='ΝΕΑ ΕΛΛΗΝΙΚΑ'){echo 'selected';}?>>ΝΕΑ ΕΛΛΗΝΙΚΑ</option> 
<option value='ΟΙΚΟΝΟΜΙΚΑ' <?php if($stir[$i]=='ΟΙΚΟΝΟΜΙΚΑ'){echo 'selected';}?>>ΟΙΚΟΝΟΜΙΚΑ</option> 
<option value='ΙΣΤΟΡΙΑ' <?php if($stir[$i]=='ΙΣΤΟΡΙΑ'){echo 'selected';}?>>ΙΣΤΟΡΙΑ</option>
<option value='ΑΓΓΛΙΚΑ' <?php if($stir[$i]=='ΑΓΓΛΙΚΑ'){echo 'selected';}?>>ΑΓΓΛΙΚΑ</option>
<option value='ΦΥΣΙΚΗ' <?php if($stir[$i]=='ΦΥΣΙΚΗ'){echo 'selected';}?>>ΦΥΣΙΚΗ</option>
<option value='ΧΗΜΕΙΑ' <?php if($stir[$i]=='ΧΗΜΕΙΑ'){echo 'selected';}?>>ΧΗΜΕΙΑ</option>
<option value='ΑΡΧΑΙΑ' <?php if($stir[$i]=='ΑΡΧΑΙΑ'){echo 'selected';}?>>ΑΡΧΑΙΑ</option>
</select>
<td><input type='text' name='persa[]'  size='4' value=<?php echo $pers[$i];?> ></td>
  <?php 
  echo "</tr>";
  $i++;
 }
echo "</table>";
?>
</td>
<td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp </td>
<td>
<b>ΔΙΕΥΚΟΛΥΝΣΕΙΣ:</b><br>
<label class="label2" >Επιπρόσθετος χρόνος:</label><input type='checkbox'  name='dief1' <?php if ($dief1==1) {echo "checked";}?> <?php echo $dief1;?> value="1"  /><br>
<label class="label2" >Ορθογραφία/Σύνταξη: </label><input type='checkbox'  name='dief2' <?php if ($dief2==2) {echo "checked";}?> <?php echo $dief2;?> value="2"  /><br>
<label class="label2" >Απλοποίηση δοκιμίου:</label><input type='checkbox'  name='dief3' <?php if ($dief3==3) {echo "checked";}?> <?php echo $dief3;?> value="3"  /><br>
<label class="label2" >Μεταγραφέας:        </label><input type='checkbox'  name='dief4' <?php if ($dief4==4) {echo "checked";}?> <?php echo $dief4;?> value="4"  /><br>
<label class="label2" >Έμφαση στα Προφορικά:</label><input type='checkbox'  name='dief5' <?php if ($dief5==5) {echo "checked";}?> <?php echo $dief5;?> value="5"/><br>
<label class="label2" >Μικρά διαλείμματα:</label><input type='checkbox'  name='dief6' <?php if ($dief6==5) {echo "checked";}?> <?php echo $dief6;?> value="6"  />
</td>
</tr>
</fieldset>
</table>
</tr>
</table>

<input type='hidden' name='c' value = "<?php echo $c; ?>" />
<input type='hidden' name='mitr' value = "<?php echo $mitr; ?>" />

<br>
<fieldset fieldset class="fieldset4"  >
<legend> <?php echo "<b>"."ΕΠΙΛΟΓΕΣ"."</b>"; ?> </legend>
<input type="submit" name="Submit" value="Καταχώρηση" >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type="button" value="Ραντεβού-Συνεντεύξεις" onclick="window.open('simvmeet1.php?m=<?php echo $mitr;?>','','width=900,height=900')" />
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="button" value="Στοιχεία Γονέα/Κηδεμόνα" onclick="window.open('simvmeet3.php?m=<?php echo $mitr;?>','ΣΤΟΙΧΕΙΑ ΚΗΔΕΜΟΝΑ','width=700,height=600')" />
</fieldset>
</form>	

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

</body>
</html>