<!-- #include file="include/admin_onlogin.asp" -->
<!-- #include file="include/admin_config_edit.asp" -->
<!-- #include file="include/jk_template.asp" -->
<!-- #include file="include/jk_md5.asp" -->
<%

dim tmp1,tmp2,tdim
tit_fir="配置"
tit="配置管理"
call admin_header(0,0)
%>
<tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
  <td><a href='?'><%response.write tit%></a></td>
  <td width=10></td>
  <td><a href='?action=common'<%if action="common" then response.write " class=red"%>>基本<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=config'<%if action="config" then response.write " class=red"%>>功能<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=number'<%if action="number" then response.write " class=red"%>>参数<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=upload'<%if action="upload" then response.write " class=red"%>>上传<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=grade'<%if action="grade" then response.write " class=red"%>>等级<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=shop'<%if action="shop" then response.write " class=red"%>>商城<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=prepay'<%if action="prepay" then response.write " class=red"%>>充值<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=music'<%if action="music" then response.write " class=red"%>>音乐<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=video'<%if action="video" then response.write " class=red"%>>影院<%response.write tit_fir%></a></td>
  </tr>
  </table>
</td></tr>
</table>
<%
if action="" then
  call admin_table(1)
else
  call admin_table(1)
%>
<tr align=center>
<td class=td width='16%'>设置名称</td>
<td class=td width='54%'>基本参数设置</td>
<td class=td width='30%'>相关说明</td>
</tr>
<%
end if

select case action
case "prepay"
  ntit="充值"
  call joekoe_chk_prepay()
case "music"
  ntit="音乐"
  call joekoe_chk_music()
case "video"
  ntit="影院"
  call joekoe_chk_video()
case "shop"
  ntit="商城"
  call joekoe_chk_shop()
case "grade"
  ntit="级别"
  call joekoe_chk_grade()
case "upload"
  ntit="上传"
  call joekoe_chk_upload()
case "number"
  ntit="参数"
  call joekoe_chk_number()
case "config"
  ntit="功能"
  call joekoe_chk_config()
case "common"
  ntit="基本"
  call joekoe_chk_common()
case "data_revert","data_backup"
  call joekoe_chk_data()
case else
  call joekoe_chk_main()
end select

call admin_ender(1)

sub joekoe_chk_data()
  dim vv,filetype,file_name1,file_name2,filetemp,filepath
  filetype=""
  if action="data_revert" then
    file_name1="include/back_common.asp"
    file_name2="include/common.asp"
    vv="还原"
  else
    file_name1="include/common.asp"
    file_name2="include/back_common.asp"
    vv="备份"
  end if
  
  filetype=get_file(file_name1)
  call create_file(file_name2,file_trim_vbcrlf(filetype))
  call admin_msg(""&vv&" 网站"&tit_fir&"成功！","?",1)
end sub

sub joekoe_chk_main()
  call admin_td(tit)
%>
<tr>
<td width='20%' ></td>
<td width='80%' height=150>
  <table border=0 width='100%'>
  <tr><td align=center>请先选择<%response.write tit_fir%>修改的类型！建议在修改<%response.write tit_fir%>文件前先 <a href='javascript:config_data_backup();'>备份<%response.write tit_fir%></a> 文件。</td></tr>
  <tr><td align=center>如果在修改<%response.write tit_fir%>时出现了错误，您可以试着 <a href='javascript:config_data_revert();'>还原<%response.write tit_fir%></a> 文件。</td></tr>
  <tr><td align=center>如果因为您的一时不小心，将<%response.write tit_fir%>文件修改错误导致不能正常登陆网站后台，请尽快用FTP连上以本地可用的<%response.write tit_fir%>文件覆盖网上错误的<%response.write tit_fir%>文件（include/common.asp）</td></tr>
  </table>
</td>
</tr>
<script language=javascript>
<!--
function config_data_backup()
{
if (confirm("此操作将 备份 现有的网站<%response.write tit_fir%>！\n\n真的要进行吗？\n备份后将无法恢复！"))
  window.location="?action=data_backup"
}
function config_data_revert()
{
if (confirm("此操作将 还原 现有的网站<%response.write tit_fir%>！\n\n真的要进行吗？\n还原后将无法恢复！"))
  window.location="?action=data_revert"
}
//-->
</script>
<%
end sub

function code_url(strers)
  dim strer
  strer=trim(strers)
  if isnull(strer) or strer="" then
    code_url=""
    exit function
  end if
  if right(strer,1)<>"/" then strer=strer&"/"
  code_url=strer
end function

function code_num(strers,cnum)
  dim strer
  strer=trim(strers)
  if not isnumeric(strer) then strer=cnum
  code_num=strer
end function

function code_config(strers,ct)
  dim strer
  strer=trim(strers)
  if isnull(strer) or strer="" then
    code_config=""
    exit function
  end if
  select case ct
  case 1
    strer=replace(strer,"'","&#39;")
    strer=replace(strer,CHR(34),"&quot;")
  case 2
    strer=replace(strer,CHR(34),"")
    strer=replace(strer,"'","")
    strer=replace(strer,":","")
    strer=replace(strer,"|","")
  case 3
    strer=replace(strer,"'","&#39;")
    strer=replace(strer,CHR(34),"&quot;")
    strer=replace(strer,"|","")
  case 4
    strer=replace(strer,CHR(34),"")
    strer=replace(strer,"'","")
    strer=replace(strer,"|","")
  case else
    strer=replace(strer,"'","")
    strer=replace(strer,CHR(34),"")
  end select
  code_config=strer
end function

sub submit_config()
  response.write vbcrlf&"<tr align=center>" & _
		 vbcrlf&"<td colspan=3><input type=submit value='提交"&tit_fir&"修改'>　　<input type=reset value='重新填写'>　　"&go_back&"</td>" & _
		 vbcrlf&"</tr></form>"
end sub

%>