| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /inetpub/wwwroot/icd/labs/ |
Upload File : |
<?php
/*
*************************************************************************************
** student.php
*************************************************************************************
*/
session_start(); // Εκκίνηση session.
header("Cache-control: private"); // Διόρθωση σφάλματος "cache control" για τον IE6.
/*
*************************************************************************************
** Εγκατάσταση καθολικών μεταβλητών και έλεγχος για το username και το password του
** χρήστη στη βάση δεδομένων.
*************************************************************************************
*/
$username = $_SESSION['username'];
$password = $_SESSION['password'];
$connection = mysqli_connect("localhost", "icd_labs", "t3!$3r") or die(mysqli_error());
mysqli_select_db($connection,"laboratories") or die(mysqli_error());
mysqli_set_charset($connection,"utf8");
mysqli_query($connection, "SET NAMES 'utf8'");
$sql = "select * from students where am= '$username' AND pass= '$password' ";
$result = mysqli_query($connection,$sql) or die(mysqli_error());
if(mysqli_num_rows($result))
{
$row = mysqli_fetch_array($result);
$_SESSION['epitheto'] = $row['epitheto'];
$_SESSION['onoma'] = $row['onoma'];
$_SESSION['etos_eis'] = $row['etos_eis'];
$_SESSION['email'] = $row['email'];
$_SESSION['eksamino'] = $row['eksamino'];
/*
*************************************************************************************
** Αν ο χρήστης υπάρχει εμφανίζονται οι πληροφορίες που τον αφορούν σύμφωνα με τα
** εργαστήρια που έχει επιλέξει μέχρι τώρα καθώς επίσης του δίνεται και η δυνατότητα
** να καταχωρηθεί σε ένα καινούριο έργαστήριο ή να διαγράψει μία του επιλογή.
*************************************************************************************
*/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>E-LABS - ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ ΠΛΗΡΟΦΟΡΙΚΗΣ, ΥΠΟΛΟΓΙΣΤΩΝ ΚΑΙ ΤΗΛΕΠΙΚΟΙΝΩΝΙΩΝ - ΔΙΠΑΕ</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<style type="text/css">
<!--
body {
background-image: url(pics/back.gif);
}
.style5 {color: #191919; font-weight: bold; }
.style6 {
font-size: 14px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #FF0000;
}
a:link {
color: #0000CC;
text-decoration: underline;
}
a:visited {
color: #0000CC;
text-decoration: underline;
}
a:hover {
color: #FFFFFF;
text-decoration: none;
}
a:active {
text-decoration: underline;
}
.style7 {
color: #003300;
font-weight: bold;
}
.style9 {
font-size: 14px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #009900;
}
-->
</style></head>
<body>
<div align="left">
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="150" colspan="6" valign="top"><img src="pics/index_up.jpg" width="1000" height="150"></td>
<td width="4"> </td>
</tr>
<tr>
<td height="2" colspan="6" valign="top"><img src="pics/horizontal_bar.gif" width="1000" height="2"></td>
<td></td>
</tr>
<tr>
<td width="10" height="19"> </td>
<td width="502" valign="top"><div align="left" class="style7">Συνδεδεμένος Χρήστης: <?php echo $_SESSION['epitheto']; echo " "; echo $_SESSION['onoma']; ?> </div></td>
<td width="292"> </td>
<td width="105" valign="top"><div align="right"><span class="style7"><a href="logout.php">Logout</a></span></div></td>
<td width="101"> </td>
<td width="19"> </td>
<td></td>
</tr>
<tr>
<td height="2" colspan="6" valign="top"><img src="pics/horizontal_bar.gif" width="1000" height="2"></td>
<td></td>
</tr>
<tr>
<td height="13"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="135"></td>
<td colspan="4" valign="top">
<table border=9 width="1000">
<tr>
<td colspan="7" align="center"><span class="style9">ΗΔΗ ΚΑΤΑΧΩΡΗΜΕΝΑ ΕΡΓΑΣΤΗΡΙΑ</span></td>
</tr>
<?php
$max_cols=0;
$connection = mysqli_connect("localhost", "icd_labs", "t3!$3r") or die(mysqli_error());
mysqli_select_db($connection,"laboratories") or die(mysqli_error());
mysqli_set_charset($connection,"utf8");
mysqli_query($connection, "SET NAMES 'utf8'");
$sql_choices = "select * from choices where am= '$username'";
$result_choices = mysqli_query($connection,$sql_choices) or die(mysqli_error());
/*
*************************************************************************************
** Έλεγχος για ήδη καταχωρημένα εργαστηριακά μαθήματα από τον σπουδαστή ή όχι.
*************************************************************************************
*/
if(!mysqli_num_rows($result_choices))
{
?>
<tr>
<td colspan="7" align="center"><span class="style5">Δεν έχετε καταχωρηθεί ακόμα σε κανένα εργαστήριο.</span></td>
</tr>
<?php
}
/*
*************************************************************************************
** Εμφάνιση των ήδη καταχωρημένων επιλογών του σπουδαστή για κάθε εργαστηριακό
** μάθημα σύμφωνα με τις επιλογές που έχει κάνει ο σπουδαστής.
*************************************************************************************
*/
else
{
$num_rows_result_choices = mysqli_num_rows($result_choices);
while($row_choices=mysqli_fetch_array($result_choices))
{
$connection = mysqli_connect("localhost", "icd_labs", "t3!$3r") or die(mysqli_error());
mysqli_select_db($connection,"laboratories") or die(mysqli_error());
mysqli_set_charset($connection,"utf8");
mysqli_query($connection, "SET NAMES 'utf8'");
$sql_count_cols = "select * from labs where lesson_name= '$row_choices[lesson_name]'";
$result_count_cols = mysqli_query($connection,$sql_count_cols) or die(mysqli_error());
if(mysqli_num_rows($result_count_cols)>$max_cols)
{
$max_cols = mysqli_num_rows($result_count_cols);
}
}
?>
<tr>
<td><span class="style5">Εργαστήριο</span></td>
<?php
for($i=0;$i<$max_cols;$i++)
{
?>
<td span class="style5"> <?php echo "Επιλογή "; echo $i+1; ?> </span></td>
<?php
}
?>
</tr>
<?php
$connection = mysqli_connect("localhost", "icd_labs", "t3!$3r") or die(mysqli_error());
mysqli_select_db($connection,"laboratories") or die(mysqli_error());
mysqli_set_charset($connection,"utf8");
mysqli_query($connection, "SET NAMES 'utf8'");
$sql_choices = "select * from choices where am= '$username'";
$result_choices = mysqli_query($connection,$sql_choices) or die(mysqli_error());
while($row_choices=mysqli_fetch_array($result_choices))
{
$cho[1] = $row_choices[ch1];
$cho[2] = $row_choices[ch2];
$cho[3] = $row_choices[ch3];
$cho[4] = $row_choices[ch4];
$cho[5] = $row_choices[ch5];
$cho[6] = $row_choices[ch6];
$cho[7] = $row_choices[ch7];
$cho[8] = $row_choices[ch8];
$cho[9] = $row_choices[ch9];
$cho[10] = $row_choices[ch10];
$cho[11] = $row_choices[ch11];
$cho[12] = $row_choices[ch12];
$connection = mysqli_connect("localhost", "icd_labs", "t3!$3r") or die(mysqli_error());
mysqli_select_db($connection,"laboratories") or die(mysqli_error());
mysqli_set_charset($connection,"utf8");
mysqli_query($connection, "SET NAMES 'utf8'");
$sql_count_cols = "select * from labs where lesson_name= '$row_choices[lesson_name]'";
$result_count_cols = mysqli_query($connection,$sql_count_cols) or die(mysqli_error());
$cur_cols = mysqli_num_rows($result_count_cols);
$i=1;
while($row_count_cols=mysqli_fetch_array($result_count_cols))
{
$c_day[$i] = $row_count_cols[day];
$c_time_start[$i] = $row_count_cols[time_start];
$c_time_end[$i] = $row_count_cols[time_end];
$i++;
}
?>
<tr>
<td><span class="style5"> <?php echo $row_choices[lesson_name]; ?> </span></td>
<?php
for($k=1;$k<=$cur_cols;$k++)
{
$j=1;
while($j<=$cur_cols)
{
if($cho[$j]==$k)
{
switch($j){
case 1:
?><td><span class="style5"> <?php echo "$c_day[1]: $c_time_start[1]-$c_time_end[1]"; ?> </span></td><?php
break;
case 2:
?><td><span class="style5"> <?php echo "$c_day[2]: $c_time_start[2]-$c_time_end[2]"; ?> </span></td><?php
break;
case 3:
?><td><span class="style5"> <?php echo "$c_day[3]: $c_time_start[3]-$c_time_end[3]"; ?> </span></td><?php
break;
case 4:
?><td><span class="style5"> <?php echo "$c_day[4]: $c_time_start[4]-$c_time_end[4]"; ?> </span></td><?php
break;
case 5:
?><td><span class="style5"> <?php echo "$c_day[5]: $c_time_start[5]-$c_time_end[5]"; ?> </span></td><?php
break;
case 6:
?><td><span class="style5"> <?php echo "$c_day[6]: $c_time_start[6]-$c_time_end[6]"; ?> </span></td><?php
break;
case 7:
?><td><span class="style5"> <?php echo "$c_day[7]: $c_time_start[7]-$c_time_end[7]"; ?> </span></td><?php
break;
case 8:
?><td><span class="style5"> <?php echo "$c_day[8]: $c_time_start[8]-$c_time_end[8]"; ?> </span></td><?php
break;
case 9:
?><td><span class="style5"> <?php echo "$c_day[9]: $c_time_start[9]-$c_time_end[9]"; ?> </span></td><?php
break;
case 10:
?><td><span class="style5"> <?php echo "$c_day[10]: $c_time_start[10]-$c_time_end[10]"; ?> </span></td><?php
break;
case 11:
?><td><span class="style5"> <?php echo "$c_day[11]: $c_time_start[11]-$c_time_end[11]"; ?> </span></td><?php
break;
case 12:
?><td><span class="style5"> <?php echo "$c_day[12]: $c_time_start[12]-$c_time_end[12]"; ?> </span></td><?php
break;
}
}
$j++;
}
}
?>
</tr>
<?php
}
}
?>
</table>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td height="15"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="73"> </td>
<td colspan="4" valign="top">
<form action=insert_choice.php method=post>
<table border=9>
<!--DWLayoutTable-->
<tr>
<td height="21" colspan="3" align="center" valign="top"><span class="style9">ΚΑΤΑΧΩΡΗΣΗ ΝΕΟΥ ΕΡΓΑΣΤΗΡΙΟΥ</span></td>
</tr>
<tr>
<td width="217" height="28"><span class="style5">Τίτλος Μαθήματος:</span></td>
<td>
<select name="lesson">
<?php
/*
*************************************************************************************
** Εμφάνιση εργαστηρίων στα οποία είναι εφικτό να γίνει καταχώρηση από τον σπουδαστή.
*************************************************************************************
*/
$connection_lesson = mysqli_connect("localhost", "icd_labs", "t3!$3r") or die(mysqli_error());
mysqli_select_db($connection_lesson,"laboratories") or die(mysqli_error());
mysqli_set_charset($connection_lesson,"utf8");
mysqli_query($connection_lesson, "SET NAMES 'utf8'");
$sql_lesson = "SELECT * FROM lessons ";
$result_lesson = mysqli_query($connection_lesson,$sql_lesson) or die(mysqli_error());
while($row_lesson = mysqli_fetch_array($result_lesson))
{
?>
<option value = " <?php echo $row_lesson[lesson_name]; ?> "> <?php echo $row_lesson[lesson_name]; ?> </option>
<?php
}
?>
</select>
</td>
<td><input type="submit" value="ΚΑΤΑΧΩΡΗΣΗ"></td>
</tr>
</table>
</form></td>
<td> </td>
<td></td>
</tr>
<tr>
<td height="22"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td></td>
<td></td>
</tr>
<tr>
<td height="110"> </td>
<td colspan="4" valign="top">
<form action=delete_choice.php method=post>
<table border=9>
<tr>
<td height="21" colspan="3" align="center" valign="top"><span class="style9">ΔΙΑΓΡΑΦΗ ΕΠΙΛΟΓΩΝ ΕΡΓΑΣΤΗΡΙΟΥ</span></td>
</tr>
<tr>
<td width="217" height="28"><span class="style5">Τίτλος Μαθήματος:</span></td>
<td>
<select name="delete">
<?php
/*
*************************************************************************************
** Εμφάνιση εργαστηρίων στα οποία είναι εφικτό να γίνει διαγραφή καταχώρησης από τον
** σπουδαστή.
*************************************************************************************
*/
$connection_delete = mysqli_connect("localhost", "icd_labs", "t3!$3r") or die(mysqli_error());
mysqli_select_db($connection_delete,"laboratories") or die(mysqli_error());
mysqli_set_charset($connection_delete,"utf8");
mysqli_query($connection_delete, "SET NAMES 'utf8'");
$sql_lesson_delete = "SELECT * FROM choices WHERE am='$username' ";
$result_lesson_delete = mysqli_query($connection_lesson,$sql_lesson_delete) or die(mysqli_error());
while($row_lesson_delete = mysqli_fetch_array($result_lesson_delete))
{
?>
<option value = "<?php echo $row_lesson_delete[lesson_name]; ?>"> <?php echo $row_lesson_delete[lesson_name]; ?> </option>
<?php
}
?>
</select>
</td>
<td><input type="submit" value="ΔΙΑΓΡΑΦΗ"></td>
</tr>
</table>
</form></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="21"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td></td>
<td></td>
</tr>
<tr>
<td height="12"></td>
<td colspan="4" valign="top"><div align="left"><span class="style6">Προσοχή! Σε περίπτωση που θέλετε να αλλάξετε τις επιλογές σας για ένα μάθημα πρέπει πρώτα να τις διαγράψετε και έπειτα να τις επανακαταχωρήσετε!!! </span></div></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="409"></td>
<td> </td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
</body>
</html>
<?php
}
/*
*************************************************************************************
** Σε περίπτωση που τα στοιχεία που καταχωρήθηκαν από τον χρήστη είναι εσφαλμέ-
** να, εμφανίζεται μήνυμα όπου και τον ενημερώνει.
*************************************************************************************
*/
else
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>E-LABS - ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ ΠΛΗΡΟΦΟΡΙΚΗΣ, ΥΠΟΛΟΓΙΣΤΩΝ ΚΑΙ ΤΗΛΕΠΙΚΟΙΝΩΝΙΩΝ - ΔΙΠΑΕ</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<META HTTP-EQUIV="Refresh" CONTENT="7; URL=index.php">
<style type="text/css">
<!--
body {
background-image: url(pics/back.gif);
}
-->
</style></head>
<body>
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="150" colspan="3" valign="top"><img src="pics/index_up.jpg" width="1000" height="150"></td>
<td width="4"> </td>
</tr>
<tr>
<td width="55" height="119"> </td>
<td width="826" valign="top"><?php
print "Τα δεδομένα που καταχωρήσατε δεν είναι σωστά. Σε λίγα δευτορόλεπτα θα μεταβείτε αυτόματα στην αρχική σελίδα για να προσπαθήσετε να επανασυνδεθείτε.";
exit;
?></td>
<td width="119"> </td>
<td> </td>
</tr>
<tr>
<td height="496"> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
<?php
}
/*
*************************************************************************************
** Developed by Petrellis Manolis.
*************************************************************************************
*/
?>