XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Side hvor det bliver skrevet ind
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<html>
<head>
<title>Indskrive en person</title>
</head>
<body>
<BODY BGCOLOR="#cccccc" TEXT="#000000"><body>
<center>
<?
$host = "127.0.0.1"; // MySQL serveren
$user = "root"; // Bruger
$password = ""; // Password
$dbname = "projekt"; // Navnet på databasen
$conn = mysql_connect($host, $user, $password); // Finder MyQL serveren
mysql_select_db($dbname, $conn); // Åbner databasen
?>
<br>
<font size="5">Indtast oplysninger
</font> <br>
<form method="POST" action="gem.php">
<table border="0" >
<tr>
<td width="10%">
</td>
</tr>
<tr>
<td width="20%">CPR nr ddmmåå-xxxx</td>
<td ><input type="text" name="CPR" size="20"></td>
<td width="10%"> Fornavn </td>
<td width="20%"><input type="text" name="Fornavn" size="20"> </td>
</tr>
<tr>
<td width="10%">Efternavn</td>
<td width ="10%" ><input type="text" name="Efternavn" size="20"></td>
<td width="10%">Adresse</td>
<td width="20%"><input type="text" name="Adresse" size="20"></td>
</tr>
<tr>
<td width="10%">Adresse2</td>
<td width="20%"><input type="text" name="Adresse_2" size="20"></td>
<td width="10%">Co</td>
<td width="20%"><input type="text" name="Co" size="20"></td>
</tr>
<tr>
<td width="10%">Post nr </td>
<td width="10%">
<select name="postnr" onchange="this.form.submit();">
<? // Henter alle postnr ud i en scrollbar
$sql = "SELECT * FROM postnr ORDER BY postnr";
$foresp = mysql_query($sql, $conn);
while($data = mysql_fetch_row($foresp))
echo "<option value = $data[0]>" .$data[0]. "</option>"; // $data[0]
tager det første felt
?>
<td width="10%">Stilling</td>
<td width="20%"><input type="text" name="Stilling" size="20"></td>
<tr><td width="10%">By</td>
<td width="20%"><input type="text" name="echo $data[1]" size="20"></td>
<td width="10%">e-mail</td>
<td><input type="text" name="Andet" size="20"> </td>
</tr>
<tr>
<td width="10%">Telefon 1</td>
<td width="20%"><input type="text" name="Telefon" size="20"></td>
<td width="10%">Telefon 2</td>
<td><input type="text" name="Telefon_2" size="20">
</tr>
<tr>
<td width="10%">Ref</td>
<td><input type="text" name="Ref" size="20"> </td>
<td width="10%">Størelse</td>
<td width="20%"><input type="text" name="Str" size="20"></td>
</tr>
<tr>
<a href="typekorekort.html"><td width="10%">Type kørekort
(A.B.C.D.E)</td></a>
<td><input type="text" name="Kørekort" size="5"> </td>
</tr>
</table>
<table border="0" >
<tr>
<td width="95%">Truckkort
<input type="checkbox" name="Truckkort" value="Ja"></td>
</tr>
<tr>
<td width="95%">Noteret...:
<input type="checkbox" name="Noteret" value="True"></td>
</tr>
</table>
<br>
<input type="submit" value="Gem" name="send">
</form>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Denne side gemmer de variabler som jeg får fra første side
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<html>
<head> <title>Gem Person</title> </head>
<body bgcolor="#cccccc">
<?
$host = "127.0.0.1"; // MySQL serveren
$user = "root"; // Bruger
$password = ""; // Password
$dbname = "projekt"; // Navnet på databasen
$conn = mysql_connect($host, $user, $password); // Finder MyQL serveren
mysql_select_db($dbname, $conn); // Åbner databasen
// henter variable fra form i personind.php
$Stilling = $_POST["Stilling"];
$Fornavn = $_POST["Fornavn"];
$Efternavn = $_POST["Efternavn"];
$Adresse = $_POST["Adresse"];
$Adresse_2 = $_POST["Adresse_2"];
$Co = $_POST["Co"];
$Postnr = $_POST["Postnr"];
$CPR = $_POST["CPR"];
$Reg_dato = date("Y-m-d H:i:s"); // Tager datoen fra serveren og
gemmer det i Reg_dato
$Telefon = $_POST["Telefon"];
$Telefon_2 = $_POST["Telefon_2"];
$Kørekort = $_POST["Kørekort"];
$Truckkort = $_POST["Truckkort"];
$Str = $_POST["Str"];
$Ref = $_POST["Ref"];
$Andet = $_POST["Andet"]; // e-mail
$Noteret = $_POST["Noteret"];
?>
<br>
<br>
<CENTER>
<font size=5>
.
<? // Skriver variablerne ind.
$sql = "INSERT INTO basis
(Stilling,Fornavn,efternavn,Adresse,Adresse_2,Co,Postnr,CPR,Reg_dato,Telefon
,Telefon_2,Kørekort,Truckkort,Str,Ref,Andet,Noteret) VALUES
('$Stilling','$Fornavn','$Efternavn','$Adresse','$Adresse_2','$Co','$Postnr'
,'$CPR','$Reg_dato
','$Telefon','$Telefon_2','$Kørekort','$Truckkort','$Str','$Ref','$Andet','$
Noteret')";
mysql_query($sql, $conn); // indsætter data i tabellen
echo "<br>"; echo "<br>";
// sammen ligner variablen Reg_dato med $Reg_dato og udskriver det ID
nummer Personen har fået
$query = "SELECT Ident FROM Basis WHERE Reg_dato='$Reg_dato'";
$res = mysql_query($query);
$result = mysql_fetch_row($res)
or die ("!!!!! Person ikke gemt... Prøv igen !!!!! ".mysql_error() );
echo "Personen har fået ID = ";
echo $result[0];
?>
</font>
</CENTER>
</form>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Når jeg så skal have mine data ud bruger jeg denne søge side
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Post Nr</title>
</head>
<BODY BGCOLOR="#cccccc"><body>
<center>
<br>
<B><I>Søg person efter ID</I></B>
<form method="POST" action="personres.php">
Søg Person ID: <input type="text" name="Ident" size="10">
<input type="submit" value="Søg">
</center>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
og her bliver alle data så skrevet ud.... bare ikke mine Noteret..:
Truckkort hvordan gøres dette
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Resultat efter søgning</title>
</head>
<body BGCOLOR="#cccccc" TEXT="#000000">
<center>
<?
$host = "127.0.0.1"; // MySQL serveren
$user = "root"; // Bruger
$password = ""; // Password
$dbname = "projekt"; // Navnet på databasen
$conn = mysql_connect($host, $user, $password); // Finder MyQL serveren
mysql_select_db($dbname, $conn); // Åbner databasen
// henter variablerne ud fra tabelen
$foresp = mysql_query("SELECT
Ident,CPR,Fornavn,Efternavn,Adresse,Adresse_2,Co,Postnr,Stilling,andet,Telef
on,Telefon_2,Ref,Str,Kørekort,Truckkort,Noteret FROM basis WHERE
Ident='$Ident'");
$data = mysql_fetch_row($foresp);
$sCPR = $data[1];
$sFornavn = $data[2];
$sEfternavn = $data[3];
$Adresse = $data[4];
$Adresse_2 = $data[5];
$Co = $data[6];
$Postnr = $data[7];
$Stilling = $data[8];
$Andet = $data[9];
$Telefon = $data[10];
$Telefon_2 = $data[11];
$Ref = $data[12];
$Str = $data[13];
$Kørekort = $data[14];
$Truckkort = $data[15];
$Noteret = $data[16];
// Finder byen til postnr.
$for = mysql_query("SELECT t1.Postnr , t2.City FROM Postnr AS t1 , Postnr
AS t2 WHERE t1.Postnr=t2.Postnr AND
t1.Postnr='$Post' ");
$data1 = mysql_fetch_row($for);
$city = $data1[1];
?>
<br>
<font size="5">Ændre oplysninger
</font> <br>
<form method="POST" action="ret.php">
<table border="0" >
<tr>
<td width="10%">
</td>
</tr>
<tr>
<td width="20%">ID nummer </td>
<td ><? echo $Ident;?></td>
</tr>
<tr>
<td width="20%">CPR nr ddmmåå-xxxx</td>
<td ><input type="text" name="CPR" value="<? echo $sCPR?>" size="20"></td>
<td width="10%"> Fornavn</td>
<td width="20%"><input type="text" name="Fornavn" value="<? echo
$sFornavn?>" size="20"> </td>
</tr>
<tr>
<td width="10%">Efternavn</td>
<td width ="10%" ><input type="text" name="Efternavn" value="<? echo
$sEfternavn?>" size="20"></td>
<td width="10%">Adresse</td>
<td width="20%"><input type="text" name="Adresse" value="<? echo
$Adresse?>" size="20"></td>
</tr>
<tr>
<td width="10%">Adresse2</td>
<td width="20%"><input type="text" name="Adresse_2" value="<? echo
$Adresse_2?>"size="20"></td>
<td width="10%">Co</td>
<td width="20%"><input type="text" name="Co" value="<? echo
$Co?>"size="20"></td>
</tr>
<tr>
<td width="10%">Post nr </td>
<td width="10%">
<select name="Postnr">
<?
$sql = "SELECT * FROM postnr ORDER BY postnr";
$foresp = mysql_query($sql, $conn);
while($data = mysql_fetch_row($foresp))
echo "<option value = $data[0]>" .$data[0]. "</option>" ; // $data[0]
tager det første felt
?>
<option selected=><? echo $Postnr?></option> # Sørger for at vælge det
postnr som står i DBén
<td width="10%">Stilling</td>
<td width="20%"><input type="text" name="Stilling" value="<? echo
$Stilling?>"size="20"></td>
</tr>
<tr>
<td width="10%">By</td>
<td width="20%"><input type="text" name="city" value="<? echo $city?>"
size="20"></td>
<td width="10%">e-mail</td>
<td><input type="text" name="Andet" value="<? echo $Andet?>" size="20">
</td>
</tr>
<tr>
<td width="10%">Telefon 1</td>
<td width="20%"><input type="text" name="Telefon" value="<? echo
$Telefon?>" size="20"></td>
<td width="10%">Telefon 2</td>
<td><input type="text" name="Telefon_2" value="<? echo $Telefon_2?>"
size="20">
</tr>
<tr>
<td width="10%">Ref</td>
<td><input type="text" name="Ref" value="<? echo $Ref?>"size="20"> </td>
<td width="10%">Størelse</td>
<td width="20%"><input type="text" name="Str" value="<? echo
$Str?>"size="20"></td>
</tr>
<tr>
<a href="typekorekort.html"><td width="10%">Type kørekort
(A.B.C.D.E)</td></a>
<td><input type="text" name="Kørekort" value="<? echo $Kørekort?>"
size="5"> </td>
</tr>
</table>
<table border="0" >
<tr>
<td width="95%">Truckkort
<input type="checkbox" name="Truckkort" value="Ja" checked="<? echo
$Truckkort ?>"> </td>
</tr>
<tr>
<td width="95%">Noteret..:
<input type="checkbox" name="Noteret" value="True"></td>
</tr>
</table>
<br>
<td width="80%">Ønsker at deltage I :
<br>
<select name="ARRNAVN" >
<?
$sql = "SELECT * FROM arrangementer ORDER BY ARRNAVN";
$foresp = mysql_query($sql, $conn);
while($data = mysql_fetch_row($foresp))
echo "<option value = $data[0]>" .$data[0]. "</option>"; // $data[0]
tager det første felt
?>
</tr>
</table>
<br>
<input type="submit" value="Ændre" name="send">
</form>
</body>
</html>
|