MET031.php
6.44 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
//*****************************************************************************
//*
//* プログラム名:電子会議室
//* プログラムID:MET031.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');
//include("inc/header.inc");
$strDBinc="include/dbcon.inc";
include($strDBinc);
$strSQL="";
$objRec="null";
//URL関数
function link_url($str){
$regex = "((https?://|ftp://)([0-9A-Za-z:_?./~%;()=+#-]|&)+)";
$str = eregi_replace($regex, "<a href=\"\\1\" target=\"_blank\">\\1</a>", $str);
$regex_mail = "((mailto:)?([0-9A-Za-z._-]+@[0-9A-Za-z.-]+))";
$str = eregi_replace($regex_mail, "<a href=\"mailto:\\3\">\\1</a>", $str);
return $str;
}
//議長? 発言OK? 終了?
$strSQL = "select chairperson, date_end, list_spk from kaigi_info_tbl where meeting_no = ".$mtgNo;
$recKaigi=pg_exec($strSQL);
if($recKaigi==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$ftcKaigi = pg_fetch_object($recKaigi, 0);
if(($ftcKaigi->chairperson) == $PHP_SYAIN_CD){
$flgCP = 1;
}else{
$flgCP = 0;
}
$CPCODE = $ftcKaigi->chairperson;
if(strpos($ftcKaigi->list_spk,"/".$PHP_SYAIN_CD."/") === false){
$flgSPK=0;
}else{
$flgSPK=1;
}
$flgEnd = 0;
if(($ftcKaigi->date_end) <= date("YmdH")){
$flgEnd = 1;
}
//$strSQL = "select meeting_no, remark_no, answer_no, cp_answer_no, speak, person ,date, syain_tbl.name_kj_sei, syain_tbl.name_kj_mei ";
//$strSQL .= "from kaigi_tbl join syain_tbl on syain_tbl.syain_cd = kaigi_tbl.person where cp_answer_no = 0 and meeting_no = ".$mtgNo." and remark_no = ".$remNo." ";
//$strSQL .= "order by remark_no desc, answer_no desc, cp_answer_no desc";
$strSQL = "select kaigi_tbl.meeting_no, kaigi_tbl.remark_no, kaigi_tbl.answer_no, kaigi_tbl.cp_answer_no, speak, person ,date, syain_tbl.name_kj_sei, syain_tbl.name_kj_mei, pkaigi_tbl.read_flg, stop_flg ";
$strSQL .= "from kaigi_tbl ";
$strSQL .= "join pkaigi_tbl on pkaigi_tbl.syain_cd = '".$PHP_SYAIN_CD."' and kaigi_tbl.meeting_no = pkaigi_tbl.meeting_no and kaigi_tbl.remark_no = pkaigi_tbl.remark_no and kaigi_tbl.answer_no = pkaigi_tbl.answer_no and kaigi_tbl.cp_answer_no = pkaigi_tbl.cp_answer_no ";
$strSQL .= "join syain_tbl on syain_tbl.syain_cd = kaigi_tbl.person ";
$strSQL .= "where kaigi_tbl.cp_answer_no = 0 and kaigi_tbl.meeting_no = ".$mtgNo." and kaigi_tbl.remark_no = ".$remNo." ";
$strSQL .= "order by kaigi_tbl.remark_no desc, kaigi_tbl.answer_no desc, kaigi_tbl.cp_answer_no desc";
$recKaigi=pg_exec($strSQL);
if($recKaigi==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$ftcKaigi = pg_fetch_object($recKaigi, pg_numrows($recKaigi)-1);
//発言停止?
$flgSTOP = (int) $ftcKaigi->stop_flg;
$max = pg_numrows($recKaigi)-1;
for($i=0;$i<$max;$i++){
$ftcKaigi = pg_fetch_object($recKaigi, $i);
if($CPCODE == trim($ftcKaigi->person)){
$FLG_CP_SPK[$i] = 1;
}else{
$FLG_CP_SPK[$i] = 0;
}
$strSpeak[$i] = link_url(str_replace ("\r\n","<br>",htmlspecialchars($ftcKaigi->speak)));
$strPerson[$i] = ($ftcKaigi->name_kj_sei).($ftcKaigi->name_kj_mei);
$strTemp = $ftcKaigi->date;
$strTemp = ((int) substr($strTemp,4,2))."/".((int) substr($strTemp,6,2))." ".substr($strTemp,8,2).":".substr($strTemp,10,2)."";
if ($FLG_CP_SPK[$i] == 1){
$strPerson[$i] = "( 議長:".$strPerson[$i]." ".$strTemp." )";
}else{
$strPerson[$i] = "( ".$strPerson[$i]." ".$strTemp." )";
}
$flgRaed[$i] = $ftcKaigi->read_flg;
$ansNo[$i] = $ftcKaigi->answer_no;
// $strMeetNo[$i] = $ftcKaigi->meeting_no;
$Count[$i] = $i;
if(($ftcKaigi->person) == $PHP_SYAIN_CD){
$flgModi[$i]=1;
}
// $strSQL = "select cp_answer_no, speak, person ,date, syain_tbl.name_kj_sei, syain_tbl.name_kj_mei ";
// $strSQL .= "from kaigi_tbl join syain_tbl on syain_tbl.syain_cd = kaigi_tbl.person where cp_answer_no > 0 and meeting_no = ".$mtgNo." and remark_no = ".$remNo." and answer_no = ".($ftcKaigi->answer_no)." ";
// $strSQL .= "order by cp_answer_no desc";
$strSQL = "select kaigi_tbl.cp_answer_no, speak, person, date, syain_tbl.name_kj_sei, syain_tbl.name_kj_mei, pkaigi_tbl.read_flg, stop_flg ";
$strSQL .= "from kaigi_tbl ";
$strSQL .= "join pkaigi_tbl on pkaigi_tbl.syain_cd = '".$PHP_SYAIN_CD."' and kaigi_tbl.meeting_no = pkaigi_tbl.meeting_no and kaigi_tbl.remark_no = pkaigi_tbl.remark_no and kaigi_tbl.answer_no = pkaigi_tbl.answer_no and kaigi_tbl.cp_answer_no = pkaigi_tbl.cp_answer_no ";
$strSQL .= "join syain_tbl on syain_tbl.syain_cd = kaigi_tbl.person ";
$strSQL .= "where kaigi_tbl.cp_answer_no > 0 and kaigi_tbl.meeting_no = ".$mtgNo." and kaigi_tbl.remark_no = ".$remNo." and kaigi_tbl.answer_no = ".($ftcKaigi->answer_no)." ";
$strSQL .= "order by cp_answer_no desc";
$recCP=pg_exec($strSQL);
if($recCP==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if(pg_numrows($recCP) > 0){
for($j=0;$j<pg_numrows($recCP);$j++){
$ftcCP = pg_fetch_object($recCP, $j);
$strSpeakCP[$i][$j] = link_url(str_replace ("\r\n","<br>",htmlspecialchars($ftcCP->speak)));
$strPersonCP[$i][$j] = ($ftcCP->name_kj_sei).($ftcCP->name_kj_mei);
$strTemp = $ftcCP->date;
$strTemp = ((int) substr($strTemp,4,2))."/".((int) substr($strTemp,6,2))." ".substr($strTemp,8,2).":".substr($strTemp,10,2)."";
$strPersonCP[$i][$j] = "( 議長:".$strPersonCP[$i][$j]." ".$strTemp." )";
$flgRaedCP[$i][$j] = $ftcCP->read_flg;
$cpansNo[$i][$j] = $ftcCP->cp_answer_no;
//$Count[$i] = $i;
if(($ftcCP->person) == $PHP_SYAIN_CD){
$flgModiCP[$i][$j]=1;
}
}
}
}
/*
$o_smarty->assign('strTheme',$strTheme);
$o_smarty->assign('ctgno',$ctgno);
*/
$o_smarty->assign('max',$max);
$o_smarty->assign('Count',$Count);
$o_smarty->assign('strSpeak',$strSpeak);
$o_smarty->assign('strSpeakCP',$strSpeakCP);
//$o_smarty->assign('remNo',$remNo-1);
$o_smarty->assign('mtgNo',$mtgNo);
$o_smarty->assign('remNo',$remNo);
$o_smarty->assign('strPerson',$strPerson);
$o_smarty->assign('strPersonCP',$strPersonCP);
$o_smarty->assign('flgCP',$flgCP);
$o_smarty->assign('flgSPK',$flgSPK);
$o_smarty->assign('ansNo',$ansNo);
$o_smarty->assign('cpansNo',$cpansNo);
$o_smarty->assign('flgEnd',$flgEnd);
$o_smarty->assign('flgRaed',$flgRaed);
$o_smarty->assign('flgRaedCP',$flgRaedCP);
$o_smarty->assign('flgModi',$flgModi);
$o_smarty->assign('flgModiCP',$flgModiCP);
$o_smarty->assign('flgSTOP',$flgSTOP);
$o_smarty->assign('FLG_CP_SPK',$FLG_CP_SPK);
$o_smarty->display('MET031.tpl');
exit;
?>