aboutsummaryrefslogtreecommitdiff
path: root/liste.php
blob: 824e604ef36dd5b928f3bcb1900b783b1b611792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php include('auth.php'); 
include("header.php");

$db = new SQLite3("../database/jg.db");

?>

<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>&#160;</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>&#160;<input type='hidden' name='id' value='$id'></td><td align='center'><input type='submit' name='submit' value='Update!'/></td><td>&#160;</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>