Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
3-4 - 3 вар.doc
Скачиваний:
0
Добавлен:
01.05.2025
Размер:
379.39 Кб
Скачать

Include "config.Php";

// Выполняем SQL-запрос

$ath = mysql_query("SELECT * FROM table2");

// Проверяем успешность выполнения SQL-запроса

if(!$ath) exit(mysql_error());

// Определяем таблицу и заголовок

if (mysql_num_rows ($ath) == 0)

{

echo ("<center><font color='black' style='font-family:Times New Roman' size=4><b>Данных нет!!!</b></font><br>");

}

else {

echo ("<center><h3>Таблица 2</h3></center>

<center><table border=1 bordercolor='black' cellpadding='4' cellspacing='4' style='border-collapse: collapse'><tr>

<td valign='center' align='center' width=40 bgcolor=#c8c8c8><font color='black' style='font-family:Times New Roman' size=3><center><b>ФИО пассажира</b></font></i></td>

<td valign='center' align='center' bgcolor=#c8c8c8><font color='black' style='font-family:Times New Roman' size=3><center><b>Шифр паспорта</b></font></i></td>

<td valign='center' align=center bgcolor=#c8c8c8><font color='black' style='font-family:Times New Roman' size=3><center><b>Пол пассажира</b></font></i></td>

<td valign='center' align=center bgcolor=#c8c8c8><font color='black' style='font-family:Times New Roman' size=3><center><b>Номер рейса</b></font></td>

<td valign='center' align=center bgcolor=#c8c8c8><font color='black' style='font-family:Times New Roman' size=3><center><b>Дата и время вылета</b></font></td>

<td valign='center' align=center bgcolor=#c8c8c8><font color='black' style='font-family:Times New Roman' size=3><center><b>Действия</b></font></td>

</tr>

");

while($user = mysql_fetch_array($ath))

{

echo ("<tr>

<td><font color='black' size=3><center>".$user['fio']."</td>

<td><font color='black' size=3><center>".$user['shifr']."</td>

<td><font color='black' size=3><center>".$user['pol']."</td>

<td><font color='black' size=3><center>".$user['n_reisa']."</td>

<td><font color='black' size=3><center>".$user['datavrem']."</td>

<td>

<table border=0 cellpadding='0'><tr><td width=100>

<form style='margin:2' action=lab3_r_t2.php method=POST>

<input name=idredact type=hidden value='".$user['id']."'>

<input name=fio type=hidden value=".$user['fio'].">

<input name=shifr type=hidden value=".$user['shifr'].">

<input name=pol type=hidden value=".$user['pol'].">

<input name=n_reisa type=hidden value=".$user['n_reisa'].">

<input name=datavrem type=hidden value=".$user['datavrem'].">

<input type=submit class='submit' value=Редактировать style='background-color:white; font-family:Times New Roman;color:black;font-size:14px;width=108'>

</form></td>

<td>

<table border=0 cellpadding='0'><tr><td width=100>

<form style='margin:2' action=lab3_u.php method=POST>

<input name=idredact type=hidden value=".$user['id'].">

<input name=table type=hidden value='table2'>

<input type=submit class='submit' value=Удалить style='background-color:white; font-family:Times New Roman;color:black;font-size:14px;width=108'>

</form></td></tr></table>

</td></tr></table>

");

}

echo ("</table><br><form action=lab3_report_excel_2.php method=post>

<input type=submit class='submit' style='background-color:white; font-family:Times New Roman;color:black;font-size:14px' value='XLS'></form>

");}?>