<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>服務器分佈/遠程</title>
<link href="css/base.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function AddServer()
{
   var op="";
   var sel = document.getElementById("c_userlist"); 
   for(var i=0;i<sel.length;i++){
   if(sel.options[i].selected == true){
	  op +=sel.options[i].value+",";
	}
   }
   if(document.form1.c_servurl.value==""||document.form1.c_servurl.value=="http://"){ alert('服務器網址不能為空！'); return ;}
   if(document.form1.c_servname.value==""){ alert('服務器名稱不能為空！'); return ;}
   if(document.form1.c_servuser.value==""){ alert('FTP用戶名不能為空！'); return ;}
   if(document.form1.c_servpwd.value==""){ alert('FTP密碼不能為空！'); return ;}
   document.form1.c_servinfo.value += document.form1.c_servname.value+" | "+document.form1.c_servurl.value+
   " | "+document.form1.c_servport.value+" | "+document.form1.c_servuser.value+" | "+document.form1.c_servpwd.value+" | "+op+
   "\r\n";
}
</script>
</head>
<body background='images/allbg.gif' leftmargin='8' topmargin='8'>
<table width="98%" border="0" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" align="center">
  <form name="form1" action="sys_multiserv.php" method="post">
    <input type="hidden" name="dopost" value="save" />
    <tr> 
      <td height="28" colspan="2" background='images/tbg.gif'> <table width="98%" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="30%" height="18" style="padding-left:10px;"><strong>服務器分佈/遠程設置：</strong></td>
            <td width="70%" align="right">&nbsp;</td>
          </tr>
        </table></td>
    </tr>
<tr> 
      <td colspan="2" bgcolor="#FFFFFF">在開啟分佈/遠程設置後需要在欄目中對相關的站點進行設置，例如子域名、後台欄目生成</td>
    </tr>
<tr> 
      <td height="26" colspan="2" bgcolor="#F9FCEF">
      	<strong>附件服務器設置：      </strong></td>
    </tr>
    
    <tr> 
      <td bgcolor="#FFFFFF" width="19%">是否啟用附件服務器：</td>
      <td width="81%" bgcolor="#FFFFFF">
      	<input name="c_remoteuploads" type="radio" class="np" value="1" <?php echo ($row['remoteuploads']==1)? 'checked' : '';?>/>
        啟用 
        <input name="c_remoteuploads" type="radio" class="np" value="0" <?php echo ($row['remoteuploads']==0)? 'checked' : '';?>/>
        不啟用
      <small style="color:#999">開啟後附件將同步遠程發佈到附件服務器中</small></td>
    </tr>
    <tr> 
      <td bgcolor="#FFFFFF">附件服務器域名：</td>
      <td bgcolor="#FFFFFF"> <label>
        <input name="c_remoteupUrl" type="text" id="c_remoteupUrl" value="<?php echo empty($row['remoteupUrl'])? '' :$row['remoteupUrl'];?>" size="35">
     <small style="color:#999"> 例如：http://img.dedecms.com,開啟後圖片地址都變為遠程地址</small></label></td>
    </tr>
    <tr> 
      <td valign="top" bgcolor="#FFFFFF">遠程服務器(FTP)：</td>
      <td align="center" bgcolor="#FFFFFF"><table width="98%" border="0" cellspacing="5" cellpadding="0">
        <tr>
          <td width="14%">主機IP：</td>
          <td width="86%" style="text-align:left;"><input name="c_rmhost" type="text" id="c_rmhost" value="<?php echo empty($row['rminfo']['rmhost'])? '' : $row['rminfo']['rmhost'];?>" size="35"></td>
        </tr>
        <tr>
          <td>FTP端口：</td>
          <td style="text-align:left;"><input name="c_rmport" type="text" id="c_rmport" value="<?php echo empty($row['rminfo']['rmport'])? '' :$row['rminfo']['rmport'];?>" size="35"></td>
        </tr>
        <tr>
          <td>FTP用戶名</td>
          <td style="text-align:left;"><input name="c_rmname" type="text" id="c_rmname" value="<?php echo empty($row['rminfo']['rmname'])? '': $row['rminfo']['rmname'];?>" size="35"></td>
        </tr>
        <tr>
          <td>FTP密碼</td>
          <td style="text-align:left;"><input name="c_rmpwd" type="text" id="c_rmpwd" value="<?php echo empty($row['rminfo']['rmpwd'])? '': $row['rminfo']['rmpwd'];?>" size="35"></td>
        </tr>
      </table></td>
    </tr>
    <tr> 
      <td height="26" colspan="2" bgcolor="#F9FCEF">
      	<strong>遠程服務器列表：</strong>(FTP鏡像) <small style="color:#999">添加的服務器配置將在前台遠程發佈中可選</small></td>
    </tr>
    <tr> 
      <td colspan="2" bgcolor="#FFFFFF">
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="160" height="30" align="right" style="line-height:28px;">名稱： 
</td>
    <td width="181" align="left" style="line-height:28px;"><input name="c_servname" type="text" id="c_servname" value="站點1" size="22" /></td>
    <td width="102" rowspan="6" align="center"><span style="line-height:28px;">
      <input type="button" name="Submit2" value="增加一項" onClick="AddServer()"  class="coolbg np" />
    </span></td>
    <td width="832">自定義文本編輯框</td>
    </tr>
  <tr>
    <td width="160" height="30" align="right" style="line-height:28px;">服務器IP：</td>
    <td height="30" align="left" style="line-height:28px;"><input name="c_servurl" type="text" id="c_servurl" size="22" /></td>
    <td width="832" rowspan="5" valign="top"><textarea name="c_servinfo" id="c_servinfo" style="width:100%;height:150px"><?php echo $row['servinfo'] ;?></textarea><br/>
      (<strong>格式</strong>：名稱|服務器IP|FTP端口|FTP用戶名|FTP密碼|管理員,每行一條，以&quot;,&quot;結束)</td>
  </tr>
  <tr>
    <td width="160" height="30" align="right" style="line-height:28px;"> FTP端口：</td>
    <td height="30" align="left" style="line-height:28px;"><input name="c_servport" type="text" id="c_servport" value="21" size="6" /></td>
    </tr>
  <tr>
    <td width="160" height="30" align="right" style="line-height:28px;">FTP用戶名：</td>
    <td height="30" align="left" style="line-height:28px;"><input name="c_servuser" type="text" id="c_servuser" size="22"></td>
    </tr>
  <tr>
    <td width="160" height="15" align="right" style="line-height:28px;">FTP密碼：</td>
    <td height="15" align="left" style="line-height:28px;"><input name="c_servpwd" type="text" id="c_servpwd" size="22"></td>
    </tr>
  <tr>
    <td height="7" align="right" style="line-height:28px;">管理員：</td>
    <td height="7" align="left" style="line-height:28px;"> <select name="c_userlist" size="3" multiple id="c_userlist">
      <?php foreach ($adminLists as $adminList) {  ?>
      <option value="<?php echo $adminList['userid'];?>"><?php echo $adminList['uname'];?> | <?php echo $adminList['typename'];?></option>
      <?php }?>
      </select>
      <br/>(多選)</td>
    </tr>
      </table>

      </td>
    </tr>
    <tr> 
      <td height="41" colspan="2" bgcolor="#FAFAF1" align="center">
      <input type="submit" name="Submit" value="保存設置" class="coolbg np" />　　　　        
        <input type="reset" name="rset" id="rset" value="重置" class="coolbg np" />
      </td>
    </tr>
  </form>
</table>
</body>
</html>
