Huhu Leute,
ich habe ein Problem, unzwar habe ich ein Script um Kunden zu erstellen, für ein Projekt.
Leider jedoch sagt er mir unexpectet end ()
Kann mir wer sagen wo die } fehlt ich finde es einfach nicht =(
Danke im Vorraus
PHP
<?php
if(user_auth('Mitarbeiter')) {
if($_SESSION['Instanz'] == "1")
{ $udpwhere = "WHERE UDP > '10999' AND UDP < '11999'";
} elseif($_SESSION['Instanz'] == "2")
{ $udpwhere = "WHERE UDP > '11999' AND UDP < '12999'";
} elseif($_SESSION['Instanz'] == "3")
{ $udpwhere = "WHERE UDP > '12999' AND UDP < '13999'";
} elseif($_SESSION['Instanz'] == "4")
{ $udpwhere = "WHERE UDP > '13999' AND UDP < '14999'";
} elseif($_SESSION['Instanz'] == "5")
{ $udpwhere = "WHERE UDP > '14999' AND UDP < '15999'";
} elseif($_SESSION['Instanz'] == "6")
{ $udpwhere = "WHERE UDP > '15999' AND UDP < '16999'";
} elseif($_SESSION['Instanz'] == "Haupt")
{ $udpwhere = "WHERE UDP > '8699' AND UDP < '8799'";
}
$kunden = mysql_query("SELECT * FROM `kunden` $udpwhere");
if(isset($_GET['action'])){
$action=$_GET['action'];
}
echo '
<div class="page_inhalt_head">
<div class="page_text1_2">Kunden ('.mysql_num_rows($kunden).')</div>';
echo "
<div class=\"page_text2_2\"></div>
";
echo '
</div>
<div class="page_inhalt_middle">';
if($action == "add"){
echo '
<form action="http://localhost/index.php?ext=Kunden" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td>Vorname</td>
<td><input name="vorname" type="text" class="form" id="vorname"></td>
</tr>
<tr>
<td style="background:#dbf0fa;">Nachname</td>
<td style="background:#dbf0fa;"><input name="nachname" type="text" class="form" id="nachname"></td>
</tr>
<tr>
<td>Strasse</td>
<td><input name="strasse" type="text" class="form" id="strasse"></td>
</tr>
<tr>
<td style="background:#dbf0fa;">PLZ, Ort</td>
<td style="background:#dbf0fa;"><input name="plz" type="text" class="form" size="6" maxlength="6" id="plz"> <input name="ort" type="text" class="form" size="17" id="ort"></td>
</tr>
<tr>
<td>Land</td>
<td><input name="land" type="text" class="form" id="land">
</td>
</tr>
<tr>
<td style="background:#dbf0fa;">E-Mail</td>
<td style="background:#dbf0fa;"><input name="email" type="text" class="form" id="email"></td>
</tr>
<tr>
<td>Geburtsdatum</td>
<td><input name="geburtsdatum" type="text" class="form" id="geburtsdatum"></td>(Format DD.MM.YYYY)
</tr>
<tr>
<td style="background:#dbf0fa;">Festnetz</td>
<td style="background:#dbf0fa;"><input name="festnetz" type="text" class="form" id="festnetz"></td>
</tr>
<tr>
<td>Handy</td>
<td><input name="handy" type="text" class="form" id="handy"></td>
</tr>
<tr>
<td style="background:#dbf0fa;">Forum-Name</td>
<td style="background:#dbf0fa;"><input name="forum" type="text" class="form" id="forum"></td>
</tr>
<tr>
<td>Homepage</td>
<td><input name="homepage" type="text" class="form" id="homepage"></td>
</tr>
<tr>
<td style="background:#dbf0fa;">Laufzeit</td>
<td style="background:#dbf0fa;"><input name="laufzeit" type="text" class="form" id="laufzeit">(Format DD.MM.YYYY)</td>
</tr>
<tr>
<td>UDP</td>
<td><input name="udp" type="text" class="form" id="udp" value="1'.$_SESSION['Instanz'].'0"></td>
</tr>
<tr>
<td style="background:#dbf0fa;">Slots</td>
<td style="background:#dbf0fa;"><input name="slots" type="text" class="form" id="slots"> </td>
</tr>
<tr>
<td>Verwarnungen</td>
<td><input name="verwarnungen" type="text" class="form" id="verwarnungen"></td>
</tr>
<tr>
<td></td>
<td><input name="save" type="submit" value="Erstellen" class="form"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>';
}
elseif($_POST['save']){
$vorname = $_POST['vorname'];
$nachname = $_POST['nachname'];
$strasse = $_POST['strasse'];
$plz = $_POST['plz'];
$ort = $_POST['ort'];
$land = $_POST['land'];
$email = $_POST['email'];
$geburtstag = $_POST['geburtstag'];
$festnetz = $_POST['festnetz'];
$handy = $_POST['handy'];
$forum = $_POST['forum'];
$homepage = $_POST['homepage'];
$laufzeit = $_POST['laufzeit'];
$verlaengert = $_POST['verlaengert'];
$udp = $_POST['udp'];
$slots = $_POST['slots'];
$informationen = 'Keine Informationen';
$verwarnungen = 'Keine Verwarnungen';
mysql_query("INSERT INTO `kunden`
( `Vorname` , `Nachname` , `Strasse` , `PLZ` , `Ort` , `Land` , `EMail` , `Geburtstag` , `Festnetz` , `Handy` , `Forum` , `Homepage` , `Laufzeit` , `Verlaengert` , `UDP`, `Slots`, `Informationen`, `Verwarnung`)
VALUES (
'$vorname', '$nachname', '$strasse', '$plz', '$ort', '$land', '$email', '$geburtstag', '$festnetz', '$handy',
'$forum', '$homepage', '$laufzeit', '$verlaengert', '$udp', '$slots', '$informationen', '$verwarnungen');") OR die(mysql_error());
redirect("".$hp_url."kunden/","Erfolgreich gespeichert.","1");
}
elseif($_GET['action']=="delete") {
$uID = $_GET['uID'];
mysql_query("DELETE FROM `kunden` WHERE `ID` = $uID LIMIT 1");
redirect("".$hp_url."kunden/","Erfolgreich gelöscht.","1");
}
else {
if(mysql_num_rows(mysql_query("SELECT * FROM `kunden` $udpwhere")) > $server_total){
echo '<div align="center" style="border: 1px dotted #d5d5d5"><span style="color: red"><strong>Instanz voll.</strong></span></div>';
}
echo '
<table width="100%" border="0" cellspacing="4" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="4">';
echo "
<tr>
<td colspan=\"4\"> </td>
<td colspan=\"1\">
<form action=\"".$hp_url."kunden/suche/\" method=\"post\">
<small>Suche:</small> <input type=\"text\" name=\"suche\" class=\"form\" onclick=\"this.value=''\" value=\"E-Mail Adresse\" />
</form>
</td>
</tr>";
echo '
<tr>
<td width="30%" align="left"><strong>Email</strong></td>
<td width="10%" align="left"><strong>UDP-Port</strong></td>
<td width="20%" align="left"><strong>Geburtsdatum</strong></td>
<td width="20%" align="left"><strong>Laufzeit</strong></td>
<td width="20%" align="center"><strong>Funktionen</strong></td>
</tr>
';
$count = 1;
$qry = mysql_query("SELECT * FROM `kunden` $udpwhere ORDER BY `udp` ASC LIMIT 0 , 41");
while($sys=mysql_fetch_array($qry)){
$count++;
if($count%2){
$bg = " style=\"background:#dbf0fa;\"";
} else {
$bg = "";
}
if($sys['first_login'] == 0) {
$flog = "<img src=\"".$hp_url_img."images/icons/bullet_green.png\" border=\"0\" onmouseover=\"return overlib('Kunde hat sich bereits angemeldet.');\" onmouseout=\"return nd();\">";
} else {
$flog = "<img src=\"".$hp_url_img."images/icons/bullet_black.png\" border=\"0\" onmouseover=\"return overlib('Kunde hat sich noch nicht angemeldet.');\" onmouseout=\"return nd();\">";
}
?>
<tr>
<td align="left"<?=$bg; ?><?=$bg; ?>><? echo $sys['email']; ?></td>
<td align="left"<?=$bg; ?><?=$bg; ?>><? echo $sys['udp']; ?></td>
<td align="left"<?=$bg; ?><?=$bg; ?>><? echo $sys['bday']; ?></td>
<td align="left"<?=$bg; ?><?=$bg; ?>><? echo $sys['laufzeit']; ?></td>
<td align="center"<?=$bg; ?>><?=$flog; ?> <a href="<?=$hp_url; ?>kunden/mail/<? echo $sys['userID']; ?>"><img src="<?=$hp_url_img; ?>images/icons/email.png" border="0"></a> <a href="<?=$hp_url; ?>kunden/edit/<? echo $sys['userID']; ?>"><img src="<?=$hp_url_img; ?>images/icons/user_edit.png" border="0"></a> <a href="<?=$hp_url; ?>kunden/del/<? echo $sys['userID']; ?>"><img src="<?=$hp_url_img; ?>images/icons/user_delete.png" border="0" onmouseover="return overlib('Kunden löschen');" onmouseout="return nd();"></a></td>
</tr>
<?
}
echo "
<tr>
<td colspan=\"4\"><a href=\"".$hp_url."kunden/add\"><img src=\"".$hp_url_img."/images/icons/user_add.png\" border=\"0\" onmouseover=\"return overlib('Neuen Kunden erstellen');\" onmouseout=\"return nd();\"></a></td>
<td>
<form action=\"".$hp_url."kunden/suche/\" method=\"post\">
<small>Suche:</small> <input type=\"text\" name=\"suche\" class=\"form\" onclick=\"this.value=''\" value=\"E-Mail Adresse\" />
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
";
echo ' </div>';
} else {
echo '401: Nicht autorisierter Zugriff!';
}
?>
Alles anzeigen