<?php 
require "../Run.php";
require "include/site_info.inc.php";
	if($admin!=1){
		ehtml('非法操作');
		exit();
	}
	echo head('子站信息');
	echo topNav('网站管理','<a href="wap_admin_cg.php?action=site_list">列表</a>','<a href="wap_admin_cg.php?">超管后台</a>');
	if($_GET['del'] != NULL){
		if($_GET['yes'] == $_GET['del']){
		if($_GET['yes'] == '1000')
		{
			die('禁止删除此站点!');
		}	
			$sql ='DELETE FROM user WHERE id=\''.$_GET['yes'].'\';';
			 $result = mysql_query($sql);
			if($result && mysql_affected_rows()>0){
			echo'<div class="tip">成功删除</div>';
	 }else{
			echo'<div class="tip">删除失败</div>';
	     }
		}else{
			echo '<div class="tip"><a href="?del='.$_GET['del'].'&yes='.$_GET['del'].'">[确定删除]</a></div>';
		}
	}else{
	if($_GET['stop'] != NULL){
	if($_GET['yes'] == $_GET['stop']){
		$sql="UPDATE user SET site_top='1' WHERE id='{$_GET['yes']}'";
            $result = mysql_query($sql);
	        if($result && mysql_affected_rows()>0){
	        echo "<div class=\"tip\">锁定成功</div>";
            }else{
            echo   "<div class=\"tip\">锁定失败</div>";
            }
		}else{
			echo '<div class="tip"><a href="?stop='.$_GET['top'].'&yes='.$_GET['stop'].'">[确定锁定]</a></div>';
		}
	}
	echo '<div class="title">"'.user('stitle','id',$site_id).'"的信息</div>';
	echo '网站名称<br>'.user('stitle','id',$site_id);
	echo '<br>系统ID<br>'.$site_id;
	echo '<br>站长用户名<br>'.user('name','id',$site_id);
	echo '<br>站长密码<br>'.user('pass','id',$site_id);
	echo '<div class="title">已经绑定的域名</div>';
	echo site_url($site_id);
	echo '<div class="subtitle">操作:<a href="?del='.$_GET['id'].'">删除</a>.<a href="?stop='.$_GET['id'].'">锁定</a></div>';
		}
	
	echo footer(1);