<form action="" method="get" name="search" id="search"  onsubmit="return ajax_list();" >
<input type="hidden" name="action" id="action" value="ajax_list" />
<table  class="from_table">
	<tr>
		<th width="77"><tpl> $langSysSpaceSelectType </tpl>：</th>
		<td>
			<select style=" *vertical-align:-3px;" name="search_type" id="search_type">
				<option value="username" <tpl> if $condition.search_type eq 'username' </tpl> selected <tpl> /if </tpl> ><tpl> $langSysSpaceUsername </tpl></option>
				<option value="spacename" <tpl> if $condition.search_type eq 'spacename' </tpl> selected <tpl> /if </tpl> ><tpl> $langSpaceName </tpl></option>
			</select>
			<input type="text" name="keywords" id="keywords"  class="txtinput_short" value="<tpl> $condition.keywords </tpl>" />
		</td>    
	</tr>
	<tr>
		<th style=" height:35px"></th>
		<td height="50">	
			<span class="btn_left"><input type="submit" name="submit"  class="btn_submit" value="<tpl> $langSysSearch </tpl>" /></span>
			<span class="btn_left"><input type="reset" name="reset"  class="btn_submit" value="<tpl> $langSpaceReset </tpl>" /></span>
		</td>
		</tr>
	
</table>
</form>
<tpl> if $space_array[0].uid neq '' </tpl>
<form action="javascript:void(null);" id="spacelist" name="spacelist" method="post">
	<table class="from_table2_one top-1">
		<tr class="area_ajax_list_title">
			<th class="pd-left" width="100" align="left" style="text-align:left"><tpl> $langSysSpaceUsername </tpl></th>
			<th width="170" align="left" style="text-align:left"><tpl> $langSpaceName </tpl></th>
			<th width="100" align="left" style="text-align:left"><tpl> $langSysSpaceState </tpl></th>
			<th width="100" align="left" style="text-align:left"><tpl> $langSysSpaceOpenDate </tpl></th>
			<th width="200" align="left" style="text-align:left"><tpl> $langCOperation </tpl></th>
		</tr>
		<div id="liststylealignleft">
		<tpl> section name=i loop=$space_array </tpl>
		<tr>
			<td class="pd-left" class="supplylist" width="130"><tpl> $space_array[i].username </tpl></td>
		  <td width="170" class="supplylist"><a href="../app/<tpl> $app_module.app_module_sign </tpl>/index.php?uid=<tpl> $space_array[i].uid </tpl>" target="_blank"><tpl> $space_array[i].spacename </tpl></a></td>
		  <td class="supplylist" width="100">
				<tpl> if $space_array[i].ifclose eq '0' </tpl>
					<font color="Green"><tpl> $langSysSpaceIsOpen </tpl></font>
				<tpl> else </tpl>
					<font color="red"><tpl> $langSysSpaceIsClose </tpl></font>
				<tpl> /if </tpl>
		  </td>
			<td class="supplylist"><tpl> $space_array[i].opendate </tpl></td>
			<td width="210" class="supplylist">
				<tpl> if $space_array[i].ifclose eq '1' </tpl>
					<a href="javascript:void(null);" onclick="space_change_state( '0', '<tpl> $space_array[i].uid </tpl>' );"><tpl> $langSysSpaceOpen </tpl></a>
				<tpl> else </tpl>
					<a href="javascript:void(null);" onclick="space_change_state( '1', '<tpl> $space_array[i].uid </tpl>' );"><tpl> $langSysSpaceIsClose </tpl></a>
				<tpl> /if </tpl>
				<a href="javascript:void(null);" onclick="return ajax_list_space('action=blog_list&uid=<tpl> $space_array[i].uid </tpl>');"><tpl> $langSysSpaceBlogManage </tpl></a>
				<a href="javascript:void(null);" onclick="return ajax_list_space('action=comment_list&uid=<tpl> $space_array[i].uid </tpl>');"><tpl> $langSysSpaceCommentManage </tpl></a>
				<a href="javascript:void(null);" onclick="return ajax_list_space('action=message_list&uid=<tpl> $space_array[i].uid </tpl>');"><tpl> $langSysSpaceMessageManage </tpl></a>
			</td>
		</tr>
		<tpl> /section </tpl>
		</div>
		
  </table>
  <div class="table-5-bottom"><div class="p-left"><span class="btn_left"> <input type="button" value="<tpl> $langSysSpaceBack </tpl>" id="back" name="back"  class="btn_submit"  onclick="ajax_list_back( 'action=ajax_list' )"/></span>	
				<span class="btn_marginright"><tpl> $page_list </tpl></span></div></div>
</form>
<tpl> else </tpl>
  <tpl> $langSysCNoThing </tpl>
<tpl> /if </tpl>
<script language="javascript">
//搜索
function ajax_list(){
	/*取表单参数*/
	var queryString=$("#search").formSerialize();
	$.ajax({
		url: "../app/<tpl> $app_module.app_module_sign </tpl>/system.php",
		data: queryString,
		type:'get',
		dataType:"html",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			hideMessage();
			$("#result_content").html(msg);
			hideLoading();
		}
	});
	return false;
}
//开通、关闭空间
function space_change_state ( state, uid ) {
	$.ajax({
		url: "../app/<tpl> $app_module.app_module_sign </tpl>/system.php?action=change_state&state=0"+state+"&uid="+uid,
		type:'get',
		dataType:"json",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			hideLoading();
			showMessage(msg.message);
			if(msg.type == 1){
				ShowDiv = 'result_content';
				getPageContent("../app/<tpl> $app_module.app_module_sign </tpl>/system.php?action=ajax_list&keywords=<tpl> $condition.keywords </tpl>&search_type=<tpl> $condition.search_type </tpl><tpl>if $space_array|@count neq 1</tpl>&curpage=<tpl> $curpage</tpl><tpl>/if</tpl>");
			}
		}
	});
	return false;	
}
//选项卡
function ajax_list_space ( str ) {
	$.ajax({
		url: "../app/<tpl> $app_module.app_module_sign </tpl>/system.php",
		data: str,
		type:'get',
		dataType:"html",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			hideLoading();
			$('#result_content').html(msg);
		}
	});
	return false;	
}
//返回应用列表
function ajax_list_back ( str ) {
	$.ajax({
		url: "../system/app_module.manage.php",
		data: str,
		type:'get',
		dataType:"html",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			hideLoading();
			$('#result_content').html(msg);
		}
	});
	return false;	
}
</script>