<?php
@session_start();
include('checkstate.php');
include('inc/function.php');
$comid=$_GET['id'];
 $sql="select * from custom where id=".$comid;
 $result=mysql_query($sql);
 $company=mysql_fetch_array($result);
?>
<!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" />
<title><?php echo $company['company']; ?> - ETW国际案例演示</title>
<link rel="stylesheet" href="media/css.css" type="text/css" media="screen" />
</head>

<body>
<div id="main">
     <div id="top"><a href="loginout.php" title="退出">退出</a></div>
     <div id="menu"><ul>
         <li><a href="index.php">案例演示</a></li><li><a href="maincompany.php?id=1">上市公司</a></li><li><a href="maincompany.php?id=2">龙头企业</a></li><li><a href="maincompany.php?id=3">中小企业</a></li>
     </ul></div>
     
     <div id="center">
        <div class="location"><strong>当前位置 : 案例演示首页 >> <?php echo getgrade($company['gradeid']); ?></strong></div>
        <div id="middle">
            <div class="title"><strong><?php echo "<font color='#FF0000'>".$company['company']."</font> 关键词排名效果分析表"; ?></strong></div>
          <div id="listtable">
          
            <table width="960" border="1" cellpadding="0" cellspacing="0" bordercolor="#003973" class="tables" style="text-align:center">
 <tr><td colspan="5" align="center"><h2><?php echo $company['company']; ?></h2></td></tr>
 <tr><td>网 址:</td><td><a href="http://www.<?php echo $company['url']; ?>" target="_blank">http://www.<?php echo $company['url']; ?></a><?php echo "(".getlanguage($company['gradeid']).")"; ?></td><td align="right">&nbsp;企业类型:</td><td colspan="2" ><?php echo getgrade($company['gradeid']); ?></td></tr>
 <tr><td colspan="5">&nbsp;</td></tr>
  <tr>
    <td width="140" align="center">搜索引擎:</td>
    <td width="334" align="center">关键词(产品名)</td>
    <td width="235" align="center">译 文</td>
    <td width="100" align="center">排名</td>
    <td width="139" align="center">日期</td>
  </tr>
  <?php $groupsearch=sql_select("select searchid from keyrank where state=1 and  companyid=".$company['id']." group by searchid");
    for($i=0; $i<count($groupsearch);$i++){  
            $sql="select * from keyrank where state=1 and companyid=".$company['id']." and searchid=".$groupsearch[$i][0];
		   $result=mysql_query($sql);
		   $count=mysql_num_rows($result);
		   $m=1;
		   while($row=mysql_fetch_array($result)){ ?>
    <tr>
    <?php if($m==1) { echo "<td width='139' align='center' rowspan='".$count."'>".getenginename($groupsearch[$i][0])."</td>"; }?>
    <td width="140"><?php  echo $row['keyword'];?></td>
    <td width="334"><?php  echo $row['transmean'];?></td>
    <td width="235"><?php  echo $row['rank'];?></td>
    <td width="100"><?php  echo date('Y-m-d',$row['edittime']);?></td>
  </tr><?php $m++; } } ?>

</table>
          </div>
        </div>
        <div id="middle">
            <div class="title"><strong><?php echo "<font color='#FF0000'>".getgrade($company['gradeid'])."</font>"; ?></strong> 企业案例一览表</div>
          <div id="listtable">
                  <table width="960" border="1" cellpadding="0" cellspacing="0" class="tables" bordercolor="#135294">
  <tr>
    <th width="50" scope="col">序 号</th>
    <th width="222" scope="col">公司名称</th>
    <th width="277" scope="col">网 址</th>
    <th width="136" scope="col">访问记录情况</th>
    <th width="131" scope="col">来源国家分析</th>
    <th width="130" scope="col">排名效果分析</th>
  </tr>
  <?php $i=1;
        $sql="select * from custom where state=1 and gradeid=".$company['gradeid'];
		$result=mysql_query($sql);
		while($row=mysql_fetch_array($result)){?>
  <tr>
    <td align="center"><?php echo $i; $i++; ?></td>
    <td><?php echo $row['company']; ?></td>
    <td><?php echo $row['url']; ?></td>
    <td align="center"><?php echo "<a href='http://jsq.etwun.com:8080/view.php?userid=".$row['jsqid']."' target='_blank'>访问记录</a>"; ?></td>
    <td align="center"><?php echo $row['jsqid']; ?></td>
    <td align="center"><?php echo "<a href='seodetail.php?id=".$row['id']."' target='_blank'>查看关键词排名</a>"; ?></td>
  </tr>
  <?php } ?>
</table>

            </div>
        </div>
        <div id="list">
        <div class="title"><strong>行业分类案例</strong></div>
            <div class="grade"><ul>
              <li><a href="maincompany.php?id=1"><img src="img/grade_img1.jpg" />上市公司</a></li>
              <li><a href="maincompany.php?id=2"><img src="img/grade_img2.jpg" />龙头企业</a></li>
              <li><a href="maincompany.php?id=3"><img src="img/grade_img3.jpg" />中小型企业</a></li>
            </ul></div>
        </div>
     </div>
     
     <div id="foot"><P>copy right &copy; 2008-2009  <font color="#990000">ETW International</font></P></div>
</div>
</body>
</html>
