<!-- $Id: integrates_setup.htm 13961 2008-01-07 06:54:44Z dolphin $ -->
{include file="pageheader.htm"}
<!-- start integrate setup form -->
<div style="border: 1px solid #CC0000;background-color:#FFFFCE;color:#CE0000;padding:4px" >{$lang.db_notice}</div>
<div class="main-div">
  <form action="integrate.php" method="post" name="theForm" onsubmit="return validate();">
  <table cellspacing="1" cellpadding="3" width="100%">
    <tr>
      <td class="label">{$lang.lable_db_host}</td>
      <td><input type="text" name="cfg[db_host]" value="{$cfg.db_host}" />{$lang.require_field}</td>
    </tr>
    <tr>
      <td class="label">{$lang.lable_db_user}</td>
      <td><input type="text" name="cfg[db_user]" value="{$cfg.db_user}" />{$lang.require_field}</td>
    </tr>
    <tr>
      <td class="label">{$lang.lable_db_pass}</td>
      <td><input type="password" name="cfg[db_pass]" value="{$cfg.db_pass}" />{$lang.require_field}</td>
    </tr>
    <tr>
      <td class="label">{$lang.lable_db_name}</td>
      <td><input type="text" name="cfg[db_name]" value="{$cfg.db_name}" />{$lang.require_field}</td>
    </tr>
    <tr>
      <td class="label"><a href="javascript:showNotice('noticeGoodsSN');" title="{$lang.form_notice}"><img src="images/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}"></a>{$lang.lable_db_chartset}</td>
      <td><select name="cfg[db_charset]">{html_options options=$set_list selected=$cfg.db_charset}</select><input type="checkbox" name="cfg[is_latin1]" value="1" {if $cfg.is_latin1}checked="checked"{/if} />{$lang.lable_is_latin1}{$lang.require_field}
      <span class="notice-span" {if $help_open}style="display:block" {else} style="display:none" {/if} id="noticeGoodsSN">{$lang.notice_latin1}</span>
      </td>
    </tr>
    <tr>
      <td class="label">{$lang.lable_prefix}</td>
      <td><input type="text" name="cfg[prefix]" value="{$cfg.prefix}" /></td>
    </tr>
    <tr>
      <td class="label">{$lang.lable_url}</td>
      <td><input type="text" name="cfg[integrate_url]" value="{$cfg.integrate_url}"  size="40" />{$lang.require_field}</td>
    </tr>
    {if isset($cfg.cookie_prefix)}
    <tr>
      <td class="label">{$lang.cookie_prefix}</td>
      <td><input type="text" name="cfg[cookie_prefix]" value="{$cfg.cookie_prefix}" />{$lang.require_field}</td>
    </tr>
    {/if}
    {if isset($cfg.cookie_salt)}
    <tr>
      <td class="label">{$lang.cookie_salt}</td>
      <td><input type="text" name="cfg[cookie_salt]" value="{$cfg.cookie_salt}" />{$lang.require_field}</td>
    </tr>
    {/if}
    <tr>
      <td colspan="2" align="center">
        {if $save eq 0}
        <input type="submit" value="{$lang.button_next}" class="button" />
        <input type="button" value="{$lang.button_force_save_config}" onclick="saveConfig('{$lang.save_confirm}')" class="button" />
        {else}
        <input type="submit" value="{$lang.button_save_config}" class="button" />
        {/if}
        <input type="reset" value="{$lang.button_reset}" class="button"  />
        <input type="hidden" name="code" value="{$code}" />
        <input type="hidden" name="act" value="check_config" />
        <input type="hidden" name="save" id="ECS_SAVE" value="{$save|default:0}">
      </td>
    </tr>
  </table>
  </form>
</div>
<!-- end integrate setup form -->
{insert_scripts files="../js/utils.js,validator.js"}
{literal}
<script language="JavaScript">
<!--
onload = function()
{
    // 开始检查订单
    startCheckOrder();
}

function saveConfig(str)
{
  if (!validate())
  {
    return;
  }
  var save = document.getElementById('ECS_SAVE');
  if (confirm(str))
  {
    save.value = 1;
    document.forms['theForm'].submit();
  }
  else
  {
    save.value = 0;
  }
}

/**
 * 验证表单输入的内容
 */
function validate()
{
    var validator = new Validator('theForm');
    validator.required("cfg[db_host]", no_host);
    validator.required("cfg[db_user]", no_user);
    validator.required("cfg[db_name]", no_name);
    validator.required("cfg[integrate_url]", no_integrate_url);

    return validator.passed();
}
//-->
</script>
{/literal}
{include file="pagefooter.htm"}