示例#1
0
<?php

require 'libs/Smarty.class.php';
require_once 'common.inc.php';
$smarty = new Smarty();
$id = $_REQUEST['id'];
$act = $_REQUEST['act'];
switch ($act) {
    case 'showkpzl':
        if ($id) {
            $row_kpzl = get_kpzl($id);
            //获取开票资料
            $smarty->assign("kpzl", $row_kpzl);
            $smarty->display('show_kpzl.tpl');
        } else {
            echo 'no,<a href="#">ADD</a>';
        }
        break;
    case 'showcp':
        if ($id) {
            $sql = "select * from  chanpin where CP_DINGDAN_ID =" . $id . "";
            $DB->db_query($sql);
            $n = 0;
            while ($row = $DB->db_fetch_array()) {
                $n++;
                $CHANPINS[] = array("ID" => $row["CP_ID"], "NAME" => $row["CP_NAME"], "GUIGE" => $row["CP_GUIGE"], "JIAGE" => $row["CP_JIAGE"], "NUM" => $row["CP_NUM"], "ZONGE" => $row['CP_JIAGE'] * $row['CP_NUM'], "BEIZHU" => $row["CP_BEIZHU"], "cixu" => $n);
                $num1 += $row['CP_NUM'];
                $heji += $row['CP_JIAGE'] * $row['CP_NUM'];
            }
            $smarty->assign("chanpin_list", $CHANPINS);
            $smarty->assign("shuliang", $num1);
示例#2
0
<?php

include "header.php";
require_once '../common.inc.php';
$id = $_REQUEST['kid'];
$rs2 = get_kpzl($id);
//获取开票资料
?>

<body bgcolor="#ffffff" >
<CENTER><b>修改开票信息</b>



<BR><BR>
<BR>
<form action="edit_kpzl2.php?id=<?php 
echo $id;
?>
" method="post" >
<table border=1>

 
  <tr> <td>订单号: </td><td> <?php 
echo $id;
?>
</td></tr>

  <tr> <td>名称: </td><td> <input type=text name="comname" size=50 value="<?php 
echo $rs2['KPZL_NAME'];
?>
<?php

/*
添加客户开票资料
*/
include "header.php";
require_once '../common.inc.php';
$id = $_REQUEST['id'];
//获取订单ID
$rs = get_kpzl($id);
//获取开票资料
$comname = trim($rs['comname']);
$shuihao = trim($rs['shuihao']);
$shuihao = preg_replace("/(\\s+)/", '', $shuihao);
$dizhi2 = trim($rs['dizhi']);
$dianhua = trim($rs['dianhua']);
$dizhi = $dizhi2 . " " . $dianhua;
$kaihuhang = trim($rs['yinhang']);
$zhanghao2 = trim($rs['zhanghao']);
$zhanghao2 = preg_replace("/(\\s+)/", '', $zhanghao2);
$zhanghao = $kaihuhang . " " . $zhanghao2;
$beizhu = trim($rs['beizhu']);
$DB->db_query("INSERT INTO kaipiaoziliao2 (name,shuihao,dizhi,zhanghao,beizhu) VALUES ('{$comname}','{$shuihao}','{$dizhi}','{$zhanghao}','{$beizhu}')");
echo '<BR><H1>OK!</H1><BR>';
?>