<?php include 'header.tpl.php';?>
<script>
function meSearchClear(){
	document.frmMain.s_state.value="-101";
	document.frmMain.s_vip.value="-1";
	document.frmMain.s_addtime1.value="";
	document.frmMain.s_addtime2.value="";
	document.frmMain.s_name.value="";
	frmExecute('');
}
function me_change(msgval){
	obj_id_vip=document.getElementById("id_vip");
	obj_id_state=document.getElementById("id_state");
	switch(msgval){
		case "vip":
		{
			obj_id_vip.style.display="";
			obj_id_state.style.display="none";
			break;
		}
		case "state":
		{
			obj_id_vip.style.display="none";
			obj_id_state.style.display="";
			break;
		}
		default:
		{
			obj_id_state.style.display="none";
			obj_id_vip.style.display="none";
		}
	}
}
function me_vip(msgid){
	var obj_vip=document.getElementById("id_s_vip");
	if(msgid==-2 || parseInt(msgid)>0){
		obj_vip.style.display="";
	}else{
		obj_vip.style.display="none";
	}
}
</script>
<div class="pMenu">
<li class="sel"><a href="javascript:frmExecute('');">管理</a></li>
<li><a href="javascript:frmExecute('add');">添加</a></li>
<li><span onclick="div_show_hide('objSearch');" style="cursor:hand">查找</span></li>
<li class="info"><a href="javascript:inc_show_help(201);" style="color:#ff0000">帮助</a></li>
</div>
<div class="pSearchDiv" id="objSearch" style="display:<?php if($get_issearch!="1")echo "none"?>">
<table class="sTab">
<tr><td>状态：<select name="s_state">
	<option value="-101">不限</option>
	<option value="1" <?php if($get_s_state==1) echo "selected";?>>通过</option>
	<option value="0" <?php if($get_s_state==0) echo "selected";?>>待审</option>
	</select>　VIP类型：<select name="s_vip" onchange="me_vip(this.value);">
	<option value="-1">不限</option>
	<option value="-2" <?php if($get_s_vip==-2) echo "selected";?>>所有VIP</option>
	<option value="0" <?php if($get_s_vip==0) echo "selected";?>>非VIP</option>
	<?php
	foreach($arr_vip as $item){
		$str_sel="";
		if($item["vip_id"]==$get_s_vip) $str_sel=" selected";
		echo "<option value='".$item["vip_id"]."'".$str_sel.">".$item["vip_name"]."</option>";
	}
	?>
	</select><span id="id_s_vip" style="<?php if($get_s_vip<1 and $get_s_vip!=-2) echo "display:none";?>">&nbsp;&nbsp;VIP时间：<input type="text" name="s_viptime1" value="<?php echo $get_s_viptime1;?>" onfocus="setday(this);"> 到 <input type="text" name="s_viptime2" value="<?php echo $get_s_viptime2;?>" onfocus="setday(this);"></td><tr>
	<tr><td>注册时间：<input type="text" name="s_addtime1" value="<?php echo $get_s_addtime1;?>" onfocus="setday(this);"> 到 <input type="text" name="s_addtime2" value="<?php echo $get_s_addtime2;?>" onfocus="setday(this);">&nbsp;&nbsp;名称或关键字：<input type="text" name="s_name" value="<?php echo $get_s_name?>">　<input type="button" name="s_btnok" value="查找" class="pBtn" onclick="frmExecute('')"> 　<input type="button" name="s_btnok" value="清空" class="pBtn" onclick="meSearchClear();frmExecute('');"></td></tr>
</table>
</div>
<div>
<table class='pTable'>
<tr class='pTabTitRow'>
	<td class='pTabTitCol'></td><td class='pTabTitCol'>公司名</td><td class='pTabTitCol'>账号</td><td class='pTabTitCol'>VIP</td>
	<td class='pTabTitCol'>注册时间</td><td class='pTabTitCol'>状态</td><td class='pTabTitCol'>操作</td></tr>
	<?php foreach($arr_company as $item){ ?>
<tr class='pTabRow' id="id_row_<?php echo $item["company_id"]?>" onmouseover="admin_row_mouseover(<?php echo $item["company_id"];?>)" onmouseout="admin_row_mouseout(<?php echo $item["company_id"];?>);">
	<td class='pTabCol' width="60"><input type='checkbox' name='companyids[]' value='<?php echo $item['company_id'];?>' onclick="admin_row_sel(this.checked,<?php echo $item["company_id"]?>);"></td><td class='pTabCol'><a href="<?php echo $item["url"];?>" target="_blank"><?php echo $item['company_name'];?></a></td>
	<td class='pTabCol'><?php echo $arr_uname["id_".$item['company_user_id']];?></td><td class='pTabCol'><?php echo $item["vipname"].$item["vipstate"];?></td><td class='pTabCol'><?php echo $item['company_addtime'];?></td><td class='pTabCol'><?php echo $item['state'];?></td>
	<td class='pTabCol' onmousedown="frmSet('id','<?php echo $item['company_id'];?>')">	<?php if($obj_ctl_limit->chk_act("edit")){?><img src="../images/b_edit.png" onclick="javascript:frmExecute('edit');" class="pImgbtn" title="编辑"><?php }?>
	</td></tr>
	<?php }?>
</table>
</div>
<div class="pPage">
<?php echo $page_split_page?>
</div>
<div class="pFootAct">
<li><input type='checkbox' name='companyidall' value='1' onclick="admin_row_selall(this.form,'companyidall','companyids');">全选　<select name="selact" onchange="me_change(this.value);">
	<option value="">--操作--</option>
	<?php if($obj_ctl_limit->chk_act("vip")){?><option value="vip">VIP设置</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("state")){?><option value="state">审核设置</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("html_exe")&&$this_is_company_html==true){?><option value="html_exe">生成html</option><?php }?>
	<?php if($obj_ctl_limit->chk_act("del")){?><option value="del_sel">删除</option><?php }?>
	</select>　<span id="id_vip" style="display:none">
	<select name="vip_id">
	<option value="0">清除VIP</option>
	<?php
	foreach($arr_vip as $item){
		echo "<option value='".$item["vip_id"]."'>".$item["vip_name"]."</option>";
	}
	?>
	</select>
	</span><span id="id_state" style="display:none">
	<select name="state_val">
	<option value="1">通过</option>
	<option value="0">待审</option>
	</select>
	</span>
	&nbsp;<input type="button" name="btnExe" value="执行" onclick="frmExecute(document.all.selact.value);" class="pBtn"></li>
</div>

<?php include 'footer.tpl.php';?>		