<?php @session_start();
include('inc/conn.php');
include('checkstate.php');
include('inc/function.php');
include('fun/funcount.php');

$ids=$_GET['id'];

 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofllow">
<title><?php echo $info[company]; ?> - 询盘详细信息- ETW国际客服系统 </title>
<link rel="stylesheet" type="text/css" href="css/css.css" />
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="js/translate.js"></script>

</head>

<body>
<div id="main">
    <div id="top">
        <?php include('header.php');  ?>
       <div id="logo">
       <div id="menu">
          <ul><li class="current"><a href="manage.php">系统首页</a></li>
         <li><a href="news.php">新闻</a></li>
          <li><a href="commontools.php">工具箱</a></li>
       </ul><iframe style=" float:right;" width='350' height='30' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='No' src='http://m.weather.com.cn/m/p3/weather1.htm' name="I6"></iframe></div>
       </div>
    </div>
     <!-- left -->
     <?php include('left.php');?>
     
  <div id="right">
    <p class="title"> 询盘管理 >> 所有询盘 >> 询盘详细信息 </p>
     <?php $sql="select * from etw_onlines where id=".$ids;
          $result=mysql_query($sql);
		  $row=mysql_fetch_array($result);
		  
		  $read=mysql_query("update etw_onlines set readed='1' where id=".$ids);
 ?>
 <table width="820" border="1" class="contents" cellpadding="0" cellspacing="0" bordercolor="#ffffff" >
  <tr><td width="103">主题</td>
  <td width="716"><span style="float:right; margin-right:50px; line-height:25px;">
  <?php if(@$_SESSION['vote']=='father') {?><select name="saler" id="saler" onchange="gotosales(<?php echo $_SESSION['guestid'].",".$row['id'];?>)">
    <option value="">--转外贸员帐户--</option>
    <?php
 $sql="select * from chat_user where userid='".$_SESSION['guestid']."'";
 $results=mysql_query($sql);
 while($rs=mysql_fetch_array($results)){
      echo "<option value=\"".$rs['id']."\">".$rs['realname']."</option>";
 } ?> </select>
 <?php } ?>
    <?php if($row['isdelete']=='0'){?>
     <a class="bg" href="#" onClick="if(confirm('确认处理为垃圾询盘吗？')){location.href='dodel.php?do=del&id=<?php echo $ids;  ?>'}">删除询盘</a> 
     <?php }elseif($row['isdelete']=='1'){?>
     <a class="bg" href="#" onClick="if(confirm('确认恢复该询盘吗？')){location.href='dodel.php?do=nodel&id=<?php echo $ids;  ?>'}">恢复询盘</a> <?php } ?></span>
   <?php echo $row['title'];  ?> </td>
  </tr>
  <tr><td> 联系人:</td><td>
  <?php if($row['childuserid']<>'') { echo "<span style='float:right; padding-right:100px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;---外贸员: ".childemail($row['childuserid'])."</span>"; }
  echo $row['contacter'];
    ?></td></tr>
  <tr><td> 电话:</td> <td><?php echo $row['telephone']; ?></td></tr>
  <tr><td> 传真:</td> <td><?php echo $row['fax']; ?></td></tr>
  <tr><td> EMAIL:</td> <td><?php echo $row['email']; ?></td></tr>
  <tr><td> 地址:</td><td><?php echo $row['address']; ?></td></tr>
  <tr><td> 时间:</td> <td><?php echo $row['senddate']; ?></td></tr>
  <tr><td> 语言:</td><td><?php echo getlanguage($row['language']); ?></td></tr>
  <tr><td> 询盘内容:</td> <td><div id="trancon"><?php echo $row['content']; ?></div>
  <input type="hidden" id="sourcelang" value="<?php echo getdomain($row['language']); ?>" /> 
  <?php if($row['translate']==0) { ?>
    <a href="#" class="bg" onclick="translate()"  style=" font-size:14px;line-height:25px; padding:3px 5px; line-height:25px; border: solid 1px #cccccc">在线翻译</a> 
      <a href="gotanslates.php?id=<?php echo $row[id];  ?>" class="bg" style="font-size:14px;line-height:25px;padding:2px 5px 3px 5px; line-height:25px; border: solid 1px #cccccc">转ETW翻译</a>
  <?php } else {   ?>
  
     <span style="float:right; padding-right:50px">转ETW翻译时间 ：<?php echo date('y-m-d H:i',$row['translate']);  ?></span> 
	 <a href="#" class="bg" onclick="translate()"  style=" font-size:14px;line-height:25px; padding:3px 5px; line-height:25px; border: solid 1px #cccccc">在线翻译</a>
	 <?php }  ?>&nbsp; <br />
<span id="resulttrans"></span><br />
   
 </td></tr></table> 
  <div id="listtable">
    <?php $tan="select * from etw_translate where chatid=".$row['id']." order by receivetime asc";
		$results=mysql_query($tan);
		$i=1;
		while($rs=mysql_fetch_array($results)){ 
		if($rs['type']<>1) { ?>
      <ul >
         <li class="name">留言内容(<?php echo "<font color='#0000FF'>".$i."楼</font>"; $i++;  ?>)</li>
        <li class="con1"><?php echo $rs['source_content']; if($rs['fujian']<>''){ echo "<a target='_blank' href='admin/fujian/".$rs['fujian']."' >原附件 </a>"; } ?> <span style="float:right; padding-right:10px">转ETW ：<?php echo date('y-m-d H:i',$rs['receivetime']);  ?></span></li>
         </ul>
         <?php }
		 if($rs['achivetime']<>0) { ?>
         <ul><li class="name">ETW 翻译</li>
         <li class="con1"><?php    echo $rs['trans_content']."<br>"; if($rs['trans_fujian']<>''){ echo "<a target='_blank' href='admin/fujian/".$rs['trans_fujian']."' > 附件 </a>"; }  ?><span style="float:right; padding-right:10px">ETW ：<?php echo date('y-m-d H:i',$rs['achivetime']);  ?></span></li>
        </ul>
      <?php }  }  ?>
  </div>
  <div style="clear:both; height:15px;"></div>
<table width="820" border="1" class="contents" cellpadding="0" cellspacing="0" bordercolor="#ffffff" >
   <?php if($row['reply']=='0'){ ?>
    <tr><td > 回复内容:</td> 
    <td width="89%"><form action="reply.php" method="post">
    <input type="hidden" name="chatid" value="<?php echo $row[id]; ?>" />
    <input type="hidden" name="uid" value="<?php echo $_SESSION['guestid']; ?>" />
    <input type="hidden" name="lang" value="<?php echo $row[language]; ?>" />
    <textarea id="reply" name="reply" cols="80" rows="10"></textarea><br />
    添加附件: &nbsp;<input type="hidden" id="fujian" name="fujian" /><iframe src="uppic.php" width="320" height="20" scrolling="no" frameborder="0"></iframe>  (上传多个文件时请打包上传)<br />
    <input id="butt" type="submit" name="submit" value=" 提交翻译 " /> <input id="butt" type="reset" name="reset" value="取消" /></form></td></tr> 
   <?php }else{  ?>
     <tr><td width="11%"> 复盘内容:</td> <td><form action="reply.php" method="post">
    <input type="hidden" name="chatid" value="<?php echo $row[id]; ?>" />
    <input type="hidden" name="uid" value="<?php echo $_SESSION['guestid']; ?>" />
    <input type="hidden" name="lang" value="<?php echo $row[language]; ?>" />
    <textarea id="reply" name="reply" cols="80" rows="10"></textarea><br />
    添加附件: &nbsp;<input type="hidden" id="fujian" name="fujian" /><iframe src="uppic.php" width="320" height="20" scrolling="no" frameborder="0"></iframe>  (上传多个文件时请打包上传)<br />
    <input id="butt" type="submit" name="submit" value=" 提交翻译 " /> <input id="butt" type="reset" name="reset" value="取消" /></form></td></tr> 

   <?php }  ?>		
     <tr><td colspan="2">&nbsp;  </td></tr>
</table>       
     </div>
<div id="footer"> Copy Rright &copy; 2008-2009 ETW International <?php if( @$_SESSION["username"]<>''){?>
<input type="hidden" id="onlineu" value="<?php echo $_SESSION["username"] ?>" />
<script type="text/javascript" src="js/onlinelisten.js"></script>
<script type="text/javascript">
window.setInterval(onlinemessage,30000);
</script>
<?php } ?></div>  
</div>
<script type="text/javascript" src="js/opencommon.js"></script>
<script type="text/javascript" src="js/gotosales.js"></script>
<script type="text/javascript">
   ins=document.getElementById("listtable").innerHTML
   if(ins==''){
     document.getElementById("listtable").style.cssText="display:none;"
   }
</script>

</body>
</html>