<?php
include("inc/conn.php");
$yid=$_GET['yid'];
if($yid==''){
echo "<script type=\"text/javascript\">window.location.href=\"index.php\";</script>";
}else{
   $sql="select * from etw_onlines where yid=".$yid;
   
   $result=mysql_query($sql);
   $rs=mysql_fetch_array($result);
   if($rs[translate]==0){
        $in="insert into etw_translate(chatid,userid,language,target,source_content,receivetime,type) value(".$rs[id].", ".$rs[usernameid].",'".$rs[language]."', 'cn','".$rs[content]."', '".time()."',1 )";
      mysql_query($in) ;
  
      $up="update etw_onlines set translate='".time()."' where id=".$rs[id];
     mysql_query($up);
   }else{
    echo "<script type=\"text/javascript\">alert('已经转翻译了，请到翻译中查看');</script>";
   }
   
}
 echo "<script type=\"text/javascript\">window.location.href='handling.php';</script>";
 ?>