diff options
| author | root | 2014-03-02 00:13:01 +0100 |
|---|---|---|
| committer | root | 2014-03-02 00:13:01 +0100 |
| commit | 82185753906709f9944a07c35a809736cf979afe (patch) | |
| tree | 3d9a9f82f13f84ba82ef9f0a2823c11989e526f0 /www/liste.php | |
| parent | f10abe4b061ce7e4f8719c2730d6edab7c06b00c (diff) | |
| download | jungegemeinde-82185753906709f9944a07c35a809736cf979afe.tar.gz | |
new folder etc
Diffstat (limited to 'www/liste.php')
| -rw-r--r-- | www/liste.php | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/www/liste.php b/www/liste.php new file mode 100644 index 0000000..94deb1a --- /dev/null +++ b/www/liste.php @@ -0,0 +1,145 @@ +<?php include('auth.php'); + +/* Copyright Maximilian Möhring, 2013 +Licensed under the GPL. Read LICENSE for more Information.*/ + +include("header.php"); + +$db = new SQLite3("../database/database.sqlite"); + +?> + +<script> +// Elemente einblenden +function show_elements() + { + var elementNames = show_elements.arguments; + for (var i=0; i<elementNames.length; i++) + { + var elementName = elementNames[i]; + document.getElementById(elementName).style.display='block'; + } + } +// Elemente ausblenden +function hide_elements() + { + var elementNames = hide_elements.arguments; + for (var i=0; i<elementNames.length; i++) + { + var elementName = elementNames[i]; + document.getElementById(elementName).style.display='none'; + } + } +</script> + +<div id='content_container' align='center'> + <br> + <div class='kleineschrift'> + <div class='ueberschrift'><p>JUNGE GEMEINDE ADLERSHOF</p> + </div> + </div> + +<?php if($_GET["id"] == 0 || $_GET["id"] == "" || !isset($_GET["id"])){ + +echo" +<br><br> + <table height='350' border='1' rules='all' cellpadding='20' cellbording='20' cellspacing='20'> + <!-- Wenn mir mal einer erklären könnte, warum die Zellen trotzdem keinen Abstand haben? --> + <thead> + <tr> + <th><a3> </a3></th> + <th><a3>Name</a3></th> + <th><a3>Adresse</a3></th> + <th><a3>Telefon</a3></th> + <th><a3>Handynummer</a3></th> + <th><a3>E-Mail</a3></th> + <th><a3>Geburtstag</a3></th> + <tr> + </thead> + <tbody cellpadding='20' cellbording='20' cellspacing='20'> + +"; + $ergebnis = $db->query("SELECT * FROM member"); + while($row=$ergebnis->fetchArray(SQLITE3_NUM)){ + $id=$row[0]; + echo "<tr>"; + foreach($row as $element){ + echo "<td align='left'><a href=\"?id=$id\" onclick=\"document.location.href='liste.php?id=$id'\">$element</a></td>"; + } + + echo " + </tr>"; + } + +echo " + </tbody> + </table> + +<br><br> +<div style='width:1000px;' class='mittlereschrift'> +Da es in letzter Zeit doch öfters vorgekommen ist, dass jemand seine Adresse geändert hat, ist es jetzt möglich, einen Eintrag in der Adressliste zu ändern oder zu ergänzen. +Wenn du deine Adresse <b>ändern</b> möchtest, dann drücke einfach auf deinen Namen in der richtigen Zeile. <a href='insert.php'>Möchtest du jemanden <b>hinzufügen</b>, dann drücke bitte <u>hier</u>.</a> +</div> + +<br><br> +"; +} else { + + + $id = $_GET["id"]; + $safe_id = SQLite3::escapeString("$id"); + $ergebnis = $db->query("SELECT * FROM member where id=$safe_id;"); + while($row=$ergebnis->fetchArray()){ + echo "<br><a2>Trage einfach die neuen Daten von $row[name] ein: </a2><br> + <form method='post' action='update.php' ><table><tr>"; + echo "<td align='right'><a2>Name: <input type='text' name='name' value='$row[name]'></a2> </td> + <td align='right'><a2>Adresse: <input type='text' name='adresse' value='$row[adresse]'> </a2></td> + <td align='right'><a2>Telefon: <input type='text' name='telefonnummer' value='$row[telefonnummer]'></a2> </td></tr> + <tr align='right'><td><a2>Handy: <input type='text' name='handynummer' value='$row[handynummer]'></a2> </td> + <td align='right'><a2>E-Mail: <input type='text' name='email' value='$row[email]'></a2> </td> + <td align='right'><a2>Geburtstag: <input type='text' name='geburtstag' value='$row[geburtstag]'></a2> </td></tr> + <tr><td> <input type='hidden' name='id' value='$id'></td><td align='center'><input type='submit' name='submit' value='Update!'/></td><td> </td></tr> + </table></form> + "; + } +} +?> + +<!--AUSKOMMENTIERT################################################################################# +<table width="400px" > +<colgroup width="170" span="3"></colgroup> +<tr align='center'> +<td nowrap> +<div id="show_update" class='unterstrich'> + <a style='color:blue;' href="#" title="Anzeigen" onclick="show_elements('update_db');">Eintrag aktualisieren?</a> + + +</div> +</td> +<td> +oder +</td> +<td nowrap> +<div id="show_update" class='unterstrich'> + <a style='color:blue;' href="#" title="Anzeigen" onclick="show_elements('update_db');">Eintrag ergänzen?</a> +</div> +</td> +</table> + +<div id="update_db" class="noscript"> + +<br><br> + <form method='get' action='index.php' > + <table><tr> + <td><input type=</td> + <td><p>Nummer:</p></td><td><p><input type='text' name='id' size='1'/></p></td> + <td><p><input type='submit' name=submit value='weiter'/></p></td> + </table> + </form> + + +</div> +--> + </div> +</body> +</html> |
