<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
?>

<!--<?php
	$getcodehtml=get_cercode(200,48,0,3);
	if($action==''):
print <<<EOT
-->
<script language="JavaScript" type="text/javascript">
var __username_check=false;

function msgshow(str, which) {
	if(which == 'username') {
		if (str.indexOf('@@@') != -1){
			var arrStr = str.split('@@@');
			getObj('username_info').innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$lang['lang.str22']}";
			getObj('username_info').style.cssText = "color:#FF3300;";
			getObj(sName).className = "regcheckno";
			__username_check=false;
		}else{
			getObj('username_info').innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$lang['lang.str21']}";
			getObj('username_info').style.cssText = "color:#339900;";
			getObj(sName).className = "regcheckok";
			__username_check=true;
		}
	}
}

var arrName = ["username"];
var arrInfo = ["{$lang['login_msg_name']}"];

function BlurCheck(divname){
	var sName = divname+"_info";
	if (!getObj(sName)) return
	with (getObj('theForm')) {
		var err = null;
		switch (divname) {
			case 'username':
				if(eval(divname+".value") == ''){
					getObj(sName).innerHTML = '{$lang['Error.str4']}';
					err = false;
				}else if(eval(divname+".value") != '' ){
					document.usernameform.username_c.value = eval(divname+".value");
					getObj(sName).innerHTML = '{$lang['lang.str10']}';
					document.usernameform.submit();		

				}
			break;
		}
		if (err === false ) {
			getObj(sName).className = "regcheckOut";
		}else if (err === true ){
			getObj(sName).innerHTML = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
			getObj(sName).className = "regcheckok";
		}else if (err === null){
			getObj(sName).innerHTML = GetarrInfoText(divname);
			getObj(sName).className = "regcheckText";
		}
	}
	return err;
}
function formcheck() {
	var reCheck=true;
	reCheck =validatecercode();
	for (var i = 0; i < arrName.length; i++) {	
		var re;
		if ( __username_check===false && arrName[i]=='username') re= BlurCheck(arrName[i]);
		else if (arrName[i]!='username') re= BlurCheck(arrName[i]);
		if (re === false || __username_check===false){
			reCheck = false;
		}
	}
	return reCheck;
}
</script>

<!--lostpass.php##忘记密码对话框(普通会员)-->
<div class="mainbox">
<iframe id="checkframe" name="checkframe" width="0" height="0"></iframe>
<form name="usernameform" action="reg.php" method="post" target="checkframe">
<input type="hidden" name="username_c">
<input type="hidden" name="action" value="usernamecheck">
</form>
<form  name=theForm id=theForm action="lostpass.php?action=step1" method="post" onsubmit="return formcheck()">
<div class="page_right" style="margin:0px 0px 0px 0px; width:270px; border:0px;">
	<div class="leftcolor" style=" background:#F4FCEE;"><br />
	<span class="font14 username">{$lang['tpl.reg.str1']}</span>
	<span class="username"><br />{$lang['tpl.reg.str2']}</span>
	<span><button onMousemove="button_move(this)" onMouseout="button_out(this)" onclick="javascript:self.location='reg.php'"> {$lang['tpl.reg.str3']} </button></span><br /><br />
	</div>
</div>
<ul class="tableborder heightd page_left2">
  <h3 class="titlebig"> {$lang['tpl.str1']}</h3>
  <li><p class="font14">{$lang['tpl.str2']}</p><input name="username" id="username" type="text"/>&nbsp;&nbsp;<span id="username_info"></span></li>
  <li><p class="font14"> {$lang['tpl.forget.cercode']}</p>{$getcodehtml}</li>
  <li>
	<p></p>
	{$lang['tpl.str3']}
  </li>
  <li>
	<p></p>
	<button onMousemove="button_move(this)" onMouseout="button_out(this)"  type="submit" name="submit" > {$lang['tpl.str4']} </button>
  </li>

  </ul>
</div>

</form>
<SCRIPT LANGUAGE="JavaScript">
<!--
	initShowInfo();
//-->
</SCRIPT>

<!--
EOT;
	elseif($action=='step1'):
		$username=$_POST['username'];
		print <<<EOT
-->
<SCRIPT LANGUAGE="JavaScript">

function formcheck() {
	var reCheck=true;
	reCheck =validatecercode();
	return reCheck;
}
</script>

<!--lostpass.php##忘记密码setup1(普通会员)-->
<div class="mainbox">
<form action="lostpass.php?action=step2" method="post" onsubmit="return formcheck()">
<input type="hidden" name="username" value="{$username}">
<input type="hidden" name="answer" value="{$answer}">
<div class="page_right" style="margin:0px 0px 0px 0px; width:270px; border:0px;">
	<div class="leftcolor" style=" background:#F4FCEE;"><br />
	<span class="font14 username">{$lang['tpl.reg.str1']}</span>
	<span class="username"><br />{$lang['tpl.reg.str2']}</span>
	<span><button onMousemove="button_move(this)" onMouseout="button_out(this)" onclick="javascript:self.location='reg.php'"> {$lang['tpl.reg.str3']} </button></span><br /><br />
	</div>
</div>
<ul class="tableborder heightd page_left2">
  <h3 class="titlebig"> {$lang['tpl.str5']}</h3>
  <li><p class="font14">{$lang['tpl.str6']}</p>{$Quesion}</li>
  <li>
	<p class="font14">{$lang['tpl.str7']}</p>
	<INPUT name="answer" type="text" tabindex="1"/> 
  </li>
  <li><p class="font14"> {$lang['tpl.forget.cercode']}</p>{$getcodehtml}</li>
  <li>
	<p></p>
	{$lang['tpl.str8']}
  </li>
  <li>
	<p></p>
	<button onMousemove="button_move(this)" onMouseout="button_out(this)"  type="submit" name="submit" > {$lang['tpl.str4']} </button>
  </li>

  </ul>
</div>
<input type="hidden" value="{$username}" name="username"/>
</form>

<!--
EOT;
	elseif($action=='step2'):
	$answer=$_POST['answer'];
		print <<<EOT
-->

<!--lostpass.php##忘记密码setup2(普通会员)-->

<div class="mainbox">
<form action="lostpass.php?action=step3" method="post">
<input type="hidden" name="username" value="{$username}">
<input type="hidden" name="password" value="{$password}">
<input type="hidden" name="answer" value="{$answer}">
<div class="page_right" style="margin:0px 0px 0px 0px; width:270px; border:0px;">
	<div class="leftcolor" style=" background:#F4FCEE;"><br />
	<span class="font14 username">{$lang['tpl.reg.str1']}</span>
	<span class="username"><br />{$lang['tpl.reg.str2']}</span>
	<span><button onMousemove="button_move(this)" onMouseout="button_out(this)" onclick="javascript:self.location='reg.php'"> {$lang['tpl.reg.str3']} </button></span><br /><br />
	</div>
</div>
<ul class="tableborder heightd page_left2">
  <h3 class="titlebig"> {$lang['tpl.str9']}</h3>
  <li><p class="font14">{$lang['tpl.str6']}</p>{$Quesion}</li>
  <li>
	<p class="font14">{$lang['tpl.str7']}</p>
	<INPUT name="answer" type="text"/> {$answer}
  </li>
  <li>
	<p class="font14">{$lang['tpl.str10']}</p><input type=password name=password>
  </li>
  <li>
	<p class="font14">{$lang['tpl.str11']}</p><input type=password name=repassword>
  </li>
  <li>
	<p ></p>{$lang['tpl.str12']}
{$readme}
  </li>
  <li>
	<p class="font14"></p>
	<button onMousemove="button_move(this)" onMouseout="button_out(this)"  type="submit" name="submit"> {$lang['tpl.str4']} </button>
  </li>

  </ul>
</div>
</form>

<!--
EOT;
	elseif($action=='step3'):
		$sql_info="select useranswer,userquesion,usertoday,userid from {$dv}user where username='".trim($username)."'";
		$result=$db->query($sql_info);
        $step3_info=$db->fetch_array($result);
		$Quesion=$step3_info['userquesion'];
		$password=$_POST['password'];
		print <<<EOT
-->

<!--lostpass.php##忘记密码setup3(普通会员)-->
<div class="mainbox">

<form action="login.php" method="post">
<input type="hidden" name="username" value="{$username}">
<input type="hidden" name="password" value="{$password}">
<input type="hidden" name="answer" value="{$answer}">
<div class="page_right" style="margin:0px 0px 0px 0px; width:270px; border:0px;">
	<div class="leftcolor" style=" background:#F4FCEE;"><br />
	<span class="font14 username">{$lang['tpl.str1']}</span>
	<span class="username"><br />{$lang['tpl.str2']}</span>
	<span><button onMousemove="button_move(this)" onMouseout="button_out(this)" onclick="javascript:self.location='reg.php'"> {$lang['tpl.str3']} </button></span><br /><br />
	</div>
</div>
<ul class="tableborder heightd page_left2">
  <h3 class="titlebig"> {$lang['tpl.str13']}</h3>
  <li><p class="font14">{$lang['tpl.str6']}</p>{$Quesion}</li>
  <li>
	<p class="font14">{$lang['tpl.str7']}</p>
	<INPUT name="answer" type="text"/> {$answer}
  </li>
  <li>
	<p class="font14">{$lang['tpl.str10']}</p>{$password}
  </li>
  <li>
	<p ></p>{$lang['tpl.str12']}{$lang['tmp.info34']}
  </li>
  <li>
	<p class="font14"></p>
	<button onMousemove="button_move(this)" onMouseout="button_out(this)"  type="submit" name="submit"> {$lang['tpl.str4']} </button>
  </li>
  </ul>
</div>
</form>
<!--
EOT;
	endif;
?>-->

