MET012.php 2.91 KB
<?php 

//*****************************************************************************

//* 

//* プログラム名:電子会議室

//* プログラムID:MET012.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');

$strDBinc="../".$PHP_FOLDER."/include/dbcon.inc";

$strTempPath="../".$PHP_FOLDER."/temp/kaigi/";

include($strDBinc);

//折り返し文字数
$intBR_ctg = 40;


//一覧表示
$selDisp = (int) $selDisp;
$strDate = date("Y").date("m").date("d").date("H");
if($selDisp == 1){
	$strWere = "where kaigi_info_tbl.date_end > '".$strDate."' ";
	$srtOn = "and kaigi_info_tbl.date_end > '".$strDate."' ";
}elseif($selDisp == 2){
	$strWere = "where kaigi_info_tbl.date_end < '".$strDate."' ";
	$srtOn = "and kaigi_info_tbl.date_end <= '".$strDate."' ";
}elseif($selDisp == 3){
	$strWere = "where kaigi_info_tbl.date_end < '".$strDate."' and minutes_maker='".$PHP_SYAIN_CD."' and minutes IS NULL ";
	$srtOn = "and kaigi_info_tbl.date_end <= '".$strDate."' and kaigi_info_tbl. minutes_maker='".$PHP_SYAIN_CD."' and kaigi_info_tbl.minutes IS NULL ";
}else{
	$strWere="";
	$srtOn="";
}

$strSQL = "select kaigi_info_tbl.category_no, mst_kaigi_category.category_name, count(*) as ctgnum, mst_kaigi_category.disp_rank ";
$strSQL .= "from  kaigi_info_tbl join  mst_kaigi_category on mst_kaigi_category.category_no = kaigi_info_tbl.category_no ";
$strSQL .= "and(kaigi_info_tbl.list_spk like '%/".$PHP_SYAIN_CD."/%' or kaigi_info_tbl.list_obs like '%".$PHP_SYAIN_CD."/%') ";
$strSQL .= $strWere;
$strSQL .= "group by kaigi_info_tbl.category_no, mst_kaigi_category.category_name, mst_kaigi_category.disp_rank ";
$strSQL .= "order by mst_kaigi_category.disp_rank";

$recData=pg_exec($strSQL);
if($recData==false){
	echo("SQL実行に失敗しました(SELECT)");
	exit;
}

for($i=0;$i<pg_numrows($recData);$i++){
	$fetchData = pg_fetch_object($recData,$i);
	//カテゴリ番号
	$ctgNo[$i] = $fetchData->category_no;
	//カテゴリ名
//	$ctgName[$i] =  LINE_BR($fetchData->category_name,$intBR_ctg);
	$ctgName[$i] =  $fetchData->category_name;
	//カテゴリ各数
	$ctgCnt[$i] = $fetchData->ctgnum;
	
	$strSQL = "select read_flg from pkaigi_tbl ";
	$strSQL .= "join kaigi_info_tbl on kaigi_info_tbl.meeting_no = pkaigi_tbl.meeting_no ".$srtOn." ";
	$strSQL .= "where pkaigi_tbl.read_flg = 0 and pkaigi_tbl.syain_cd = '".$PHP_SYAIN_CD."' and pkaigi_tbl.category_no= ".$ctgNo[$i];

	$recCnt=pg_exec($strSQL);
	if($recCnt==false){
		echo("SQL実行に失敗しました(SELECT)");
		exit;
	}
	$noRead[$i] = pg_numrows($recCnt);
}

$o_smarty->assign('strDisp',$strDisp);
$o_smarty->assign('ctgNo',$ctgNo);
$o_smarty->assign('ctgName',$ctgName);
$o_smarty->assign('ctgCnt',$ctgCnt);
$o_smarty->assign('noRead',$noRead);

$o_smarty->display('MET012.tpl');

?>