<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<script src="js/submit_mail.js"></script>
</head>
<script language="javascript">
    function open01(){
		if(kh.style.display=='')
		   kh.style.display='none';
		else if(kh.style.display=='none')
		   kh.style.display='';
	  } 
   
 function open02(){
		if(ts.style.display=='')
		   ts.style.display='none';
		else if(ts.style.display=='none')
		   ts.style.display='';
	  } 
function open04(){
		if(file.style.display=='')
		   file.style.display='none';
		else if(file.style.display=='none')
		   file.style.display='';
	  } 

function mail_address(mail_address){
	var id;
	id=document.getElementById('touser').value;

if(id==""){
document.getElementById('touser').value=mail_address;
}else{

if(id.match(mail_address)!=null){
alert('该地址已经被添加！');
return false;
}
document.getElementById('touser').value=id+'*'+mail_address;
}
return false;
}

//全部选择/取消
function alldel(tot){

	for(i=0;i<tot;i++){
		if(!document.getElementById('mail_a['+i+']').checked){
			document.getElementById('mail_a['+i+']').checked = true;
		}
	}
	return false;
}
// 反选
function overdel(tot){
	for(i=0;i<tot;i++){
		if(!document.getElementById('mail_a['+i+']').checked){
			document.getElementById('mail_a['+i+']').checked = true;
		}else{
			document.getElementById('mail_a['+i+']').checked = false;
		}
	}
	return false;
}

function del(tot){
var rd=Array();
	for(i=0,j=0;i<tot;i++){
		if(!document.getElementById('mail_a['+i+']').checked){


		}else{
			
				rd[j]=document.getElementById('mail_a['+i+']').value;
j++;
			
		}
	}

for(j=0;j<rd.length;j++){
mail_address(rd[j]);
}
	return false;
}

</script>
<body>
<?php include_once("conn/conn.php"); ?>
<table border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td><img src="images/首页(2)_6.jpg" width="180" height="45" ></td>
                </tr>
</table>

<table width="167" border="0" cellspacing="0" cellpadding="0">

                <tr> 
                  <td><img src="images/首页(2)_8.jpg" width="180" height="36" border="0" onClick="javascript:open04();"></td>
                </tr>
</table>
<table width="180" border="0" cellpadding="0" cellspacing="0" id="file"
			
			  <?php
		
if(!($_GET[lmlb]=="客户信息管理" || $_GET[lmlb]=="同事信息管理")){
			  ?>  style="display:none"
			  <?php
			  }
			  ?>  
			  >
       <tr> 
        <td height="24" align="center" valign="middle" background="images/首页(2)_10.jpg">
         <a href="#" class="select_STYLE1" onClick="MM_openBrWindow('customer_gl.php?lmbs=<?php echo $_GET[lmbs];?>&lmlb=客户','','width=780,height=350')">&nbsp;客户信息管理</a></td>
  </tr>
<tr> 
        <td height="24" align="center" background="images/首页(2)_10.jpg">
	     <a href="#" class="select_STYLE1" onClick="MM_openBrWindow('colleague_gl.php?lmbs=<?php echo $_GET[lmbs];?>&lmlb=同事','','width=780,height=350')">&nbsp;同事信息管理</a></td>
  </tr>
</table>
 <table width="14%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td><img src="images/首页(2)_16.jpg" width="180" height="25" border="0" onClick="javascript:open01();"></td>
                </tr>
</table>
<table width="180" border="0" cellpadding="0" cellspacing="0" id="kh"
			 
			  <?php
		
if(!($_GET[idss]!='')){
			  ?> style="display:none"
			  <?php
			  }
			  ?>  
			  >
   <form name="form2">              
   <?php
$sql="select * from tb_colleague where tb_colleague_category='客户'";
$rst = $conn -> Execute($sql);	//执行pageExecute函数
$m=0;
while(!$rst -> EOF){											//配合wihle语句循环输出结果

?>
   <tr>
     <td height="24" align="center" class="select_STYLE1" background="images/首页(2)_10.jpg">&nbsp;
       <?php if($_GET[lmbs]=="发件箱"){?>
	   <a href="#" onClick=" return mail_address('<?php echo $rst->fields[4];?>')" class="select_STYLE1"><?php echo $rst->fields[1];?></a>
	   <input name="<?php echo $rst->fields[4];?>1" type="checkbox" id="mail_a[<?php echo $m;?>]" value="<?php echo $rst->fields[4];?>">
       <?php }else{

echo $rst->fields[1];
}?></td> 
     </tr>
<?php
$m++;
	     $rst -> movenext();
   }
if($_GET[lmbs]=="发件箱"){
	  ?>
     <tr>
     <td height="24" align="center" background="images/首页(3)_10.jpg">
<input type="submit" name="Submit2" class="buttoncss" value="提交" onClick=" return del(<?php echo $m;?>)">
       <input name="button" type=button class="buttoncss" onClick="alldel(<?php echo $m;?>)" value="全选">
<input type=button value="反选" class="buttoncss" onClick="overdel(<?php echo $m;?>)"></td>
     </tr>
<?php }?>
</form> 
</table>
 <table width="14%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td><img src="images/首页(2)_17.jpg" width="180" height="25" border="0" onClick="javascript:open02();"></td>
                </tr>
</table>
<table width="180" border="0" cellpadding="0" cellspacing="0" id="ts"
			 
			  <?php
		
if(!($_GET[idss]!='')){
			  ?> style="display:none"
			  <?php
			  }
			  ?>  
			  >
               <form name="form2">
   <?php

$sqls="select * from tb_colleague where tb_colleague_category='同事'";
$n=0;
$ret = $conn -> Execute($sqls);	//执行pageExecute函数
while(!$ret -> EOF){											//配合wihle语句循环输出结果

?>
   <tr>
     <td height="24" align="center" class="select_STYLE1" background="images/首页(2)_10.jpg">&nbsp;
       <?php 
if($_GET[lmbs]=="发件箱"){
?>
	  <a  href="#" onClick=" return mail_address('<?php echo $ret->fields[4];?>')" class="select_STYLE1"><?php echo $ret->fields[1];?></a>&nbsp;		<input name="<?php echo $ret->fields[4];?>2" type="checkbox" id="mail_a1[<?php echo $n;?>]" value="<?php echo $ret->fields[4];?>"></td> 
      <?php }else{
echo $ret->fields[1];
}
?>
  </tr>
  
<?php
$n++;
	     $ret -> movenext();
   }
if($_GET[lmbs]=="发件箱"){
	  ?>
<tr>
     <td height="24" align="center" background="images/首页(3)_10.jpg"><input type="submit" name="Submit1" class="buttoncss" value="提交" onClick=" return del1(<?php echo $n;?>)">
       <input name="button" type=button class="buttoncss" onClick="alldel1(<?php echo $n;?>)" value="全选">
<input type=button value="反选" class="buttoncss" onClick="overdel1(<?php echo $n;?>)"></td>
     </tr>
<?php }?>
</form> 
      
</table>

 



</body>
</html>
