7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
183 lines
5.2 KiB
PHP
183 lines
5.2 KiB
PHP
<?php
|
|
//------------------------------------------同步执行页面,RFID方式
|
|
/*门禁表
|
|
DROP TABLE IF EXISTS MW_EntryList;
|
|
CREATE TABLE `MW_EntryList` (
|
|
`PKID` int(10) unsigned NOT NULL auto_increment,
|
|
`DevCode` varchar(250) NOT NULL default '',
|
|
`EPCCode` varchar(250) NOT NULL default '',
|
|
`ReadTime` datetime NOT NULL default '0000-00-00 00:00:00',
|
|
`Status` varchar(20) NOT NULL default '',
|
|
PRIMARY KEY (`PKID`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
|
insert into MW_EntryList (DevCode,EPCCode) values ('12W110223','1');
|
|
insert into MW_EntryList (DevCode,EPCCode) values ('12W110391','1');
|
|
*/
|
|
function _mysql_connect_mj(){
|
|
global $dbmj_host,$dbmj_user,$dbmj_pw,$dbmj_name;
|
|
$db_mj=new DB_Sql;
|
|
$db_mj->connect($dbmj_host,$dbmj_user,$dbmj_pw,$dbmj_name);
|
|
return $db_mj;
|
|
}
|
|
////////////////////////////////////定义门禁数据库
|
|
$dbmj_host='localhost';
|
|
$dbmj_user='hehe';
|
|
$dbmj_pw='hehe';
|
|
$dbmj_name='edt';
|
|
$dbmj_table_name='MW_EntryList';
|
|
//定义进出门ID
|
|
$enter_door="1";
|
|
$out_door="2";
|
|
//定义展厅
|
|
$zt="";
|
|
////////////////////////////////////
|
|
include "../tmpl/config.php";
|
|
require "../ipad/include/function.php";
|
|
require "../ipad/include/db_mysql.php";
|
|
define("THIS_FILE_ROOT",dir_cutb(dirname(__FILE__),1)."/ipad");
|
|
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
|
date_default_timezone_set('Asia/Shanghai');
|
|
//-------------------------------register global
|
|
$magic_quotes_gpc = get_magic_quotes_gpc();
|
|
$register_globals = @ini_get('register_globals');
|
|
if(!$register_globals || !$magic_quotes_gpc) {
|
|
@extract(daddslashes($_POST));
|
|
@extract(daddslashes($_GET));
|
|
}
|
|
if(!@mysql_connect($dbmj_host,$dbmj_user,$dbmj_pw)) {
|
|
echo "Can not connect to MJ MySQL server";
|
|
exit;
|
|
}
|
|
if($_a=="tb"){
|
|
header("Content-type: text/html;charset=GB2312");
|
|
$db=_mysql_connect_mj();
|
|
$q="select * from ".$dbmj_table_name." where status<>'y' order by ReadTime";
|
|
$r=$db->query($q);
|
|
$arr_mj=array();
|
|
while($m=$db->fetch_array($r)){
|
|
$arr_mj[$m["EPCCode"]][]=$m["DevCode"];
|
|
$db->query("update ".$dbmj_table_name." set status='y' where PKID='".$m["PKID"]."'");
|
|
}
|
|
if(count($arr_mj)>0){
|
|
$db=_mysql_connect();
|
|
$tip="";
|
|
//
|
|
for($i=0;$i<count($arr_mj);$i++){
|
|
$m1=get_db_msg("select * from ".$table_pre."kh_rfid where rfid='".$arr_mj[$i]."'");
|
|
if($m1["id"]>0){
|
|
$tip.="<span class='right'>".$m1["kh"]."-".$m1["color"]."-".get_cate_title_no("color",$m1["color"]);
|
|
if($arr_mj_door==$enter_door){
|
|
$tip.="展示";
|
|
$check=get_db_msg("select * from ".$table_pre."kh_tb where ");
|
|
$db->query("update ".$table_pre."client set available='n' where id='".$m1["id"]."'");
|
|
}else{
|
|
$tip.="退出";
|
|
$db->query("update ".$table_pre."client set available='y' where id='".$m1["id"]."'");
|
|
}
|
|
$tip.="成功!</span><br>";
|
|
}else{
|
|
$tip.="<span class='wrong'>".$arr_mj[$i].",操作失败!<br></span>";
|
|
}
|
|
}
|
|
echo "y|".$tip;
|
|
}else{
|
|
echo "n|";
|
|
}
|
|
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=utf-8" />
|
|
<title>e订通-门禁</title>
|
|
<style>
|
|
BODY{
|
|
font-family:宋体;FONT-SIZE:16px;margin:0px;padding:0px;
|
|
}
|
|
a,a:link,a:visited,a:active {
|
|
text-decoration:none;COLOR: #0000ff;FONT-SIZE:16px;
|
|
}
|
|
a:hover {
|
|
TEXT-DECORATION: underline;COLOR: #aaaa9f;FONT-SIZE:16px;
|
|
}
|
|
body,input,td,select,div,li,ul,textarea,form {
|
|
font-family:宋体;
|
|
FONT-SIZE:16px;
|
|
}
|
|
.wrong{
|
|
color:#ff0000;font-weight:bold;
|
|
}
|
|
.right{
|
|
color:#0000ff;font-weight:bold;
|
|
}
|
|
</style>
|
|
<script>
|
|
//ajax
|
|
function ajaxinit()
|
|
{
|
|
var xmlhttp;
|
|
try {
|
|
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
|
|
} catch (e) {
|
|
try {
|
|
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
|
} catch (E) {
|
|
xmlhttp=false;
|
|
}
|
|
}
|
|
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
|
|
try {
|
|
xmlhttp = new XMLHttpRequest();
|
|
} catch (e) {
|
|
xmlhttp=false;
|
|
}
|
|
}
|
|
if (!xmlhttp && window.createRequest) {
|
|
try {
|
|
xmlhttp = window.createRequest();
|
|
} catch (e) {
|
|
xmlhttp=false;
|
|
}
|
|
}
|
|
return xmlhttp;
|
|
}
|
|
//
|
|
function tb(){
|
|
var xmlhttp=ajaxinit();
|
|
var url="mjrfid.php?_a=tb";
|
|
var obj=document.getElementById("div_tip");
|
|
xmlhttp.open("POST",url,true);
|
|
xmlhttp.setRequestHeader("Cache-Control","no-cache");
|
|
xmlhttp.onreadystatechange=function(){
|
|
if(xmlhttp.readyState==4 && xmlhttp.status==200){
|
|
var arr_tmp=xmlhttp.responseText.split("|");
|
|
if(arr_tmp[0]=="y"){
|
|
obj.innerHTML=arr_tmp[1];
|
|
}
|
|
}
|
|
}
|
|
xmlhttp.send(null);
|
|
}
|
|
//
|
|
function auto_tb(){
|
|
tb();
|
|
setTimeout("auto_tb()",3000);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="auto_tb();">
|
|
<br />
|
|
<form name="form1" action="mj.php" method="post">
|
|
<table width="50%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#cccccc">
|
|
<input type="hidden" name="is_submit" value="y">
|
|
<tr>
|
|
<td align="center" bgcolor="#f0f0f0" style="font-size:18px" height="40"><b>e订通-门禁系统</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" bgcolor="#ffffff" valign="top" style="line-height:150%;" height="100px"><div id="div_tip">系统等待中......</div></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</body>
|
|
</html>
|