?> <input type="submit" value="开始检索"> </td> </tr></form> </table> </td> </tr> <form method="post" name="sel"> <tr> <td bgcolor="#FFFFFF"> <?php $asql = new dedesql(false); $aquery = "select sum(amoney) as imoney from #@__accounts where atype='收入'"; $aquery1 = "select sum(amoney) as omoney from #@__accounts where atype='支出'"; $asql->setquery($aquery); $asql->execute(); $rs = $asql->getone(); $imoney = $rs['imoney']; $asql->setquery($aquery1); $asql->execute(); $rs = $asql->getone(); $omoney = $rs['omoney']; $asql->close(); if ($imoney < $omoney) { $moneystring = "亏损:¥" . ($omoney - $imoney) . "元,总收入:¥" . $imoney . ",总支出:¥" . $omoney; } elseif ($imoney - $omoney == 0) { $moneystring = "收支平衡,总收入:¥" . $imoney . ",总支出:¥" . $omoney; } else { $moneystring = "盈利:¥" . ($imoney - $omoney) . "元,总收入:¥" . $imoney . ",总支出:¥" . $omoney; }
// if ($maxpage > 0) { $maxpage = ceil($datacount / $pagesize); } else { $maxpage = $datacount / $pagesize; //获取总页数 } } else { $maxpage = 0; } if ($pageno > $maxpage && $maxpage != 0) { echo "<script>alert('好像没有这么多页数据!');history.go(-1);</script>"; exit; } $query = "select #@__archives.id,#@__archives.pubdate,#@__archives.title,#@__archives.senddate,#@__archives.ismake,#@__archives.arcrank,#@__archives.money,#@__arctype.namerule,#@__arctype.typedir,#@__archives.typeid from #@__archives,#@__arctype where pubdate>{$starttime} and pubdate <{$endtime} {$where} AND #@__archives.arcrank=0 and #@__arctype.id = #@__archives.typeid LIMIT {$startrow},{$pagesize}"; $db->setquery($query); $db->execute(); $list = array(); while ($row = $db->getarray()) { $row['time'] = date('20y-m-d H:i', $row['pubdate']); $row['pubdate'] = date('20ymd', $row['pubdate']); $list[] = $row; } require_once dirname(__FILE__) . "/../update/date.htm"; function GetArcUrl($aid, $typeid, $timetag, $title, $ismake = 0, $rank = 0, $namerule = "", $artdir = "", $money = 0) { return GetFileUrl($aid, $typeid, $timetag, $title, $ismake, $rank, $namerule, $artdir, $money); } function rili($date, $file = '/update/index.php', $nomax = false) { $curtime = time();
$wrs = $wsql->GetOne(); $wsql->ExecuteNoneQuery("insert into #@__saleback(productid,number,rdh,dtime,r_text) values('" . $pid . "','" . $num . "','" . $did . "','" . GetDateTimeMk(time()) . "','" . $r_text . "')"); $wsql->close(); } $csql->SetQuery("select * from #@__saleback where rdh='{$did}'"); } $csql->Execute(); $rowcount = $csql->GetTotalRow(); if ($rowcount == 0) { echo "<tr><td> </td></tr>"; } else { echo "<tr class='row_color_head'><td>货号</td><td>名称</td><td>规格</td><td>分类</td><td>单位</td><td>售价</td><td>退回原因<td>退回数量</td><td>删除</tr>"; while ($row = $csql->GetArray()) { $nsql = new dedesql(false); $query1 = "select * from #@__basic where cp_number='" . $row['productid'] . "'"; $nsql->setquery($query1); $nsql->execute(); $row1 = $nsql->getone(); $amoney += $row1['cp_sale'] * $row['number']; $anum += $row['number']; echo "<tr onMouseMove=\"javascript:this.bgColor='#EBF1F6';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\"><td>" . $row['productid'] . "</td><td> " . $row1['cp_name'] . "</td><td>" . $row1['cp_gg'] . "</td><td>" . get_name($row1['cp_categories'], 'categories') . ">" . get_name($row1['cp_categories_down'], 'categories') . "</td><td>" . get_name($row1['cp_dwname'], 'dw') . "</td><td>¥" . $row1['cp_sale'] . "</td><td>" . $row['r_text'] . "</td><td>" . $row['number'] . "</td><td><a href='current_order_back.php?action=del&id=" . $row['id'] . "&rid=" . $row['rdh'] . "'>删除</a></td></tr>"; $nsql->close(); } } echo "<tr><td> 共计:</td><td></td><td></td><td></td><td> 金额:</td><td>¥" . $amoney . "</td><td align='right'>数量:</td><td>" . $anum . "</td></tr></table>"; $csql->close(); ?> </td> </tr></form> </table> </body>
</tr> <tr> <td bgcolor="#FFFFFF"><form action="add_money.php?action=save" method="post"> <table width="100%" cellspacing="0" cellpadding="0" border="0" id="table_border"> <tr> <td id="row_style"> 科目:</td> <td> <select name="atype"><option value="收入">收入</option><option value="支出">支出</option></select> </td> </tr> <tr> <td id="row_style"> 银行:</td> <td> <?php $bank = new dedesql(false); $bank->setquery("select * from #@__bank"); $bank->execute(); $r = $bank->gettotalrow(); if ($r == 0) { echo "没有银行供选择,请先<a href='bank.php?action=new'>添加</a>"; } else { echo "<select name='abank'>"; while ($row = $bank->getArray()) { if ($row['bank_default'] == 1) { echo "<option selected value='" . $row['id'] . "'>" . $row['bank_name'] . "</option>"; } else { echo "<option value='" . $row['id'] . "'>" . $row['bank_name'] . "</option>"; } } echo "</select>"; }