MTG010_m.php
6.4 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?php
//*****************************************************************************
//*
//* プログラム名:電子会議室
//* プログラムID:MTG010_m.php
//* 機能 :電子会議室.発言
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=Shift_JIS");
//*** 共通処理 ***//
include("include_m/CommonProcess.inc");
//*** 共通処理 ***//
include("../inc/mail_add.inc");
//*** URL取得処理 ***//
include("include_m/CommonUrlGet.inc");
//*** 電子会議 ***
$strMenuSQL = "SELECT name FROM sub_menu_TBL WHERE url = 'MET010.php'";
$rsRecset = pg_exec($strMenuSQL);
$PHP_TITLE_NAME=mb_convert_encoding(pg_result($rsRecset,0,"name"), "SJIS", "EUC-JP");
//** 予定入力チェック **//
if ($M==""){
echo '<HTML>';
echo '<HEAD>';
echo '<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">';
echo '<TITLE>E-グルPro('.$PHP_TITLE_NAME.')</TITLE>';
echo '</HEAD>';
echo '<BODY>';
echo '<form>';
echo "入力エラー<br>新規議案は必須入力です<br>戻るボタンで戻り再入力してください。";
echo "</form>";
echo "</BODY>";
echo "</HTML>";
exit;
}
if (strstr($M,"<")==True){
echo '<HTML>';
echo '<HEAD>';
echo '<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">';
echo '<TITLE>E-グルPro('.$PHP_TITLE_NAME.')</TITLE>';
echo '</HEAD>';
echo '<BODY>';
echo '<form>';
echo "入力エラー<br>新規議案に不正な文字『<』が使用されています。<br>戻るボタンで戻り再入力してください。";
echo "</form>";
echo "</BODY>";
echo "</HTML>";
exit;
}
if (strstr($M,">")==True){
echo '<HTML>';
echo '<HEAD>';
echo '<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">';
echo '<TITLE>E-グルPro('.$PHP_TITLE_NAME.')</TITLE>';
echo '</HEAD>';
echo '<BODY>';
echo '<form>';
echo "入力エラー<br>新規議案に不正な文字『>』が使用されています。<br>戻るボタンで戻り再入力してください。";
echo "</form>";
echo "</BODY>";
echo "</HTML>";
exit;
}
//発言番号設定
$strSQL="select remark_no, kaigi_info_tbl.theme, kaigi_info_tbl.notice_flg from kaigi_tbl ";
$strSQL.="join kaigi_info_tbl on kaigi_info_tbl.meeting_no = kaigi_tbl.meeting_no ";
$strSQL.="where kaigi_tbl.meeting_no = ".$mtgNo." order by remark_no DESC";
$recRemNo=pg_exec($strSQL);
if($recRemNo==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($recRemNo) > 0){
$objNo = pg_fetch_object($recRemNo, 0);
$txtTheme = ($objNo->theme);
$intNotice = (int)$objNo->notice_flg;
$intRemNo=($objNo->remark_no) +1;
}else{
$intRemNo=1;
}
//発言登録
$strSQL = "insert into kaigi_tbl (meeting_no, remark_no, answer_no, cp_answer_no, speak, person, date) ";
$strSQL .= "values(".$mtgNo.", ".$intRemNo.", 0, 0, '".mb_convert_encoding(addslashes($M), "EUC-JP", "SJIS")."', '".$PHP_SYAIN_CD."', '".date("YmdHi")."')";
$execIns =pg_exec($strSQL);
if($execIns==false){
echo("SQL実行に失敗しました(INSERT)");
exit;
}
//** 発言者名前取得 **//
$strSQLNm="SELECT name_kj_sei,name_kj_mei FROM syain_tbl Where syain_cd='$PHP_SYAIN_CD'";
$objNm = pg_exec($strSQLNm);
if($objNm==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$objNmData = pg_fetch_object($objNm, 0);
$strNameData=mb_convert_encoding($objNmData->name_kj_sei." ".$objNmData->name_kj_mei, "SJIS", "EUC-JP");
//**** メール本文 ****//
//** PC版 **//
$strMail[0] = "会議に新しい議案が提出されました\n";
$strMail[0] .= "【会議テーマ】\n";
$strMail[0] .= mb_convert_encoding($txtTheme, "SJIS", "SJIS")."\n";
$strMail[0] .= "【議案】\n";
$strMail[0] .= mb_convert_encoding($M, "SJIS", "SJIS")."\n";
$strMail[0] .= "【発言者】\n";
$strMail[0] .= $strNameData."\n";
//** 携帯版 **//
$strMobile = "会議に新しい議案が提出されました\n";
$strMobile .= "【会議テーマ】\n";
$strMobile .= mb_convert_encoding($txtTheme, "SJIS", "SJIS")."\n";
$strMobile .= "【議案】\n";
$strMobile .= mb_convert_encoding($M, "SJIS", "SJIS")."\n";
$strMobile .= "【発言者】\n";
$strMobile .= $strNameData."\n";
$strMobile = mb_convert_encoding($strMobile, "euc-jp", "SJIS");
//個人用テーブル設定
//対象検索 発言者
$strSQL="select category_no, list_spk, list_obs from kaigi_info_tbl where meeting_no = ".$mtgNo;
$recList=pg_exec($strSQL);
if($recList==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$objList = pg_fetch_object($recList, 0);
$intCtgNo=($objList->category_no); //カテゴリ番号
$strList=($objList->list_spk);
$arrSPK = split("/",$strList);
for($i=1;$i<count($arrSPK)-1;$i++){
//本人?
if($arrSPK[$i] == $PHP_SYAIN_CD){
$read_flg=1;
}else{
$read_flg=0;
//開設メール配信
if($intNotice == 1){
$strMail[1] = $strMobile;
if ($PHP_MOBILE_NAME==0){
$strMail[1] .= "\n".$UrlHead_MB."MTG004_m.php?P_SYAIN_CD=".$arrSPK[$i]."&P_FOLDER=".$PHP_FOLDER;
$strMail[1] .= "&ctgno=".$ctgno."&mtgNo=".$mtgNo."&remNo=".$intRemNo;
}
if(subMailIns($mtgNo,3,3,$arrSPK[$i],"000000000000",$strMail) == false){
echo ("SQL実行に失敗しました(INSERT)");
exit;
}
}
}
$strSQL = "insert into pkaigi_tbl (syain_cd, meeting_no, remark_no, answer_no, cp_answer_no, category_no, speak_flg, read_flg) ";
$strSQL .= "values('".$arrSPK[$i]."', ".$mtgNo.", ".$intRemNo.", 0, 0, ".$intCtgNo.", 1, ".$read_flg.")";
$execIns =pg_exec($strSQL);
if($execIns==false){
echo("SQL実行に失敗しました(INSERT)");
exit;
}
}
//対象検索 オブザーバ
$strList=($objList->list_obs);
$arrOBS = split("/",$strList);
if(count($arrOBS)>0){
for($i=1;$i<count($arrOBS)-1;$i++){
//本人?
if($arrOBS[$i] == $PHP_SYAIN_CD){
$read_flg=1;
}else{
$read_flg=0;
//開設メール配信
if($intNotice == 1){
$strMail[1] = $strMobile;
if ($PHP_MOBILE_NAME==0){
$strMail[1] .= "\n".$UrlHead_MB."MTG004_m.php?P_SYAIN_CD=".$arrOBS[$i]."&P_FOLDER=".$PHP_FOLDER;
$strMail[1] .= "&ctgno=".$ctgno."&mtgNo=".$mtgNo."&remNo=".$intRemNo;
}
if(subMailIns($mtgNo,3,3,$arrOBS[$i],"000000000000",$strMail) == false){
echo ("SQL実行に失敗しました(INSERT)");
exit;
}
}
}
$strSQL = "insert into pkaigi_tbl (syain_cd, meeting_no, remark_no, answer_no, cp_answer_no, category_no, speak_flg, read_flg) ";
$strSQL .= "values('".$arrOBS[$i]."', ".$mtgNo.", ".$intRemNo.", 0, 0, ".$intCtgNo.", 0, ".$read_flg.")";
$execIns =pg_exec($strSQL);
if($execIns==false){
echo("SQL実行に失敗しました(INSERT)");
exit;
}
}
}
header("Location: ./MTG003_m.php?".$PHP_Argument."&ctgno=".$ctgno."&mtgNo=".$mtgNo.'&selDisp='.$selDisp);
?>