<?php
$query = 'select * from `wd_pz_settings` where `code`="sitename" || `code`="sitelogo"';
$rs = $GLOBALS['db']->Query($query);
$GLOBALS['dbrequests']++;
if(!$rs->EOF) {
    foreach($rs as $row) $pzoneSettings[$row['code']] = $row;
}
$_SESSION['sitename'] = $siteName = !empty($pzoneSettings['sitename']['svalue'])?$pzoneSettings['sitename']['svalue']:MT_SITETITLE;
$siteLogo = !empty($pzoneSettings['sitelogo']['svalue'])?$pzoneSettings['sitelogo']['svalue']
            :(($logo=$GLOBALS['Auth']->getSetting('Aff_style_logo_url')) != '' ? $logo : $this->a_this->getImage('web_logo.gif'));
define('FINAL_SITELOGO',$siteLogo);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta content="Marketools Inc." name="Copyright" />
<title><?php echo $_SESSION['sitename'],' > ',L_G_DEFAULT_SUBJ_AFF_EMAIL_FORGOTPAS2; ?></title>
<link type="text/css" rel="stylesheet" media="all" href="../templates/affiliate/default/css/login.css" />
<!--[if lt IE 7]>
<style type="text/css">img, div{ behavior: url(../templates/affiliate/default/css/iepngfix.htc);}</style>
<![endif]-->

<script type="text/javascript">
function validate(form) {
  if (form.username.value == "") {
    alert("<?php echo L_G_YOUHAVETOENTEREMAIL?>");
    return false;
  }

  return true;
}
</script>
</head>

<body id="login">
    <div id="wrappertop"></div>
        <div id="wrapper">
                <div id="content">
                    <div id="header">
                        <h1><a href="index.php"><img src="<?php echo QUnit_UI_TemplatePage::getImage('login_logo.gif'); ?>" title="MT 4.0" alt="MT 4.0"></a></h1>
                    </div>
                    <form action="forgot_password.php" method="post" onsubmit="return validate(this)">
                    <fieldset class="form">
<?php
    if(!empty($GLOBALS['errorMessages']) && is_array($GLOBALS['errorMessages'])) {
        echo '<p class="error">'.join('<br />',$GLOBALS['errorMessages']).'</p>';
    }
    if(!empty($GLOBALS['okMessages']) && is_array($GLOBALS['okMessages'])) {
        echo '<p class="sucess">'.join('<br />',$GLOBALS['okMessages']).'</p>';
    }
?>
                        <p>
                            <label for="user_name">Email：</label>
                            <input name="username" id="user_name" type="text" value="<?php echo $_REQUEST['username']?>" />
                        </p>

                        <button type="submit" class="positive" name="Submit">
                            <img src="<?php echo QUnit_UI_TemplatePage::getImage('email_go.png'); ?>" alt="Announcement"/><?php echo L_G_GETPASSWORDSETP1; ?></button>
                    </fieldset>
                      <input type="hidden" name="md" value="QCore_ForgotPassword" />
                      <input type="hidden" name="action" value="<?php echo $_POST['action']?>" />
                      <input type="hidden" name="postaction" value="step1" />
                      <input type="hidden" name="commited" value="yes" />
                    </form>


                    <form action="forgot_password.php" method="post" onsubmit="return validate(this)">
                    <fieldset class="form">
                        <p>
                            <label for="code">Code：</label>
                            <input name="code" id="code" type="text" value="<?php echo $_REQUEST['code']?>" />
                        </p>

                        <button type="submit" class="positive" name="Submit">
                            <img src="<?php echo QUnit_UI_TemplatePage::getImage('email_go.png'); ?>" alt="Announcement"/><?php echo L_G_GETPASSWORDSETP2; ?></button>
                    </fieldset>
                      <input type="hidden" name="md" value="QCore_ForgotPassword" />
                      <input type="hidden" name="action" value="<?php echo $_POST['action']?>" />
                      <input type="hidden" name="postaction" value="step2" />
                      <input type="hidden" name="commited" value="yes" />
                    </form>
                </div>
            </div>


        <div id="wrapperbottom_branding"><div id="wrapperbottom_branding_text">
            <p><a href="index.php"><?php echo L_G_BACKTOLOGIN;?></a></p>
            <p>By <a href="http://www.marketools.cn" target="_blank">Marketools</a>.
            Copyright &copy 2007-<?php echo date('Y'); ?></p>
            <p><a href="../"><?php echo L_G_HOME;?></a></p>
        </div></div>

    </body>
</html>

