-
-
Save MelkorNemesis/4229710 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function remove(id) {if (confirm("Jste si jisti?")) window.location = "primar.php?m=lekari&s=vymazat&i=" + id; } | |
</script> | |
<?php | |
$vys=mysql_query('SELECT * FROM osetrujici LEFT JOIN uvazek ON rodne_cislo LIKE osetrujici WHERE jmeno like "%'.$fjm.'%" AND prijmeni like "%'.$fpr.'%" | |
AND rodne_cislo like "%'.$fro.'%" AND (oddeleni LIKE "%'.$fod.'%" OR oddeleni IS NULL) AND active=true GROUP BY rodne_cislo ORDER BY prijmeni;'); | |
if ($vys==false) die('Invalid query: '.mysql_error()); | |
while ($row = mysql_fetch_row($vys)) { | |
if ($row[8] == NULL && strlen($fod)) continue; | |
$vys2 = mysql_query('SELECT oddeleni, GROUP_CONCAT(oddeleni) AS blbost FROM uvazek WHERE osetrujici = "'.$row[0].'" ORDER BY oddeleni;'); | |
if ($vys2==false) die('Invalid query: '.mysql_error()); | |
$odd = mysql_fetch_assoc($vys2); | |
echo '<tr> | |
<td>'.$row[2].'</td> | |
<td>'.$row[1].'</td> | |
<td>'.$row[0].'</td> | |
<td>'.$odd['blbost'].'</td> | |
<td style="width: 60"> | |
<a href="detail.php?i='.$row[0].'"><i class="icon-zoom-in"></i></a>  | |
<a href="#" onclick=remove("' . $row[0] . '");><i class="icon-remove"></i></a>  </td> | |
</tr> ' ; | |
// mysql_real_escape_string | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment