guozhang.php
资源名称:minierp.rar [点击查看]
上传用户:yantgcom
上传日期:2013-07-19
资源大小:478k
文件大小:1k
源码类别:
MySQL数据库
开发平台:
PHP
- <?php
- $t_AUTOID=$_GET[AUTOID];
- if (empty($t_AUTOID)){$t_AUTOID=0;};
- include ("../inc/db.php");
- include ("../inc/phpmkrfn.php");
- include ("../kuchen/kuchen.php");
- include ("../yinfu/yinfu.php");
- include ("../casebank/case.php");
- $conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT);
- $sSql = "select * from jhdmast where autoid =$t_AUTOID";
- $rs = phpmkr_query($sSql,$conn) or die("Failed to execute query: " . phpmkr_error() . '<br>SQL: ' . $sSql);
- $row = mysql_fetch_array($rs, MYSQL_ASSOC);
- $ys_ac=$row[JHM02]; //客户编号
- $ys_id=$row[JHMID]; //送货单号
- $ys_lx=$row[JHM10]; //结款类型
- $ys_ty="JHD"; //送货单
- if (phpmkr_num_rows($rs) > 0){
- $uSql = "update jhdmast set ";
- $uSql .= "JHM11 = '1' ";
- $uSql .= " where autoid =$t_AUTOID";
- }
- $drs = phpmkr_query($uSql,$conn) or die("Failed to execute query: " . phpmkr_error() . '<br>SQL: ' . $uSql);
- $sSql = "select sum(JHD05) as jtotal from jhddelt where JHDID ='$ys_id'";
- $rs = phpmkr_query($sSql,$conn) or die("Failed to execute query: " . phpmkr_error() . '<br>SQL: ' . $sSql);
- $row = mysql_fetch_array($rs, MYSQL_ASSOC);
- $ys_num=$row[jtotal]; //金额合计
- //echo $ys_lx;
- if ($ys_lx=="02"){ // 月结
- //新增应付帐款
- yinfu_new($ys_ac,$ys_id,$ys_ty,$ys_num);
- }
- if ($ys_lx=="01"){ // 现金
- //新增现金日记帐
- $ys_fx = 1; //支出
- case_new($ys_ac,$ys_id,$ys_ty,$ys_num,$ys_fx);
- }
- header("location:list.php");
- ?>