<?php 
error_reporting(0);
include 'config.inc.php';
include_once 'include/db_mysql.class.php';
include 'include/db_multi.class.php';
include '../phpcms/libs/functions/global.func.php';
$db = new dbstuff;
$db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW,UC_DBNAME,UC_DBCONNECT);
mysql_query("set names gb2312;");
?>
<?php
	
	date_default_timezone_set('PRC');
	include 'ip_pro.php';
	function GetIP(){
		if(!empty($_SERVER["HTTP_CLIENT_IP"])){
		  $cip = $_SERVER["HTTP_CLIENT_IP"];
		}
		elseif(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){
		  $cip = $_SERVER["HTTP_X_FORWARDED_FOR"];
		}
		elseif(!empty($_SERVER["REMOTE_ADDR"])){
		  $cip = $_SERVER["REMOTE_ADDR"];
		}
		else{
		  $cip = "无法获取！";
		}
		return $cip;
	}
	//获取ip
	
	
	
	function myip2long($ip){
		$ip_arr=split('\.',$ip);
		$iplong=(16777216*intval($ip_arr[0]))+(65536*intval($ip_arr[1]))+(256*intval($ip_arr[2]))+intval($ip_arr[3]);
		return $iplong;
	}
	
	
	
	function mysqlClean($array, $index, $maxlength)
	{
		if (isset($array[$index]))
		{
			$input = substr($array["{$index}"], 0, $maxlength);
			$input = mysql_real_escape_string($input);
			return ($input);
		}
		return NULL;
	}
	

			date_default_timezone_set('PRC');
			$ip=GetIP();
			$cheack = true;
			$ipInfos = GetIpLookup($ip);
			$ipnum = (int)(myip2long(GetIP()));
			$vote1 = $_POST['tp'];
			$vote2 = $_POST['tp2'];
			$vote3 = $_POST['tp3'];
			$mobile = $_POST['telephone'];
			$time=time();
			$strtotime=strtotime('today');
			$sql_cod = "set names utf8";
			if($vote1 != null){
			for($i=0; $i<count($vote1);$i++){  
  
				$name="";
				$class="";
				$na_cl = mysql_query("select * from univer_shuju WHERE works_id='".$vote1[$i]."'");
				while($r_anc = mysql_fetch_array($na_cl))
				{	
					$name = $r_anc['works_name'];
					$class = $r_anc['works_class'];
				}
			
			
			
				
				
				$sql="SELECT COUNT(*) AS count FROM univer_vote WHERE univer_mobile = '".$mobile."' AND univer_time > $strtotime AND univer_class = '".$class."' ";
			$result=mysql_fetch_array(mysql_query($sql)); 
			$count=$result['count'];
			if($count<3){
				
					
					
					
					$res=mysql_query("select 1 from univer_vote where univer_mobile = '".$mobile."' AND univer_vote.univer_time > $strtotime AND univer_vote.univer_voteid = '".$vote1[$i]."' limit 1" );
					$row= mysql_num_rows($res);
				
					if($row==0){
						mysql_query("UPDATE univer_shuju SET works_count = works_count + 1 where works_id='".$vote1[$i]."'" );
						mysql_query("INSERT INTO univer_vote (univer_name, univer_voteid, univer_mobile, univer_ip, univer_rip, univer_time,univer_class) VALUES ('$name', '$vote1[$i]', '$mobile', '$ipnum', '$ip', '$time', '$class')");
						$cheack = true;
					}
					
					
					
					else{
						$cheack = false;
					}
				
			}
			
			else{
				$cheack = false;
			}
			//数据库操作完毕				
							
					
					
		}
			
			}
		
		
		
		
		if($vote2 != null){
			for($k=0; $k<count($vote2);$k++){  
  
				$name="";
				$class="";
				$na_cl = mysql_query("select * from univer_shuju WHERE works_id='".$vote2[$k]."'");
				while($r_anc = mysql_fetch_array($na_cl))
				{	
					$name = $r_anc['works_name'];
					$class = $r_anc['works_class'];
				}
			
			
			
				
				
				$sql="SELECT COUNT(*) AS count FROM univer_vote WHERE univer_mobile = '".$mobile."' AND univer_time > $strtotime AND univer_class = '".$class."' ";
			$result=mysql_fetch_array(mysql_query($sql)); 
			$count=$result['count'];
			if($count<3){
				
					
					
					
					$res=mysql_query("select 1 from univer_vote where univer_mobile = '".$mobile."' AND univer_vote.univer_time > $strtotime AND univer_vote.univer_voteid = '".$vote2[$k]."' limit 1" );
					$row= mysql_num_rows($res);
				
					if($row==0){
						mysql_query("UPDATE univer_shuju SET works_count = works_count + 1 where works_id='".$vote2[$k]."'" );
						mysql_query("INSERT INTO univer_vote (univer_name, univer_voteid, univer_mobile, univer_ip, univer_rip, univer_time,univer_class) VALUES ('$name', '$vote2[$k]', '$mobile', '$ipnum', '$ip', '$time', '$class')");
						$cheack = true;
					}
					
					
					
					else{
						$cheack = false;
					}
				
			}
			
			else{
				$cheack = false;
			}
			//数据库操作完毕				
							
					
					
		}
			
			}
			
			
			
			
			
			if($vote3 != null){
			for($g=0; $g<count($vote3);$g++){  
  
				$name="";
				$class="";
				$na_cl = mysql_query("select * from univer_shuju WHERE works_id='".$vote3[$g]."'");
				while($r_anc = mysql_fetch_array($na_cl))
				{	
					$name = $r_anc['works_name'];
					$class = $r_anc['works_class'];
				}
			
			
			
				
				
				$sql="SELECT COUNT(*) AS count FROM univer_vote WHERE univer_mobile = '".$mobile."' AND univer_time > $strtotime AND univer_class = '".$class."' ";
			$result=mysql_fetch_array(mysql_query($sql)); 
			$count=$result['count'];
			if($count<3){
				
					
					
					
					$res=mysql_query("select 1 from univer_vote where univer_mobile = '".$mobile."' AND univer_vote.univer_time > $strtotime AND univer_vote.univer_voteid = '".$vote3[$g]."' limit 1" );
					$row= mysql_num_rows($res);
				
					if($row==0){
						mysql_query("UPDATE univer_shuju SET works_count = works_count + 1 where works_id='".$vote3[$g]."'" );
						mysql_query("INSERT INTO univer_vote (univer_name, univer_voteid, univer_mobile, univer_ip, univer_rip, univer_time,univer_class) VALUES ('$name', '$vote3[$g]', '$mobile', '$ipnum', '$ip', '$time', '$class')");
						$cheack = true;
					}
					
					
					
					else{
						$cheack = false;
					}
				
			}
			
			else{
				$cheack = false;
			}
			//数据库操作完毕				
							
					
					
		}
			
			}
		
		
		
		if($vote1!= null || $vote2 != null || $vote3 != null){

			if($cheack != false){
			
				echo"<script language='javascript'> alert('恭喜您，投票成功！！');location.href='index.php';</script>";
				exit();	
				
			}
			
			else{
			
				
				echo"<script language='javascript'> alert('对不起，请不要频繁刷票！！');location.href='index.php';</script>";
				exit();
			
			}

		}
		
	
	
	
?>



<!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=gbk" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<link rel="stylesheet" href="css/screen.css">
<link rel="stylesheet" href="css/lightbox.css">
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/vote_ajax.js" language="javascript" type="text/javascript"></script> 
<link href="css/style.css" rel="stylesheet" type="text/css">
<title>韶关市大学生旅游文化节--旅游文化节Logo与纪念品设计</title>
</head>
<body>
    <div id="main">
    	<div class="nav">
        	<ul>
            	<li class="long_nav focus"><a href="http://www.sglyzx.com/univercity2015/index.php">旅游文化节Logo与纪念品设计</a></li>
                <li><a href="http://www.sglyzx.com/univercity2015/tyly/">"体验旅游"攻略创作竞赛</a></li>
                <li><a href="http://www.sglyzx.com/univercity2015/sjdy/">"十佳导游"服务技能竞赛</a></li>
                <li class="short_nav"><a href="http://www.sglyzx.com/univercity2015/jdfw/">酒店服务技能系列竞赛</a></li>
                <li class="short_nav2"><a href="http://www.sglyzx.com/univercity2015/bmys/">闭幕仪式暨颁奖晚会</a></li>
            </ul>
        </div>
        
        
        <div class="cont_req">
        
        	<h1 class="h1_title">活动内容及要求</h1>
            <p>（一）韶关市大学生旅游文化节Logo标识设计</p>
			<p>要求：</p>
            <p>1、以大学生、旅游、文化三个关键词为依托，进行主题凝练，图文设计；</p>
            <p>2、体现大学生积极向上、热爱科学、崇尚文化的精神风貌；</p>
            <p>3、图案设计易于在徽章、手链、手袋、帽子、文化衫等其中一种纪念品上表现；</p>
            <p>4、图文并茂，表现力丰富；</p>
            <p>5、文字用"韶关市大学生旅游文化节"。</p>

            <p>（二）韶关市旅游信息服务中心Logo标识设计。</p>
            <p>要求：</p>
            <p>1、体现韶关市旅游信息服务中心为旅游者服务的内涵；</p>
            <p>2、图文简洁美观，易于表现，文字用"韶关市旅游信息服务中心"。</p>
            
            <p>（三）"韶关旅游"Logo标识设计。</p>
            <p>要求：</p>
            <p>1、挖掘并表现韶关旅游的特色；</p>
            <p>2、图文并茂，美观大方，文字用"韶关旅游"。</p>
        
        	
        
        </div>
    
    
        
        
        <div class="attention">
        
        	<h1 class="h1_title2">注意事项</h1>
            <p>/作品请自留底稿，一概不退；</p>
			<p>/获奖作品将收入由我校与韶关市旅游局合编的《2015年韶关市大学生旅游文化节成果汇编》；</p>
            <p>/组委会有权将获奖作品用于非商业目的（非卖品），并不再支付作者报酬；</p>
            <p>/请在作品上注明学院、年级、班级、学号、姓名、手机长号/短号等基本信息，有指导老师的请注明指导老师姓名和联系方式。</p>

        </div>
        
        
        <div class="schedule">
        
        	<h1 class="h1_title2">活动日程</h1>
            <p>/2015年5月20日前将参赛作品纸质稿件提交到韶关学院旅游与地理学院副院长办公室，同时发送电子稿至979483939@qq.com</p>
			<p>/联系人：余老师，</p>
            <p>/手机长号：15992964406，</p>
            <p>/手机短号：664406</p>
            <p>/2015年5月28日前组成专家评委会，评选出相应奖项。</p>
			<p>/2015年6月进行颁奖活动。具体颁奖日期将另行通知。</p>

        </div>
        
        <div class="set_award">
        <h1 class="h1_title3">大赛奖项<br />AWARD.</h1>
        
            <p>/韶关市大学生旅游</p>
            <p>文化节、韶关市旅</p>
            <p>游信息服务中心和</p>
            <p>"韶关旅游"Logo</p>
            <p>设计各设</p>
            <br />
            <p>/一等奖 1 名</p>
            <p>/二等奖 2 名</p>
            <p>/三等奖 3 名</p>
            <br />
            <p>/ 同时分别颁发奖励证书。</p>
            <br />
            <p>韶关学院旅游与地理学院将为参赛选手出具活动
            参赛或获奖证明，同时参与导游技能竞赛的学生可视情况
            申请创新实践学分。</p>
        </div>
        
        <div class="tp_tips">
        	<p>
            	        自2015年4月25日发出《关于开展2015年韶关市大学生旅游文化节Logo设计竞赛的通知》
                        以来，我市大学生就本次大赛不断向组委会打来咨询电话，或发来咨询短信、邮件等，
                        表现出较高的参赛热情。到截止日期（5月20日），已经收到各类参赛作品近40件（幅），
                        有手绘的，有电脑制作的。经过组委会聘请的专家委员会审查初选，现有26件（幅）
                        作品公示网络并进行投票，网友可根据自己喜爱的logo进行投票，输入手机号码每天
                        可投票一次，每次可投系列作品各三个（共九个）。
            </p>
        </div>
        <form name="voteForm" id="form1" method="post" action="?action=vote">
    	<div class="show1_title"><h1><strong>作品展示-韶关市大学生旅游文化节</strong></h1></div>
        <div class="show">
        	<ul>
            <?php
			$query = $db->query("SElECT * FROM univer_shuju where works_class=2 ORDER BY works_id asc");
			while ($rs1 = $db->fetch_array($query)){			
			?>
            <li><a href="<?php echo $rs1['works_img']  ?>_1.jpg" data-lightbox="<?php echo $rs1['works_img']  ?>"><img src='<?php echo $rs1['works_img']  ?>.jpg' /></a><p><label><input name='tp2[]' type='checkbox' value='<?php echo $rs1['works_id'] ?>' />当前票数: <?php echo $rs1['works_count'] ?></label></p></li>        
            <?php }?>
            </ul>
        </div>
        <div class="show2_title"><h1><strong>作品展示-韶关市旅游信息服务中心</strong></h1></div>
        <div class="show2">
        	<ul>
        	<?php
			$query = $db->query("SElECT * FROM univer_shuju where works_class=3 ORDER BY works_id asc");
			while ($rs1 = $db->fetch_array($query)){			
			?>
            <li><a href="<?php echo $rs1['works_img']  ?>_1.jpg" data-lightbox="<?php echo $rs1['works_img']  ?>"><img src='<?php echo $rs1['works_img']  ?>.jpg' /></a><p><label><input name='tp3[]' type='checkbox' value='<?php echo $rs1['works_id'] ?>' />当前票数: <?php echo $rs1['works_count'] ?></label></p></li>        
            <?php }?>
            </ul>
        </div>
        <div class="show3_title"><h1><strong>作品展示-韶关旅游</strong></h1></div>
        <div class="show3">
        	<ul>
            <?php
			$query = $db->query("SElECT * FROM univer_shuju where works_class=1 ORDER BY works_id asc");
			while ($rs1 = $db->fetch_array($query)){			
			?>
            <li><a href="<?php echo $rs1['works_img']  ?>_1.jpg" data-lightbox="<?php echo $rs1['works_img']  ?>"><img src='<?php echo $rs1['works_img']  ?>.jpg' /></a><p><label><input name='tp[]' type='checkbox' value='<?php echo $rs1['works_id'] ?>' />当前票数: <?php echo $rs1['works_count'] ?></label></p></li>        
            <?php }?>
            </ul>
            <div style="padding-top:30px;width:160px; margin:0 auto;">
            <a id="ctlNext" href="javascript:show('light');" class="abutton" style="">投 票</a>
            </div>
        </div>
        <div id="light" class="white_content">
            <div class="close">
                <a href="javascript:void(0)" onclick="hide('light')"> 关闭</a>
                <h2>验&nbsp;&nbsp;证</h2>
            </div> 
            <div class="telephone">
            	<label>手机号码：</label>
            	<input id="telephone" name="telephone" type="text" style="width:150px;">
			</div>
            
            <div class="con">       
     <script async  type="text/javascript" src="http://api.geetest.com/get.php?gt=6ddba8333428deb1fcea5955c050da42&mobile=1"></script>
            </div>
    </div>
    <div id="fade" class="black_overlay"></div>
    <?php 
	$db2 = new dbstuff;
$db2->connect(UC_DBHOST, UC_DBUSER, UC_DBPW,UC_DBNAME1,UC_DBCONNECT);
?>
    <script type="text/javascript" src="js/verification.js"></script>
     </form>
     <div class="news_title"><h1>最新动态</h1></div>
        <div class="news">
			<ul>
            	<?php 
				$query4 = $db2->query("SElECT * FROM v9_news WHERE catid = 193 And status = 99 ORDER BY listorder DESC,id DESC limit 0,9");
				while ($r4 = $db2->fetch_array($query4)){
				?>
                <li><span class="time"><?php echo date('m-d',$r4['inputtime']) ?></span><a href="<?php echo $r4['url'] ?>" target="_blank" title="<?php echo $r4['title'] ?>"><?php echo str_cut($r4['title'] ,38,'') ?></a></li>
                <?php }?>
            </ul>
        </div>
        <div class="images_title"><h1>图片滚动</h1></div>
        <div class="images_list">
        	<ul>
            	<?php 
				$query5 = $db2->query("SElECT * FROM v9_news WHERE catid = 192 And thumb != '' And status = 99 ORDER BY listorder DESC,id DESC limit 0,9");
				while ($r5 = $db2->fetch_array($query5)){
				?>
                <li><a  href="<?php echo $r5['url'] ?>" target="_blank" title="<?php echo $r5['title'] ?>"><img src="<?php echo $r5['thumb'] ?>" alt="<?php echo $r5['title'] ?>" /><p><?php echo $r5['title'] ?></p></a></li>
                <?php }?>
            </ul>
        </div>
</div>
<script src="js/lightbox.js"></script>
</body>
</html>
