die kleine handliche web-basierte Notiz/Adress-Datenbank fuer php/mysql
This commit is contained in:
parent
0bffe48b4b
commit
c84e8b144f
26 changed files with 1363 additions and 0 deletions
73
notiz-datenbank/edit_adresse_formular.php
Normal file
73
notiz-datenbank/edit_adresse_formular.php
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?PHP
|
||||
|
||||
// von auÿen kommt die Variable $adresse_id mit der Nummer des Adresseintrags
|
||||
// bzw. sie ist nicht gesetzt für einen Neuen
|
||||
// ausserdem wird die $mensch_id uebergeben
|
||||
|
||||
|
||||
include_once("init.php");
|
||||
|
||||
|
||||
importGET("adresse_id");
|
||||
if (!isset($adresse_id)) importPOST("adresse_id");
|
||||
if (!isset($adresse_id)) $adresse_id = -1;
|
||||
|
||||
// falls eine bestehende Adresse bearbeitet werden soll
|
||||
if ($adresse_id > -1)
|
||||
{
|
||||
$result = mysql_query("SELECT * FROM Adressen WHERE adresse_id='$adresse_id'");
|
||||
$infos = mysql_fetch_array($result);
|
||||
$strasse = $infos["Strasse"];
|
||||
$hausNummer = $infos["Hausnummer"];
|
||||
$PLZ = $infos["PLZ"];
|
||||
$ort = $infos["Ort"];
|
||||
$zusatz = $infos["Zusatz"];
|
||||
$land = $infos["Land"];
|
||||
$notiz = $infos["Notiz"];
|
||||
}
|
||||
else
|
||||
// eine neue Adresse wird angelegt
|
||||
{
|
||||
$hausNummer = "";
|
||||
$strasse = "";
|
||||
$PLZ = "";
|
||||
$ort = "Rostock";
|
||||
$land = "D";
|
||||
$zusatz = "";
|
||||
$notiz = "";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<P>
|
||||
<DIV ALIGN="CENTER">
|
||||
<FORM NAME="Adresse" ACTION="edit_adresse.php?<?PHP print SID; ?>" METHOD="POST">
|
||||
<DIV ALIGN="CENTER">
|
||||
<table border="2" cellpadding="4" cellspacing="2">
|
||||
<COLGROUP><COL WIDTH="33%"><COL WIDTH="37%"><COL WIDTH="30%"></COLGROUP>
|
||||
<tr> <td colspan="2">Straße: <input type="text" name="strasse" size="22"
|
||||
value="<?PHP echo $strasse; ?>"></td>
|
||||
<td>Nr.: <INPUT TYPE="TEXT" name="hausNummer" size="4"
|
||||
VALUE="<?PHP echo $hausNummer; ?>"</td></TR>
|
||||
<TR> <td>PLZ: <INPUT TYPE="TEXT" NAME="PLZ" size="6"
|
||||
value="<?php echo $PLZ; ?>"></td>
|
||||
<td colspan="2">Ort: <INPUT TYPE="TEXT" NAME="ort"
|
||||
VALUE="<?PHP print $ort; ?>" size="23"></TD></TR>
|
||||
<TR> <TD COLSPAN="2">Zusatz: <INPUT TYPE="TEXT" NAME="zusatz"
|
||||
VALUE="<?PHP print $zusatz; ?>" size="20"></TD>
|
||||
<TD>Land: <INPUT TYPE="TEXTE" NAME="land"
|
||||
VALUE="<?PHP print $land; ?>" size="4"></TD></TR>
|
||||
<tr> <td colspan="3">Notiz: <INPUT TYPE="TEXT" NAME="notiz"
|
||||
VALUE="<?PHP print $notiz; ?>" size="35"></TD></TR>
|
||||
</table>
|
||||
</DIV>
|
||||
<input type="hidden" name="adresse_id" value="<?php echo $adresse_id; ?>">
|
||||
<INPUT TYPE="HIDDEN" NAME="submitAdresse" VALUE="edit">
|
||||
<INPUT TYPE="hidden" NAME="mensch_id"
|
||||
VALUE="<?PHP print $mensch_id; ?>">
|
||||
<DIV ALIGN="CENTER"><input type="submit" value=" Eintragen "
|
||||
ACCESKEY="
"></DIV>
|
||||
|
||||
</FORM>
|
||||
</DIV>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue