diff --git a/index.js b/index.js new file mode 100644 index 0000000..db5113f --- /dev/null +++ b/index.js @@ -0,0 +1,59 @@ +function tokenEncoder(password, date){ + keyword = "213jhkjhg*&^"; + token = password + keyword + date; + return token; +} + +function getDate(){ + let now = new Date(); + let year = now.getFullYear(); + let month = now.getMonth() + 1; + let date = year + "-" + month; + return date; +} + + +let localToken = localStorage.getItem("token"); +if(localToken === "" || localToken === null){ + var password="" + password=prompt('请输入密码(本网站需输入密码才可以进入):',''); + function custom_close() + { + window.opener=null; + window.open('','_self'); + window.close(); + } + if (password !='yys') + {alert("密码不正确,无法进入本站!!!") + + custom_close(); + alert("即将打开百度")//加这一段是为了避免有些浏览器不支持关闭浏览器的js ,所以请求跳转到一个新页面! + window.location.href='http://www.baidu.com'; + }else{ + let token = tokenEncoder(password, getDate()); + localStorage.setItem("token", token); + } + }else{ + let token = tokenEncoder('yys', getDate()); + if(token != localToken){ + var password="" + password=prompt('请输入密码(本网站需输入密码才可以进入):',''); + function custom_close(){ + window.opener=null; + window.open('','_self'); + window.close(); + } + if (password !='yys'){ + alert("密码不正确,无法进入本站!!!") + + custom_close(); + alert("即将打开百度")//加这一段是为了避免有些浏览器不支持关闭浏览器的js ,所以请求跳转到一个新页面! + window.location.href='http://www.baidu.com'; + }else{ + let token = tokenEncoder(password, getDate()); + localStorage.setItem("token", token); + } + } + } + + diff --git a/index.php b/index.php new file mode 100644 index 0000000..084dbc4 --- /dev/null +++ b/index.php @@ -0,0 +1,156 @@ + + + + + + + +
+
+
+ + + + + +
+ query("set names 'utf8'"); //utf8防止乱码 + if(!$dbConnect){ + exit('数据库连接失败!'); + } + if(!empty($_POST["selectSub"])){ + $keyword1 = $_POST["ckdm"]; + $keyword2 = $_POST["spdm"]; + if($keyword1 == "" || $keyword2 == "" ){ + echo ""; + }else{ + $data = mysqli_query($dbConnect, "select + distinct lxmc,djmc,djbh,qrrq,dm1,spdm,ckj,GG1DM, + sum(case when GG2DM='X210' or GG2DM='T195' then -SL else null end) as wz1, + sum(case when GG2DM='215' or GG2DM='T200' then -SL else null end) as wz2, + sum(case when GG2DM='220' or GG2DM='205' then -SL else null end) as wz3, + sum(case when GG2DM='225' or GG2DM='210' then -SL else null end) as wz4, + sum(case when GG2DM='230' or GG2DM='T215' then -SL else null end) as wz5, + sum(case when GG2DM='235' or GG2DM='T220' then -SL else null end) as wz6, + sum(case when GG2DM='240' or GG2DM='T225' then -SL else null end) as wz7, + sum(case when GG2DM='245' or gg2dm='T230' then -SL else null end) as wz8, + sum(case when GG2DM='250' or gg2dm='T235' then -SL else null end) as wz9, + sum(case when GG2DM='255' then -SL else null end) as wz10, + sum(case when GG2DM='260' then -SL else null end) as wz11, + sum(case when GG2DM='265' then -SL else null end) as wz12, + sum(case when GG2DM='270' then -SL else null end) as wz13, + sum(case when GG2DM='275' then -SL else null end) as wz14, + sum(case when GG2DM='280' then -SL else null end) as wz15, + sum(case when GG2DM='000' then -SL else null end) as wz16 + from v_jxc + where + spdm like '%".$keyword2."%' and + dm1 like '%".$keyword1."%' + GROUP BY lxmc,djmc,djbh,qrrq,dm1,spdm,ckj,GG1DM + order by qrrq desc + limit 300 + "); + + + if($data){ + echo " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; + while ($row = mysqli_fetch_array($data)){ + echo ''; + echo " + + + + + + + + + + + + + + + + + + + + + + + + + "; + echo ''; + } + echo '
类型名称单据名称单据编号确认日期客户代码商品代码出库价格颜色代码X210
T195
215
T200
220
205
225
210
230
T215
235
T220
240
T225
245
T230
250
T235
255
260
265
270
275
280
均码
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]$row[9]$row[10]$row[11]$row[12]$row[13]$row[14]$row[15]$row[16]$row[17]$row[18]$row[19]$row[20]$row[21]$row[22]$row[23]
'; + } + } + } + mysqli_close($dbConnect); + ?> + +
+
+ + \ No newline at end of file