MDT010.php
2.07 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
<?php
//*****************************************************************************
//*
//* プログラム名:資料集
//* プログラムID:MDT010.php
//* 機能 :フォルダツリー(共有)
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include("include/STRING.inc");
include('./include/smarty.conf');
$strDBinc="include/dbcon.inc";
include($strDBinc);
//自分の所属を取得
$strSQL_s = "SELECT syozoku_cd FROM syozoku_tbl WHERE syain_cd ='$PHP_SYAIN_CD' ";
$objRec_s = pg_exec($strSQL_s);
if($objRec_s==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
for ($intSyozoku=0; $intSyozoku < pg_numrows($objRec_s); $intSyozoku++){
$objSyozoku = pg_fetch_object($objRec_s, $intSyozoku);
if ($intSyozoku==0){
$strJoken= " and (folder_bumon =0 or folder_bumon = " .$objSyozoku->syozoku_cd ;
}else{
$strJoken=$strJoken. " or folder_bumon=".$objSyozoku->syozoku_cd ;
}
}
if (pg_numrows($objRec_s) > 0){
$strJoken=$strJoken. ") ";
}else{
$strJoken= " and (folder_bumon =0)";
}
//共有フォルダ情報取得
//$Share_Folder[0]="共有フォルダ";
//$Share_Seq[0]=0;
tree($Share_Folder,$Share_Seq,1,$strJoken,0);
function tree (&$Share_Folder,&$Share_Seq,$intKai,$strJoken,$oya_seq) {
$strSQL="SELECT * FROM mst_folder Where del_flg=0 AND oya_seq=".$oya_seq." AND folder_kind='' ".$strJoken." Order by folder_name";
$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);
$inti=count($Share_Folder);
$Share_Folder[$inti]=substr(" ", 0,$intKai*2)."".$objData->folder_name;
$Share_Seq[$inti]=$objData->seq;
tree($Share_Folder,$Share_Seq,$intKai+1,$strJoken,$objData->seq);
}
}
$o_smarty->assign('Share_Folder',$Share_Folder);
$o_smarty->assign('Share_Seq',$Share_Seq);
$o_smarty->display('MDT010.tpl');
?>