query($sql);
$numOfResult = mysql_num_rows($rs);
if($numOfResult>0){
while($row=$db->fetch_array($rs)){
if(!isset($id)){
header("location:./".$page_address."?id=".$row["id"]);
exit;
}
$event_list.='
'.$row["date"].' | '.$row["name"].'';
}
}
$sql = "SELECT * FROM event WHERE id=".$id;
$rs = $db->query($sql);
$numOfResult = mysql_num_rows($rs);
if($numOfResult>0)
{
$row = $db->fetch_array($rs);
$event_name = $row["name"];
$event_desc = $row["desc"];
}
$sql = "SELECT * FROM event_element";
$sql.= " LEFT JOIN attachment ON table_name='event_element'";
$sql.= " AND table_id=event_element.id";
$sql.= " AND (col_name='eventphoto' OR col_name='eventvideo')";
$sql.= " WHERE event_element.element_id=".$id;
$sql_limit = " LIMIT ".$sql_start_pos.", 6";
$rs = $db->query($sql.$sql_limit);
$numOfResult = mysql_num_rows($rs);
if($numOfResult>0)
{
while($row=$db->fetch_array($rs)){
if($row["isvideo"]==0){
$event_thumb .='
';
}
else
{
$event_thumb .='
';
}
}
}
//page
$rs = $db->query($sql);
$total = mysql_num_rows($rs);
$multipage = new MultiPage();
$multipage->total = $total;
$multipage->perpage = 6;
$multipage->maxpage = 5;
$multipage->offset = 6;
$multipage->curr_page = $page;
$pagelists = $multipage->getpagelist();
$myval = "";
foreach($_GET as $key => $value) {
if ($key != "page")
$myval .= "&".$key."=".$value;
}
$pagelist = "";
//page list
for ($i=0;$i ";
} else {
$pagelist .= ''.$pagelists[$i].' ';
}
}
//prev page
if ($multipage->getprev() != "") {
$prevpage = ' < ';
} else {
$prevpage = ' < ';
}
//next page
if ($multipage->getnext() != "") {
$nextpage = ' > ';
} else {
$nextpage = ' > ';
}
//total page
$totalpage = $multipage->gettotal();
if($pagelist==""){
$pagelist = "1";
}
$fullpagelist = $prevpage." ".$pagelist." ".$nextpage;
$pageofpage = "Page ".$page." of ".$totalpage."";
$numofrecords = "".$total." Record(s).";
?>
Natural Music Center:活動花絮
=$event_thumb?>
=$fullpagelist?>
=$event_name?>
=$event_desc?>