<style type="text/css">
.tables tr{background-color:expression('#F8F8F8,#EFEFEF'.split(',')[rowIndex%2]);}
.tables tr.gren{ background:#E8EFF5; height:35px; line-height:30px; font-size:14px;}
table{ border:solid 1px #ccc; width:100%; text-align:center; font-size:12px;  border-collapse:collapse;}

.ee{ background: url(images/email1.gif)  no-repeat center left; padding-left:10px;}
.red{ color:#FF0000}
</style>
    <div style="padding-left:30px;">共有 <?php unreadinquery($_SESSION['guestid'],$wherechild);  ?> 封未读询盘：</div>
<table cellpadding="0" cellspacing="0" class="tables">
  <tr class="gren">
    <th width="65" scope="col">序号</th>
    <th width="100" scope="col">语言</th>
    <th width="333" scope="col">主题</th>
    <th width="258" scope="col">E-mail</th>
    <th width="216" scope="col">收件时间</th>
    <th width="129" scope="col">物理地址</th>
  </tr>
<?php
    $ids=sql_select("select max(id) as id from etw_onlines where usernameid=".$_SESSION['guestid'].$wherechild." group by title,contacter,email,address,content");
	 $id="";
	for($i=0;$i<count($ids)-1;$i++){
	   $id=$id."'".$ids[$i][0]."',";
	  }
	$id=$id."'".$ids[count($ids)-1][0]."'";
    $sql="select * from etw_onlines where id in(".$id.") and translate=0 and reply=0 and readed=0";

  //$sql="select a.* from etw_onlines a right join (select max(id) id from etw_onlines group by title,contacter,email,address,content) b on b.id = a.id where usernameid=".$_SESSION['guestid'].$wherechild." and translate=0 and reply=0 and readed=0";
 
  $result=mysql_query($sql);
  $i=1;
  while($rs=mysql_fetch_array($result)){
	$sql2="select * from etw_translate where chatid=".$rs['id']." and achivetime<>0  order by achivetime desc ";
	$result2=mysql_query($sql2);
	$row=mysql_fetch_array($result2);
 ?>
  <tr>
   <td><p class="ee"><?php echo $i;$i=$i+1 ;  ?></p></td>
    <td><?php echo  getlanguage($rs['language']);  ?></td>
    <td><a href="inquirydetail.php?id=<?php echo $rs['id']; ?>"><?php echo $rs['title'];  ?></a></td>
    <td><?php echo $rs['email'];  ?></td>   
    <td><?php echo $rs['senddate'];  ?></td>
    <td><?php echo ipcountry($rs['ip']); ?></td>
    
  </tr>
<?php  }  ?>
</table>

    <div style="padding-left:30px;"><br /><br />共有 <?php unreadetwtrans($_SESSION['guestid'],$wherechild);  ?> 封新ETW国际翻译询盘未读：</div>
<table cellpadding="0" cellspacing="0" class="tables">
  <tr class="gren">
    <th width="59" scope="col">序号</th>
    <th width="110" scope="col">类型</th>
    <th width="120" scope="col">语言</th>
    <th width="331" scope="col">主题</th>
    <th width="215" scope="col">E-mail</th>
    <th width="147" scope="col">转翻译时间</th>
    <th width="119" scope="col">完成时间</th>
  </tr>
<?php
  $sql="select * from etw_onlines where usernameid=".$_SESSION['guestid'].$wherechild." and (translate<>0 or reply<>0) and readed=0";
  $result=mysql_query($sql);
  $i=0;
  while($rs=mysql_fetch_array($result)){
	$sql2="select * from etw_translate where chatid=".$rs[id]." and achivetime<>0  order by achivetime desc ";
	$result2=mysql_query($sql2);
	$row=mysql_fetch_array($result2);
 ?>
  <tr>
   <td><p class="ee"><?php echo $i+1 ;  ?></p></td>
  <td><?php if($rs['yid']=='-1'){ echo "邮件询盘"; }else{ echo "留言询盘"; } ?></td>
    <td><?php echo  getlanguage($rs['language']);  ?></td>
    <td><a href="inquirydetail.php?id=<?php echo $rs['id']; ?>"><?php echo $rs['title'];  ?></a></td>
    <td><?php echo $rs['email'];  ?></td>   
    <td><?php if($rs['reply']==0){echo  date('y-m-d',$rs['translate']);}else{echo  date('y-m-d',$rs['reply']);}  ?></td>
    <td><?php echo date('y-m-d',$row['achivetime']); ?></td>
    
  </tr>
<?php  }  ?>
</table>

