left.php
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:3k
- <?php
- session_start();
- set_time_limit(1800);
- $user=$_SESSION["all_agent"];
- $names=$_SESSION["user_name"];
- include("../inc/conn.php");
- include("checks.php");
- $menu=$_SESSION["menus"];
- mysql_query("update online set title='$menu' where user_account='$user' and user_type='3'",$conn);
- $sqlps=mysql_query("select * from online where user_account='$user' and user_type='3' and vmsg='1'",$conn);
- if(mysql_num_rows($sqlps)<>0)
- {
- mysql_query("update online set vmsg='0' where user_account='$user'",$conn);
- echo "<script language='javascript'>alert('".mysql_result($sqlps,0,"content")."')</script>";
- }
- $sql_count=mysql_query("select * from online ",$conn);
- $nowtimes=date("Y-m-d H:i:s");
- $h=date("YmdHis");
- while($rowct=mysql_fetch_array($sql_count))
- {
- $tcid=$rowct["ID"];
- $tctimes=$rowct["active_time"];
- $tctime=split(" ",$tctimes);
- $tcymd=split("-",$tctime[0]);
- $tchms=split(":",$tctime[1]);
- $tclimit_times=mktime($tchms[0],$tchms[1],$tchms[2],$tcymd[1],$tcymd[2],$tcymd[0]);
- $lowtime=time()-$tclimit_times."<br>";
- if($lowtime>1800) mysql_query("delete from online where ID='$tcid'",$conn);
- }
- $sqlhv=mysql_query("select * from online where user_account='$user'",$conn);
- $find_haves=mysql_num_rows($sqlhv);
- $ip=$_SERVER['REMOTE_ADDR'];
- if($find_haves==0) mysql_query("insert into online(user_type,user_name,user_account,ip,login_time,login_time,active_time)values('3','$names','$user','$ip','$h','$h')",$conn);
- $sqlps=mysql_query("select * from all_agent where user_account='$user'",$conn);
- mysql_query("update online set active_time='$nowtimes' where user_account='$user'",$conn);
- if(mysql_result($sqlps,0,"online")==1)
- {
- echo "<script language='javascript'>alert('Parse error,please login again!');window.location.href='exit.php';</script>";
- }
- $sqlpt=mysql_query("select * from all_agent where user_account='$user'",$conn);//踢出
- if(mysql_result($sqlpt,0,"deleted")==1) echo "<script language='javascript'>alert('对不起,您的账号已被停用!');window.location.href='exit.php';</script>";
- $names=$_SESSION["user_name"];
- $sqlf=mysql_query("select * from online where user_account='$user'",$conn);
- $have=mysql_num_rows($sqlf);
- $ip=$_SERVER['REMOTE_ADDR'];
- $tm=date(YmdHis);
- if($have==0) mysql_query("insert into online(user_type,user_name,user_account,ip,login_time,active_time)values('3','$names','$user','$ip','$tm','$tm')",$conn);
- $sqlon=mysql_query("select * from onuser where user_account='$user' and sign='3'",$conn); //登录T出
- if(mysql_num_rows($sqlon)>0&&!isset($_SESSION["onyes"]))
- {
- echo "<script language='javascript'>alert('对不起,您的账号在别处登录,您被迫下线!');window.location.href='exit.php';</script>";
- }elseif(mysql_num_rows($sqlon)==0)
- {
- unset($_SESSION["onyes"]);
- }
- ?>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <meta http-equiv="refresh" content="20;URL=">