<?php
if (  ! defined( 'MOD' ))
{
	die("access die");
}
if ( $_POST['up'] == 1 )
{
	checkAdminReferer();
	$id = intval( $_POST['id'] );
	$name = trim( $_POST['name'] );
	$serverpath = trim( $_POST['serverpath'] );
	if(substr($serverpath, -1) != '/') $serverpath = $serverpath . '/';
	$chanid = intval( $_POST['channelid'] );
	$is_lock = intval( $_POST['is_lock'] );
	$displayorder = intval( $_POST['displayorder'] );
	if (  ! $name ||  ! $serverpath )
	{
		qbase::showmsg('服务器名称与地址必须题写');
	}

	qdb::Query("update `".TABLEPRE."downserver` set  `channelid`='$chanid' ,`name`='".$name."',`serverpath`='".$serverpath."',`is_lock`='$is_lock',`displayorder`='$displayorder' where id='$id'" );
	servercache();
	qbase::showmsg( '服务器信修改完毕', 'default', "module.php?mod={$mod}&action=server&action_do=modify&channelid={$channelid}");
}
else
{
	$id   = intval( $_GET['id'] );
	$info = qdb::QueryFirst( "select * from `".TABLEPRE."downserver` where id='$id'" );
}

?>
