/***********************************************
DAIEISSK SYSTEM
view_info.php
新着情報ページ表示PHPプログラム
Update history
--------------
************************************************/
//TESTモード
//$test = "/pre";
//本番モード
$test = "";
$include_path = "../php_common";
include_once ("$include_path/common_class.ini");
include_once ("$include_path/common_function.ini");
include_once ("$include_path/config.ini");
$TemplatePath = "../php_common/template";
$msg_template = "$TemplatePath/msg.html";
while(list($keyname,$value) = each($_POST)){
$value = replace_html($value);
$in[$keyname]= $value;
}
while(list($keyname,$value) = each($_GET)){
$value = replace_html($value);
$in[$keyname]= $value;
}
$d = new DbConnect;
$d->doConnect();
mysql_query("begin",$d->con);
//----------------------------------------------------------------
$sql1 = "select * from info where info_id='".$in['info_id']."'";
//echo $sql1;
$rtn1 = mysql_query($sql1,$d->con);
if (!$rtn1) {
print("Alert1");
mysql_query("rollback",$d->con);
exit;
}
$cnt1 = mysql_num_rows($rtn1);
if($cnt1>0){
$data=mysql_fetch_array($rtn1);
}
//------------------------------------------------------------------
$info_date = $data['date_yyyy'] . "." . $data['date_mm'] . "." . $data['date_dd'];
//---------------------------------------------------
//テンプレート書き出し
//---------------------------------------------------
$tmpl = "$TemplatePath/info_page.html";
$fp = fopen( $tmpl, "r" );
$tmp_contents = fread ($fp, filesize ($tmpl));
$contents = $tmp_contents;
$contents = ereg_replace("",$info_date,$contents);
$info_title = ereg_replace("\n","
",$data['info_title']);
$contents = ereg_replace("",$info_title,$contents);
$comment = ereg_replace("\n","
",$data['comment']);
$contents = ereg_replace("",$comment,$contents);
$contents = mb_convert_encoding($contents,"SJIS","EUC-JP");
print $contents;
mysql_query("commit",$d->con);
mysql_close($d->con);
?>