get-phones.php
changeset 0 66cea237d6e8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/get-phones.php	Thu May 18 23:00:19 2006 +0200
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<html>
+<head>
+	<title>Consulta de telčfons: Resultats de la cerca</title>
+	<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+</head>
+
+<body>
+
+<h1 align=center>Agenda de telčfons</h1>
+<h2>Resultat de la cerca</h2>
+
+<p>Resultats a la base de dades <STRONG>
+<?php
+	switch($_POST["db_selected"])
+	{
+		case "phones": echo "Telčfons del Mňbil"; break;
+		case "phones_olot": echo "Telčfons d'Olot"; break;
+	}
+?> </STRONG>: </p>
+
+<TABLE BORDER=1>
+<TR>
+	<TH>Nom
+	<TH>Telčfon
+	<TH>Descripció
+
+<?php
+	$connexio = mysql_connect("localhost", "viric_consultant", "potato");
+	mysql_select_db("viric",$connexio);
+	$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);
+
+	while ($fila = mysql_fetch_row($resultat))
+	{
+		printf("<tr>\n\t<td><A HREF=\"update-phones.php?id=%s&amp;db_selected=%s\">%s</A>\n\t<td>%s\n\t<td>%s\n",
+			$fila[1], $_POST["db_selected"], $fila[0], $fila[1], $fila[2]);
+	}
+
+?>
+</TABLE>
+
+<BR>
+<A HREF="update-phones">Afegir entrada</A>
+
+<BR>
+<A HREF="index">Tornar a consultar telčfons</A>
+
+</body>
+</html>