⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 typeview.jsp

📁 一个用java编译的流量统计系统
💻 JSP
字号:
<html>
<head>
<title>中华网---个人主页分类平均排名</title>
<style type="text/css">
<!--
body.t{  font-family: "宋体", "Arial", "Times New Roman"; font-size: 9pt; 
                  line-height: 150%; letter-spacing: 1px}
.tt3{  font-family: "!宋体", "!Arial", "!Times New Roman"; font-size:11pt; 
              line-height: 130%; color: #000000;}
-->
</style></head>
<body class="tt3" bgcolor="#666699" text="#000000" link="#00AA80" vlink="#000000" alink="#000000">
<? include  "./db_mysql.inc" ;
$maintypepath[0]="arts";
$maintypepath[1]="money";
$maintypepath[2]="technology";
$maintypepath[3]="education";
$maintypepath[4]="entertainment";
$maintypepath[5]="health";
$maintypepath[6]="sports";
$maintypepath[7]="lifestyle";
					
$shortmaintypename[0]="ac";
$shortmaintypename[1]="bm";
$shortmaintypename[2]="ct";
$shortmaintypename[3]="ed";
$shortmaintypename[4]="en";
$shortmaintypename[5]="he";
$shortmaintypename[6]="sp";
$shortmaintypename[7]="li";

$subtypename[0]="graphics arts (图像艺术)";
$subtypename[1]="paintings (绘画)";
$subtypename[2]="reading & writing (阅读写作)";
$subtypename[3]="photography (摄影)";
$subtypename[4]="personal finance (个人理财)";
$subtypename[5]="career (事业)";
$subtypename[6]="employment (求职广场)";
$subtypename[7]="realty (房地产)";
$subtypename[8]="stocks (股市)";
$subtypename[9]="Internet (互联网)";
$subtypename[10]="Programming (程式设计)";
$subtypename[11]="PC (个人电脑)";
$subtypename[12]="Mac (苹果电脑)";
$subtypename[13]="Telecommunication (电子通讯)";
$subtypename[14]="Primary School (小学)";
$subtypename[15]="Secondary School (中学)";
$subtypename[16]="University (大学)";
$subtypename[17]="Training (专业训练)";
$subtypename[18]="Movies (电影)";
$subtypename[19]="Music (音乐)";
$subtypename[20]="Comics (漫画)";
$subtypename[21]="Games (游戏)";
$subtypename[22]="Stars (明星)";
$subtypename[23]="healthy living (健康生活)";
$subtypename[24]="exercise & fitness (强身健体)";
$subtypename[25]="soccer (足球)";
$subtypename[26]="basketball (篮球)";
$subtypename[27]="car racing (赛车)";
$subtypename[28]="racing (赛马)";
$subtypename[29]="bridge (棋牌)";
$subtypename[30]="fashion (时装)";
$subtypename[31]="cuisine (饮食)";
$subtypename[32]="travel (旅游)";
$subtypename[33]="romance (爱情)";

$shortsubtypename[0]="acga";
$shortsubtypename[1]="acpa";
$shortsubtypename[2]="acrw";
$shortsubtypename[3]="acph";
$shortsubtypename[4]="bmpf";
$shortsubtypename[5]="bmca";
$shortsubtypename[6]="bmem";
$shortsubtypename[7]="bmre";
$shortsubtypename[8]="bmst";
$shortsubtypename[9]="ctin";
$shortsubtypename[10]="ctpr";
$shortsubtypename[11]="ctpc";
$shortsubtypename[12]="ctma";
$shortsubtypename[13]="ctte";
$shortsubtypename[14]="edps";
$shortsubtypename[15]="edss";
$shortsubtypename[16]="edun";
$shortsubtypename[17]="edtr";
$shortsubtypename[18]="enmo";
$shortsubtypename[19]="enmu";
$shortsubtypename[20]="enco";
$shortsubtypename[21]="enga";
$shortsubtypename[22]="enst";
$shortsubtypename[23]="hehl";
$shortsubtypename[24]="heef";
$shortsubtypename[25]="spso";
$shortsubtypename[26]="spgo";
$shortsubtypename[27]="spcr";
$shortsubtypename[28]="sphr";
$shortsubtypename[29]="spmj";
$shortsubtypename[30]="lifa";
$shortsubtypename[31]="licu";
$shortsubtypename[32]="litr";
$shortsubtypename[33]="liro";

$subtypepath[0]="graphics";
$subtypepath[1]="paintings";
$subtypepath[2]="reading";
$subtypepath[3]="photography";
$subtypepath[4]="finance";
$subtypepath[5]="career";
$subtypepath[6]="employment";
$subtypepath[7]="realty";
$subtypepath[8]="stocks";
$subtypepath[9]="internet";
$subtypepath[10]="programming";
$subtypepath[11]="pc";
$subtypepath[12]="mac";
$subtypepath[13]="telecom";
$subtypepath[14]="primaryschool";
$subtypepath[15]="secondaryschool";
$subtypepath[16]="university";
$subtypepath[17]="training";
$subtypepath[18]="movies";
$subtypepath[19]="music";
$subtypepath[20]="comics";
$subtypepath[21]="games";
$subtypepath[22]="stars";
$subtypepath[23]="living";
$subtypepath[24]="fitness";
$subtypepath[25]="soccer";
$subtypepath[26]="golf";
$subtypepath[27]="carracing";
$subtypepath[28]="horse";
$subtypepath[29]="mahjong";
$subtypepath[30]="fashion";
$subtypepath[31]="cuisine";
$subtypepath[32]="travel";
$subtypepath[33]="romance";
 ?>
<table align="center" border="0" cellPadding="0" cellSpacing="0" width="100%" class="tt3">
<td width="14%" bgcolor="#4e4e82" valign="top"><p align="center"><a href="allview1.php"><font color="CCFFCC">总平均排名</font></a></p>
<?   $j=0;
     while($j<34){
     $p1=strpos($subtypename[$j],"(")+1;
     $p2=strrpos($subtypename[$j],")")-1;
  ?>&nbsp;&nbsp;
  <a href="typeview1.php?type=<? echo $shortsubtypename[$j];?>" ><font color="f0f0f0"><? echo substr($subtypename[$j],$p1,$p2);?></font></a><br>
  <? $j+=1;
     }
      ?><br></td>
<td width="86%" bgcolor="#666699" valign="top">
  <?
  //-------------取得站点类型-------------------------
     $j=0;
     while($j<34){
       if (strcmp($shortsubtypename[$j],$type)==0){
         $p1=strpos($subtypename[$j],"(")+1;
          $p2=strrpos($subtypename[$j],")")-1; 
	  $countresult[6]=substr($subtypename[$j],$p1,$p2);
          break;
        }
      $j+=1;
     }
    if ($j==34)
       $countresult[6]="类别未知";

   $newdb=new DB_Sql;
   $sqlstr="select t2.username,t2.title,t1.starttime,t1.totalhits,to_days(now())-to_days(starttime) as days, totalhits/(to_days(now())-to_days(starttime)+1) as avghits,t1.sitetype from stat t1,userinfo t2 where t1.uid=t2.uid and t2.ok=1 and t1.sitetype='$type' order by avghits desc limit 0,100";
   $newdb->query($sqlstr);
   $total_rec_num=$newdb->num_rows();
   if ($total_rec_num<=0){?>
   <br>
    <p align="center"><b><font color="#FFCC00" size="+1">HOME4U分类统计平均名次</font></b></p>
    <p align="center"><b><font color="#ffff00" ><? echo $countresult[6];?></font></b></p>
    <p></p>
    <p align="center">没有该类别的统计信息</p>
    </td></table>
    </body>
    </html>
   <?
   die;}
   else {
      $pg_row_num=25;
   if($total_rec_num%$pg_row_num==0)
	$max_pg_num=$total_rec_num/$pg_row_num;
   else
	$max_pg_num=floor($total_rec_num/$pg_row_num)+1;
if(isset($first) or trim($pg)=="" or (int)$pg<1)
	$pg=1;
if(isset($last) or (int)$pg>$max_pg_num)
		$pg=$max_pg_num;

$pos=$pg_row_num*($pg-1);
$newdb->seek($pos);

  ?>

<div align="center"><center>
<br>
<p><b><font color="#FFCC00" size="+1">HOME4U分类统计平均名次</font></b></p>
<p><b><font color="#ffff00" ><? echo $countresult[6];?></font></b></p>
<table border="0" width="80%" bgcolor="#f0f0f0" cellspacing="0"
cellpadding="2" class="tt3">
  <tr bgcolor="#4e4e82">
    <td align="center"><font color="ffffff">名次</font></td>
    <td align="left"><font color="ffffff">站点名称</font></td>
    <td align="center"><font color="ffffff">登记时间</font></td>
     <td align="right"><font color="f0f0f0">平均人数</font></td>
   <td align="right"><font color="ffffff">总人数</font></td>
    <td align="right"><font color="ffffff">天数</font></td>
    <td align="center"><font color="ffffff">网站类别</font></td>
  </tr>
</center></div>
<? $i=0;
   while ($newdb->next_record() and $i<$pg_row_num)   {
          $i=$i+1;
          $ii=$pos+$i;
	      //从username获得dns 绝对路径
          $username=$newdb->Record["username"];
           $url1=substr($username,0,2);
	   $url2=substr($username,0,4);
  	   $url3=substr($username,4);

	  $j=0;
           while($j<8){
       if (strcmp($shortmaintypename[$j],$url1)==0){
     	  $url11=$maintypepath[$j];
          break;
        }
      $j+=1;
     }
    if ($j<>8){
     $k=0;
           while($k<34){
       if (strcmp($shortsubtypename[$k],$url2)==0){
     	  $url22=$subtypepath[$k];
          break;
        }
      $k+=1;
     }
      $countresult[1]="http://home4u.china.com/".$url11."/".$url22."/".$url3."/";
       }
        else
      {
      $countresult[1]="";}

          $countresult[0]=$newdb->Record["title"];
          $countresult[2]=substr($newdb->Record["starttime"],0,10);
          $countresult[3]=$newdb->Record["totalhits"];
          $countresult[5]=$newdb->Record["days"]+1;
          $countresult[7]=round($newdb->Record["avghits"]);
         if ($countresult[7]==0)
	       $countresult[7]="小于1人";

    ?>
  <tr>
    <td align="center"><? echo $ii;?></td>
   <? if ($countresult[1]=="") {?>
    <td align="left"><? echo $countresult[0];?></td>
    <?}else{?>
    <td align="left"><a href=<? echo $countresult[1];?> target="_blank"><? echo $countresult[0];?></a></td>
    <?}?> 
    <td align="center"><? echo $countresult[2];?></td>
    <td align="right"><? echo $countresult[7];?>&nbsp;</td>
    <td align="right"><? echo $countresult[3];?>&nbsp;</td>
    <td align="right"><? echo $countresult[5];?></td>
    <td align="center"><? echo $countresult[6];?></td>
  </tr>
<?}
?>
</table>
<p>
<table border="0" class="tt3" width="80%" align="center" cellspacing="0" cellpadding="0">
<tr> 
      <td width="80%" height="60" align="right"> 
 <?   $k=0;
      while ($k<$max_pg_num-1){
         $k1=$k*$pg_row_num+1;
	 $k2=($k+1)*$pg_row_num;
	?>
         <a href="typeview1.php?type=<? echo $type;?>&pg=<? echo $k+1;?>">第<? echo $k1;?>-<? echo $k2;?>名</a>&nbsp;&nbsp;&nbsp;&nbsp;
<?         $k=$k+1;}
?>       
         <a href="typeview1.php?type=<? echo $type;?>&pg=<? echo $k+1;?>">第<? echo ($max_pg_num-1)*$pg_row_num+1;?>-<? echo $total_rec_num;?>名</a>
      </td>
    </tr>
  </table>
<?
}?></td></table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -