ASP(Active Server Pages) ソースコード公開
WEB DE 在庫管理・売上分析・受注管理 はすべてのソースコードが公開されています。
ソースはカスタマイズしやすくコメントが随所に記されています。
|
<% Option Explicit %> <!-- #INCLUDE FILE="general.asp" --> <!-- #INCLUDE FILE="common.asp" --> <!-- #INCLUDE FILE="security.asp" --> <% Const APPNAME = "salesgraph.asp" '--- ASPファイル名 Const HOMEINDEX = "index.htm" '--- インデックスファイル名 Const BGINAREA = "#ffffcc" '--- グラフの内部背景色 Const BGOUTAREA = "#cccccc" '--- グラフの外枠背景色 Const BGDAYAREA = "#660000" '--- 日付部分背景色 Const FCDAYAREA = "#ffffff" '--- 日付部分文字色 Const BGLABEL = "#000066" '--- ラベルの背景色 Const blnGraphOrder = True '--- 売上順にソートするかどうかのフラグ |
汎用性を高めるために処理ごとにプロシージャにまとめられています。
|
Public Function MakeDateGraph(strFrom, strTo) '// 商品日付別グラフの作成準備 Dim strSQL, rsTemp Dim i, lngMaxValue Dim strMonth, strDay, strOldMonth strSQL = "SELECT SUM(sales.cost) As SumCost, " & _ "SUM(sales.total) As SumAmount, " & _ "sales.slipdate " & _ "FROM sales " & _ "WHERE sales.slipdate >= " & _ strDateQT & FormatDateEx(strFrom) & strDateQT & " " & _ "And sales.slipdate <= " & _ strDateQT & FormatDateEx(strTo) & strDateQT & " " & _ "And sales.saleflag > 0 " & _ "GROUP BY sales.slipdate" Set rsTemp = cnMain.Execute(strSQL) If rsTemp.EOF Then Call WriteMessage("出力するレコードが一件も存在しませんでした。", "戻る") MakeDateGraph = False Exit Function End If ......... End Function |
©2000 Inside Soft Design. All rights
reserved.