ZIS9100.php
3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?PHP
//*****************************************************************************
//* プログラム名:実績メニュー
//* プログラムID:ZIS9100.php
//* 機能 :勘定科目設定
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("./inc/session_start.inc");
include("./inc/SessionChk.inc");
include("./inc/dbcon.inc");
include('./inc/smarty.conf');
include("./inc/const.inc");
include("./inc/pagetitle.inc");
include("./inc/pagefooter.inc");
TreeMake($Kamoku_List,$Kamoku_Id,$Kamoku_Cnt,$Kamoku_Step,1,$strJoken,0);
function TreeMake(&$Kamoku_List,&$Kamoku_Id,&$Kamoku_Cnt,&$Kamoku_Step,$intKai,$strJoken,$oya_id) {
$strSQL = "SELECT ";
$strSQL .= " kamoku_id,";
$strSQL .= " oya_id,";
$strSQL .= " kamoku_name ,";
$strSQL .= " (";
$strSQL .= " SELECT ";
$strSQL .= " COUNT(*)";
$strSQL .= " FROM";
$strSQL .= " z_mst_kamoku ";
$strSQL .= " WHERE";
$strSQL .= " oya_id=M1.kamoku_id";
$strSQL .= " )";
$strSQL .= " AS child_cnt ";
$strSQL .= "FROM";
$strSQL .= " z_mst_kamoku as M1 ";
$strSQL .= "WHERE ";
$strSQL .= " oya_id=".$oya_id." ";
$strSQL .= "ORDER BY ";
$strSQL .= " kamoku_name";
//echo $strSQL;
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
for ($intBumon = 0; $intBumon < pg_numrows($objRec); $intBumon++) {
$objData = pg_fetch_object($objRec, $intBumon);
$intIdx = count($Kamoku_List);
$Kamoku_Step[$intIdx] = $intKai;
$Kamoku_List[$intIdx] = substr(" ", 0,$intKai*2)."".$objData->kamoku_name;
//$Kamoku_List[$intIdx] = $objData->kamoku_name;
$Kamoku_Id[$intIdx] = $objData->kamoku_id;
//echo "<hr>".$objData->child_cnt;
if ($objData->child_cnt==0){
//echo "あ";
$Kamoku_Cnt[$intIdx] = "";
}else{
//echo "い";
$Kamoku_Cnt[$intIdx] = "(".$objData->child_cnt.")";
}
TreeMake($Kamoku_List,$Kamoku_Id,$Kamoku_Cnt,$Kamoku_Step,$intKai+1,$strJoken,$objData->kamoku_id);
}
}
$o_smarty->assign('Kamoku_List' , $Kamoku_List);
$o_smarty->assign('Kamoku_Id' , $Kamoku_Id);
$o_smarty->assign('Kamoku_Cnt' , $Kamoku_Cnt);
$o_smarty->assign('Kamoku_Step' , $Kamoku_Step);
//HTMLヘッダの書き出し
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; cahrset=euc-jp">
<meta http-equiv="content-style-type" content="text/css">
<meta name="robots" content="noindex, nofollow">
<script type="text/javascript" src="./js/xmlhttp.js"></script>
<script type="text/javascript" src="./js/ZIS9100.js"></script>
<script type="text/javascript" src="./js/input_chk.js"></script>
<title><?PHP echo($PHP_SYSNAME); ?></title>
<link rel="stylesheet" href="./templates/SIMmain.css" type="text/css" />
</head>
<?PHP
//タイトル部分の表示
dspTitle($PHP_SYSNAME, $PHP_GROUP_NAME, $PHP_BUMON_NAME, $PHP_USER_NAME, "http://www.f-mtclab.net/article/149573054.html#help0");
//メインHTML部分の表示
//[0]システムURL、[1]HP URL、[2]マニュアルURL、[3]MTC HP URL、[4]マスタメールアドレス、
//[5]期間区分名、[6]大区分名、[7]小区分名、[8]支出名、[9]収入名、[10]消費税率(文字型)
$o_smarty->assign('DEFARR',$DEFARR);
$o_smarty->assign('PHP_SYSNAME',$PHP_SYSNAME);
$o_smarty->assign('PHP_GROUP_NAME',$PHP_GROUP_NAME);
$o_smarty->assign('PHP_BUMON_NAME',$PHP_BUMON_NAME);
$o_smarty->assign('PHP_USER_NAME',$PHP_USER_NAME);
$o_smarty->assign('PHP_USER_ADMIN',$PHP_USER_ADMIN);
$o_smarty->assign('PHP_USER_NYUKIN',$PHP_USER_NYUKIN);
$o_smarty->assign('PHP_USER_SHIKIN',$PHP_USER_SHIKIN);
$o_smarty->assign('PHP_USER_SEQ',$PHP_USER_SEQ);
$o_smarty->assign('User_Sikaku' , $User_Sikaku); //入力資格
$o_smarty->display('ZIS9100.tpl');
//フッタ部分の表示
dspFooter($DEFARR[1], $DEFARR[3],"http://www.f-mtclab.net/article/149573054.html#help0");
?>