0
|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
2 |
<html>
|
|
3 |
<head>
|
|
4 |
<title>Consulta de telčfons: Resultats de la cerca</title>
|
|
5 |
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
6 |
</head>
|
|
7 |
|
|
8 |
<body>
|
|
9 |
|
|
10 |
<h1 align=center>Agenda de telčfons</h1>
|
|
11 |
<h2>Resultat de la cerca</h2>
|
|
12 |
|
|
13 |
<p>Resultats a la base de dades <STRONG>
|
|
14 |
<?php
|
|
15 |
switch($_POST["db_selected"])
|
|
16 |
{
|
|
17 |
case "phones": echo "Telčfons del Mňbil"; break;
|
|
18 |
case "phones_olot": echo "Telčfons d'Olot"; break;
|
|
19 |
}
|
|
20 |
?> </STRONG>: </p>
|
|
21 |
|
|
22 |
<TABLE BORDER=1>
|
|
23 |
<TR>
|
|
24 |
<TH>Nom
|
|
25 |
<TH>Telčfon
|
|
26 |
<TH>Descripció
|
|
27 |
|
|
28 |
<?php
|
|
29 |
$connexio = mysql_connect("localhost", "viric_consultant", "potato");
|
|
30 |
mysql_select_db("viric",$connexio);
|
|
31 |
$resultat = mysql_query("SELECT * FROM " . $_POST["db_selected"] . " WHERE (nom LIKE '%" . $_POST["nom"] . "%' OR descripcio LIKE '%" .$_POST["nom"] . "%') AND telefon LIKE '%" . $_POST["telefon"] . "%' ORDER BY nom", $connexio);
|
|
32 |
|
|
33 |
while ($fila = mysql_fetch_row($resultat))
|
|
34 |
{
|
|
35 |
printf("<tr>\n\t<td><A HREF=\"update-phones.php?id=%s&db_selected=%s\">%s</A>\n\t<td>%s\n\t<td>%s\n",
|
|
36 |
$fila[1], $_POST["db_selected"], $fila[0], $fila[1], $fila[2]);
|
|
37 |
}
|
|
38 |
|
|
39 |
?>
|
|
40 |
</TABLE>
|
|
41 |
|
|
42 |
<BR>
|
|
43 |
<A HREF="update-phones">Afegir entrada</A>
|
|
44 |
|
|
45 |
<BR>
|
|
46 |
<A HREF="index">Tornar a consultar telčfons</A>
|
|
47 |
|
|
48 |
</body>
|
|
49 |
</html>
|