📄 acc_fxlssj.php
字号:
echo "<tr style='background-color:#ccf;' onclick='javascript:document.getElementById(\"mx_".$row[0]."\").style.display==\"block\"?document.getElementById(\"mx_".$row[0]."\").style.display=\"none\":document.getElementById(\"mx_".$row[0]."\").style.display=\"block\";'>";
echo "<td class='e'".$d_r.">$row[0]</td><td class='e'".$d_r.">".substr($row[1],11)."</td>";
echo "<td class='e'".$d_r." align='right'>$_Nf</td><td class='e'".$d_r.">$row[3]</td>";
echo "<td class='e'".$d_r." align='right'>$row[4]</td><td class='e'".$d_r.">$row[5]".$d_w."</td></tr>\n";
echo "<tr><td class='v' colspan='6'><table style='display:none' id='mx_".$row[0]."'>\n";
## 提取明细帐
## ******************************** DEBUG **********************************
## left join using (sp_code) unique left table 使之忽略右表中的重复记录
if ( $row[7] === 'mdrj' || $row[7] === 'mdcj' ) {
$que = "select bdxh,spzkj,oth_read ";
$que.= " from ".$xoopsDB->prefix("market_mdseri_history");
$que.= " where store_id='".$_REQUEST['s_id0']."' and substring(date_h,1,16)='".$_REQUEST['hist_d']."' and sdbh=".$row[0]." order by bdxh";
$cnt = $xoopsDB->query($que);
echo "<tr><td class='v'>#</td><td class='v'>交易</td><td class='v'>发生额</td><td class='v'>备注/说明</td></tr>\n";
while ( $mxz = $xoopsDB->fetchrow($cnt) ) {
echo "<tr style='background-color:#cfd;'><td class='v'".$d_r.">$mxz[0]</td><td class='v'>$_Nf</td>";
echo "<td class='v'".$d_r.">$mxz[1]</td><td class='v'".$d_r." align='left'>$mxz[2]</td></tr>\n";
}
} elseif ( $row[7] === 'kczj' || $row[7] === 'kcjs' || $row[7] === 'mdjh' ) {
$que = "select a.bdxh,a.xssl,a.oth_read,b.sp_name,a.sj ";
$que.= " from ".$xoopsDB->prefix("market_mdseri_history")." a left join ".$xoopsDB->prefix("market_spinfo")." b ";
$que.= " using (sp_code,store_id) where a.store_id='".$_REQUEST['s_id0']."' and substring(date_h,1,16)='".$_REQUEST['hist_d']."' and a.sdbh=".$row[0]." order by a.bdxh";
$cnt = $xoopsDB->query($que);
echo "<tr><td class='v'>#</td><td class='v'>交易</td><td class='v'>商品名称</td><td class='v'>数量</td>";
if ( $row[7] == 'mdjh' ) echo "<td class='v'>金额</td>";
echo "<td class='v'>备注/说明</td></tr>\n";
while ( $mxz = $xoopsDB->fetchrow($cnt) ) {
echo "<tr style='background-color:#cfd;'><td class='v'".$d_r.">$mxz[0]</td><td class='v'>$_Nf</td>";
echo "<td class='v'>$mxz[3]</td><td class='v'".$d_r.">$mxz[1]</td>";
if ( $row[7] == 'mdjh' ) echo "<td class='v'".$d_r." align='right'>$mxz[4]</td>";
echo "<td class='v'".$d_r." align='left'>$mxz[2]</td></tr>\n";
}
} elseif ( $row[7] === 'mdpy' || $row[7] === 'mdpk' ) {
$que = "select a.bdxh,a.xssl,a.oth_read,b.sp_name ";
$que.= " from ".$xoopsDB->prefix("market_mdseri_history")." a left join ".$xoopsDB->prefix("market_spinfo")." b ";
$que.= " using (sp_code,store_id) where a.store_id='".$_REQUEST['s_id0']."' and substring(date_h,1,16)='".$_REQUEST['hist_d']."' and a.sdbh=".$row[0]." order by a.bdxh";
$cnt = $xoopsDB->query($que);
echo "<tr><td class='v'>#</td><td class='v'>交易</td><td class='v'>商品名称</td><td class='v'>发生额</td><td class='v'>备注/说明</td></tr>\n";
while ( $mxz = $xoopsDB->fetchrow($cnt) ) {
echo "<tr style='background-color:#cfd;'><td class='v'".$d_r.">$mxz[0]</td><td class='v'>$_Nf</td>";
echo "<td class='v'>$mxz[3]</td><td class='v'".$d_r.">$mxz[1]</td><td class='v'".$d_r." align='left'>$mxz[2]</td></tr>\n";
}
} elseif ( $row[7] === 'mdtg' ) {
$que = "select a.bdxh,b.sp_name,a.xssl,a.spzkj,a.zke,a.user_disc ";
$que.= " from ".$xoopsDB->prefix("market_mdseri_history")." a left join ".$xoopsDB->prefix("market_spinfo")." b ";
$que.= " using (sp_code,store_id) where a.store_id='".$_REQUEST['s_id0']."' and substring(date_h,1,16)='".$_REQUEST['hist_d']."' and a.sdbh=".$row[0]." order by a.bdxh";
$cnt = $xoopsDB->query($que);
echo "<tr><td class='v'>#</td><td class='v'>品名</td><td class='v'>折扣%</td><td class='v'>数量</td><td>售价</td><td>折扣额</td></tr>\n";
while ( $mxz = $xoopsDB->fetchrow($cnt) ) {
echo "<tr style='background-color:#cfd;'><td class='v'".$d_r.">$mxz[0]</td><td class='v'>$mxz[1]</td>";
echo "<td class='v'>$mxz[5]</td><td class='v' align='left'>$mxz[2]</td><td class='v'".$d_r." align='right'>$mxz[3]</td>";
echo "<td class='v'".$d_r." align='right'>$mxz[4]</td></tr>\n";
}
} elseif ( $row[7] === 'mdpf' ) {
$que = "select a.bdxh,b.sp_name,a.xssl,a.spzkj ";
$que.= " from ".$xoopsDB->prefix("market_mdseri_history")." a left join ".$xoopsDB->prefix("market_spinfo")." b ";
$que.= " using (sp_code,store_id) where a.store_id='".$_REQUEST['s_id0']."' and substring(date_h,1,16)='".$_REQUEST['hist_d']."' and a.sdbh=".$row[0]." order by a.bdxh";
$cnt = $xoopsDB->query($que);
echo "<tr><td class='v'>#</td><td class='v'>品名</td><td class='v'>数量</td><td>合计金额</td></tr>\n";
while ( $mxz = $xoopsDB->fetchrow($cnt) ) {
echo "<tr style='background-color:#cfd;'><td class='v'".$d_r.">$mxz[0]</td><td class='v'>$mxz[1]</td>";
echo "<td class='v'".$d_r." align='left'>$mxz[2]</td><td class='v'".$d_r." align='right'>$mxz[3]</td></tr>\n";
}
} elseif ( $row[7] === 'mdhg' ) {
$que = "select a.bdxh,b.sp_name,a.xssl,a.spzkj,a.user_disc ";
$que.= " from ".$xoopsDB->prefix("market_mdseri_history")." a left join ".$xoopsDB->prefix("market_spinfo")." b ";
$que.= " using (sp_code,store_id) where a.store_id='".$_REQUEST['s_id0']."' and substring(date_h,1,16)='".$_REQUEST['hist_d']."' and a.sdbh=".$row[0]." order by a.bdxh";
$cnt = $xoopsDB->query($que);
echo "<tr><td class='v'>#</td><td class='v'>品名</td><td class='v'>数量</td><td>合计金额</td><td>折上折</td></tr>\n";
while ( $mxz = $xoopsDB->fetchrow($cnt) ) {
echo "<tr style='background-color:#cfd;'><td class='v'".$d_r.">$mxz[0]</td><td class='v'>$mxz[1]</td>";
echo "<td class='v'".$d_r." align='left'>$mxz[2]</td><td class='v'".$d_r." align='right'>$mxz[3]</td><td>$mxz[4]</td></tr>\n";
}
} elseif ( $row[7] === 'mdxs' ) {
$que = "select a.bdxh,b.sp_name,a.xssl,a.spzkj,a.zke,a.zkl ";
$que.= " from ".$xoopsDB->prefix("market_mdseri_history")." a left join ".$xoopsDB->prefix("market_spinfo")." b ";
$que.= " using (sp_code,store_id) where a.store_id='".$_REQUEST['s_id0']."' and substring(date_h,1,16)='".$_REQUEST['hist_d']."' and a.sdbh=".$row[0]." order by a.bdxh";
$cnt = $xoopsDB->query($que);
echo "<tr><td class='v'>#</td><td class='v'>品名</td><td class='v'>手工折</td><td class='v'>数量</td><td>售价</td><td>折扣额</td></tr>\n";
while ( $mxz = $xoopsDB->fetchrow($cnt) ) {
echo "<tr style='background-color:#cfd;'><td class='v'".$d_r.">$mxz[0]</td><td class='v'>$mxz[1]</td>";
echo "<td class='v'>$mxz[5]</td><td class='v'".$d_r." align='left'>$mxz[2]</td><td class='v'".$d_r." align='right'>$mxz[3]</td>";
echo "<td class='v' align='right'>$mxz[4]</td></tr>\n";
}
}
echo "</table></tr>\n";
}
echo "</table>\n";
echo '
<script language="javascript">
<!--
function all_st(sta) {
if ( sta == 0 ) var aact="none";
if ( sta == 1 ) var aact="block";
var rec_End = "'.$rec_End.'";
rec_End = Number(rec_End);
for ( var i = 0; i<=rec_End; i++ ) {
if ( document.getElementById("mx_"+i) != null ) {
document.getElementById("mx_"+i).style.display=aact;
}
}
}
// -->
</script>
';
echo "<input type='button' value='全部展开' onclick='javascript:all_st(1);this.blur();' /> \n";
echo " <input type='button' value='全部收起' onclick='javascript:all_st(0);this.blur();' />\n";
} ## 流水帐显示 End
?>
<center><form action="" method="POST" name="hist_seri" id="hist_seri">
<script language='javascript'>
<!--
function hist_sj(sj_date) {
var act = '<?php echo $_SERVER['PHP_SELF'].'?s_id0='.$_REQUEST['s_id0']; ?>';
document.getElementById('sj_date').value=sj_date;
document.getElementById('hist_seri').action=act;
document.getElementById('hist_seri').submit();
}
// -->
</script>
<input type='hidden' name='hist_data' value='1' />
<input type='hidden' name='sj_date' value='' />
<input type='hidden' name='s_id0' value='<?php echo $_REQUEST['s_id0']; ?>' />
<hr />
<?php
$que = "select substring(date_h,1,16) from ".$xoopsDB->prefix("market_mdseri_history");
$que.= " where shbz!='2' and store_id='".$_REQUEST['s_id0']."' group by substring(date_h,1,16)";
$res = $xoopsDB->query($que);
$c = 'font-size:14px;background-color:#ff9;color:#00F;width:203px;height:20px;';
echo "<nobr>\n";
while ( $row = $xoopsDB->fetchrow($res) ) {
echo "<input style='$c' type='button' value='查询".$row[0]."历史销售' onclick=\"javascript:hist_sj('$row[0]');\" />";
echo "<br />\n";
}
echo "</nobr>\n";
echo "</form>\n";
echo "<hr /><input type='button' value='关闭窗口' onclick='returnValue=1;window.close();' /></center>\n";
include_once '../../footer.php';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -