TDL003.php
2.56 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
<?php
//*****************************************************************************
//*
//* プログラム名:ToDo
//* プログラムID:TDL003.php
//* 機能 :ToDo 詳細
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include('./include/smarty.conf');
$strDBinc="include/dbcon.inc";
include($strDBinc);
$strSQL="";
$objRec="null";
//抽出!!
$strSQL = "select ";
$strSQL .= "seq, sakusei_cd, kikan_flg, start_date, end_date, kyoyu_menber, alarm_date, naiyo ";
$strSQL .= "from ";
$strSQL .= "todo_tbl ";
$strSQL .= "where seq = ".$seqNo;
$objRec = pg_exec($strSQL);
if($objRec == false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$objftc = pg_fetch_object($objRec, 0);
$strseq = $objftc->seq;
if($objftc->kikan_flg == 1){
$temp = $objftc->start_date;
$strKikanS = substr($temp,0,4)."年".substr($temp,4,2)."月".substr($temp,6,2)."日".substr($temp,8,2)."時";
$temp = $objftc->end_date;
$strKikanE = substr($temp,0,4)."年".substr($temp,4,2)."月".substr($temp,6,2)."日".substr($temp,8,2)."時";
}else{
$strKikanS = "----年--月--日--時";
$strKikanE = "----年--月--日--時";
}
$strnaiyo = str_replace("\r\n","<br>",$objftc->naiyo);
//共有者
$strkyoyu = "";
$temp = trim($objftc->kyoyu_menber);
if($temp != "/"){
//作成者が含まれていない場合、たす!!
if(strpos($temp, "/".($objftc->sakusei_cd)."/") === false){
$temp = "/".($objftc->sakusei_cd).$temp;
}
$strwhere = str_replace("//", "", $temp);
$strwhere = substr($strwhere, 1, (strlen($strwhere) - 1));
$strwhere = str_replace("/", "' or syain_cd = '", $strwhere);
$strSQL2 = "select name_kj_sei, name_kj_mei from syain_tbl where syain_cd = '".$strwhere."' Order by disp_rank";
$objRec2 = pg_exec($strSQL2);
if($objRec2 == false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
for($i=0;$i<pg_numrows($objRec2);$i++){
$objftc2 = pg_fetch_object($objRec2, $i);
$strkyoyu .= ($objftc2->name_kj_sei).($objftc2->name_kj_mei)."<br>";
}
}
if(trim($objftc->alarm_date) != ""){
$temp = $objftc->alarm_date;
$stralarm = substr($temp,0,4)."年".substr($temp,4,2)."月".substr($temp,6,2)."日".substr($temp,8,2)."時";
}else{
$stralarm = "----年--月--日--時";
}
$o_smarty->assign('strseq',$strseq);
$o_smarty->assign('strKikanS',$strKikanS);
$o_smarty->assign('strKikanE',$strKikanE);
$o_smarty->assign('strnaiyo',$strnaiyo);
$o_smarty->assign('strkyoyu',$strkyoyu);
$o_smarty->assign('stralarm',$stralarm);
$o_smarty->display('TDL003.tpl');
?>