CON113_1.php 1.55 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:電子会議室カテゴリDB設定処理(削除)
//* プログラムID:CON113.PHP
//* 機能        :電子会議室カテゴリ情報をDB設定する
//* 作成者      :
//* 
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");

//*****************************************************************************
//* インクルードファイル
//*****************************************************************************
include("include/session_start.inc");						//セッション開始
include("include/SessionChk.inc");							//セッションチェック
include("include/dbcon.inc");										//DB接続

//カテゴリマスタ削除
$strSql = "DELETE FROM mst_kaigi_category WHERE category_no=".$_POST["category_no"];
$rsResult = pg_exec($pg_con,$strSql);

//会議番号抽出
$strSql = "select meeting_no from kaigi_info_tbl where category_no = ".$_POST["category_no"];
$rsResult = pg_exec($pg_con,$strSql);
if(pg_numrows($rsResult) > 0){
	$strWhere = "";
	for($i=0;$i<pg_numrows($rsResult);$i++){
		$strWhere .= " meeting_no = ".pg_result($rsResult,$i,"meeting_no");
		if($i < (pg_numrows($rsResult) - 1)){
			$strWhere .= ", or";
		}
	}
	//各会議データ削除
	$strSql = "DELETE FROM kaigi_info_tbl WHERE".$strWhere;
	$rsRes = pg_exec($pg_con,$strSql);
	$strSql = "DELETE FROM kaigi_tbl WHERE".$strWhere;
	$rsRes = pg_exec($pg_con,$strSql);
	$strSql = "DELETE FROM pkaigi_tbl WHERE".$strWhere;
	$rsRes = pg_exec($pg_con,$strSql);
}

header("Location: CON110.php");
?>