156 lines
7.4 KiB
PHP
156 lines
7.4 KiB
PHP
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<script src="index.js"></script>
|
|
<style>
|
|
.container{
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
.tb{
|
|
border-collapse: collapse;
|
|
border: 2px solid rgb(140, 140, 140);
|
|
letter-spacing: 1px;
|
|
margin: 20px 0;
|
|
}
|
|
th,
|
|
td{
|
|
border: 1px solid rgb(160 160 160);
|
|
padding: 8px 10px;
|
|
}
|
|
.text-center {
|
|
text-align: center;
|
|
}
|
|
thead,
|
|
tfoot {
|
|
background-color: rgb(228 240 245);
|
|
}
|
|
.select-box{
|
|
margin: 20px 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<form action="" method="post" name="selectForm">
|
|
<div class="select-box">
|
|
|
|
<input type="text" name="ckdm" value="" placeholder="仓库代码"/>
|
|
<input type="text" name="spdm" value="" placeholder="商品代码"/>
|
|
|
|
<input type="submit" name="selectSub" value="查询"/>
|
|
</div>
|
|
<?php
|
|
$dbConnect = mysqli_connect('162.14.110.130', 'yysjxc', '7XyMdMExNKNMwMRb', 'yysjxc');
|
|
$dbConnect->query("set names 'utf8'"); //utf8防止乱码
|
|
if(!$dbConnect){
|
|
exit('数据库连接失败!');
|
|
}
|
|
if(!empty($_POST["selectSub"])){
|
|
$keyword1 = $_POST["ckdm"];
|
|
$keyword2 = $_POST["spdm"];
|
|
if($keyword1 == "" || $keyword2 == "" ){
|
|
echo "<script>alert('筛选条件不能为空!');</script>";
|
|
}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 "
|
|
<table class='tb'>
|
|
<thead>
|
|
<tr>
|
|
<th>类型名称</th>
|
|
<th>单据名称</th>
|
|
<th>单据编号</th>
|
|
<th>确认日期</th>
|
|
<th>客户代码</th>
|
|
<th>商品代码</th>
|
|
<th>出库价格</th>
|
|
<th>颜色代码</th>
|
|
<th>X210<br />T195</th>
|
|
<th>215<br />T200</th>
|
|
<th>220<br />205</th>
|
|
<th>225<br />210</th>
|
|
<th>230<br />T215</th>
|
|
<th>235<br />T220</th>
|
|
<th>240<br />T225</th>
|
|
<th>245<br />T230</th>
|
|
<th>250<br />T235</th>
|
|
<th>255<br /></th>
|
|
<th>260<br /></th>
|
|
<th>265<br /></th>
|
|
<th>270<br /></th>
|
|
<th>275<br /></th>
|
|
<th>280<br /></th>
|
|
<th>均码<br /></th>
|
|
</tr>
|
|
</thead>
|
|
";
|
|
while ($row = mysqli_fetch_array($data)){
|
|
echo '<tr>';
|
|
echo "
|
|
<td>$row[0]</td>
|
|
<td>$row[1]</td>
|
|
<td>$row[2]</td>
|
|
<td>$row[3]</td>
|
|
<td>$row[4]</td>
|
|
<td>$row[5]</td>
|
|
<td>$row[6]</td>
|
|
<td>$row[7]</td>
|
|
<td>$row[8]</td>
|
|
<td>$row[9]</td>
|
|
<td>$row[10]</td>
|
|
<td>$row[11]</td>
|
|
<td>$row[12]</td>
|
|
<td>$row[13]</td>
|
|
<td>$row[14]</td>
|
|
<td>$row[15]</td>
|
|
<td>$row[16]</td>
|
|
<td>$row[17]</td>
|
|
<td>$row[18]</td>
|
|
<td>$row[19]</td>
|
|
<td>$row[20]</td>
|
|
<td>$row[21]</td>
|
|
<td>$row[22]</td>
|
|
<td>$row[23]</td>
|
|
";
|
|
echo '</tr>';
|
|
}
|
|
echo '</table>';
|
|
}
|
|
}
|
|
}
|
|
mysqli_close($dbConnect);
|
|
?>
|
|
|
|
</form>
|
|
</div>
|
|
</body>
|
|
</html>
|