<?
session_start();
if(!$l){
$l=$HTTP_ACCEPT_LANGUAGE;
}
if ($l=="en"){$l2="default";}
if ($l=="de"){$l2="de";}
if ($l=="ru"){$l2="ru";}
if(!$STEP){$STEP=1;}

foreach ($_REQUEST as $key => $value) {
    $PARAM[$key] = $value;
    $HIDDFDS.="<input type=hidden name=\"$key\" value=\"$value\">\n";

}
if ($KILL==1 || $l2=="")
{
session_destroy();
$_REQUEST=array();
$_SESSION=array();
header("LOCATION: $PHP_SELF");
exit;
}

// CHECK DER DATEN ---------------------------------------------------------------------------
include_once 'include/config.inc.php';
include_once 'include/options.inc.php';
include_once 'include/security.inc.php';
include_once 'include/functions.inc.php';
include_once 'templates/'.C_TEMP.'/config.php';
include_once C_PATH.'/header.php';

if(!((get_info('adminip') == md5(ip())) && (get_info('adminlogin') == md5(C_ADMINL)) && (get_info('adminpass') == md5(C_ADMINP)))) IsSecure(C_REGISTER_ACCESS);
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<style type="text/css">
<!--

body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
}
select {
	background-color: #ffffff;
	border: 1px solid #999999;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	text-decoration: none;
}
.inp_txt {
	border: 1px solid #666666;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
	height: 18px;
	scrollbar-base-color: #ffffff;
scrollbar-3d-light-color: #ffffff;
scrollbar-arrow-color: #660000;
scrollbar-darkshadow-color: #ffffff;
scrollbar-face-color: #ffffff;
scrollbar-highlight-color: #ffffff;
scrollbar-shadow-color: #ffffff;
scrollbar-track-color: #ffffff;
scrollbar-3dlight-color: #ffffff;
}
.inp_txtaera {
	border: 1px solid #666666;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
	height: 80px;
	scrollbar-base-color: #FAE280;
scrollbar-3d-light-color: #ffffff;
scrollbar-arrow-color: #660000;
scrollbar-darkshadow-color: #ffffff;
scrollbar-face-color: #ffffff;
scrollbar-highlight-color: #ffffff;
scrollbar-shadow-color: #ffffff;
scrollbar-track-color: #ffffff;
scrollbar-3dlight-color: #ffffff;
	}

}
a:link {
	color: #000000;
	text-decoration: underline;
}
a:visited {
	text-decoration: underline;
	color: #000000;
}
a:hover {
	text-decoration: none;
	color: #000000;
}
a:active {
	text-decoration: none;
	color: #000000;
}

.stars {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: normal;
	color: #660000;
}

td.scroll
{
width: 100%px;
height: 120px;
border: 0px solid #000000;
font-family: verdana;
font-size: 10px;
color: #000000;
scrollbar-base-color: #ffffff;
scrollbar-3d-light-color: #ffffff;
scrollbar-arrow-color: #0000000;
scrollbar-darkshadow-color: #ffffff;
scrollbar-face-color: #ffffff;
scrollbar-highlight-color: #ffffff;
scrollbar-shadow-color: #ffffff;
scrollbar-track-color: #ffffff;
scrollbar-3dlight-color: #ffffff;
}
.div2
 {
border: 1px solid #999999;
font-family: verdana;
font-size: 10px;
	}
.div1{
border: 1px solid #999999;
font-family: verdana;
font-size: 10px;
	}
.eins { background-color: #ffffff; cursor: hand; color: #000000;}
.zwei{
	background-color: #316AC5;
	border: #7F9DB9;
	border-style: solid;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	cursor: hand;
	color: #FFFFFF;
}
.zwei:hover {
	background-color: #000066;
	border: #7F9DB9;
	border-style: solid;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	cursor: hand;
	color: #FFFFFF;
}
.borderl {
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-right-style: none;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-color: #7F9DB9;
	border-right-color: #7F9DB9;
	border-bottom-color: #7F9DB9;
	border-left-color: #7F9DB9;
}
.borderr {
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: none;
	border-top-color: #7F9DB9;
	border-right-color: #7F9DB9;
	border-bottom-color: #7F9DB9;
	border-left-color: #7F9DB9;
}
-->
</style>
<script language="JavaScript">
<!--
function pviiClassNew(obj, new_style) {
obj.className = new_style;
}
function ShowHide(id, visibility) 
	{   
   	divs = document.getElementsByTagName("div");
    divs[id].style.visibility = visibility; 
 	
 	}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<?
include "profile/lcodes.php";
include "languages/".$l2."/".$l2."_.php";
include "languages/".$l2."/".$l2.".php";
// https://h61239.serverkompetenz.net
$dbd0 	= new class_mysql;

if ($STEP==2 && $cc < 1)// CHECK DER DATEN ---------------------------------------------------------------------------
	{
	$have_error = 0;
		//--- vorname----------------------------------------
	if( strlen($fname) < 3 ||  strlen($fname) > 20 ) // vornamename Prüfen
		{$have_error++; $ERROR .= str_replace("{0} - {1}" ," 3 - 8 ",$w[3])."<br>"; }
		//--- beschreibung----------------------------------------
	// 	if (empty($descr) || trim($descr) == "") 
	// 		{$have_error++; $ERROR .= $w[38]."<br>"; }
	// 		else
	// 			{
	// 			if (strlen($descr) > 500)
	// 			{$have_error++; $ERROR .= str_replace("{0}", " 500 ", $w[40])."<br>"; 
	// 				}else
	// 					{if (strlen($descr) < 100)
	// 						{$have_error++; $ERROR .= str_replace("{0}", " 100 ", $w[39] )."<br>"; }
	// 						} 			
	// 		}
			//--- email----------------------------------------
		if (c_email($email) == 0)
		{ $have_error++; $ERROR .=$w[11].'<br>';}
		
	$tmp = mysql_query("SELECT email FROM ".C_MYSQL_MEMBERS_SEC." WHERE email = '" . $email . "'");
	$count=mysql_num_rows($tmp);
	if($count > '0') 
	{ $have_error++; $ERROR .=$w[2].'<br>';}				
	}
	
	if($have_error!=0){$STEP=1;echo '<div id="Layer1" style="position:absolute; width:100%; height:45px; z-index:99; visibility: visible; overflow: auto; background-color: #ff0000; layer-background-color: #ff0000; border: 1px solid #000000;"><table cellpadding=3><tr><td><font color=white>'.$ERROR.'</font></td></tr></table></div>';} 
		else{
			

if (!empty($HTTP_POST_FILES[file1]['name']))			
			{
			srand ((double)microtime()*1000000);
			$UNIC = rand();
			$_SESSION[UNIC]=$UNIC;
			//------------------------------------------------THUMB nicht grösser als 550px
			$files = $HTTP_POST_FILES['file1']['tmp_name'];
  		$file1_name = $HTTP_POST_FILES['file1']['name'];
  		$file1_error = $HTTP_POST_FILES['file1']['error'];
  		$file1_size = $HTTP_POST_FILES['file1']['size'];
			
			$upfile1 = "/opt/lampp/htdocs/upload/".$UNIC;
			
			if (is_uploaded_file($files))
   			{
    		
    		@move_uploaded_file($files, $upfile1);
      	
      	}
			
			
			foreach ($_REQUEST as $key => $value) {
    	$_SESSION[$key] = $value;   	
				}
			}
}
// echo $_SESSION[email];
// echo $_SESSION[pass];
if ($submit){$_SESSION=array(); session_destroy();}
?>
<table width="100%" height=100% border="1" cellspacing="6" cellpadding="0" bgcolor=white bordercolor=#cccccc >
  <tr bgcolor=white bordercolor=white>
    <td bgcolor=white bordercolor=white OnFocus="ShowHide('s1','hidden');">
	<?
switch($STEP)
	{	
	case "1":
//--------------------------------------------------------------LANGUAGES

define('REGISTER_USER', $w[50]);
define('FIRSTNAME', $w[51]);
$Variable = (isset($pass)) ? $pass : '';
define('PASSWORD', $w[54].' ['.C_PASSS.'-'.C_PASSB.' '.$w[52].']');
define('PASSWORD_VALUE', $Variable);

$Variable = (isset($rpass)) ? $rpass : '';
define('RETYPE_PASSWORD', $w[55]);
define('RETYPE_PASSWORD_VALUE', $Variable);
define('BIRTHDAY', $w[56]);	
$Variable = '';
$p = 1;
while (isset($wmm[$p]))
{
	if (isset($month) && ($month == $p)) $Variable .= '<option value="'.$p.'" selected>'.$wmm[$p];
	else $Variable .= '<option value="'.$p.'">'.$wmm[$p];
	$p++;
}
define('MONTH_VALUE', $Variable);
$Variable = '';
for($p = 1; $p < 32; $p++)
{
	if (isset($day) && ($day == $p)) $Variable .= '<option selected>'.$p;
	else $Variable .= '<option>'.$p;
}
define('DAY_VALUE', $Variable);
$Variable = '';
$y = date("Y", time());
$yfrom = $y-C_AGES;
$yto = $y-C_AGEB;
for($p = $yto; $p <= $yfrom; $p++)
{
	if (isset($year) && ($year == $p)) $Variable .= '<option selected>'.$p;
	else $Variable .= '<option>'.$p;
}
define('YEAR_VALUE', $Variable);
$Variable = '';
define('GENDER', $w[57]);
$p = 1;
while (isset($wg[$p]))
{
	if (isset($gender) && ($gender == $p)) $Variable .= '<option value="'.$p.'" selected>'.$wg[$p];
	else $Variable .= '<option value="'.$p.'">'.$wg[$p];
	$p++;
}
define('GENDER_VALUE', $Variable);
$Variable = '';
define('HEIGHT', $w[68]);
$p = 1;
while (isset($wh[$p]))
{
	if (isset($height) && ($height == $p)) $Variable .= '<option value="'.$p.'" selected>'.$wh[$p];
	else $Variable .= '<option value="'.$p.'">'.$wh[$p];
	$p++;
}
define('HEIGHT_VALUE', $Variable);
$Variable = '';
define('WEIGHT', $w[69]);
$p = 1;
while (isset($ww[$p]))
{
	if (isset($weight) && ($weight == $p)) $Variable .= '<option value="'.$p.'" selected>'.$ww[$p];
	else $Variable .= '<option value="'.$p.'">'.$ww[$p];
	$p++;
}
define('WEIGHT_VALUE', $Variable);
define('DESCRIPTION', $w[79]);
$Variable = (isset($descr)) ? tb($descr) :
'';
define('DESCRIPTION_VALUE', $Variable);
define("BILD",$w[87]);
define('EMAIL', $w[60]);
$Variable = (isset($email)) ? $email : '';
define("INFOTEXT", "<b><li>".$w[60]."</b>:<nobr>".is_hide(C_EMAILSH)."</li>");
define('EMAIL_VALUE', $Variable);
if ((C_AGR) && ($a == '')) define('AGREEMENT', '1');
else define('AGREEMENT', '2');

if (!file_exists(C_PATH.'/languages/'.$l.'/agr.php') || (empty($l))) $l = 'default';
if (!defined("REGISTER")) define('REGISTER', $w[89]);
define('LANG', $w[382].$Require.is_hide(C_LANGSH));
$tm = array(C_PASSS, C_PASSB);
define('PASSWORD_ERROR_1', template($w[6], $tm));
define('PASSWORD_ERROR_2', $w[48]);
define('PASSWORD_ERROR_3', $w[49]);
if (C_BIRTHR)
{
	define('BIRTHDAY_ALLOW', '1');
	define('BIRTHDAY_ERROR', $w[5]);
}
else
{
	define('BIRTHDAY_ALLOW', '0');
	define('BIRTHDAY_ERROR', '');
}

if (C_GENDR)
{
	define('GENDER_ALLOW', '1');
	define('GENDER_ERROR', $w[7]);
}
else
{
	define('GENDER_ALLOW', '0');
	define('GENDER_ERROR', '');
}
define('DESCRIPTION_ERROR', $w[38]);
if (C_FIRSTNR)
{
	$tm = array(C_FIRSTNS, C_FIRSTNB);
	define('FIRSTNAME_ALLOW', '1');
	define('FIRSTNAME_ERROR', template($w[3], $tm));
}
else
{
	define('FIRSTNAME_ALLOW', '0');
	define('FIRSTNAME_ERROR', '');
}

	define('AGB', $w[551]);
	define('AGB_ERROR',$w[552]);
//--------------------------------------------------------------LANGUAGES ENDE
?>
<body>	
<script language="JavaScript">
<!--
function formCheck(form) 
{
if (form.pass.value == "") {alert("<?=PASSWORD_ERROR_1?>");return false;}

if (form.rpass.value == "") {alert("<?=PASSWORD_ERROR_2?>");return false;}
if (form.pass.value != form.rpass.value) {alert("<?=PASSWORD_ERROR_3?>");return false;}
if (form.email.value == "") {alert("<?=EMAIL_ERROR?>");return false;}
if (form.fname.value == "") {alert("<?=FIRSTNAME_ERROR?>");return false;}
if (form.height.selectedIndex=="") {alert("<?=HEIGHT_ERROR?>");return false;}
if (form.weight.selectedIndex=="") {alert("<?=WEIGHT_ERROR?>");return false;}
if (form.gender.selectedIndex=="") {alert("<?=GENDER_ERROR?>");return false;}
if ( (form.month.selectedIndex == "") || (form.day.selectedIndex == "") || (form.year.selectedIndex == "")) {alert("<?=BIRTHDAY_ERROR?>");return false;}
if ( form.agbja.checked != true ) { alert("<?=AGB_ERROR?>"); return false; }
if (form.descr.value=="") {alert("<?=DESCRIPTION_ERROR?>");return false;}
}
// -->
</script>

	<table width="100%"  border="0" cellspacing="2" cellpadding="5" align=center bgcolor=white bordercolor=#666666>
      <tr bgcolor=white bordercolor=white>
        <td width="70%" valign="top" bgcolor=white bordercolor=white><fieldset><legend><?=REGISTER_USER?></legend>
          <br>
		<table width="100%" border="0" cellspacing="2" cellpadding="0">
<form action="<?=$PHP_SELF?>" method="POST" enctype="multipart/form-data" name=form OnSubmit="return formCheck(this);" OnClick="ShowHide('lang','hidden'); ShowHide('infotag','visible');">
<input type="hidden" name="l" value="<?=LANGUAGE?>">
<input type="hidden" name="l2" value="<?=$l2?>">
<input type="hidden" name="a" value="a">
<input type="hidden" name="have_error" value="<?=HAVE_ERROR?>">
<input type="hidden" name="STEP" value="<? $STEP++; echo $STEP; ?>">
<input type="hidden" name="passw" value="<?=MD5PASS?>">
<input type="hidden" name="id" value="<?=UID?>">
<input type="hidden" name="cc" value="0">


	
  <tr >
    <td width="18">&nbsp;</td>
    <td width="160"><?=FIRSTNAME?></td>
    <td width="20" valign="top" class=stars><?=$w[0]?></td>
    <td><input type="text" name="fname" style="width:250px" class="inp_txt" value="<?=$fname?>"></td>
  </tr>
  <tr>
    <td></td>
    <td><?=EMAIL?></td>
    <td width="20" valign="top" class=stars><?=$w[0]?></td>
    <td><input type="text" name="email" style="width:250px" class="inp_txt" value="<?=$email?>"></td>
  </tr>
  <tr>
    <td></td>
    <td><?=PASSWORD?></td>
    <td width="20" valign="top" class=stars><?=$w[0]?></td>
    <td><input type="password" name="pass" style="width:250px" class="inp_txt" value="<?=$pass?>"></td>
  </tr>
  <tr>
    <td></td>
    <td><?=RETYPE_PASSWORD?></td>
    <td width="20" valign="top" class=stars><?=$w[0]?></td>
    <td><input type="password" name="rpass" style="width:250px" class="inp_txt"  value="<?=$rpass?>"></td>
  </tr>
  <tr>
    <td></td>
    <td><?=BIRTHDAY?></td>
    <td width="20" valign="top" class=stars><?=$w[0]?></td>
    <td>
    
    <select name="month" style="width:63px" class="inp_txt">
    <option value=0> --------- 
   	<?=MONTH_VALUE?>
    </select>
    
    <select name="day" style="width:62px" class="inp_txt">
    <option value=0> ----- 
    <?=DAY_VALUE?>
    </select>
      
    <select name="year" style="width:119px" class="inp_txt">
    <option value=0> ----- 
    <?=YEAR_VALUE?>
    </select>
      
      </td>
  </tr>
  <tr>
    <td></td>
    <td><?=GENDER?></td>
    <td width="20" valign="top" class=stars><?=$w[0]?></td>
    <td>
    
    <select name="gender" style="width:250px" class="inp_txt">
      <option value=0> --------- 
      <?=GENDER_VALUE?>
    </select>
    
  	</td>
  </tr>
  <tr>
    <td></td>
    <td><?=HEIGHT?></td>
    <td width="20" valign="top" class=stars><?=$w[0]?></td>
    <td>
    
     <select name="height" style="width:250px" class="inp_txt">
      <option value=0> --------- 
      <?=HEIGHT_VALUE?>
    </select>
    
    </td>
  </tr>
  <tr>
    <td></td>
    <td><?=WEIGHT?></td>
    <td width="20" valign="top" class=stars><?=$w[0]?></td>
    <td>
    
    <select name="weight" style="width:250px" class="inp_txt">
      <option value=0> --------- 
      <?=WEIGHT_VALUE?>
    </select>
    
</td>
  </tr>
  <tr>
    <td></td>
    <td valign="top"><?=DESCRIPTION?></td>
    <td width="20" valign="top" class=stars><?=$w[0]?></td>
    <td valign=top>
    <textarea name="descr" style="width:250px" class="inp_txtaera"><?=DESCRIPTION_VALUE?></textarea>
    </td>
  </tr>
    <tr>
    <td></td>
    <td><?=BILD?></td>
    <td width="20" valign="top"></td>
    <td class=stars>(JPG/PNG)<br><input type="file" name="file1" style="width:250px" class="inp_txt"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td valign="top">&nbsp;</td>
    <td valign="top">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="3" align="left" valign="top"><input type="submit" name="register1" value="<?=REGISTER?>">&nbsp;&nbsp;<input type="checkbox" name="agbja" id="agbja" value="JA">&nbsp;<?=AGB?>&nbsp;</td>
</tr>
  </form>
</table>

		</fieldset></td>
        
		<td valign="top"><fieldset><legend>TEXT</legend>
		  <br>
            <table width="100%" height=150 border="0" cellspacing="0" cellpadding="5">
              <tr>
                <td valign=top width="100%">
        <div id="infotag" name=infotag style="position:absolute; z-index:1; visibility: hidden;">
				<?=INFOTEXT?>
				</div>
				<div id="lang" name=lang style="position:absolute; z-index:5; width:100%; visibility: visible;"><center><?=LANG?><br>
        <a href="<?=$PHP_SELF?>?l=en"><img src="/images/en.gif" width="24" height="15" border="1"></a> 
				<a href="<?=$PHP_SELF?>?l=de"><img src="/images/de1.gif" width="24" height="15" border="1"></a>
				<a href="<?=$PHP_SELF?>?l=ru"><img src="/images/ru1.gif" width="24" height="15" border="1"></a>
				</center>
				</div>
				<br><br><br><br>
				</td>
          </tr>
             <tr>
    <td valign=top height=262 class=scroll>
    <div id=s2 name=s2 style="width: 98%; height: 262px; overflow: auto; visibility: visable;" class=div2>
    <?
    $agb = implode ('', file ('languages/'.$l2.'/agr.php'));
		$agb = str_replace("\n","<br>",$agb);
		echo "<font style=font-size:9px; font-family:'Courier New', Courier, mono; voice-family:inherit; speech-rate:medium; speak:spell-out; >".$agb."</font>";
		?>
    <div>    
    </td>
    </tr>
</table>
		</fieldset></td>
      </tr>
    </table>
	<?
	break;
	//--------------------------------------------------------------------------------------------------
	case"2":
		//------------------------------------------------------------------------------------------------
		//             CHECK DER DATEN UND SPEICHEN IN DB
		//------------------------------------------------------------------------------------------------	
  	// Siehe oben... 
		//----------------------------------- weiter mit Auswahl des Landes ------------------------------
	switch($cc)
		{
			
		case"0":
			$mq="select id, staat, language from _map order by staat ASC";
			$dbd0->select($mq);

			if ($dbd0->getRecords()>0)
				{ 
	 			while($O = $dbd0->fetchArray())
					{
					if (!@in_array(strtoupper($O[staat]),$LC)){
					$LC[]  		= 	trim(strtoupper($O[staat]));
					$LCL[] 		= 	trim($wcr[$O['language']]);
					$LZIFF[] 	=  	$O['language'];
					}}
				}
	
	
			if ($country=="")
				{
				$bild="<a href=\"javascript:void(0);\" style=\"cursor:hand; text-decoration: none;\">&nbsp;&nbsp;-&nbsp;&nbsp;-&nbsp;&nbsp;-&nbsp;&nbsp;</a>&nbsp;&nbsp;";
					}else{
				 			$bild="<a href=\"javascript:void(0);\" style=\"cursor:hand; text-decoration: none;\">\n
			 				  &nbsp;<img src=\"/flaggen/flaggen.php?CTRY=".$country."\" border=1 style=border: 1px solid #000000;  width=18 height=12 align=\"absmiddle\">&nbsp;&nbsp;".trim($wcr[$LCI])."</a>";
				}
      //--------begin table länder
       $OUT.='<table border="0" cellpadding="0" cellspacing="0" bordercolor="#ffffff" bgcolor="#FFFFFF">'
  		 			.'<tr bordercolor="#7F9DB9" bgcolor="#FFFFFF">'
    	 			.'<td width="90%" height="12"  onClick="ShowHide(\'s1\',\'visible\');" nowrap bgcolor="#FFFFFF" class=borderl>'.$bild
    	 			.'</td><td width="11" height="12" align="center" valign="middle"  bgcolor="#FFFFFF" class=borderr>'
   			 		.'<img src="/images/ddown.png"  name="Image1" id="Image1" onClick="ShowHide(\'s1\',\'visible\');" '
   			 		.'onDblClick="ShowHide(\'s1\',\'hidden\');" onMouseOver="MM_swapImage(\'Image1\',\'\',\'/images/ddowndown.png\',1)" '
   			 		.'onMouseOut="MM_swapImgRestore()"></td>'
   			  	.'<td width="1" height="12"  bgcolor="#FFFFFF"></td>'
  					.'</tr><tr><td height="12" colspan="3" class=scroll nowrap onlosecapture="ShowHide(\'s1\',\'hidden\');">'
						.'<div id=s1 name=s1 style="width: 100%; height: 120px; overflow: auto; visibility: hidden;" class=div2 onlosecapture="ShowHide(\'s1\',\'hidden\');">';
						
   		$OUT.= '<table width=100% border="0" cellpadding="1" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">';
   		$OUT.= '<tr valign="middle" bordercolor="#000000" bgcolor="#FFFFFF" onMouseOver="pviiClassNew(this,\'zwei\')" class="eins" onMouseOut="pviiClassNew(this,\'eins\')">';
	 		
			$nn=1;for ($n=0;$n <= count($LCL)-1;$n++)
				{
				$OUT.="<a href=".$PHP_SELF."?country=".strtolower($LC[$n])."&l=".$l."&LCI=".$LZIFF[$n]."&cc=1&STEP=2>\n<td nowrap onMouseOut=\"ShowHide('s1','visible');\">
			 		&nbsp;<img src=\"/flaggen/flaggen.php?CTRY=".strtolower($LC[$n])."\" border=1 style=border: 1px solid #000000;  width=18 height=12 align=\"absmiddle\">&nbsp;&nbsp;".$LCL[$n]."</td></a>\n";
  			$nn++;if($nn > 0){$nn=0;$OUT.='<tr><tr valign="middle" bordercolor="#000000" bgcolor="#FFFFFF" onMouseOver="pviiClassNew(this,\'zwei\')" class="eins" onMouseOut="pviiClassNew(this,\'eins\')">';}
				}
   		
   		$OUT.="</div></tr></table>\n";
	 		$OUT.='</td></tr></table>';
	 		$OUT.="<input type=hidden name=l value=".$l.">\n";	
	break;

	case"1":
		switch($country)
			{
				case "ru":
				case "ua":
				case "by":
				case "az":
				case "ee":
				case "ge":
				case "kg":
				case "kz":
				case "lt":
				case "lv":
				case "md":
				case "md":
				echo "allcases";
				$mna=$mnaus="";
				
				if ($l=="de"){$mna="name_de";}  	If ($l=="en"){$mna="name_en";}
				if ($l=="ru") {$mna="gebietrus";}
				
				$mq="select id, staat, language, $mna  from _map where staat ='".$country."' and kategorie='2' order by name_en ASC";
  			
				$dbd0->select($mq);
				
				if ($dbd0->getRecords()>0)
					{
					$OUT.="<select name=\"oblast\" onChange=javascript:form1.submit();>\n";
					$OUT.="<option value=\"\"> - - - </option>\n";
					
					$p=0;
					
					while($O = $dbd0->fetchArray())
						{
						$ONmae = $O[$mna];
						if (!@in_array(strtoupper($O[staat]),$LC))
								{
								$p++;
								$OUT.="<option value=\"". $O[id] ."\">". $ONmae ."</option>\n";
								}
							}
						}
				
					$OUT.="</select>\n";
					$OUT.="<input type=hidden name=cc value=2>\n";
					$OUT.="<input type=hidden name=country value=\"".$country."\">\n";
					$OUT.="<input type=hidden name=l value=".$l.">\n";
					
			 // $OUT .="<input type=\"submit\" name=\"Submit\" value=\" ". REGISTER. "\">";	
					
					if ($p<=1)
							{
								
							$OUT =  "City:<input type=hidden name=country value=\"".$country."\">
							 			   <input type=text name=city value=\"".$city."\">
							 			   <input type=hidden name=cc value=4>\n";
							$OUT .= "<input type=hidden name=l value=".$l.">\n";
							$OUT .= "<input type=\"submit\" name=\"Submit\" value=\" ". REGISTER. "\">";			 
							
							}
							
				break;

	default:
		
		
		
		$mna="";
		$mnaus="";
		
		if ($l=="de"){$mna="name_de"; $xand = "and kategorie='2'";}  If ($l=="en"){$mna="name_en";}
		if ($l=="de"){$mnaus="name_de";} If ($l=="en"){$mnaus="name_en";}
		if ($l=="ru"){$mnaus="gebietrus";}
	
		if ($country=="pl"){$mna="gebietrus";$xand = "and kategorie='2'";}
	
		$mq="select id, staat, language, $mna from _map where staat ='".$country."' $xand order by name_en ASC";
		$dbd0->select($mq);
	
		if ($dbd0->getRecords()>0)
			{
			$OUT.="<select name=\"oblast\" onChange=javascript:form1.submit();>\n";
			$OUT.="<option value=\"\"> - - - </option>\n";		
			$p=0;
			while($O = $dbd0->fetchArray())
				{
				if (!@in_array(strtoupper($O[staat]),$LC))
					{
					$p++;
					$OUT.="<option value=\"". $O[id] ."\">". $O[$mna] ."</option>\n";	
				}}}

		$OUT.="</select>\n";
		$OUT.="<input type=hidden name=cc value=2>\n";
		$OUT.="<input type=hidden name=country value=\"".$country."\">\n";
		if ($p <= 1){
			$OUT ="City:<input type=hidden name=country value=\"".$country."\">
				 			<input type=text name=city value=\"".$city."\">
				 			<input type=hidden name=cc value=4>\n";
			$OUT.="<input type=hidden name=l value=".$l.">\n";
			$OUT .="<input type=\"submit\" name=\"Submit\" value=\" ". REGISTER. "\">";
			}
	break;
	}
break;
//---------------------------------------------------------------------ENDE cc=1
case"2":



//---------------------------------------------------------------------cc=2
	if ($l=="de"){$mna="stadt_de";}  	If ($l=="en"){$mna="stadt_en";}
	if ($l=="ru") {$mna="stadt_en";}
	$mq="select id, staat, language, $mna  from _map where id ='".$oblast."'limit 0,1";
	$dbd0->select($mq);
	
	if ($dbd0->getRecords()>0)
		{
		$OUT.="<select name=\"city\" onChange=javascript:form1.submit();>\n";
		$OUT.="<option value=\"\"> - - - </option>\n";
		$p=0;
		$O = $dbd0->fetchArray();
		$stadte = explode("|",$O[$mna]);
		for($j=0;$j<=count($stadte)-1;$j++)
			{ 	
			$OUT.="<option value=\"". $j ."\"";
			if ($city==uml($stadte[$p])){$OUT.=" selected";}
			$OUT.=">". uml($stadte[$p]) ."</option>\n";
			$p++;
			}
		}
	
	if ($city==" "){$p=0;}
	$OUT.="<option value=\" \">andere..</option>\n";
	$OUT.="</select>\n";
	$OUT.="<input type=hidden name=cc value=3>\n";
	$OUT.="<input type=hidden name=country value=\"".$country."\">\n";
	$OUT.="<input type=hidden name=oblast value=\"".$oblast."\">\n";
	$OUT.="<input type=hidden name=l value=".$l.">\n";
	// $OUT .="<input type=\"submit\" name=\"Submit\" value=\" ". REGISTER. "\">";
	if ($p==0){
		$OUT ="City:<input type=hidden name=country value=\"".$country."\">
				 <input type=text name=city value=\"".trim($city)."\">
				 <input type=hidden name=cc value=4>\n
				 <input type=hidden name=l value=".$l.">\n
				 <input type=hidden name=oblast value=\"".$oblast."\">";
		$OUT .="<input type=\"submit\" name=\"Submit\" value=\" ". REGISTER. "\">";
				
		}
	//	else{
	//	$OUT .="<input type=\"submit\" name=\"Submit\" value=\" ". REGISTER. "\">";
	// 	}

//---------------------------------------------------------------------
break;
case "3":
$OUT = "<input type=hidden name=country value=\"".$country."\">";
$OUT .= $city;
				if ($city == "" || $city== " ")
					{
$OUT .=	 	"<input type=text name=city value=\"".trim($city)."\">";
					}
$OUT .=	"<input type=hidden name=cc value=4>\n
				 <input type=hidden name=l value=".$l.">\n
				 <input type=hidden name=oblast value=\"".$oblast."\">";
$OUT .= "<input type=\"submit\" name=\"Submit\" value=\" ". REGISTER. "\">";

break;


case "4":

if ($_SESSION[gender]==2)
	{
	$sgender=1;
	$req=1;
	}else
	{	$req=0; $sgender=2; }
//---------------------------------------------------------------------

$birthday=$_SESSION[year]."-".$_SESSION[month]."-".$_SESSION[day];		//					// fname 					lname birthday gender purposes country city height weight sgender files horo regdate editdate hits hits_count status req 			
 
 																													// 	id  		username 										fname 						lname 		birthday 					gender 					purposes 	country 							city 								height 									weight 								 sgender 		files horo regdate editdate hits hits_count status req 
mysql_query("INSERT INTO ".C_MYSQL_MEMBERS_MAIN." VALUES ('', '" . $_SESSION[fname] . "','" . $_SESSION[fname] . "','','".$birthday."','".$_SESSION[gender]."','".$_SESSION[oblast]."','".$_SESSION[LCI]."','".$_SESSION[city]."','".$_SESSION[height]."','".$_SESSION[weight]."','".$sgender."','0','".horo($_SESSION[month],$_SESSION[day])."',NOW(''),NOW(''),'0','0','1','".$req."')") or die(mysql_error());
 				
 		
 		$last_id = mysql_fetch_array(mysql_query("SELECT LAST_INSERT_ID() AS last_id"));
 		$last_id = $last_id['last_id'];
 		$id=$last_id;		
 		mysql_query("REPLACE INTO ".C_MYSQL_MEMBERS_EXT." VALUES ('".$last_id ."','','','','','','','','','','','','','','','','','','','','".$_SESSION[descr]."','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','".$hdyfu."','','1')") or die(mysql_error());
 		mysql_query("INSERT INTO ".C_MYSQL_MEMBERS_SEC." VALUES ('".$last_id ."','".$_SESSION[pass]."','".$_SESSION[email]."','".ip2int(ip())."','0','1')") or die(mysql_error());
 		// hinzugefügt --- Falko ------------------------------------------------------------------------
 		mysql_query("INSERT INTO _members_pic_txt VALUES ('" . $last_id . "','','','','','','','','','','','','','','','','')") or die(mysql_error());
 		mysql_query("INSERT INTO _members_int VALUES ('" . $last_id . "','','','','','','','','','','','','','','','','','','','','','','')") or die(mysql_error());
		
		if ($_SESSION[UNIC])
		{
		
		$UNIC = $_SESSION[UNIC];
		echo $UNIC; 
		
		$filename = $UNIC;
		
		$UPFILE =  "/opt/lampp/htdocs/upload/".$UNIC;
		
		$MOVE_TO_AZDG="/opt/lampp/htdocs/members/uploads/".id2path($last_id)."0";
		
		$NEADMINFILE ="/opt/lampp/htdocs/upload/".$last_id;
		
		include "inc/phpthumb.class.php";
			$filename= $UNIC;
			$tn = new phpThumb();
			$tn->src 				= $UPFILE;
			$tn->iar=0;
			$tn->w = 550;
			$tn->q = 62;
			$tn->bg="ffffff";
			$tn->bgt=265;
			$tn->aoe=0;
			$tn->bw=0;
			$tn->bc="919191";
			$tn->config_output_format = 'png';
			$tn->config_error_die_on_error = false;
			if ($tn->GenerateThumbnail()) 
				{
    		 $tn->RenderToFile($filename);
    		 copy ($filename,$NEADMINFILE); // von temp nach upload admin
    		 copy($filename,$MOVE_TO_AZDG);
    		 unlink($filename);
    	   unlink($UPFILE);
    	   if (file_exists($MOVE_TO_AZDG))
    	   {
    	   mysql_query("UPDATE ".C_MYSQL_MEMBERS_MAIN." SET files='0', status = '1'  WHERE id = '".$last_id."'");
    	   }
  			}
		}
		
session_destroy();
$_SESSION=array();
//---------------------------------------------------------------------
echo " <script language=\"JavaScript\"><!--\n
 window.location.replace( '". C_URL . "/login.php?l=" .$l. "&" .s(). "&p=s&id=" .$_SESSION[email]. "&password=" .$_SESSION[pass] ."' );
  -->
 </script>";
 session_destroy();
$_SESSION=array();
break;

}//------------------------------------------------------ende cc

break;
}
//----------------------------------------------------------ende STEPS
if ($_SESSION[STEP] == 2 && $have_error==0)
	{
	$birthday="$year-$month-$day";
	?>
	<table  border="0" cellspacing="2" cellpadding="5" align=center>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td width="480" valign="top"><fieldset><legend><b></b></legend><br>
	<table width="100%"  border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td><div align="center"><br>
    <form action=<?=$PHP_SELF?> method=POST name=form1 target=_self>
		<?=$HIDDFDS?>
		<?=$OUT?>
		<input type="hidden" name="STEP" value="2">
		<input type="hidden" name="STEP" value="2">
	</form>  
  </div></td>
  </tr>
</table>
	</fieldset>
	</td>
    <td width="199"><fieldset><br><table width="100%"  border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td height="279" valign="top">ADVERTISING oder so </td>
  </tr>
	</table>
	</fieldset></td>
  </tr>
</table>
<?	
}
?>
	</td>
  </tr>
</table>

<?include_once C_PATH.'/footer.php';?>


<?
	function is_hide($var)
{
	Global $w,$wpu;
	if(C_REGISTER_NOTE && $var < 255)
	return ($var <= C_HIDE_FIELDS) ? '' : template($w[404],array($wpu[$var]));
	else
	return ($var <= C_HIDE_FIELDS) ? '' : $w[348];
}


function uml($in)
{
$in =	str_replace("%C3%BC","ue", $in);
$in =	str_replace("%C3%A4","ae", $in);
$in =	str_replace("%C3%B6","oe", $in);
$in =	str_replace("%C3%A9","e",  $in);
$in =	str_replace("%C3%9C","Ue", $in);
$in =	str_replace("%FC","ue",    $in);
$in =	str_replace("%E4","ae",    $in);
$in =	str_replace("%F6","oe",    $in);
$in =	str_replace("%E9","e",     $in);
$in =	str_replace("_"," ",       $in);
$in =	str_replace("%28","(",     $in);
$in =	str_replace("%29",")",     $in);
$in =	str_replace("%2C",",",     $in);
$in =	str_replace("%C3%9F","ss", $in);
$in =	str_replace("%27","'", $in);
return $in;
}
