<?
if(!(isset($_SESSION))){session_start();}
$mAccount=$_SESSION['mAccount'];
$mId=$_SESSION['mId'];
putenv("NLS_LANG=TRADITIONAL CHINESE_TAIWAN.AL32UTF8");
require_once("../db.php");

require_once("../function.php");

if($_SESSION['mAccount']==''){

url_session($aId='',$c='');

}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="style/default.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="../activity/style/ui.datepicker.css" type="text/css" media="screen" title="core css file"/>
 <link rel="stylesheet" type="text/css" href="../jQuery/jquery.autocomplete.css" />
 <style type="text/css">

		
		#leftBox{
			width:150px; padding:3px;text-align:left;
			height:165px;
			
			background-image:url(images/announce.png);
			background-repeat:repeat-y;
			}
	
		</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JUME(Join You And Me)揪咪揪團活動網</title>
<script src='../jQuery/jquery-1.2.6.js' type='text/javascript'></script>
<script type="text/javascript" src="../jQuery/jquery.floatingbox.js"></script>
<!-- Stylesheets -->
</head>
<body>
<!--橋牌大賽廣告 -->

 
<div id="wrapper">

    <div id="header">
	        
		        <? include("header.php"); ?> 
	        
	</div> <!-- end #header -->

<!--<table align="center" border="0" cellpadding="0" cellspacing="0" width="1000" background="/member/images/container.gif">-->
 
<div id="content">
		<div id="map_index">

	
		
		    <div id="map-buttom">
			<ul>
       <li class="1" id='1'><a href="../map/test.php?type=1" target="test" id="1"><br/>SHOPPING</a></li>
	   <li id='2'><a href="../map/test.php?type=2" target="test"><br/>PARTY</a></li> 
	   <li id='3'><a href="../map/test.php?type=3" target="test"><br/>FOOD</a></li> 
	   <li id='4'><a href="../map/test.php?type=4" target="test"><br/>TRAVEL</a></li> 
	   <li id='5'><a href="../map/test.php?type=5" target="test"><br/>SPORTS</a></li> 
	   <li id='6'><a href="../map/test.php?type=6" target="test"><br/>EDUCATE</a></li></ul>
	        </ul>
	         
            <? //include("../map/test.php"); ?> 
		 
		    <iframe id="f_map" frameborder="0" marginwidth="5" marginheight="5" scrolling="no" name="test" src="../map/test.php" style="  width:910px;  height: 360px ; "></iframe>
		  </div> <!-- end .map-buttom -->
			<!-- end .googlemap -->
		<div id="search" >
			<div id="mapsearch">
			<form  id="map_se"  method="post" target="test" action="../map/test.php"  onsubmit="return mpa_ser();"> 
				
				<input type="checkbox" name="type"  id="mtype"/><b class="heavy"><u>活動類型</u>：</b>
 <input type="checkbox" name="aType[]" value="1">Shopping
	    <input type="checkbox" name="aType[]" value="2">Party
		<input type="checkbox" name="aType[]" value="3">Food
		<input type="checkbox" name="aType[]" value="4">Travel
		<input type="checkbox" name="adate"  id="madate"/>
		<input type="checkbox" name="aType[]" value="5">Sports
		<input type="checkbox" name="aType[]" value="6">Educate

        <br /><input type="checkbox" name="aname" id="maname" /><b class="heavy"><u>活動名稱</u>：</b>
			<input type="text"  id="name" name="name" >
			<br>
			
<input type="checkbox" name="aadd"  id="maadd"/><b class="heavy"><u>活動地址</u>：</b><input name="add" type="text" id="addr"  size="35" maxlength="50"/>
<b class="heavy"><u>活動日期</u>：</b>開始時間
<input type="text" size="10" name="start_date" value="" id="start_date"/> to <input type="text" size="10" name="end_date" value="" id="end_date"/>
</tr>
<input type="hidden" name="se" value="se" />
 <input type="submit" value="send" />
</form> </div><!--end mapsearch-->
			</div>
           
		</div><!--end map-->

<div id="information">	
							<div id="announce">
							<div id="scrollDiv" >
  <ul>
    <li>10/30 <strong>[揪咪公告]</strong>&nbsp;&nbsp;第二波好康活動，終結孤單、揪團拿大獎 >.^</li>
	<li>10/28 <strong>[揪咪公告]</strong>&nbsp;&nbsp;第一屆揪咪橋牌大賽圓滿落幕!!</li>
	<li>10/18 <strong>[揪咪公告]</strong>&nbsp;&nbsp;網站上線嚕，有問題歡迎回報喔 >.^</li>
    <li>[揪咪提醒]&nbsp;&nbsp;建議瀏覽解析度: 1280*1024 </li>
    <li>[揪咪提醒]&nbsp;&nbsp;瀏覽器版本: IE 7.0 Firefox3.0 以上</li>

  </ul>
</div>	
</div>
<div id="info_left">

<div id="link_1">
<a href="../activity/add_activity.php"><img src="/member/images/addact.png" width='200' border="0"/></a><br>
</div>
<div id="link_2">
<a href="../activity/activity_show.php"><img src="/member/images/addraise.png" width='200' border="0"/></a><br>
</div>
<div id="link_3">
<!--<a href="../raise/join_raise.php">--><img src="/member/images/joinraise.png" width='200' border="0"/></a>
</div>
</div><!--end info_left-->


     <!--最新發布活動-->
<div id="floatnews">
<div id="newactivity">
<?
$dtoday=date("Y-m-d");
$str1 = oci_parse($conn,"SELECT AID,ATIME,END_DATE,ANAME FROM ACTIVITY WHERE END_DATE>='$dtoday' AND ROWNUM<10 ORDER BY AID DESC ") or die('Insert error');
oci_execute($str1);



echo"<div id=Layer1 style=' position: absolute;left:5px; top:10px; width:215px; height:173; overflow: hidden;'> 
	<marquee height=130 behavior=loop direction=up scrolldelay=3 scrollamount=1>";
while(list($aId,$start_date,$end_date,$aName)=oci_fetch_row($str1)){
	echo "<table width='100%' border='0' height='20'>
  	<tr> 
   	<td height='120' align='left'> 
   	<FONT  size=2>
	<a href=../activity/activity_show_detail.php?aId=$aId>活動名稱：$aName<br>日期：$start_date~$end_date<br>";
	
	$pic = oci_parse($conn,"select PPATH from PICTURE where AID='$aId'") or die('Insert error');
oci_execute($pic);
	$num_p=oci_fetch_all($pic,$results);
	if($num_p=='0')
		{
			echo "<img src=../activity/picture/original.png  width='200' height='110'border='0'><br>";
		}
	else{
	oci_execute($pic);
		while(list($pPath)=oci_fetch_row($pic)){
			echo "<img src=../activity/$pPath  width='200' height='110' border='0'><br>";
		}
	}
  	echo "<br><br><br></font></td></tr>
 </table>";
}



echo "  </marquee>
</div>";
?>
</div><!--end newactivity-->
<!--最新發布揪團-->
<div id="newtake">
<? 

	$str5 = oci_parse($conn,"SELECT ACTIVITY.AID, ACTIVITY.ANAME, ACTIVITY.END_DATE, RAISE.RID,  RAISE.MID FROM RAISE LEFT OUTER JOIN ACTIVITY ON RAISE.AID = ACTIVITY.AID where ACTIVITY.END_DATE>='$dtoday'ORDER BY RAISE.RID DESC ") or die('Insert error');
oci_execute($str5);
	
echo"<div id=Layer2 style=' position: absolute;left:5px; top:10px; width:215px; height:173; overflow: hidden;'> 
<marquee height=130 behavior=loop direction=up scrolldelay=3 scrollamount=1>";
for($h=0;$h<9;$h++){
		if(list($aId,$aName,$end_date,$rId,$rmId) = oci_fetch_row($str5)){
               echo "<table width='100%' border='0' height='20'>
    			<tr><td height='120' align='left'><FONT  size=2>";
				$str6 = oci_parse($conn,"select MACCOUNT from MEMBER where MID=$rmId") or die('Insert error');
oci_execute($str6);
  			   
			   while(list($mAccount)=oci_fetch_row($str6)){
  			   echo"<a href=../raise/show_raise_detail.php?rId=$rId><br>主揪：$mAccount</a><br>
  			   <a href=../activity/activity_show_detail.php?aId=$aId>活動名稱：$aName<br/>";
  
  $check = oci_parse($conn,"select PPATH from PICTURE where AID='$aId'") or die('Insert error');
oci_execute($check);
	$num_check=oci_fetch_all($check,$results);
              
			   if($num_check!='0'){
			   		while(list($pPath)=oci_fetch_row($check)){
  			     		 echo "<img src=../activity/$pPath  width='200' height='110' border='0'>";
						 }
				}
			   else{echo "<img src=../activity/picture/original.png  width='200' height='110' border='0'>";
			   }
					
			   echo "</a><br><br><br></font></td></tr></table>";}
					 
	        
}}

echo "</marquee>
</div>";
?>
</div><!--end newtake-->  
</div><!--end floatnews--> <!--News-->

<div id="activity" class="test">


<!--最近期活動-->

<div align=left id=news_1>
<div class=news_border>
<div id=showhere class=news_show ></div>
</div>
<div class=buttondiv id=news_button>
<img src=prev.gif align="absmiddle" id=news_prev><img src=pause.gif align="absmiddle" id=news_pause><img src=next.gif align="absmiddle" id=news_next >
</div>
<div class=news_mark>
<div id=news_display class=news_title></div>
</div>
</div>


<!--熱門活動-->

<div align=left id=news_2><div class=news_border>
<div id=showhere1 class=news_show ></div>
</div>
<div class=buttondiv id=news_button1>
<img src=prev.gif align="absmiddle" id=news_prev><img src=pause.gif align="absmiddle" id=news_pause><img src=next.gif align="absmiddle" id=news_next >
</div>
<div class=news_mark>
  <div id=news_display1 class=news_title></div>
</div>
</div>

</div><!--end activity-->


<div id="group" class="test">

<!--最近期揪團-->

<div align=left id=news_3>
<div class=news_border>
<div id=showhere2 class=news_show >
</div>
</div>
<div class=buttondiv id=news_button2>
<img src=prev.gif align="absmiddle" id=news_prev><img src=pause.gif align="absmiddle" id=news_pause><img src=next.gif align="absmiddle" id=news_next >
</div>
<div class=news_mark>
<div id=news_display2 class=news_title>
</div>
</div>
</div>


<!--熱門揪團-->

<div align=left id=news_4><div class=news_border>
<div id=showhere3 class=news_show ></div>
</div>
<div class=buttondiv id=news_button3>
<img src=prev.gif align="absmiddle" id=news_prev><img src=pause.gif align="absmiddle" id=news_pause><img src=next.gif align="absmiddle" id=news_next ></div>
<div class=news_mark><div id=news_display3 class=news_title></div>
</div></div>


</div><!--end group-->

<div style="clear:both;"></div>
<!--人氣揪團王區塊-->
<div id="member">
<div id="popular_member">
<table border="0" caellpadding="3" cellspacing="3" >
<tr>
<?
/*

$today=date("Y-m-d");
$pre_rTime=explode("-",$today);
		$rTime_a=$pre_rTime[0];
		$rTime_b=$pre_rTime[1]; 
		$rTime_c=$pre_rTime[2];
$str=mysql_query("SELECT raise.mId, count(raise.mId ) FROM take	LEFT OUTER JOIN raise ON take.rId = raise.rId
				  WHERE raise.rPotime like  '_____".$rTime_b."___' GROUP BY raise.mId	order by count(raise.mId) desc");
$num=mysql_num_rows($str);
if($num!=''){

	for($i=0;$i<5;$i++){
		if(list($rmId,$amount)=mysql_fetch_row($str)){
			$str_1=mysql_query("select mId,nickname,mPath from member where mId='$rmId'");
			while(list($mId,$nickname,$mPath)=mysql_fetch_row($str_1)){
				if($mPath!=''){echo"<td width='155'><a href='../member/show_member_detail.php?mId=$mId'>
							<img src='../../member/$mPath' width='80' height='70' border='0'></a><br>";}
				else{echo"<td width='155'><a href='../member/show_member_detail.php?mId=$mId'>
							<img src='../../member/mpic/User.png' width='80' height='70' border='0'></a><br>";}
				echo"暱稱：<a href='../member/show_member_detail.php?mId=$mId'>$nickname</a>";
				
				echo"<br>目前總揪到：$amount".人."</td>";
			
			}//end of while
		}//end of if
	}//end of for

}//end of if
else{echo"本月還沒有揪團人氣王哦!!<br>請大家踴躍發起揪團!!";}  
*/

function msql ($type){

$popstr="SELECT RAISE.MID, COUNT(RAISE.MID)  FROM ACTIVITY INNER JOIN RAISE ON RAISE.AID = ACTIVITY.AID INNER JOIN  TAKES
ON TAKES.RID = RAISE.RID WHERE ACTIVITY.TID='".$type."' GROUP BY RAISE.MID ORDER BY  COUNT( RAISE.MID ) DESC ";
return $popstr;


}
/*
SELECT raise.mId, count( raise.mId ) ,activity.aType
FROM activity LEFT OUTER JOIN (take
INNER JOIN raise  ) ON take.rId = raise.rId and raise.aId=activity.aId
GROUP BY raise.mId
ORDER BY count( raise.mId ) DESC , activity.aType ASC 

*/



$today=date("Y-m-d");
$pre_rTime=explode("-",$today);
		$rTime_a=$pre_rTime[0];
		$rTime_b=$pre_rTime[1]; 
		$rTime_c=$pre_rTime[2];
		
		
//$str=mysql_query("SELECT raise.mId, count(raise.mId ) FROM take	LEFT OUTER JOIN raise ON take.rId = raise.rId WHERE raise.rPotime like  '_____".$rTime_b."___' GROUP BY raise.mId	order by count(raise.mId) desc");
//$str="SELECT raise.mId, count( raise.mId ) ,activity.aType, raise.rId FROM ( take INNER JOIN raise)INNER JOIN activity  ON take.rId = raise.rId and raise.aId =activity.aId WHERE activity.aType='2' GROUP BY raise.mId ORDER BY count( raise.mId ) DESC ";

//echo msql($type=1);
$str = oci_parse($conn,msql($type=1)) or die('Insert error');
oci_execute($str);
 $num=oci_fetch_all($str,$results);
if($num!=''){
oci_execute($str);
	for($i=0;$i<1;$i++){
		if(list($rmId,$amount)=oci_fetch_row($str)){
		$str_1 = oci_parse($conn,"select MID,MACCOUNT from MEMBER where MID='$rmId'") or die('Insert error');
        oci_execute($str_1);		
			while(list($mId,$nickname)=oci_fetch_row($str_1)){
				
				echo"<td width='155'><a href='../member/show_member_detail.php?mId=$mId'>
							</a><br>";
				echo"暱稱：<a href='../member/show_member_detail.php?mId=$mId'>$nickname</a>";
				
				echo"<br>目前總揪到：$amount".人."</td>";
			
			}//end of while
		}//end of if
	}//end of for

}//end of if
else{echo"<td width='155'>目前無購物揪團王!!<br>請踴躍發起揪團!!</td>";}  


$str = oci_parse($conn,msql($type=2)) or die('Insert error');
oci_execute($str);
 $num=oci_fetch_all($str,$results);

if($num!=''){

	for($i=0;$i<1;$i++){
		if(list($rmId,$amount)=oci_fetch_row($str)){
			$str_1 = oci_parse($conn,"select MID,MACCOUNT from MEMBER where MID='$rmId'") or die('Insert error');
            oci_execute($str_1);
			while(list($mId,$nickname)=oci_fetch_row($str_1)){
				echo"<td width='155'><a href='../member/show_member_detail.php?mId=$mId'>
							</a><br>";
				echo"暱稱：<a href='../member/show_member_detail.php?mId=$mId'>$nickname</a>";
				
				echo"<br>目前總揪到：$amount".人."</td>";
			
			}//end of while
		}//end of if
	}//end of for

}//end of if
else{echo"<td width='155'>目前無娛樂揪團王!!<br>請踴躍發起揪團!!</td>";}  



$str = oci_parse($conn,msql($type=3)) or die('Insert error');
oci_execute($str);
 $num=oci_fetch_all($str,$results);

if($num!=''){

	for($i=0;$i<1;$i++){
		if(list($rmId,$amount)=oci_fetch_row($str)){
			$str_1 = oci_parse($conn,"select MID,MACCOUNT from MEMBER where MID='$rmId'") or die('Insert error');
            oci_execute($str_1);
			while(list($mId,$nickname)=oci_fetch_row($str_1)){
				echo"<td width='155'><a href='../member/show_member_detail.php?mId=$mId'>
							</a><br>";
				echo"暱稱：<a href='../member/show_member_detail.php?mId=$mId'>$nickname</a>";
				
				echo"<br>目前總揪到：$amount".人."</td>";
			
			}//end of while
		}//end of if
	}//end of for

}//end of if
else{echo"<td width='155'>目前無美食揪團王!!<br>請踴躍發起揪團!!</td>";}  



$str = oci_parse($conn,msql($type=4)) or die('Insert error');
oci_execute($str);
 $num=oci_fetch_all($str,$results);

if($num!=''){

	for($i=0;$i<1;$i++){
		if(list($rmId,$amount)=oci_fetch_row($str)){
			$str_1 = oci_parse($conn,"select MID,MACCOUNT from MEMBER where MID='$rmId'") or die('Insert error');
            oci_execute($str_1);
			while(list($mId,$nickname)=oci_fetch_row($str_1)){
				echo"<td width='155'><a href='../member/show_member_detail.php?mId=$mId'>
							</a><br>";
				echo"暱稱：<a href='../member/show_member_detail.php?mId=$mId'>$nickname</a>";
				
				echo"<br>目前總揪到：$amount".人."</td>";
			
			}//end of while
		}//end of if
	}//end of for

}//end of if
else{echo"<td width='155'>目前無旅遊揪團!!<br>請踴躍發起揪團!!</td>";}  



$str = oci_parse($conn,msql($type=5)) or die('Insert error');
oci_execute($str);
 $num=oci_fetch_all($str,$results);

if($num!=''){

	for($i=0;$i<1;$i++){
		if(list($rmId,$amount)=oci_fetch_row($str)){
			$str_1 = oci_parse($conn,"select MID,MACCOUNT from MEMBER where MID='$rmId'") or die('Insert error');
            oci_execute($str_1);
			while(list($mId,$nickname)=oci_fetch_row($str_1)){
				echo"<td width='155'><a href='../member/show_member_detail.php?mId=$mId'>
							</a><br>";
				echo"暱稱：<a href='../member/show_member_detail.php?mId=$mId'>$nickname</a>";
				
				echo"<br>目前總揪到：$amount".人."</td>";
			
			}//end of while
		}//end of if
	}//end of for

}//end of if
else{echo"<td width='155'>目前無運動揪團王!!<br>請踴躍發起揪團!!</td>";} 



$str = oci_parse($conn,msql($type=6)) or die('Insert error');
oci_execute($str);
 $num=oci_fetch_all($str,$results);

if($num!=''){

	for($i=0;$i<1;$i++){
		if(list($rmId,$amount)=oci_fetch_row($str)){
			$str_1 = oci_parse($conn,"select MID,MACCOUNT from MEMBER where MID='$rmId'") or die('Insert error');
            oci_execute($str_1);
			while(list($mId,$nickname)=oci_fetch_row($str_1)){
				echo"<td width='155'><a href='../member/show_member_detail.php?mId=$mId'>
							</a><br>";
				echo"暱稱：<a href='../member/show_member_detail.php?mId=$mId'>$nickname</a>";
				
				echo"<br>目前總揪到：$amount".人."</td>";
			
			}//end of while
		}//end of if
	}//end of for

}//end of if
else{echo"<td width='155'>目前無文藝揪團王!!<br>請踴躍發起揪團!!</td>";} 




?>
</tr>
</table>
<?
echo "<br><br><br><br><a href=\"pop.php?height=500&width=300&type=1\" class=\"thickbox\" title=\"購物人氣王排行前五名\">更多購物人氣排行</a>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"pop.php?height=500&width=300&type=2\" class=\"thickbox\" title=\"娛樂人氣王排行前五名\">更多娛樂人氣排行</a>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"pop.php?height=500&width=300&type=3\" class=\"thickbox\" title=\"美食人氣王排行前五名\">更多美食人氣排行</a>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"pop.php?height=500&width=300&type=4\" class=\"thickbox\" title=\"旅遊人氣王排行前五名\">更多旅遊人氣排行</a>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"pop.php?height=500&width=300&type=5\" class=\"thickbox\" title=\"運動人氣王排行前五名\">更多運動人氣排行</a>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"pop.php?height=500&width=300&type=6\" class=\"thickbox\" title=\"文藝人氣王排行前五名\">更多文藝人氣排行</a>";







?>
</div><!--end popular_member-->
</div><!--end member-->
</div><!--end information-->
</div><!-- end .content -->

<div id="footer">   
  <div id="footer-in" align="center">
    <p>版權資訊</p>
    <p>國立中山大學  資訊管理學系  揪咪揪團網 <a href="mailto:jumemis@yahoo.com.tw">揪咪團隊<img src="../mail/send email.gif" border="0"/></a> 版權所有  Taiwan All Rights Reserved</p> 
  </div><!-- end #footer-in -->
</div><!-- end #footer -->
</div><!-- end div#wrapper -->

<!-- actyvity1-->
<div id=mynews>
<? 

$dtoday=date("Y-m-d");
$d1=date("Y-m-d",mktime(0,0,0,date("m"),(date("d")+7),date("Y")));
	$str2 = oci_parse($conn,"SELECT ACTIVITY.AID, ACTIVITY.ATIME, ACTIVITY.END_DATE, ACTIVITY.ANAME, PICTURE.PPATH FROM ACTIVITY LEFT OUTER JOIN PICTURE ON ACTIVITY.AID = PICTURE.AID where  ACTIVITY.ATIME<='$d1' and ACTIVITY.ATIME >='$dtoday' ORDER BY ACTIVITY.AID DESC") or die('Insert error');
            oci_execute($str2);

 $i=1;
   for($a=0;$a<9;$a++){
   if(list($aId,$start_date,$end_date,$aName,$pPath)=oci_fetch_row($str2)){
   
	    echo "<div id=news$i class=news_style rel=\"$aName\">
         <table width=200><tr><td align=left>";
		 if($pPath==''){echo"<a href='../activity/activity_show_detail.php?aId=$aId'>
		 <img src=../activity/picture/original.png   width=200 height=110 border=0 '></a>";
		 }else{echo"<a href='../activity/activity_show_detail.php?aId=$aId'>
		 			<img src=../activity/$pPath  width=200 height=110 border=0 ></a>";}
		 echo"
		 </td></tr>
		 <tr><td> 
	     <a href='../activity/activity_show_detail.php?aId=$aId'>活動名稱：$aName<br/>
	     日期：$start_date~$end_date</a></td></tr>
         </table>
		 </div>
		 ";
		  $i++;
		  }	
	}
			if($i==1){
			echo "
		<div id='news$i' class=news_style rel=\"沒有最近期活動\">
		沒有最近期活動
			</div>";
			
			}
?>
</div>	
<!--END ACTYVITY1-->

<!--activity2-->
<div id=mynews1>
<? 
	/*
	$str2 = oci_parse($conn,"select AID from counter group by aId order by count(aId) desc limit 0,10") or die('Insert error');
            oci_execute($str2);
$str3=mysql_query("");
 $j=1;

    while(list($aId)=mysql_fetch_row($str3)){
	$str4=mysql_query("SELECT distinct activity.aId,activity.aName, activity.start_date, activity.end_date, activity.aPlace ,picture.pPath 
	FROM activity left outer join picture ON activity.aId = picture.aId where activity.aId='$aId' and activity.end_date>'$dtoday'");
	   for($g=0;$g<9;$g++){
	   if(list($aId_1,$aName,$start_date,$end_date,$aPlace,$pPath)=mysql_fetch_row($str4)){
		echo "
		 <div id=news$j class=news_style rel=\"$aName\">
         <table width=200><tr><td align=left> ";
		 if($pPath==''){echo "<a href=../activity/activity_show_detail.php?aId=$aId_1>
		 					  <img src=../activity/picture/original.png  width=200 height=110 border=0 ></a>";}
		 else{echo "<a href=../activity/activity_show_detail.php?aId=$aId_1>
		 			<img src=../activity/$pPath  width=200 height=110 border=0 ></a>";}
		echo"</td></tr>
		 <tr><td> 
	     <a href=../activity/activity_show_detail.php?aId=$aId_1>
		 活動名稱：$aName<br/>日期：$start_date~$end_date<br/>活動地點：$aPlace</a>
		 </td></tr>
    	 </table>
		 </div>";

		$j++;
		}}}
		 
		if($j==1){
			echo "
		<div id='news$j' class=news_style rel=\"沒有人氣活動\">
		沒有人氣活動
			</div>";
			
			}
	
		*/
?>
</div>
<!--END ACTYVITY2-->

<!--group1-->
<div id=mynews2>
  <? 
$d7=date("Y-m-d",mktime(0,0,0,date("m"),(date("d")+7),date("Y")));

$str8 = oci_parse($conn,"SELECT RAISE.RID,RAISE.RPLACE,RAISE.RDATE,RAISE.MID,RAISE.RPOTIME,ACTIVITY.AID,ACTIVITY.ANAME,ACTIVITY.MID  FROM RAISE left outer JOIN ACTIVITY ON RAISE.AID=ACTIVITY.AID where RAISE.RDATE>='$dtoday' and RAISE.RDATE<='$d7' and ACTIVITY.END_DATE>='$dtoday' ORDER BY RAISE.RID DESC") or die('Insert error');
            oci_execute($str8);

    $k=1;
   while(list($rId,$rPlace,$rDate,$rmId,$rPotime,$aId,$aName,$amId)=oci_fetch_row($str8)){
 			
		echo "
		<div id='news$k' class=news_style rel=\"$aName\">
         <table width=200><tr><td align=left> ";
 $str_1 = oci_parse($conn,"SELECT PICTURE.PPATH FROM ACTIVITY left outer JOIN PICTURE ON ACTIVITY.AID = PICTURE.AID WHERE ACTIVITY.AID='$aId'") or die('Insert error');
            oci_execute($str_1);
       
		 while(list($pPath)=oci_fetch_row($str_1)){
		 if($pPath==''){echo "<a href=../activity/activity_show_detail.php?aId=$aId>
		 						<img src=../activity/picture/original.png  width=200 height=110 border='0'>";}
		 else{echo "<a href=../activity/activity_show_detail.php?aId=$aId>
		 			<img src=../activity/$pPath  width=200 height=110 border='0'>";}}
		 echo "</td></tr>
		 <tr><td> 
		 <a href=../activity/activity_show_detail.php?aId=$aId>活動名稱：$aName</a><br>";
		 
		 	 $str9 = oci_parse($conn,"select MACCOUNT from MEMBER where MID=$rmId ") or die('Insert error');
            oci_execute($str9);
		 
		 list($mAccount)=oci_fetch_row($str9);
		 echo"<a href=../raise/show_raise_detail.php?rId=$rId>主揪：$mAccount</a><br>";
		 
		 echo "</td></tr></table>
        </div>";
	$k++;
		}
		 
		if($k==1){
			echo "
		<div id='news$k' class=news_style rel=\"沒有最近期揪團\">
		沒有最近期揪團
			</div>";
			
			}
?>
</div>
<!--END group1-->

<!-- group2 -->
<div id=mynews3>
<? 
$str11 = oci_parse($conn,"SELECT DISTINCT ACTIVITY.AID, ACTIVITY.ANAME, ACTIVITY.END_DATE, ACTIVITY.MID, RAISE.RID, RAISE.RPLACE,RAISE.RDATE, RAISE.MID,RAISE.RLIMIT,RAISE.RLIMIT_1 FROM RAISE LEFT OUTER JOIN ACTIVITY ON (ACTIVITY.AID = RAISE.AID and ACTIVITY.END_DATE >= '$dtoday' and RAISE.RDATE >= '$dtoday')GROUP BY ACTIVITY.AID, ACTIVITY.ANAME, ACTIVITY.END_DATE, ACTIVITY.MID, RAISE.RID, RAISE.RPLACE,RAISE.RDATE, RAISE.MID,RAISE.RLIMIT,RAISE.RLIMIT_1 ORDER BY RAISE.RLIMIT_1/RAISE.RLIMIT desc,RAISE.RID desc") or die('Insert error');
            oci_execute($str11);

 $l=1;
   for($m=0;$m<9;$m++){
   if(list($aId,$aName,$end_date,$mId,$rId,$rPlace,$rDate,$rmId,$rLimit_1)=oci_fetch_row($str11))
	   {
	   $str12 = oci_parse($conn,"select PICTURE.PPATH from ACTIVITY left outer join PICTURE on ACTIVITY.AID=PICTURE.AID where ACTIVITY.AID='$aId'") or die('Insert error');
            oci_execute($str12);
	   
		 while(list($pPath)=oci_fetch_row($str12)){
		
		echo "
		 <div id='news$l' class=news_style rel=\"$aName\">
         <table width=200><tr><td align=left> ";
		 if($pPath==''){echo "<a href=../activity/activity_show_detail.php?aId=$aId>
		 						<img src=../activity/picture/original.png   width=200 height=110 border='0'>";}else{
		 echo "<a href=../activity/activity_show_detail.php?aId=$aId>
		 	   <img src=../activity/$pPath  width=200 height=110 border='0'>";}
		 echo "</td></tr>
		  <tr><td>
		  <a href=../activity/activity_show_detail.php?aId=$aId>活動名稱：$aName<br></a>";
		    $str13 = oci_parse($conn,"select MACCOUNT from MEMBER where MID=$rmId ") or die('Insert error');
            oci_execute($str13);
		
		 list($mAccount)=oci_fetch_row($str13);
		 echo"<a href=../raise/show_raise_detail.php?rId=$rId>主揪：$mAccount </a><br>";
		 
		 echo "</td></tr>
         </table>
        </div>";
	$l++;
		}
		}
		}
		if($l==1){
			echo "
		<div id='news$l' class=news_style rel=\"沒有人氣揪團\">
		沒有人氣揪團
			</div>";
			
			}
?>
</div>

<!--END group2-->

	<!--	
		<div id="leftBox">
			 
10/18 <br><strong>[揪咪公告]</strong><br>網站上線嚕，有問題歡迎回報喔 >.^<br><br>
建議瀏覽解析度:<br>1280*1024<br>
瀏覽器版本:<br> IE 7.0 Firefox3.0 以上

		</div>-->
	
		
</body>
</html>
<!-- Javascript - Fix the flash of unstyled content -->

<script src="../jQuery/jquery-ui-personalized-1.6rc1.min.js" type="text/javascript"></script>
<?
if($_SESSION['mAccount']!=''){
  echo "

<script type=\"text/javascript\" src=\"../thick/thickbox.js\"></script>


<link rel=\"stylesheet\" href=\"../thick/reg_thickbox.css\" type=\"text/css\" media=\"screen\" />
<style type=\"text/css\" media=\"all\">@import \"../thick/reg_thickbox.css\";</style>




";
}
?>
<script src="../jQuery/jquery.autocomplete.pack.js" type="text/javascript"></script>
<!--新聞顯示-->
<script type="text/javascript" src="js/jquery.easynews.js"></script>
<!--首頁JS檔-->
<script type="text/javascript" src="js/ui.datepicker.js"></script>
<script type="text/javascript" src="js/index_js.js"></script>
<script>  
	function AutoScroll(obj){
        $(obj).find("ul:first").animate({ marginTop:"-25px" },500,function(){
                $(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
        });
}

   $(document).ready(function()
				{
				
					//$('#rightBox').floating({targetX:'right', targetY:'top'});		
					//$('#leftBox').floating({targetX:'left', targetY:'bottom'});		
					
					// setInterval('AutoScroll("#scrollDiv")',3000)
				}
				  
			);
 function mpa_ser(){
	
//if($("[id='mtype'][checked]") || $("[id='mplace'][checked]") || $("[id='maname'][checked]") ||  $("[id='maadd'][checked]") || $("[id='madate'][checked]"))	{
if($('#mtype').is(':checked')|| $('#maname').is(':checked')  ||  $('#maadd').is(':checked') || $('#madate').is(':checked') )	{	
	return true;
	}else
	{
	alert("請選擇分類")
		return false;
	}
	
	
}
    
 </script>  