<?php

#########################################################
#
# Datei   : /index.php
#
# Autor   : Axel Jaeger
#
# Version : 1.0 vom 29.04.2013
#
# Eingangs-Seite fuer www.mydress.de (oder so aehnlich).
#
#
#########################################################

require_once "./zubehoer/functions_htmlout.php.inc";
require_once "./zubehoer/functions_db.php.inc";

session_start();
init_vars();

if ( isset($_SESSION["USERID"]) )
{
  print_header(0,"./seite.php","",0);
}
else
{
print_header(-1,"","./zubehoer",0);


if ( isset($_POST["absenden"]) ) 
{
  $nickname  = trim($_POST["benutzer"]);
  $vorname   = trim($_POST["vorname"]);
  $nachname  = trim($_POST["nachname"]);
  $email     = trim($_POST["email"]);
  $sex       = trim($_POST["sex"]);
  $tag       = $_POST["tag"];
  $monat       = $_POST["monat"];
  $jahr       = $_POST["jahr"];
}
else
{
  $nickname = "";
  $vorname  = "";
  $nachname = "";
  $email    = "";
  $sex      = "";
  $tag      = 0;
  $monat    = 0;
  $jahr     = 0;
}

  $form1_w = 300;
  $form1_h = 120;
  $form1_t = 250;

  $abstand = 80;

  $form2_w = 350;
  $form2_h = 450;
  $form2_t = 150;

# 3. Summand ist der Abstand zwischen den Formularen...
  $summe = $form1_w + $form2_w + $abstand;

  $weite=$form1_w + 200;
  $hoehe=400;
  if ( isset($_SESSION["W"]) ) { $weite = $_SESSION["W"]; }
  if ( isset($_SESSION["H"]) ) { $hoehe = $_SESSION["H"]; }

  $form1_p = max( round( ($weite - $summe) / 2 ) , 0);
  $form2_p = $form1_p + $form1_w + $abstand;

  $form3_t = max ( $form1_t + $form1_h, $form2_t + $form2_h) + 50;
  $form3_p = 100;
  $form3_w = max ( $weite - 200 , 0 );  

print "<div class=\"hidden\">\n";
print "<table width=100%>\n";
print "<tr>\n";
print "<td width=100px><img src=\"./images/Drumble.png\" height=$ICONHEIGHT></td>\n";
print "<td align=center><h1 align=center class=\"shadow titel\">$titel</h1></td>\n";
?>
</tr></table>
</div>
<div class="shadow" align=center>
<table width=100%>
<tr>
<td width=100px></td>
<td align=center><h2 align=center>Share your dress</h2></td>
</tr></table>
</div>

<div style="position:absolute top:{$form1_t}px; left:0px; width:150px; height:100px;"><small>V 0.95<br>

<?php

$countonl = counter();

print "Start  : 22.12.2013<br>\n";
print $index["Besucher"] . " : $countonl[0]<br>\n";
print $index["Online"] . " : $countonl[1]<br>\n";
#print $_ENV["SERVER_NAME"] . "<br>\n";
print "<a href= \"./html/impressum.html\" target=_new>Impressum</a>\n";
print "</small></div>\n";

print "<div class=\"form\" align=center valign=center style=\"top:{$form1_t}px; left:{$form1_p}px; width:{$form1_w}px; height:{$form1_h}px;\">\n";

print "<form action=\"./auth.php\" method=\"post\">\n";
print "<table border=0 align=center>\n";
print "<tr>\n";
print "<td align=right>" . $index["login"] . " : </td><td align=left><input type=\"text\" name=\"bekben\"></td>\n";
print "</tr><tr>\n";
print "<td align=right>" . $index["passwort"] . " : </td><td align=left><input type=\"password\" name=\"bekpass\"></td>\n";
print "</tr><tr>\n";
print "<td colspan=2 align=center><input type=\"submit\" name=\"einloggen\" value=\"" . $index["value"] . "\"></td>\n";
print "</tr><tr><td colspan=2>" . $index["lang"];
if ( $_SESSION["sprache"] != "en" )
  print "<a href=\"./set_session.php?L=en&url=./index.php\"><img src=\"./images/english.gif\" height=\"19\"></td></tr>\n";
if ( $_SESSION["sprache"] != "de" )
  print "<a href=\"./set_session.php?L=de&url=./index.php\"><img src=\"./images/deutsch.gif\" height=\"19\"></td></tr>\n";
print "</table></form></div>\n";

print "<div class=\"form\" align=center valign=center style=\"top:{$form2_t}px; left:{$form2_p}px; width:{$form2_w}px; height:{$form2_h}px;\">\n";

print_registerform($nickname,$vorname,$nachname,$email,$sex,$tag,$monat,$jahr,$weite,$hoehe);

print "</div>\n";

#print "<div class=\"form\" align=center valign=center style=\"top:{$form3_t}px; left:{$form3_p}px; width:{$form3_w}px; height:20px;\">\n";
#print "<table width=100%><tr><td align=center valign=top>about this site</td><td align=center valign=top>legal Notice</td></tr></table>\n";
#print "</div>\n";

if ( ! $FARBVERLAUF )
{
 print "</div>\n";
}


}
?>