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

📄 acc_qxcrcz.php

📁 自己实现一个实用的商店应用系统
💻 PHP
字号:
<?php
////////////////////////////////////////////////////////
// Author by SHuWeiCh
// Date : 2007.11.13
// 建站支持: http://www.shuweich.net
// 作者: Shuweich
// QQ: 1502384
// ICQ: 190492112
// MSN: shuweich@hotmail.com
// E-mail: root@shuweich.net
// E-mail: shuweich@163.com
////////////////////////////////////////////////////////
// 模块管理 by txdyz
// For 前台出、入金操作
////////////////////////////////////////////////////////
include_once '../../mainfile.php';

include_once 'head_win.php';
include_once 'head_inc.php';
if ( $_REQUEST['cz'] == 'c' ) { $zy0='mdcj'; $czts = '出金'; }
elseif ( $_REQUEST['cz'] == 'r' ) { $zy0='mdrj'; $czts = '入金'; }
else { $zy0='other'; $czts='其它操作'; }
if ( isset($_REQUEST['smit0']) && $_REQUEST['smit0'] == '1' ) {
  		## 取本店最大流水 + 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 =  "insert into ".$xoopsDB->prefix("market_mdseri");
  $ins .= " (bh,store_id,sdbh,bdxh,date_q,date_h,spzkj,rz_user_id,shbz,zy,oth_read) values ";
  $ins .= " (0,'".$_REQUEST['s_id0']."',".$sdbh0.",1,'".$_REQUEST['curr_time0']."',now(),".$_REQUEST['rj0'].",".$xoopsUser->getVar('uid').",'0','".$zy0."','".$_REQUEST['oth_read0']."')";
  ## echo $ins."<hr />\n";
  $in0 = $xoopsDB->queryF($ins);
  if ( $in0 ) echo $czts."操作已完成!\n";
  echo "<hr /><center><input type='button' value='关闭窗口' onclick='returnValue=1;window.close();' /></center>\n";
} else {
?>
<script language='javascript'>
<!--
	function chk_rj() {
		if ( Number(document.getElementById('rj0').value) <= 0 ) return false;
		else return true;
	}
// -->
</script>
<form action='<?php echo $_SERVER['PHP_SELF']; ?>' name='frj' method='post' onSubmit='javascript:return chk_rj();'>
  <?php echo $czts; ?>时间:<input type='text' name='curr_time0' value='' size='19' readonly /><br /><br />
  <input type='hidden' name='smit0' value='1' />
  <input type='hidden' name='s_id0' value='<? echo $_REQUEST['s_id0']; ?>' />
  <input type='hidden' name='cz' value='<? echo $_REQUEST['cz']; ?>' />
  <?php

  $cz_je = 0;
  $cz_ly = '';
  $que =  "select spzkj from ";
  $que .= $xoopsDB->prefix("market_mdseri")." where store_id='".$_REQUEST['s_id0']."' and shbz!='2' and zy='mdrj'";
  $rj = $xoopsDB->getRowsNum( $xoopsDB->query($que) );
  if ( $_REQUEST['cz'] == 'r' && $rj == 0 ) {
    $que =  "select date_h rj from ";
    $que .= $xoopsDB->prefix("market_mdseri_history")." where store_id='".$_REQUEST['s_id0']."' and shbz!='2'";
    $que .= " group by date_h order by date_h desc limit 0,1";
    $dateh = $xoopsDB->fetchrow( $xoopsDB->query($que) );
    $que = "select sum(spzkj) xsje ";
    $que.= " from ".$xoopsDB->prefix("market_mdseri_history");
    $que.= " where store_id='".$_REQUEST['s_id0']."' and shbz!='2' and zy in (".$_TKjy.") and date_h='".$dateh[0]."'";
    $yy = $xoopsDB->fetchrow( $xoopsDB->query($que) );
    $que =  "select sum(spzkj) cj from ";
    $que .= $xoopsDB->prefix("market_mdseri_history")." where store_id='".$_REQUEST['s_id0']."' and shbz!='2' and zy='mdcj' and date_h='".$dateh[0]."'";
    $cj = $xoopsDB->fetchrow( $xoopsDB->query($que) );
    $que =  "select sum(spzkj) rj from ";
    $que .= $xoopsDB->prefix("market_mdseri_history")." where store_id='".$_REQUEST['s_id0']."' and shbz!='2' and zy='mdrj' and date_h='".$dateh[0]."'";
    $rj = $xoopsDB->fetchrow( $xoopsDB->query($que) );
    $yk = $rj[0] + $yy[0] - $cj[0];
    $cz_je = $yk;
    $cz_ly = '昨日余款';

  }

  echo $czts.":<input type='text' name='rj0' value='".$cz_je."' size='10' maxlength='10' />元人民币<br />";
  echo "交易留言:<input type='text' name='oth_read0' value='".$cz_ly."' /><hr />";
  ?>
  <script language='javascript'>
  <!--
    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;
    document.getElementById("curr_time0").value = clocktext;
  // -->
  </script>
  <input type='reset' name='s01' value='取消' onclick='javascript:window.close();' />
  <input type='submit' name='s02' value='确定' />
</form>
<?php
}

include_once '../../footer.php';
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -