<?php
$query = 'select `code`,`value` from `wd_g_settings` where `code` in ("Aff_login_text_in_the_middle_msg","Aff_signup_terms_conditions") and `accountid`='._q($GLOBALS['Auth']->getAccountID());
$rs = $GLOBALS['db']->Query($query);
$GLOBALS['dbrequests']++;
foreach($rs as $settings){
    $_POST[str_replace('Aff_','',$settings['code'])] = $settings['value'];
}
?>
<h3><?php echo L_G_SETUPWIZARD.'  '.L_G_SECONDEPSTITLE; ?></h3>
<p><?php echo L_G_SW_STEP2DESC; ?></p>
<table class="listing mt10" width="780" border="0" cellspacing="0" cellpadding="0">
<?php QUnit_Templates::printFilter(1, L_G_SECONDEPSTITLE); ?>
<tr><td>
    <form id="wizardform" action="index.php?md=Affiliate_Merchants_Views_SetupWizard" method="POST">
    <table class="tb2" cellpadding="5" cellspacing="0" border="0" width="100%">
        <tr><td width="100%"><b><?php echo L_G_TEXTINTHEMIDDLE; ?></b>
            <p><?php echo L_G_COMPANY_DESC; ?></p>
        </td></tr>
        <tr>
            <td>
                <textarea id="editor1" name="login_text_in_the_middle_msg"><?php echo $_POST['login_text_in_the_middle_msg']; ?></textarea>
            </td>
        </tr>
        <tr><td><b><?php echo L_G_TERMOFREGISTER; ?></b>
            <p><?php echo L_G_TERMOFREGISTER_DESC; ?></p>
        </td></tr>
        <tr>
            <td>
                <textarea id="editor2" name="signup_terms_conditions"><?php echo $_POST['signup_terms_conditions']; ?></textarea>
            </td>
        </tr>
        <tr>
            <td class="wizard_buttons">
                <input class="btn" type="button" onclick="StepBackOn();" value="<?php echo L_G_BACKDTEP; ?>" />
                <input class="btn" type="button" onclick="SaveAndGotoNextStep();" value="<?php echo L_G_SAVEANDNEXT; ?>" />
                <input class="btn" type="button" onclick="SaveAndFinish();" value="<?php echo L_G_SAVEANDFINISH; ?>" />
                <input class="btn" type="button" onclick="SkipCurrentStep();" value="<?php echo L_G_SKIPTHISSTEP; ?>" />
                <input type="hidden" value="2" name="step" id="step" />
                <input type="hidden" value="no" name="commited" id="commited" />
                <input type="hidden" value="no" name="finish" id="finish" />
            </td>
        </tr>
    </table>
    </form>
</td></tr>
</table>

<script type="text/javascript" src="../scripts/jquery.js"></script>
<script type="text/javascript" src="../include/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="../include/ckfinder/ckfinder.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	var config = {
		toolbar:
		[
			['Source','-','Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'],
			['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
            ['Font','FontSize'],
            ['TextColor','BGColor']
		],
        height: '175px'
	};


    if(typeof CKEDITOR == 'undefined') {
        $('#editor1').value('加载CKEditor失败，请如果您不是开发人员，请联系系统管理员，谢谢！');
        $('#editor2').value('加载CKEditor失败，请如果您不是开发人员，请联系系统管理员，谢谢！');
    } else {
        var __editor1 = CKEDITOR.replace('editor1',config);
        CKFinder.setupCKEditor(__editor1, '../include/ckfinder/');

        var __editor2 = CKEDITOR.replace('editor2',config);
        CKFinder.setupCKEditor(__editor2, '../include/ckfinder/');
    }
});
</script>
