📄 acc_qtshrk.php
字号:
<?php
////////////////////////////////////////////////////////
// Author by Shuweich
// Date : 2007.07.27
// 2007.11.16 完成了前端界面的开发
// 建站支持: http://www.shuweich.net
// 作者: Shuweich
// QQ: 1502384
// ICQ: 190492112
// MSN: shuweich@hotmail.com
// E-mail: root@shuweich.net
// E-mail: shuweich@163.com
////////////////////////////////////////////////////////
// 模块管理 by lssppxb
// For 前台收货入库
////////////////////////////////////////////////////////
// 考虑增面HTML头尾结构
$title='收货入库';
include_once '../../mainfile.php';
include_once 'head_acc.php';
include_once 'head_inc.php';
$q_zy='mdjh';
if ( $_REQUEST['spzl_ins_up'] == '1' ) {
/*
echo "这里是调试窗口之数据资料窗:<hr /><br />\n";
echo "<pre>";
print_r($_REQUEST);
echo "</pre>";
echo "<hr /><br />\n";
*/
## ********************* DEBUG ***********************
## 取本店最大流水 + 1(代码待改进) !!!!!
$que = "select sdbh ";
$que.= " from ".$xoopsDB->prefix("market_mdseri");
$que.= " where store_id='".$_REQUEST['s_id0']."' order by sdbh desc limit 0,1";
$res = $xoopsDB->query($que);
$row = $xoopsDB->fetchrow($res);
$sdbh0 = $row[0] + 1;
## echo "<hr />$que<hr />\n";
## 取本店最大流水 + 1 !!!!!
$ins_for = $_REQUEST['sum_sl0'] + 0;
$ins = "insert into ".$xoopsDB->prefix("market_mdseri");
$ins .= " (bh,store_id,sdbh,bdxh,date_q,date_h,sp_barcode,sp_code,xssl,sj,rz_user_id,shbz,zy,oth_read) values ";
$Squ = "select bybz from ".$xoopsDB->prefix("market_store")." where store_id='".$_REQUEST['s_id0']."' limit 0,1";
$ssp0 = $xoopsDB->fetchrow( $xoopsDB->query($Squ) );
$S_ID = substr($ssp0[0],23,1)=='7'?'696':$_REQUEST['s_id0'];
for ( $i = 1; $i <= $ins_for; $i++ ) {
$is_real_prod = "select sp_code from ".$xoopsDB->prefix("market_spinfo");
$is_real_prod .= " where sp_code='".$_REQUEST['sp_code0_'.$i]."' and store_id='$S_ID'";
$is_real = $xoopsDB->getRowsNum( $xoopsDB->query($is_real_prod) );
if ( $is_real == 0 ) continue;
$ins .= "(0,";
$ins .= "'".$_REQUEST['s_id0']."',";
$ins .= $sdbh0.",";
$ins .= $i.",";
$ins .= "'".$_REQUEST['curr_time0']."',";
$ins .= "now(),";
$ins .= "'".$_REQUEST['sp_barcode0_'.$i]."',";
$ins .= "'".$_REQUEST['sp_code0_'.$i]."',";
$ins .= "'".$_REQUEST['spsl0_'.$i]."',";
$ins .= "'".$_REQUEST['spsj0_'.$i]."',";
$ins .= "'".$_REQUEST['u_id0']."',";
$ins .= "'0',";
$ins .= "'".$_REQUEST['q_zy0']."',"; ## 前台摘要/交易代码
$ins .= "'".$_REQUEST['sp_oth0_'.$i]."'"; ## 说明或留言
$ins .= "),";
}
$ins = substr($ins,0,-1);
$ins00 = $xoopsDB->queryF($ins);
unset($ins);
?>
<script language='javascript'>
<!--
// window.location.href='<?php echo $_SERVER['PHP_SELF'].'?s_id0='.$_REQUEST['s_id0']; ?>';
// -->
</script>
<?php
} ## 数据提交到数据库 End
## 根据`bybz`字段值定义具体语句 [2] [3] [4] [5] [6] ## To Debug ##
$que = "select a.store_id,b.s_name,a.user_id,a.user_name,b.bybz,a.auth,b.jfxs ";
$que .=" from ".$xoopsDB->prefix("market_member")." a,".$xoopsDB->prefix("market_store")." b";
$que .=" where a.user_id='".$xoopsUser->getVar("uid")."' and a.store_id=b.store_id ";
$que .=" order by b.store_id";
$res = $xoopsDB->query($que);
if ( $xoopsDB->getRowsNum($res) > 1 ) {
while ( $row = $xoopsDB->fetchrow($res) ) { echo "多店管理人员"; } ## 一人管多店,提示选择具体门店登录
} elseif ( $xoopsDB->getRowsNum($res) == 1 ) {
$row = $xoopsDB->fetchrow($res); $s_id = $row[0]; $s_nm = $row[1]; $u_id = $row[2]; $u_nm = $row[3];
} elseif ( $xoopsDB->getRowsNum($res) == 0 ) {
$s_id = '696'; $s_nm = '未定义的机构或公共操作空间'; $u_id = $xoopsUser->getVar('uid'); $u_nm = $xoopsUser->getVar('name');
} else {
echo "数据选择错误,请联系管理员。";
}
define("_SSP", substr($row[4],23,1));
?>
<div style="position:absolute;color:#00ff00;background-color:#0f0f0e;height:638px;width:739px;font-size:14px;"><nobr>
<span style='position:absolute;left:8px;'>
<?php
echo "
<input type='button' value='↑' title='水单总在最上' name='BA01' onclick='javascript:to_up();blur();' />
<input type='button' value='↓√' title='水单依次向下' name='BA02' onclick='javascript:to_down();blur();' disabled />
</span>
";
echo "<form method='post' action='".$_SERVER['PHP_SELF']."?s_id0=".$_REQUEST['s_id0']."' name='seri_prc' >\n";
if ( !$ins00 && isset($ins00) ) {
echo "<span style='position:absolute;top:199px;left:346px;width:240px;height:80px;color:#f00;background-color:#000;border:1px solid #008000;'><br /> 数据添加出错!";
echo "<br /> 请速与管理员联系!<hr /><center><input type='button' value='退回上页' onclick='javascript:window.history.go(-1);' /> <input type='button' value='重新记帐!' onclick='javascript:window.location.reload();' /></center><br /></span>\n";
}
$d_s = $s_nm.":".$u_nm; ## 显示操作员信息
echo "<span style='position:absolute;top:38px;left:9px;'>";
echo "<input style='border:none;color:#0f0;background-color:#0f0f0f;font-size:16px;' name='md0' id='md0' type='text' ";
echo " size='".strlen($d_s)."' value='".$d_s."' readonly /><br />\n";
echo "<input type='hidden' id='s_id0' name='s_id0' value='".$s_id."' />"; ## 门店编号
echo "<input type='hidden' id='u_id0' name='u_id0' value='".$u_id."' />"; ## 用户系统编号
echo "<input type='hidden' id='q_zy0' name='q_zy0' value='".$q_zy."' />"; ## 记帐摘要/交易
echo "</span>";
?>
<center><span style='font-size:20px;'>商 品 收 货 入 库 窗 口<br />
===================================<br />
<input style='border:none;color:#0f0;background-color:#0f0f0f;' type='text' value='' name='curr_time0' id='curr_time0' size='19' readonly /></span></center>
<span style='position:absolute;top:89px;left:0px;font-size:16px;'>
<input style='font-size:16px;border:none;color:#0f0;background-color:#0f0f0f;' type='text' size='5' value='序号↓' name='spxh' id='spxh' />
商品条码
商品名称
数量
单价
金额
备注
</span><br /><br /><br />
<input type='hidden' size='1' value='1' id='spzl_ins_up' name='spzl_ins_up' />
<?php
$i=1;
echo "\n<input style='border:1px 2px 0px;color:#0f0;background-color:#0f0f0f;' type='text' value='№ $i' size='6' id='xh_$i' name='xh_1' readonly />\n";
echo " <input class='inst' type='text' value='6907305' id='sp_barcode0_$i' name='sp_barcode0_$i' size='13' maxlength='13' autocomplete='off' onkeyup='javascript:if ( this.value.length == 13 ) { chk_code($i,this.value); }' />\n";
echo " <input class='inst' type='text' value='' id='spmc0_$i' name='spmc0_$i' size='19' maxlength='37' readonly />\n";
echo " <input class='inst' type='hidden' value='' id='sp_code0_$i' name='sp_code0_$i' size='13' maxlength='5' autocomplete='off' />\n";
echo " <input class='inst' type='text' value='' id='spsl0_$i' name='spsl0_$i' onchange='javascript:sum_sj();' size='7' maxlength='7' />\n";
echo " <input class='inst' type='text' value='' id='spdj0_$i' name='spdj0_$i' size='8' readonly />\n";
echo " <input class='inst' type='text' value='' id='spsj0_$i' name='spsj0_$i' size='8' readonly />\n";
echo " <input class='inst' type='text' value='' id='sp_oth0_$i' name='sp_oth0_$i' size='19' maxlength='29' />\n";
echo "<br />\n";
?>
<input type='hidden' size='1' value='1' id='spzl_ins_down' name='spzl_ins_down' />
<hr width='738' align='left' />
<input type='button' value='取消' onclick='javascript:window.location.href="<?php echo $_SERVER['PHP_SELF'].'?s_id0='.$_REQUEST['s_id0']; ?>";' />
<input type='submit' value='确认录入' />
∑ <input style='border:none;color:#0f0;background-color:#0f0f0f;' type='text' value='0' size='3' name='sum_sl0' id='sum_sl0' readonly />个单品,共计<input class='depo' type='text' value='0' size='3' name='sum_je0' id='sum_je0' readonly />元
<input value='<?php echo _SKD; ?>' type='hidden' name='user_kdjf0' id='user_kdjf0' />
</form>
</nobr></div>
<script language='javascript'>
<!--
document.bgColor = '0f0f0f';
function rclick() {
if (event.button==2) {
alert('技术支持电话:15827003355');
}
}
document.onmousedown=rclick;
var s_obj=null;
var hs=1;
var ins_line='';
var add_obj='spzl_ins_down';
var loc_obj='beforeBegin';
function to_up() {
add_obj='spzl_ins_up';
loc_obj='afterEnd';
document.getElementById('BA01').value='↑√';
document.getElementById('BA02').value='↓';
document.getElementById('BA01').blur();
document.getElementById('spxh').value='序号 ↑';
document.getElementById('BA01').disabled=true;
document.getElementById('BA02').disabled=false;
}
function to_down() {
add_obj='spzl_ins_down';
loc_obj='beforeBegin';
document.getElementById('BA01').value='↑';
document.getElementById('BA02').value='↓√';
document.getElementById('BA02').blur();
document.getElementById('spxh').value='序号 ↓';
document.getElementById('BA01').disabled=false;
document.getElementById('BA02').disabled=true;
}
function add_line(fx,hhs) {
var obj=document.getElementById(add_obj);
hs0=hs-1;
if ( hs == hhs ) {
document.getElementById('sum_sl0').value=hs;
hs++;
ins_line = "<input style='border:none;color:#0f0;background-color:#0f0f0f;' type='text' size='6' id='xh_"+hs+"' name='xh_"+hs+"' value='№ "+hs+"' readonly /> ";
ins_line += " <input class='inst' type='text' value='6907305' id='sp_barcode0_"+hs+"' name='sp_barcode0_"+hs+"' size='13' maxlength='13' autocomplete='off' onkeyup='javascript:if ( this.value.length == 13 ) { chk_code("+hs+",this.value); }' />\n";
ins_line += " <input class='inst' type='text' value='' id='spmc0_"+hs+"' name='spmc0_"+hs+"' size='19' maxlength='37' readonly />\n";
ins_line += " <input class='inst' type='hidden' value='' id='sp_code0_"+hs+"' name='sp_code0_"+hs+"' size='13' maxlength='5' autocomplete='off' />\n";
ins_line += " <input class='inst' type='text' value='' id='spsl0_"+hs+"' name='spsl0_"+hs+"' onchange='javascript:sum_sj();' size='7' maxlength='7' />\n";
ins_line += " <input class='inst' type='text' value='' id='spdj0_"+hs+"' name='spdj0_"+hs+"' size='8' readonly />\n";
ins_line += " <input class='inst' type='text' value='' id='spsj0_"+hs+"' name='spsj0_"+hs+"' size='8' readonly />\n";
ins_line += " <input class='inst' type='text' value='' id='sp_oth0_"+hs+"' name='sp_oth0_"+hs+"' size='19' maxlength='29' />\n";
ins_line+="<br />\n";
obj.insertAdjacentHTML(loc_obj,ins_line);
}
}
var pload = 'acc_qtshrk';
var focus_id = 'spsl0_';
document.getElementById('sp_barcode0_'+hs).select();
document.getElementById('sp_barcode0_'+hs).focus();
//-->
</script>
<?php
include_once 'inc_prod_arr.php';
?>
<script type="text/javascript">
<!--
function sum_sj() {
var sum_je = 0;
for ( i=1; i<hs; i++ ) {
var je = Number(document.getElementById('spdj0_'+i).value) * Number(document.getElementById('spsl0_'+i).value);
document.getElementById('spsj0_'+i).value = je;
sum_je += je;
}
document.getElementById('sum_je0').value = sum_je;
document.getElementById('sp_barcode0_'+hs).select();
document.getElementById('sp_barcode0_'+hs).focus();
}
function chk_code(the_line,sp_barcode) {
cre_prod_arr(sp_barcode);
products_search(sp_barcode,the_line);
add_line('up',the_line);
document.getElementById('spsl0_'+the_line).select();
document.getElementById('spsl0_'+the_line).focus();
}
var clocktext;
function scroll() {
today = new Date();
yy = today.getYear(); mm = today.getMonth() + 1; dd = today.getDate();
hh = today.getHours(); mi = today.getMinutes(); ss = today.getSeconds();
if (mm <= 9) mm = "0" + mm; if (dd <= 9) dd = "0" + dd;
if (hh <= 9) hh = "0" + hh; if (mi <= 9) mi = "0" + mi; if (ss <= 9) ss = "0" + ss;
var clocktext = yy + "-" + mm + "-" + dd + " " + hh + ":" + mi + ":" + ss;
clocktimer = setTimeout("scroll()",1000);
document.getElementById("curr_time0").value = clocktext;
}
// if (document.all) scroll();
scroll();
// 左上角按钮处理
var jv_s_id0 = document.getElementById('s_id0').value;
var jv_curr_time0 = document.getElementById('curr_time0').value;
//-->
</script>
<?php
include_once '../../footer.php';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -