<?php
/*
'**************************************************************************************************
' 软件名称: 盘锦DJ舞曲CMS Content Management PjRen.Net
' 版本编号: Version 2.5
' 官方网站: http://www.pj57.com
' 官方论坛: http://www.pjren.net
' 版权所有: 盘锦舞曲开发团队    盘锦人(QQ:814006710)
' 郑重声明:
'    1、任何个人或组织不得在未经授权的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息；
'    2、盘锦网络事业部保留此软件的法律追究权利
'**************************************************************************************************
*/
include "../../include/conn.php";
include "../../include/function.php";
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
header("Cache-Control: no-cache, must-revalidate"); 
header("Pragma: no-cache");
if(empty($_SERVER['HTTP_REFERER'])){exit("盘锦人QQ:814006710");}
$ac=SafeRequest("action","get");
if($ac=="goodbad"){
	global $db;
	$S_ID=SafeRequest("id","get");
	$sql="Select * from s_video where S_ID=".$S_ID."";
	if($row=$db->Getrow($sql)){
		$S_ID=$row['S_ID'];
		$OuHits=$row['S_Apex'];
		$OdHits=$row['S_Tread'];
		$nCount=$row['S_Apex']+$row['S_Tread'];
		if($OuHits==$OdHits){
			$uHits="50";
			$dHits="50";
		}else{
			$uHits=$OuHits/$nCount*100;
			$dHits=$OdHits/$nCount*100;
		}
	}
	$showstr="";
	$showstr=$showstr."<div class=\"diggbox digg_good\" onClick=\"up_down($S_ID, 'good')\" onfocus=\"this.blur()\" onmousemove=\"this.style.backgroundPosition='left bottom';\" onmouseout=\"this.style.backgroundPosition='left top';\" >";
	$showstr=$showstr."<div class=\"digg_num\">($OuHits)</div>";
	$showstr=$showstr."<div class=\"digg_percent\">";
	$showstr=$showstr."<div class=\"digg_percent_bar\"><span style=\"width:$uHits%\"></span></div>";
	$showstr=$showstr."</div></div>";
	$showstr=$showstr."<div class=\"diggbox digg_bad\" onClick=\"up_down($S_ID, 'bad')\" onfocus=\"this.blur()\" onmousemove=\"this.style.backgroundPosition='right bottom';\" onmouseout=\"this.style.backgroundPosition='right top';\">";
	$showstr=$showstr."<div class=\"digg_num\">($OdHits)</div>";
	$showstr=$showstr."<div class=\"digg_percent\">";
	$showstr=$showstr."<div class=\"digg_percent_bar\"><span style=\"width:$dHits%\"></span></div>";
	$showstr=$showstr."</div></div>";
	echo escape($showstr);
	//echo $showstr;
}elseif($ac=="doHits"){
	global $db;
	$S_ID=SafeRequest("id","get");
	$dowhat=SafeRequest("dowhat","get");
	if($dowhat=="good"){	
		$sql="update s_video set S_Apex=S_Apex+1 where S_ID=".$S_ID."";
	}else{
		$sql="update s_video set S_Tread=S_Tread+1 where S_ID=".$S_ID."";
        }
        $cookies="doHits_dj_$S_ID";
	if($_COOKIE[$cookies]=="yes"){
		exit("".escape("Err_115")."");
	}else{
		setcookie($cookies,"yes",time()+86400);
		if($db->query($sql)){}
        }
}
?>