MTG004_m.php 12.7 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:会議(携帯電話)
//* プログラムID:MTG004_m.php
//* 機能        :会議
//* 作成者      :
//* 
//*****************************************************************************
header("Content-type: text/html; charset=Shift_JIS");

//*** 広告 ***//
include("include_m/Advertisement.inc");

//*** 共通処理 ***//
include("include_m/CommonProcess.inc");

//*** 文字列処理 ***//
include("include_m/STRING.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");

//*** 会議カテゴリ名 ****//
$strSQL = "select * from mst_kaigi_category ";
$strSQL .= " WHERE category_no=$ctgno";
$recData=pg_exec($strSQL);
if($recData==false){
		echo("SQL実行に失敗しました(SELECT)");
		exit;
}
$recSet = pg_fetch_object($recData, 0);
$PHP_TITLE_NAME.="(".mb_convert_encoding($recSet->category_name, "SJIS", "EUC-JP").")";

if ($Pg==""){
		$Pg=0;
}

$strValue   = '&ctgno='.$ctgno.'&mtgNo='.$mtgNo.'&remNo='.$remNo.'&selDisp='.$selDisp;
$strHidden  = '<INPUT TYPE="hidden" NAME="ctgno" VALUE="'.$ctgno.'">';
$strHidden .= '<INPUT TYPE="hidden" NAME="mtgNo" VALUE="'.$mtgNo.'">';
$strHidden .= '<INPUT TYPE="hidden" NAME="remNo" VALUE="'.$remNo.'">';
$strHidden .= '<INPUT TYPE="hidden" NAME="selDisp" VALUE="'.$selDisp.'">';

$strDate = date("Y").date("m").date("d").date("H");

if ($selDisp==""){
		$selDisp=1;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>E-グルPro(<?php  echo $PHP_TITLE_NAME ?>)</TITLE>
</HEAD>
<BODY>
<center>
<?php  echo $PHP_TITLE_NAME ?><br>
<?php  echo $strName; ?>
<HR width="100%">
<?php  echo $koukokuTEL; ?>
</center>
<?php 
	//メニュー表示
	include("include_m/CommonMenuReturn.inc");
?>
<HR width="100%">
<a href="MTG001_m.php?<?php  echo $PHP_Argument.'&selDisp='.$selDisp; ?>"accesskey="1"><?php  echo Get_Num("1"); ?>カテゴリ一覧</A>&nbsp;
<a href="MTG002_m.php?<?php  echo $PHP_Argument.'&ctgno='.$ctgno.'&selDisp='.$selDisp ?>"accesskey="2"><?php  echo Get_Num("2"); ?>テーマ一覧</A>
<a href="MTG003_m.php?<?php  echo $PHP_Argument.'&ctgno='.$ctgno.'&mtgNo='.$mtgNo.'&selDisp='.$selDisp ?>"accesskey="3"><?php  echo Get_Num("3"); ?>発言一覧</A>
<br>
<?php 

$strSQL = "select theme, measure, meeting_rule, etc,date_start, date_end, chairperson, minutes_maker, minutes, list_spk, list_obs, ";
$strSQL .= "file_name, file_name_jp, notice_flg, opener, mst_kaigi_category.category_name, mst_kaigi_category.category_no ";
$strSQL .= "from kaigi_info_tbl join mst_kaigi_category on mst_kaigi_category.category_no = kaigi_info_tbl.category_no ";
$strSQL .= "where meeting_no = ".$mtgNo;
$recData=pg_exec($strSQL);
if($recData==false){
		echo("SQL実行に失敗しました(SELECT)");
		exit;
}
$ftcData = pg_fetch_object($recData,0);
$strCPNo = trim($ftcData->chairperson);
$date_end=$ftcData->date_end;
$strSyain = $ftcData->list_spk;
if(strpos($strSyain, "/".$PHP_SYAIN_CD."/") === false){
	$strSpkFlg = 0;
}else{
	$strSpkFlg = 1;
}
echo '【会議テーマ】<BR>';
echo str_replace ("\r\n","<br>",htmlspecialchars(mb_convert_encoding($ftcData->theme, "SJIS", "EUC-JP")));
echo '<br>';

$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.answer_no = 0 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, 0);
$strTemp = $ftcKaigi->date;
$stop_flg=(int)$ftcKaigi->stop_flg;
$strTemp = ((int) substr($strTemp,4,2))."/".((int) substr($strTemp,6,2))." ".substr($strTemp,8,2).":".substr($strTemp,10,2)."";
echo '<form Method="GET" action="MTG011_m.php">';
echo '【議案】<br>';
echo "・".str_replace ("\r\n","<br> ",mb_convert_encoding($ftcKaigi->speak, "SJIS", "EUC-JP" ));
if ($ftcKaigi->read_flg==0){
		echo '<input type="submit" name="intSts" value="確認">';
}
if ($strCPNo==$PHP_SYAIN_CD){
		echo '<br>';
		echo '<input type="submit" name="intSts" value="修正">';
		if ($stop_flg==0){
				echo '<input type="submit" name="intSts" value="発言停止">';
		}else{
				echo '<input type="submit" name="intSts" value="発言再開">';
		}
}
echo '<br> ';
echo $strTemp;
echo "(".mb_convert_encoding($ftcKaigi->name_kj_sei, "SJIS", "EUC-JP").mb_convert_encoding($ftcKaigi->name_kj_mei, "SJIS", "EUC-JP").")";
echo '<br>';
echo $strHidden;
echo '<INPUT TYPE="hidden" NAME="ansNo" VALUE="0">';
echo '<INPUT TYPE="hidden" NAME="cpNo"  VALUE="0">';
echo '<INPUT TYPE="hidden" NAME="Pg"    VALUE="'.$Pg.'">';
include("include_m/CommonHidden.inc");
echo '</form>';
?>
<HR width="90%">
<?php  if (($strSpkFlg == 1) && ($strDate<=$date_end) && ($stop_flg==0)){ ?>
<form Method="GET" action="MTG012_m.php">
【新規発言】<BR>
<TEXTAREA name="M" rows="5" wrap="virtual" cols="20"></TEXTAREA><br>
<input type="submit" value="発言する"><br>
<?php 
echo $strHidden;
include("include_m/CommonHidden.inc");
?>
</form>
<HR width="90%">
<?php  } ?>
<?php 
$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;
}
$max = pg_numrows($recKaigi)-1;
$intCnt=0;
for($i=0;$i<$max;$i++){
		$ftcKaigi = pg_fetch_object($recKaigi, $i);
	
		//発言内容
		$strData[$intCnt][0] = " ".str_replace ("\r\n","<br> ",mb_convert_encoding($ftcKaigi->speak, "SJIS", "EUC-JP" ));

		//既読フラグ
		$strData[$intCnt][1] = $ftcKaigi->read_flg;

		//発言日
		$strTemp = $ftcKaigi->date;
		$strTemp = ((int) substr($strTemp,4,2))."/".((int) substr($strTemp,6,2))." ".substr($strTemp,8,2).":".substr($strTemp,10,2)."";
		$strData[$intCnt][2] = $strTemp;

		//発言者
		$strData[$intCnt][3] = mb_convert_encoding($ftcKaigi->name_kj_sei, "SJIS", "EUC-JP").
													 mb_convert_encoding($ftcKaigi->name_kj_mei, "SJIS", "EUC-JP");

		//発言番号
		$strData[$intCnt][4]=$ftcKaigi->answer_no;

		//cpNo
		$strData[$intCnt][5]=0;

		//修正ボタン
		if ($ftcKaigi->person==$PHP_SYAIN_CD){
				$strData[$intCnt][6]=1;
		}

		$intCnt=$intCnt+1;
		//議長発言
		$strSQL = "select kaigi_tbl.cp_answer_no,kaigi_tbl.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);

						//発言内容
						$strData[$intCnt][0] = " ".str_replace ("\r\n","<br> ",mb_convert_encoding($ftcCP->speak, "SJIS", "EUC-JP" ));

						//既読フラグ
						$strData[$intCnt][1] = $ftcCP->read_flg;

						//発言日
						$strTemp = $ftcCP->date;
						$strTemp = ((int) substr($strTemp,4,2))."/".((int) substr($strTemp,6,2))." ".substr($strTemp,8,2).":".substr($strTemp,10,2)."";
						$strData[$intCnt][2] = $strTemp;

						//発言者
						$strData[$intCnt][3] = mb_convert_encoding($ftcCP->name_kj_sei, "SJIS", "EUC-JP").
																	 mb_convert_encoding($ftcCP->name_kj_mei, "SJIS", "EUC-JP");

						//発言番号
						$strData[$intCnt][4]=$ftcCP->answer_no;

						//cpNo
						$strData[$intCnt][5]=1;

						//修正ボタン
						if ($ftcCP->person==$PHP_SYAIN_CD){
								$strData[$intCnt][6]=1;
						}
						$intCnt=$intCnt+1;
						
				}
		}
}

$strChk=count($strData);
//終了ページの取得
$intEndCnt=5 * ($Pg+1);
if ($intEndCnt>$strChk){
	$intEndCnt=$strChk;
}

if (($Pg > 0) && ($strChk > (5 * ($Pg+1)))){
		$intPt1=$Pg-1;
		$intPt2=$Pg+1;
		echo '<a href="MTG004_m.php?'.$PHP_Argument.$strValue.'">[最新]</a>';
		echo '<a href="MTG004_m.php?'.$PHP_Argument.'&Pg='.$intPt1.$strValue.'">[前5件]</a>';
		echo '<a href="MTG004_m.php?'.$PHP_Argument.'&Pg='.$intPt2.$strValue.'">[次5件]</a>';
		echo "<br>";
}elseif(($Pg > 0) && ($strChk <= (5 * ($Pg+1)))){
		$intPt1=$Pg-1;
		echo '<a href="MTG004_m.php?'.$PHP_Argument.$strValue.'">[最新]</a>';
		echo '<a href="MTG004_m.php?'.$PHP_Argument.'&Pg='.$intPt1.$strValue.'">[前5件]</a>';
//		echo '[次5件]';
		echo "<br>";
}elseif(($Pg == 0) && ($strChk > (5 * ($Pg+1)))){
		$intPt2=$Pg+1;
		echo '<a href="MTG004_m.php?'.$PHP_Argument.$strValue.'">[最新]</a>';
//		echo '[前5件]';
		echo '<a href="MTG004_m.php?'.$PHP_Argument.'&Pg='.$intPt2.$strValue.'">[次5件]</a>';
		echo "<br>";
}

echo "【発言】<br>";
for($i=5*$Pg;$i<$intEndCnt;$i++){
		echo '<form Method="GET" action="MTG011_m.php">';
		echo "・".$strData[$i][3];
		echo "&nbsp;".$strData[$i][2]."<br>";
		$strButton="";
		if ($strData[$i][1]==0){
				$strButton.= '&nbsp;<input type="submit" name="intSts" value="確認">';
		}
		if(($strCPNo == $PHP_SYAIN_CD) && ($strData[$i][5]==0) && ($strDate<=$date_end)){
				$strButton.= '&nbsp;<input type="submit" name="intSts" value="返信">';
		}
		if (($strData[$i][6]==1) && ($strDate<=$date_end)){
				$strButton.= '&nbsp;<input type="submit" name="intSts" value="修正">';
		}
		if ($strButton!=""){
				echo $strButton.'<br>';
		}
		echo $strData[$i][0];
		echo '<HR width="90%">';
		echo $strHidden;
		echo '<INPUT TYPE="hidden" NAME="ansNo" VALUE="'.$strData[$i][4].'">';
		echo '<INPUT TYPE="hidden" NAME="cpNo"  VALUE="'.$strData[$i][5].'">';
		echo '<INPUT TYPE="hidden" NAME="Pg"    VALUE="'.$Pg.'">';
		include("include_m/CommonHidden.inc");
		echo '</form>';
}

if (($Pg > 0) && ($strChk > (5 * ($Pg+1)))){
		$intPt1=$Pg-1;
		$intPt2=$Pg+1;
		echo '<a href="MTG004_m.php?'.$PHP_Argument.$strValue.'">[最新]</a>';
		echo '<a href="MTG004_m.php?'.$PHP_Argument.'&Pg='.$intPt1.$strValue.'">[前5件]</a>';
		echo '<a href="MTG004_m.php?'.$PHP_Argument.'&Pg='.$intPt2.$strValue.'">[次5件]</a>';
		echo "<br>";
}elseif(($Pg > 0) && ($strChk <= (5 * ($Pg+1)))){
		$intPt1=$Pg-1;
		echo '<a href="MTG004_m.php?'.$PHP_Argument.$strValue.'">[最新]</a>';
		echo '<a href="MTG004_m.php?'.$PHP_Argument.'&Pg='.$intPt1.$strValue.'">[前5件]</a>';
//		echo '[次5件]';
		echo "<br>";
}elseif(($Pg == 0) && ($strChk > (5 * ($Pg+1)))){
		$intPt2=$Pg+1;
		echo '<a href="MTG004_m.php?'.$PHP_Argument.$strValue.'">[最新]</a>';
//		echo '[前5件]';
		echo '<a href="MTG004_m.php?'.$PHP_Argument.'&Pg='.$intPt2.$strValue.'">[次5件]</a>';
		echo "<br>";
}

?>
<br>
<a href="MTG001_m.php?<?php  echo $PHP_Argument.'&selDisp='.$selDisp; ?>"accesskey="1"><?php  echo Get_Num("1"); ?>カテゴリ一覧</A>&nbsp;
<a href="MTG002_m.php?<?php  echo $PHP_Argument.'&ctgno='.$ctgno.'&selDisp='.$selDisp ?>"accesskey="2"><?php  echo Get_Num("2"); ?>テーマ一覧</A>
<a href="MTG003_m.php?<?php  echo $PHP_Argument.'&ctgno='.$ctgno.'&mtgNo='.$mtgNo.'&selDisp='.$selDisp ?>"accesskey="3"><?php  echo Get_Num("3"); ?>発言一覧</A>
<HR width="100%">
<?php 
	//メニュー表示
	include("include_m/CommonMenuReturn.inc");
?>

</BODY>
</HTML>