<?php
$_POST['sitename'] = $_SESSION['sitename'];

$query = 'select `code`,`value` from `wd_g_settings` where `code` in ("Aff_main_site_url","Aff_system_email","Aff_notifications_email") 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_FIRSTSTEPSTITLE; ?></h3>
<p><?php echo L_G_SW_STEP1DESC;?></p>

<table class="listing mt10" width="780" border="0" cellspacing="0" cellpadding="0">
<?php QUnit_Templates::printFilter(1, L_G_FIRSTSTEPSTITLE); ?>
<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="120"><b><?php echo L_G_PZONE_SITETITLE;?></b></td>
            <td>
                <input class="txt" type="text" size="50" name="sitename" value="<?php echo $_POST['sitename'];?>">
            </td>
        </tr>
        <tr>
            <td><b><?php echo L_G_URL_TO_MAIN_SITE; ?></b></td>
            <td>
                <input class="txt" type="text" size="50" name="main_site_url" value="<?php echo $_POST['main_site_url'];?>">
                <p><?php echo L_G_HLPURL_TO_MAIN_SITE; ?></p>
            </td>
        </tr>
        <tr>
            <td><b><?php echo L_G_SYSTEMEMAIL; ?></b></td>
            <td>
                <input class="txt" type="text" size="50" name="system_email" value="<?php echo $_POST['system_email'];?>">
                <p><?php echo L_G_SYSEMAIL_DESC; ?></p>
            </td>
        </tr>
        <tr>
            <td><b><?php echo L_G_EMAILFORSENDINGNOTIFICATIONS; ?></b></td>
            <td>
                <input class="txt" type="text" size="50" name="notifications_email" value="<?php echo $_POST['notifications_email'];?>">
                <p><?php echo L_G_HLPEMAILFORSENDINGNOTIFICATIONS;?></p>
            </td>
        </tr>
        <tr>
            <td>&nbsp;
                <input type="hidden" value="1" name="step" id="step" />
                <input type="hidden" value="no" name="commited" id="commited" />
                <input type="hidden" value="no" name="finish" id="finish" />
            </td>
            <td class="wizard_buttons">
                <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; ?>" />
            </td>
        </tr>
    </table>
    </form>
</td></tr>
</table>
