<?php
/*
if (!isset($_SESSION)) //判斷是否已經開啟SESSION
{
	header("Cache-control:private");
session_start();}//開起SESSION}
include("../function.php");
check_login();
*/

require_once("../db.php");
$rId=$_POST["rId"];
//$rTitle=$_POST['rTitle'];
$rPlace=$_POST['rPlace'];
//做字串處理
$rTime_a=$_POST['rTime_a'];
$rTime_b=$_POST['rTime_b'];
$rTime = $rTime_a."-".$rTime_b;

$rDate=$_POST['rDate'];
$rElse=$_POST['rElse'];
$rPhone=$_POST['rPhone'];
$rEmail=$_POST['rEmail'];
//$rMsn=$_POST['rMsn'];
$rLimit=$_POST['rLimit'];
//$end_date=$pre_date[1];
$d0=date("Y-m-d");
$rPotime=$d0;



/*------------------空白判斷-----------------------*/

if(empty($rPlace))
{
	echo "<script>";
	echo "alert(\"請輸入揪團集合地點!!\");";
	echo "history.go(-1)";
	echo "</script>";
}
else if(empty($rTime_a)||empty($rTime_b))
{
	echo "<script>";
	echo "alert(\"請選擇揪團集合時間!\");";
	echo "history.go(-1)";
	echo "</script>";
}
else if(empty($rPhone))
{
	echo "<script>";
	echo "alert(\"請輸入您的聯絡資訊!!\");";
	echo "history.go(-1)";
	echo "</script>";
}
else
{
 $rElse=nl2br(htmlspecialchars($rElse));
 // $rTitle=nl2br(htmlspecialchars($rTitle));
$rPlace=nl2br(htmlspecialchars($rPlace));
$rTime_a=nl2br(htmlspecialchars($rTime_b));
$rTime=nl2br(htmlspecialchars($rTime));
$rDate=nl2br(htmlspecialchars($rDate));
$rPhone=nl2br(htmlspecialchars($rPhone));
$rEmail=nl2br(htmlspecialchars($rEmail));
//$rMsn=nl2br(htmlspecialchars($rMsn));
$rLimit=nl2br(htmlspecialchars($rLimit));
 
	
	
$res = oci_parse($conn,"UPDATE RAISE SET RPLACE='$rPlace', RTIME='$rTime' , RDATE='$rDate' , RELSE='$rElse' , RPHONE='$rPhone',REMAIL='$rEmail' , RLIMIT='$rLimit' ,RPOTIME='$rPotime' where RID='$rId'") or die('Insert error');
oci_execute($res);	
	echo "<html>
        	<head>
        	<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
        	</head>
        	<body><script>";
	echo "alert(\"修改完成!\");";
	echo "location.href=\"ad_main.php?rId=$rId\" ";
	echo "</script></body>
        	</html>";
}

echo mysql_error();



?>
