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

📄 acc_spsjbg.php

📁 自己实现一个实用的商店应用系统
💻 PHP
字号:
<?php
////////////////////////////////////////////////////////
// Author by Shuweich
// Date : 2008.02.21
// 建站支持: 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';
$title='&nbsp;&nbsp;&nbsp;===========商品售价变更===========&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
include_once 'head_inc.php';

include_once 'head_win.php';
$TAB0 = $xoopsDB->prefix("market_spinfo");
$TAB1 = $xoopsDB->prefix("market_mdspfl");
?>
<script language='javascript'>
<!--
  function bj_fl(s_id0,sp_fl) {
    // alert(s_id0);	// alert(sp_fl);
    document.getElementById('getfl').value='1';
    document.getElementById('s_id0').value=s_id0;
    document.getElementById('sp_fl').value=sp_fl;
    document.getElementById('putfl').action='<?php echo $_SERVER['PHP_SELF']; ?>';
    document.getElementById('putfl').submit();
  }
  function putbj(s_id0,sp_fl) {
    document.getElementById('sp_fl2').value=sp_fl;
    document.getElementById('modi_sj').action='<?php echo $_SERVER['PHP_SELF']; ?>';
    document.getElementById('modi_sj').submit();
  }
//-->
</script>
<center>
<?php

if ( isset($_REQUEST['getfl']) && $_REQUEST['getfl'] == '1' ) {
    $spfl = $_REQUEST['sp_fl'];
  if ( isset($_REQUEST['sj_bg']) && $_REQUEST['sj_bg'] == '1' ) {
    $spfl = $_REQUEST['sp_fl2'];

    ## Update sp_sj
    ## echo "<pre>"; print_r($_POST['sp_']); echo "</pre>\n";
    while ( list($sp_id, $sp_sj) = each($_POST['sp_']) ) {
      ## echo "$sp_id :-: $sp_sj <br />\n";
      $upd  =  "update ".$TAB0." set sp_sj=".$sp_sj." where sp_id=".$sp_id;
      ## echo $upd.'<hr />';
      $up0 = $xoopsDB->queryF($upd);
    }
  }

  $que = "select sp_flm from ".$TAB1." where sp_fl='".$spfl."' and store_id='".$_REQUEST['s_id0']."'";
  $row = $xoopsDB->fetchrow( $xoopsDB->query($que) );
  echo "<font style='font-size:20px;width:238px;height:40px;background-color:#594;color:#c97;border:3px solid #008000;padding:14px;'><b>".$row[0]."</b></font>";
  ## for ( $i=0; $i<20; $i++ ) echo "=";
  echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="modi_sj">
<input type="hidden" name="sj_bg" id="sj_bg" value="1" />
<input type="hidden" name="s_id0" id="s_id0" value="'.$_REQUEST['s_id0'].'" />
<input type="hidden" name="sp_fl2" id="sp_fl2" value="'.$spfl.'" />
<input type="hidden" name="getfl" id="getfl" value="1" />
<table border="0">
<tr><th>条形码</th><th>品名</th><th>售价</th></tr>
';
  $que = "select sp_barcode,sp_name,sp_sj,sp_id from ".$TAB0;
  $que .=" where store_id='".$_POST['s_id0']."' and sp_fl='".$spfl."'";
  // echo $que;
  $rsp = $xoopsDB->query($que);
  while ( $spw = $xoopsDB->fetchrow($rsp) ) {
    echo "<tr><td>".$spw[0]."</td>";
    echo "<td>".$spw[1]."</td>";
    echo "<td><input type='text' name='sp_[".$spw[3]."]' id='sp_[".$spw[3]."]' class='spsj' size='9' value='".$spw[2]."' /></td></tr>\n";
  }
  echo "</table><hr style='height:3px;color:988;width:338px;' />\n";
  echo "<input type='reset' name='s01' value='恢复' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  echo "<input type='button' name='s02' value='确认变价' onclick='javascript:putbj(\"".$_REQUEST['s_id0']."\",\"".$spfl."\");' />\n";
  echo "</form>\n";
}
echo "<form method='post' action='".$_SERVER['PHP_SELF']."' name='putfl' id='putfl'>\n";
echo "<input type='hidden' name='s_id0' id='s_id0' value='".$_REQUEST['s_id0']."' />\n";
echo "<input type='hidden' name='getfl' id='getfl' value='1' />\n";
echo "<input type='hidden' name='sp_fl' id='sp_fl' value='".$_REQUEST['sp_fl']."' />\n";
echo "<br /><br />请选择商品分类<hr style='width:138px;height:2px;color:#04f;' />";
$que = "select sp_fl,sp_flm from ".$TAB1." where store_id='".$_REQUEST['s_id0']."'";
$res = $xoopsDB->query($que);
while ( $row = $xoopsDB->fetchrow($res) ) {
  echo "<input type='button' id='B01' value='".$row[1]."' style='width:139px;'";
  echo " onclick='javascript:bj_fl(\"".$_REQUEST['s_id0']."\",\"".$row[0]."\");' />\n";
}
echo "</form>\n";
?>

<?php

echo "<hr /><input type='button' value='关闭窗口' onclick='returnValue=1;window.close();' />\n";
echo "<center>\n";

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

⌨️ 快捷键说明

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