Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ?>
- <!DOCTYPE HTML>
- <html lang="pl">
- <head>
- <meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
- <title>Przychodnia - baza lekarzy</title>
- </head>
- <body>
- <table width="1000" align="center" border="1" bordercolor="#d5d5d5" cellpadding="0" cellspacing="0">
- <tr>
- <?php
- ini_set("display_errors", 0);
- require_once "dbconnect.php";
- $polaczenie = mysqli_connect($host, $user, $password);
- mysqli_query($polaczenie, "SET CHARSET utf8");
- mysqli_query($polaczenie, "SET NAMES 'utf8' COLLATE 'utf8_polish_ci'");
- mysqli_select_db($polaczenie, $database);
- $zapytanietxt = file_get_contents("dodajpacjenta.txt");
- $rezultat = mysqli_query($polaczenie, $zapytanietxt);
- $ile = mysqli_num_rows($rezultat);
- echo "znaleziono: ".$ile;
- $usun = "DELETE FROM przychodnia WHERE idlekarza=1";
- $rezultat2 = mysqli_query($polaczenie, $zapytanietxt);
- if ($ile>=1)
- {
- echo<<<END
- <td width="50" align="center" bgcolor="e5e5e5">ID Lekarza</td>
- <td width="100" align="center" bgcolor="e5e5e5">Imie</td>
- <td width="100" align="center" bgcolor="e5e5e5">Nazwisko</td>
- <td width="100" align="center" bgcolor="e5e5e5">Specjalizacja</td>
- </tr><tr>
- END;
- }
- for ($i = 1; $i <= $ile; $i++)
- {
- $row = mysqli_fetch_assoc($rezultat);
- $a1 = $row['idlekarza'];
- $a2 = $row['imie'];
- $a3 = $row['nazwisko'];
- $a4 = $row['specjalizacja'];
- echo<<<END
- <td width="50" align="center">$a1</td>
- <td width="100" align="center">$a2</td>
- <td width="100" align="center">$a3</td>
- <td width="100" align="center">$a4</td>
- <td width="100" align="center" bgcolor="e5e5e5"></form>
- <a href="delete.php?del=<?php echo $idlekarza; ?>" onclick ="return confirm('Are you sure?');"> Delete </a>
- </form></td>
- </tr><tr>
- END;
- }
- ?>
- </tr></table>
- </body>
- </html>
Add Comment
Please, Sign In to add comment