Разработка информационной системы заочного обучения, страница 31

</FONT>&nbsp;'.htmlspecialchars(stripslashes($myArray['message'])).'<hr>

</tr>';

}; echo'

<tr>    <td valign="top" width="172">

</table> </TD> <TD>

<IMG SRC="/images/medium_04_1.jpg" WIDTH=16 HEIGHT=100% ALT="">

</TD> <TD border=0 WIDTH=550 HEIGHT=100% valign=top>';

?>

index_admin_rasp.php:

<?php

@ session_start();

if (@$HTTP_SESSION_VARS['user']=="admin"){

@$db = mysql_pconnect('localhost','root','');

if (@$button=="УДАЛИТЬ"){

mysql_query("DELETE FROM `allgroup`.`rasp$spec` WHERE `data` = '$dat' LIMIT 1;");

};

if (@$button=="Сохранить изменения"){

mysql_query("UPDATE `allgroup`.`rasp$spec` SET `data`='$dat',`time1`='$time1',`name1`='$name1',`kab1`='$kab1',`time2`='$time2',`name2`='$name2',`kab2`='$kab2' WHERE CONVERT( `data` USING utf8 ) ='$dat' LIMIT 1");

};

if (@$add=="addOK" && $dat)

{

mysql_query("INSERT INTO `allgroup`.`rasp$spec` (`data`, `time1`, `name1`, `kab1`, `time2`, `name2`, `kab2`) VALUES ('$dat', '$time1', '$name1','$kab1', '$time2', '$name2','$kab2')");

};

include "../header.php";

include "menu_services.php";

$result = mysql_query("SELECT * FROM `allgroup`.vsespec");

$num = mysql_num_rows($result);

print '<FORM action="index_admin_rasp.php" method=post><select name="spec">';

if (@$spec) echo "<option>".$spec;

for ($i=0; $i<$num; $i++){

$myArray = mysql_fetch_array($result);

echo "<option>";

echo htmlspecialchars(stripslashes($myArray['spec']));

};

echo '</select><br><input type="submit" value="Посмотреть расписание"></form>';

if (@$spec) include "add_rasp.php";

include "../footer.php";}else include "reg_error.php";

?>

insert_plan.php:

<?php

@ session_start();

if (@$HTTP_SESSION_VARS['user']=="admin"){

@$db = mysql_pconnect('localhost','root','');

include "../header.php";

include "menu_stud.php";

include "add_stud_plan_menu2.php";

echo'<HR>';

$result = mysql_query("SELECT `p1_1`,`p1_2`,`p1_3` FROM `allgroup`.`$spec` WHERE CONVERT( `nomer` USING utf8 ) ='$nomer' LIMIT 1");

$myArray = mysql_fetch_array($result);

echo '<h3>Студент '.htmlspecialchars(stripslashes($myArray['p1_1'])).' '.htmlspecialchars(stripslashes($myArray['p1_2'])).' '.htmlspecialchars(stripslashes($myArray['p1_3']));

echo'<p><table ALIGN="left" border=0>';

for ($i=1;$i<=6;$i++){

echo '<form  action="add_stud_plan.php" method=post><tr><td>

<input type="hidden" NAME="nomer" VALUE="'.$nomer.'">

<input type="hidden" NAME="spec" VALUE="'.$spec.'">

<input type="hidden" NAME="kurs" VALUE="'.$i.'">

<input type="hidden" NAME="write" VALUE="OK">';

echo '<input type="submit" name="but" value="'.$i.'курс">';

echo '</td></tr></form>';}

echo '</table>';

include "../footer.php";}else include "reg_error.php";

?>

izm_plan.php:

<?php

session_start();

if (@$HTTP_SESSION_VARS['user']=="admin"){

include "../header.php";

include "add_plan_menu.php";

echo '</form>';

@$db = mysql_pconnect('localhost','root','');

if (@$save_izm="Сохранить изменения!"&&$p1){

@mysql_query("UPDATE `allgroup`.`kurs$kurs$vibor` SET `p1`='$p1',`p2`='$p2',`p1`='$p1',`p2`='$p2',`p3`='$p3',`p4`='$p4',`p5`='$p5',`p6`='$p6',`p7`='$p7',`p8`='$p8',`p9`='$p9',`p10`='$p10',`p11`='$p11',`p12`='$p12',`p13`='$p13',`p14`='$p14',`p15`='$p15',`p16`='$p16',`p17`='$p17',`p18`='$p18',`p19`='$p19' WHERE CONVERT( `p1` USING utf8 ) ='$p1' LIMIT 1");

}

$k=0;

echo '<table border=1 bordercolor="#aaaaaa" cellSpacing=0 cellPadding=0>