MET950.php 5.17 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:電子会議室
//* プログラムID:MET950.php
//* 機能        :電子会議室.議長返信
//* 作成者      :
//* 
//*****************************************************************************
include("include/session_start.inc");
include("include/SessionChk.inc");

$strDBinc="include/dbcon.inc";
include($strDBinc);

//*** URL取得処理 ***//
include("include/url_get.inc");

include("inc/mail_add.inc");

//議長返信番号設定
$strSQL="select cp_answer_no from kaigi_tbl where meeting_no = ".$mtgNo." and remark_no = ".$remNo." and answer_no = ".$ansNo." order by cp_answer_no DESC";
$recRemNo=pg_exec($strSQL);
if($recRemNo==false){
		echo("SQL実行に失敗しました(SELECT)");
		exit;
}
if (pg_numrows($recRemNo) > 0){
	$objNo = pg_fetch_object($recRemNo, 0);
	$intRemNo=($objNo->cp_answer_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.", ".$remNo.", ".$ansNo.", ".$intRemNo.", '".addslashes($txtAnswer)."', '".$PHP_SYAIN_CD."', '".date("Ymdhi")."')";
$execIns =pg_exec($strSQL);
if($execIns==false){
		echo("SQL実行に失敗しました(INSERT)");
		exit;
}

//個人用テーブル設定
//対象検索 発言者
$strSQL="select category_no, list_spk, list_obs, notice_flg, theme 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);

$txtTheme = ($objList->theme);
$intNotice = (int)$objList->notice_flg;

//** 発言者名前取得 **//
$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=$objNmData->name_kj_sei." ".$objNmData->name_kj_mei;

//**** メール本文 ****//
//** PC版 **//
$strMail[0] = "会議で発言に修正がありました\n";
$strMail[0] .= "【会議テーマ】\n";
$strMail[0] .= addslashes($txtTheme)."\n";
$strMail[0] .= "【修正発言】\n";
$strMail[0] .= mb_convert_encoding(addslashes($txtAns), "eucJP-win", "auto")."\n";
$strMail[0] .= "【発言者】\n";
$strMail[0] .= addslashes($strNameData)."\n";
//20081023 追加
$strMail[0] .= "\n※このメールは、送信専用メールアドレスから配信されています。\nご返信いただいても配信元へは届きませんのでご了承ください。";

//** 携帯版 **//
$strMobile = "会議で発言に修正がありました\\n";
$strMobile .= "【会議テーマ】\n";
$strMobile .= addslashes($txtTheme)."\n";
$strMobile .= "【修正発言】\n";
$strMobile .= mb_convert_encoding(addslashes($txtAns), "eucJP-win", "auto")."\n";
$strMobile .= "【発言者】\n";
$strMobile .= addslashes($strNameData)."\n";
//20081023 追加
$strMobile .= "\n※このメールは、送信専用メールアドレスから配信されています。\nご返信いただいても配信元へは届きませんのでご了承ください。";

$arrSPK = split("/",$strList);
for($i=1;$i<count($arrSPK)-1;$i++){
	$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.", ".$remNo.", ".$ansNo.", ".$intRemNo.", ".$intCtgNo.", 1, 0)";
	$execIns =pg_exec($strSQL);
	if($execIns==false){
			echo("SQL実行に失敗しました(INSERT)");
			exit;
	}
	
		//開設メール配信
		if($intNotice == 1){
			$strMail[1]  = $strMobile;
			if ($PHP_MOBILE_FLG==0){
					$strMail[1] .= "\n".$UrlHead_MB."MTG004_m.php?P_SYAIN_CD=".$arrSPK[$i]."&P_FOLDER=".$PHP_FOLDER_NAME;
					$strMail[1] .= "&ctgno=".$intCtgNo."&mtgNo=".$mtgNo."&remNo=".$remNo;
			}
			if(subMailIns($mtgNo,3,3,$arrSPK[$i],"000000000000",$strMail) == false){
//				echo ("SQL実行に失敗しました(INSERT)");
//				exit;
			}
		}
}
//対象検索 オブザーバ
$strList=($objList->list_obs);
$arrOBS = split("/",$strList);
if(count($arrOBS)>0){
	for($i=1;$i<count($arrOBS)-1;$i++){
		$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.", ".$remNo.", ".$ansNo.", ".$intRemNo.", ".$intCtgNo.", 0, 0)";
		if($execIns==false){
				echo("SQL実行に失敗しました(INSERT)");
				exit;
		}

			//開設メール配信
			if($intNotice == 1){
					$strMail[1]  = $strMobile;
					if ($PHP_MOBILE_FLG==0){
							$strMail[1] .= "\n".$UrlHead_MB."MTG004_m.php?P_SYAIN_CD=".$arrOBS[$i]."&P_FOLDER=".$PHP_FOLDER_NAME;
							$strMail[1] .= "&ctgno=".$intCtgNo."&mtgNo=".$mtgNo."&remNo=".$remNo;
					}
					if(subMailIns($mtgNo,3,3,$arrOBS[$i],"000000000000",$strMail) == false){
	//					echo ("SQL実行に失敗しました(INSERT)");
	//					exit;
					}
			}
	}
}

?>

<script language="javascript">
function DoSubmit(){
	document.e_gru.action = "MET030.php";
	document.e_gru.method="POST";
	document.e_gru.submit();
	return false;
}
</script>
<body onload="DoSubmit()">
<form name = "e_gru" method="post">
<input name='mtgNo'  type="hidden" value="<?php  echo $mtgNo ?>">
<input name='remNo'  type="hidden" value="<?php  echo $remNo ?>">
<input name='ansNo'  type="hidden" value="<?php  echo $ansNo ?>">
</form>
</body>