-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudents_script.php
31 lines (21 loc) · 1.05 KB
/
students_script.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require "db_connection.php";
$class_id = "1а";
if(isset($_POST['class_id']) == TRUE)
$class_id = $_POST['class_id'];
$query = "select student_id, last_name, first_name, patronymic from students where class_id = '$class_id' order by last_name";
$result = mysql_query($query);
print("<div id = \"table\"><p id = \"Headliner\">Обучающиеся в $class_id классе</p>");
$cnt = 0;
while ($sql = mysql_fetch_array($result))
{
$cnt++;
$student_id = $sql['student_id'];
$last_name = $sql['last_name'];
$first_name = $sql['first_name'];
$patronymic = $sql['patronymic'];
print ("<div id=\"student\"><form method=\"post\" action=\"marks.php\"><button name=\"marks\" value=\"$student_id\">$cnt. $last_name $first_name $patronymic</button></form><form id=\"x_mark\" method=\"post\" action=\"delete_stud.php\"><button type=\"submit\" name=\"delete\" value=\"$student_id\">Удалить</button></form></div>");
}
print("</div>");
mysql_close();
?>