<?php
require("mysql.php");

$titel = 'Neues Album - Fotos';
if(!$_SESSION[foto]) {
header("location:photo.php?login");
}else{
if(!$_POST[neu]) {
$low = mysql_fetch_array(mysql_query("select * from accounts where name='".$_SESSION[foto]."'"));
$alben = mysql_fetch_array(mysql_query("select count(id) as fotos from fotoalben where nick='".$low[name]."'"));
$rofllol = 3-$alben[fotos];
if($rofllol >= 1) {
$blubb = 'noch '.$rofllol.'';
}else{
$blubb = 'keine weiteren';
}
$inhalt .= '	
<div class="photo"> 
<div class="noh1"></div> 
<div class="box small"> 
<div class="hd"> 
<div class="tl"></div> 
<div class="tr"></div> 
<div class="tm"></div> 
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Beschreibung festlegen</h1></div> 
</div></div> 
</div> 
<div class="bd fade bd-fade"> 
<div class="m"> 
<div class="mi"> 
 
<div class="createmessage"> 
Du kannst '.$blubb.' Alben anlegen.
</div> 
 
<form accept-charset="utf-8"action="photos-createalbum" method="POST" accept-charset="UTF-8"
id="form-upl"
name="form-upl"> 
<div class="formerror hidden" id="err-albumcreation"> 
 
</div> 
<table class="none"
> 
<tbody> 
<tr id="formline-name" class="formline formline-name formres-no formres-noresult-name "> 
<td class="formlabel"> 
<span class="label"><label for="name">Name</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="name" id="name"
value="" /><div class="formerror hidden" id="err-name"> 
 
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-location" class="formline formline-location formres-no formres-noresult-location "> 
<td class="formlabel"> 
<span class="label"><label for="location">Ort</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="ort" id="location"
value="" /><div class="formerror hidden" id="err-location"> 
 
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-description" class="formline formline-description formres-no formres-noresult-description "> 
<td class="formlabel"> 
<span class="label"><label for="description">Beschreibung</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<textarea class="textarea type-String"
name="beschreibung" id="description"
rows="8"
></textarea><div class="formerror hidden" id="err-description"> 
 
</div> 
</div> 
</td> 
</tr> 

</tbody> 
</table> 
<div class="button_offset"> 
 
<div class="bbutton submit" id="submit-button-create"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-create-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="neu" value="create" class="image-submit" /><div class="btmi"><span class="text">Album erstellen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div> 
 
</div> 
<div class="clear"></div> 
</form> 
</div> 
</div> ';
}else{
if($rofllol >= 1) {
if(!$_POST[name]) {
$inhalt .= ' 
<div class="photo"> 
<div class="noh1"></div> 
<div class="box small"> 
<div class="hd"> 
<div class="tl"></div> 
<div class="tr"></div> 
<div class="tm"></div> 
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Beschreibung festlegen</h1></div> 
</div></div> 
</div> 
<div class="bd fade bd-fade"> 
<div class="m"> 
<div class="mi"> 
 
<div class="createmessage"> 
Du kannst '.$blubb.' Alben anlegen.
</div> 
 
<form accept-charset="utf-8" action="photos-createalbum.php" method="POST" accept-charset="UTF-8"
id="form-upl"
name="form-upl"> 
<div class="formerror hidden" id="err-albumcreation"> 
 
</div> 
<table class="none"
> 
<tbody> 
<tr id="formline-name" class="formline formline-name formres-no formres-noresult-name "> 
<td class="formlabel"> 
<span class="label"><label for="name">Name</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="name" id="name"
value="'.mysql_real_escape_string(utf8_decode($_POST[name])).'" /><div class="formerror " id="err-name"> 
 Der Name muss angegeben werden!
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-location" class="formline formline-location formres-no formres-noresult-location "> 
<td class="formlabel"> 
<span class="label"><label for="location">Ort</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="ort" id="location"
value="'.mysql_real_escape_string(utf8_decode($_POST[ort])).'" /><div class="formerror hidden" id="err-location"> 
 
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-description" class="formline formline-description formres-no formres-noresult-description "> 
<td class="formlabel"> 
<span class="label"><label for="description">Beschreibung</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<textarea class="textarea type-String"
name="beschreibung" id="description"
rows="8" 
>'.mysql_real_escape_string(utf8_decode($_POST[beschreibung])).'</textarea><div class="formerror hidden" id="err-description"> 
 
</div> 
</div> 
</td> 
</tr> 

</tbody> 
</table> 
<div class="button_offset"> 
 
<div class="bbutton submit" id="submit-button-create"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-create-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="neu" value="create" class="image-submit" /><div class="btmi"><span class="text">Album erstellen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div> 
 
</div> 
<div class="clear"></div> 
</form> 
</div> 
</div> ';
}else if(strlen($_POST[name]) > 80) {
$inhalt .= '
<div class="photo"> 
<div class="noh1"></div> 
<div class="box small"> 
<div class="hd"> 
<div class="tl"></div> 
<div class="tr"></div> 
<div class="tm"></div> 
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Beschreibung festlegen</h1></div> 
</div></div> 
</div> 
<div class="bd fade bd-fade"> 
<div class="m"> 
<div class="mi"> 
 
<div class="createmessage"> 
Du kannst '.$blubb.' Alben anlegen.
</div> 
 
<form accept-charset="utf-8" action="photos-createalbum" method="POST" accept-charset="UTF-8"
id="form-upl"
name="form-upl"> 
<div class="formerror hidden" id="err-albumcreation"> 
 
</div> 
<table class="none"
> 
<tbody> 
<tr id="formline-name" class="formline formline-name formres-no formres-noresult-name "> 
<td class="formlabel"> 
<span class="label"><label for="name">Name</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="name" id="name"
value="'.mysql_real_escape_string(utf8_decode($_POST[name])).'" /><div class="formerror " id="err-name"> 
 Der Name darf höchstens 80 Zeichen enthalten!
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-location" class="formline formline-location formres-no formres-noresult-location "> 
<td class="formlabel"> 
<span class="label"><label for="location">Ort</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="ort" id="location"
value="'.mysql_real_escape_string(utf8_decode($_POST[ort])).'" /><div class="formerror hidden" id="err-location"> 
 
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-description" class="formline formline-description formres-no formres-noresult-description "> 
<td class="formlabel"> 
<span class="label"><label for="description">Beschreibung</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<textarea class="textarea type-String"
name="beschreibung" id="description"
rows="8" 
>'.mysql_real_escape_string(utf8_decode($_POST[beschreibung])).'</textarea><div class="formerror hidden" id="err-description"> 
 
</div> 
</div> 
</td> 
</tr> 

</tbody> 
</table> 
<div class="button_offset"> 
 
<div class="bbutton submit" id="submit-button-create"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-create-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="neu" value="create" class="image-submit" /><div class="btmi"><span class="text">Album erstellen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div> 
 
</div> 
<div class="clear"></div> 
</form> 
</div> 
</div> ';
}else if(strlen($_POST[ort]) > 80) {
$inhalt .= '
<div class="photo"> 
<div class="noh1"></div> 
<div class="box small"> 
<div class="hd"> 
<div class="tl"></div> 
<div class="tr"></div> 
<div class="tm"></div> 
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Beschreibung festlegen</h1></div> 
</div></div> 
</div> 
<div class="bd fade bd-fade"> 
<div class="m"> 
<div class="mi"> 
 
<div class="createmessage"> 
Du kannst '.$blubb.' Alben anlegen.
</div> 
 
<form action="photos-createalbum" method="POST" accept-charset="UTF-8"
id="form-upl"
name="form-upl"> 
<div class="formerror hidden" id="err-albumcreation"> 
 
</div> 
<table class="none"
> 
<tbody> 
<tr id="formline-name" class="formline formline-name formres-no formres-noresult-name "> 
<td class="formlabel"> 
<span class="label"><label for="name">Name</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="name" id="name"
value="'.mysql_real_escape_string(utf8_decode($_POST[name])).'" /><div class="formerror hidden" id="err-name"> 

</div> 
</div> 
</td> 
</tr> 
<tr id="formline-location" class="formline formline-location formres-no formres-noresult-location "> 
<td class="formlabel"> 
<span class="label"><label for="location">Ort</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="ort" id="location"
value="'.mysql_real_escape_string(utf8_decode($_POST[ort])).'" /><div class="formerror " id="err-location"> 
Der Ort darf höchstens 80 Zeichen enthalten!
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-description" class="formline formline-description formres-no formres-noresult-description "> 
<td class="formlabel"> 
<span class="label"><label for="description">Beschreibung</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<textarea class="textarea type-String"
name="beschreibung" id="description"
rows="8" 
>'.mysql_real_escape_string(utf8_decode($_POST[beschreibung])).'</textarea><div class="formerror hidden" id="err-description"> 
 
</div> 
</div> 
</td> 
</tr> 

</tbody> 
</table> 
<div class="button_offset"> 
 
<div class="bbutton submit" id="submit-button-create"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-create-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="neu" value="create" class="image-submit" /><div class="btmi"><span class="text">Album erstellen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div> 
 
</div> 
<div class="clear"></div> 
</form> 
</div> 
</div> ';
}elseif(strlen($_POST[beschreibung]) > 1000) {
$inhalt .= '
<div class="photo"> 
<div class="noh1"></div> 
<div class="box small"> 
<div class="hd"> 
<div class="tl"></div> 
<div class="tr"></div> 
<div class="tm"></div> 
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Beschreibung festlegen</h1></div> 
</div></div> 
</div> 
<div class="bd fade bd-fade"> 
<div class="m"> 
<div class="mi"> 
 
<div class="createmessage"> 
Du kannst '.$blubb.' Alben anlegen.
</div> 
 
<form action="photos-createalbum" method="POST" accept-charset="UTF-8"
id="form-upl"
name="form-upl"> 
<div class="formerror hidden" id="err-albumcreation"> 
 
</div> 
<table class="none"
> 
<tbody> 
<tr id="formline-name" class="formline formline-name formres-no formres-noresult-name "> 
<td class="formlabel"> 
<span class="label"><label for="name">Name</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="name" id="name"
value="'.mysql_real_escape_string(utf8_decode($_POST[name])).'" /><div class="formerror hidden" id="err-name"> 

</div> 
</div> 
</td> 
</tr> 
<tr id="formline-location" class="formline formline-location formres-no formres-noresult-location "> 
<td class="formlabel"> 
<span class="label"><label for="location">Ort</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="ort" id="location"
value="'.mysql_real_escape_string(utf8_decode($_POST[ort])).'" /><div class="formerror hidden" id="err-location"> 
 
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-description" class="formline formline-description formres-no formres-noresult-description "> 
<td class="formlabel"> 
<span class="label"><label for="description">Beschreibung</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<textarea class="textarea type-String"
name="beschreibung" id="description"
rows="8" 
>'.mysql_real_escape_string(utf8_decode($_POST[beschreibung])).'</textarea><div class="formerror " id="err-description"> 
 Die Beschreibung darf höchstens 1000 Zeichen enthalten!
</div> 
</div> 
</td> 
</tr> 

</tbody> 
</table> 
<div class="button_offset"> 
 
<div class="bbutton submit" id="submit-button-create"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-create-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="neu" value="create" class="image-submit" /><div class="btmi"><span class="text">Album erstellen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div> 
 
</div> 
<div class="clear"></div> 
</form> 
</div> 
</div> ';
}else{
mysql_query("insert into fotoalben set nick='".$_SESSION[foto]."', name='".mysql_real_escape_string(utf8_decode($_POST[name]))."', ort='".mysql_real_escape_string(utf8_decode($_POST[ort]))."', beschreibung='".mysql_real_escape_string(utf8_decode($_POST[beschreibung]))."'");
//Weiterleitung damit man Fotos hochladen kann
die("Hier geht's leider nicht weiter!");
}
}else{
$inhalt .= '
<div class="photo"> 
<div class="noh1"></div> 
<div class="box small"> 
<div class="hd"> 
<div class="tl"></div> 
<div class="tr"></div> 
<div class="tm"></div> 
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Beschreibung festlegen</h1></div> 
</div></div> 
</div> 
<div class="bd fade bd-fade"> 
<div class="m"> 
<div class="mi"> 
 
<div class="createmessage"> 
Du kannst '.$blubb.' Alben anlegen.
</div> 
 
<form action="photos-createalbum" method="POST" accept-charset="UTF-8"
id="form-upl"
name="form-upl"> 
<div class="formerror hidden" id="err-albumcreation"> 
 
</div> 
<table class="none"
> 
<tbody> 
<tr id="formline-name" class="formline formline-name formres-no formres-noresult-name "> 
<td class="formlabel"> 
<span class="label"><label for="name">Name</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="name" id="name"
value="" /><div class="formerror hidden" id="err-name"> 
 
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-location" class="formline formline-location formres-no formres-noresult-location "> 
<td class="formlabel"> 
<span class="label"><label for="location">Ort</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<input type="text" class="text type-String"
name="ort" id="location"
value="" /><div class="formerror hidden" id="err-location"> 
 
</div> 
</div> 
</td> 
</tr> 
<tr id="formline-description" class="formline formline-description formres-no formres-noresult-description "> 
<td class="formlabel"> 
<span class="label"><label for="description">Beschreibung</label>:</span> 
</td><td class="formelement"> 
<div class="formelementbody"> 
<textarea class="textarea type-String"
name="beschreibung" id="description"
rows="8"
></textarea><div class="formerror hidden" id="err-description"> 
 
</div> 
</div> 
</td> 
</tr> 

</tbody> 
</table> 
<div class="button_offset"> 
 
<div class="bbutton submit" id="submit-button-create"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-create-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="neu" value="create" class="image-submit" /><div class="btmi"><span class="text">Album erstellen</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div> 
 
</div> 
<div class="clear"></div> 
</form> 
</div> 
</div> ';
}}
}

$inhalt .= '
          
          <div class="bl"></div>
          <div class="br"></div>
          <div class="bm"></div>

         
        </div></div></div>
       </div>';

$styles = '<link href="/sf/f/registration/registration.css" rel="stylesheet" type="text/css">
<link href="/sf/m/buttons/buttons.css" rel="stylesheet" type="text/css"><link href="/sf/f/index/index.css" rel="stylesheet" type="text/css"><link href="/sf/m/boxes/boxes.css" rel="stylesheet" type="text/css"><link href="/sf/m/forms/forms.css" rel="stylesheet" type="text/css"><link href="/sf/f/photos/photos.css" rel="stylesheet" type="text/css"><link href="/sf/m/tables/tables.css" rel="stylesheet" type="text/css"><link href="/sf/m/uploader/uploader.css" rel="stylesheet" type="text/css"><link href="/sf/f/photos/photos-rate.css" rel="stylesheet" type="text/css">
';
echo str_replace(array('<?url?>','<?inhalt?>', '<?titel?>', '<?fotonavi?>', '<?registrieren?>', '<?styles?>', '<?fotos?>'),array($_SERVER[SERVER_NAME], $inhalt, $titel, $fotonavi, $registrieren, $styles, $fotos),implode("",file("sf/b/style.tpl")));
?>    