require_once "common.php";
$mc = $_REQUEST['mc'];
$sc = $_REQUEST['sc'];
$smc = "";
$ssc = "";
include_once "functions.php";
?>
include "../rcontrol/config.php";
include "../rcommon/functions.php";
include "../rcommon/stripallslashes.php";
include "../rcommon/database.php";
//check if the user has already logged on
/*
$result = mysql_db_query($DATABASE, "SELECT memberlogin FROM logger WHERE abc='$abc'");
if(mysql_error()) error("Unexpected Error !!");
$count = mysql_num_rows($result);
if ($count==0)
{
$go = urlencode("!relibrary/industryevents~");
Header ("Location: ../ruser/index.php?go=$go");
exit;
}
$login = stripslashes(mysql_result($result,0,0));
*/
// making the sql statement
$sql = "";
// the month variable
if(!$month) $month = date("Ym", time());
if($month!="null") $sql .= " AND (substring(startdate,1,6)=$month OR substring(enddate,1,6)=$month)";
// the country variable
if($country) $sql .=" AND (country='".d_($country)."') ";
// the keywords variable
$eachkeyword = explode(" ",$keywords);
$keywordcount = count($eachkeyword);
if($keywords)
{
for($i=0;$i<$keywordcount;$i++)
{
if($eachkeyword[$i])
{
$sql .= " AND (title like '".d_($eachkeyword[$i])."%' OR title like '% ".d_($eachkeyword[$i])."%' OR ";
$sql .= " about like '".d_($eachkeyword[$i])."%' OR about like '% ".d_($eachkeyword[$i])."%' OR ";
$sql .= " location like '".d_($eachkeyword[$i])."%' OR location like '% ".d_($eachkeyword[$i])."%')";
}
}
}
$cdate=date('Ymd');
// finalizing the sql
$id = $_GET['id'];
if ($id != null ){
if($sql) $sql = "WHERE ".substr($sql,4). " ORDER BY startdate ASC limit 1";
else $sql = "ORDER BY startdate desc LIMIT 1";
$sqlfinal = "SELECT * FROM industryevent WHERE id = $id";
}
else{
if($sql) $sql = "WHERE ".substr($sql,4). " ORDER BY startdate ASC";
else $sql = "ORDER BY startdate desc LIMIT 20";
$sqlfinal = "SELECT * FROM industryevent $sql";
}
$sqlfinal = "SELECT * FROM industryevent $sql";
$result=mysql_db_query($DATABASE, $sqlfinal);
$count=mysql_num_rows($result);
if($count!=0)
{
while($row=mysql_fetch_row($result))
{
$startdate = date("d M Y", mysqltime_to_mktime(stripslashes($row[1])));
$enddate = date("d M Y", mysqltime_to_mktime(stripslashes($row[2])));
$title = h_(strtoupper(stripslashes($row[3])));
$about = nl2br(h_(stripslashes($row[4])));
if($about=="null") $about="";
$location = h_(stripslashes($row[5]));
if($location=="null") $location="";
$country = h_(stripslashes($row[6]));
$url = h_(stripslashes($row[7]));
if($url=="null") $url="";
$image = h_(stripslashes($row[8]));
if($image!="null") $image="";
else $image="";
$displayeventnow .="