⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 acc_lrpdsj.php

📁 自己实现一个实用的商店应用系统
💻 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='mdpf';
if ( $_REQUEST['spzl_ins_up'] == '1' ) {
	 /*
	echo "这里是调试窗口之数据资料窗:<hr /><br />\n";
  echo "<pre>";
  print_r($_REQUEST);
  echo "</pre>";
  echo "<hr /><br />\n";
	 */
	## ********************* DEBUG ***********************
  $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'];
  $ins_for = $_REQUEST['sum_sl0'] + 0;
  $ins =  "insert into ".$xoopsDB->prefix("market_pdsj");
  $ins .= " (pd_id,store_id,pd_date,pd_xh,sp_code,pd_cl,pd_shbz,pd_user_id) values ";
  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 .= "'".$_REQUEST['curr_time0']."',";
    $ins .= $i.",";
    $ins .= "'".$_REQUEST['sp_code0_'.$i]."',";
    $ins .= "'".$_REQUEST['spsl0_'.$i]."',";
    $ins .= "'0',";
    $ins .= "'".$_REQUEST['u_id0']."'";
    $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:618px;width:458px;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 />&nbsp;数据添加出错!";
  echo "<br />&nbsp;请速与管理员联系!<hr /><center><input type='button' value='退回上页' onclick='javascript:window.history.go(-1);' />&nbsp;&nbsp;<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' />
商品条码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
商品名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
盘存数量
</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 " &nbsp;<input class='inst' type='text' value='' id='spmc0_$i' name='spmc0_$i' size='19' maxlength='37' readonly />\n";
      echo " &nbsp;<input class='inst' type='text' value='' id='spsl0_$i' name='spsl0_$i' size='11' maxlength='11' autocomplete='off' onchange='javascript:sum_sj($i);' />\n";
      echo " <input class='inst' type='hidden' value='' id='sp_code0_$i' name='sp_code0_$i' size='13' />\n";
      echo "<br />\n";

      ?>
    <input type='hidden' size='1' value='1' id='spzl_ins_down' name='spzl_ins_down' />
    <hr style='width:458px;height:3px;' align='left' />
    &nbsp;&nbsp;&nbsp;
    <input type='button' value='取消' onclick='javascript:window.location.href="<?php echo $_SERVER['PHP_SELF'].'?s_id0='.$_REQUEST['s_id0']; ?>";' />&nbsp;&nbsp;
    <input type='submit' value='确认录入' />&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;∑&nbsp;<input style='border:none;color:#0f0;background-color:#0f0f0f;' type='text' value='0' size='3' name='sum_sl0' id='sum_sl0' />条单品盘点记录
    <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 += " &nbsp;<input class='inst' type='text' value='' id='spmc0_"+hs+"' name='spmc0_"+hs+"' size='19' maxlength='37' readonly />\n";
      ins_line += " &nbsp;<input class='inst' type='text' value='' id='spsl0_"+hs+"' name='spsl0_"+hs+"' size='11' maxlength='11' autocomplete='off' onchange='javascript:sum_sj("+hs+");' />\n";
      ins_line += " <input class='inst' type='hidden' value='' id='sp_code0_"+hs+"' name='sp_code0_"+hs+"' size='13' />\n";
      ins_line+="<br />\n";

      obj.insertAdjacentHTML(loc_obj,ins_line);
    }
  }

  var pload = 'acc_lrpdsj';
  var _dj = false;
//-->
</script>

<?php
include_once 'inc_prod_arr.php';
?>

<script type="text/javascript">
<!--

  function sum_sj() {
    // var sl9 =  Number(document.getElementById('spsl0_'+the_hs).value);
    document.getElementById('sp_barcode0_'+hs).select();
    document.getElementById('sp_barcode0_'+hs).focus();
  }

  function chk_code(the_line,sp_barcode) {
    cre_prod_arr(sp_barcode);
    var mhs = products_search(sp_barcode,the_line);
    add_line('down',the_line);
    if ( mhs ) {
      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 + -