0)) { // $query=$_SERVER['QUERY_STRING']; $ref=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; header("location: /eagritrader/login/login.php?referer=$ref"); exit; }*/ //require_once("../phplib/alteon.php"); /* */ /* $pos = strstr($subs_opt, $comid); if(($pos===false) || ($pos=="") || ($pos==0)) { header("location: /eagritrader/login/errorlogin.php"); exit; } */ require_once("phplib/db_mysql_eagri.php"); $q=new DB_Sql(); //echo "COM:".$cid; //exit; /////////chk subscription if($cid==0 || $cid==""){ $sql="select commodityid from CommodityMaster where active='T'"; $q->query($sql); while($q->next_record()) { if($m_comsub == "") $m_comsub = $q->f("commodityid"); else $m_comsub = $m_comsub . "," . $q->f("commodityid"); } } else{ $m_comsub=$cid; } /*if($cid <> 0 and $cid <> "") $m_comfilter = " where commodityid = " . $cid; $sql = "select distinct commodityid from UserOptions" . $m_comfilter; $q->query($sql); while($q->next_record()) { if($m_comsub == "") $m_comsub = $q->f("commodityid"); else $m_comsub = $m_comsub . "," . $q->f("commodityid"); }*/ //echo $sql; //echo "
" . $m_comsub; /*if($m_comsub == "") { header("location: /eagritrader/login/errorlogin.php"); exit; }*/ //////////// end of chk subscription $commname = "Home"; if($cid <> 0 and $cid <> "") { $sql = "select commodityname from CommodityMaster where commodityid = " . $cid; $q->query($sql); $q->next_record(); $commname = $q->f("commodityname"); } if($varid <> 0 and $varid <> "") { $sql = "select varietyname from VarietyMaster where varietyid = " . $varid; $q->query($sql); $q->next_record(); $varname = " > " . $q->f("varietyname"); } ?>
     Exchange Watch  ".$image2.""; $common_lhs.=join(" ", file("http://127.0.0.1/eagritrader/home_exchange_menu.php")); $common_lhs.=""; $common_top=join(" ", file("http://127.0.0.1/eagritrader/home_menu.php?cid=1")); $more_resources=join(" ", file("http://127.0.0.1/eagritrader/common/more_resources.php?cid=$cid")); $common_footer=join(" ", file("http://127.0.0.1/eagritrader/common/footer.php")); ?> commoditiescontrol.com - Home
     More Resources
eAgritrader.com - Newsquery($sql); while($q->next_record()) { $commid.="|".$q->f("CommodityId"); } $commid=$commid."|"; $msgpg = 12; $m_cid = $cid; if ($m_cid == "") $m_filter = ""; else if($m_cid==0 || $m_cid=="") { //$m_filter = " where commodityid is not null"; $m_filter = " where active = 1 $online and commodityid in (" . $m_comsub . ")"; } else { //$m_filter = " where commodityid = " . $m_cid; $m_filter = " where active = 1 $online and commodityid in (" . $m_comsub . ")"; if ($varid<>0 and $varid<>"") $m_filter = $m_filter . " and varietyid like '%" . $varid . ",%'"; else { $sql = "SELECT CommodityMaster.CommodityId, CommodityMaster.CommodityName, VarietyMaster.VarietyID, VarietyMaster.VarietyName, UserOptions.UserID FROM UserOptions INNER JOIN CommodityMaster ON (UserOptions.CommodityID = CommodityMaster.CommodityId) INNER JOIN VarietyMaster ON (UserOptions.VarietyId = VarietyMaster.VarietyID) WHERE (UserOptions.UserID = $userid) AND (UserOptions.Active = 'T') AND (UserOptions.EndDate >= now()) AND CommodityMaster.CommodityId = $cid group by CommodityMaster.CommodityId, CommodityMaster.CommodityName, VarietyMaster.VarietyID, VarietyMaster.VarietyName, UserOptions.UserID"; $subvarid = ""; $m_varfilter = ""; $q->query($sql); while($q->next_record()) { $subvarid = $q->f("VarietyID"); if($m_varfilter == "") $m_varfilter = " AND (varietyid like '%" . $subvarid . ",%'"; else $m_varfilter = $m_varfilter . " or varietyid like '%" . $subvarid . ",%'"; } if($m_varfilter){ $m_filter = $m_filter . $m_varfilter.")"; } } } //if ($varid<>0 and $varid<>"") // $m_filter = $m_filter . " and varietyid like '%" . $varid . ",%'"; if ($page == 0) $m_all = ""; else $m_all = "limit " . $page * $msgpg; if($m_type=="DJN"){ $sql = "select count(*) cnt from " . $m_table . " where commodityid in (".$m_comsub.")"; } else{ $sql = "select count(*) cnt from " . $m_table . " " . $m_filter; } //echo $sql; $q->query($sql); $q->next_record(); $m_totalmsg=$q->f("cnt"); $m_str = "
"; $ctr = 0; $m_msgpg = $msgpg; $m_page = $page; $m_start = ($m_page - 1) * $m_msgpg; $m_end = $m_start + $m_msgpg; $m_msgctr = 0; //echo "CTR:" . $m_start . " : " . $m_end; if($m_type=="DJN"){ $sql = "Select itemid, caption, substring(entrydate,1,16),subheading, entrydate, varietyid, commodityid From " . $m_table . " where active = 1 and commodityid in (" . $m_comsub . ") order by entrydate desc " . $m_all; $q->query($sql); } else if($m_type=="TRA"){ $sql = "Select itemid, caption, substring(entrydate,1,16), entrydate, varietyid, commodityid From " . $m_table . " where active = 1 $online and commodityid in (" . $m_comsub . ") order by entrydate desc " . $m_all; $q->query($sql); } else if($m_type=="BRK"){ $sql = "Select id as itemid, caption,brocker, substring(posteddate,1,16) entrydate, commodityid From " . $m_table . " where commodityid in (" . $m_comsub . ") order by entrydate desc " . $m_all; $q->query($sql); } else{ $sql = "Select itemid, caption, substring(entrydate,1,16),subheading, entrydate, varietyid, commodityid From " . $m_table . " " . $m_filter . " order by entrydate desc " . $m_all; $q->query($sql); } //echo $sql; while($q->next_record()) { $itemid=$q->f("itemid"); $caption=$q->f("caption"); if(strlen($caption) >= 60) $caption = substr($caption,0,60)."..."; $entrydate=$q->f("entrydate"); //$news_date = substr($entrydate,9,2)."/".substr($entrydate,7,2)." ".substr($entrydate,12,5); $news_date = $entrydate; $varietyid=$q->f("varietyid"); $commodityid=$q->f("commodityid"); $brkid=$q->f("brocker"); //if($commodityid==8){ // $commodityid=1; //} /*$image=""; if(!preg_match("/\|$commodityid\|/",$commid) && ($m_type=="DJN" || $m_type=="SPR")){ $image=""; }*/ //if(preg_match( $dt_width = "23%"; $news_width = "75%"; $dt = date("d/m/y H:i",strtotime($news_date)); if ($ctr >= $m_start) { if($m_type=="WPN" && $q->f("subheading")!=""){ $m_str = $m_str . ""; }else if($m_type=="BRK" && $q->f("caption")!="") { $m_str = $m_str . ""; } else { $m_str = $m_str . ""; } } $m_msgctr = $m_msgctr + 1; $ctr = $ctr + 1; //if ($m_msgctr == $m_msgpg && $m_page > 0) if($ctr >= $m_end) break; } if ($m_msgctr > 0 && $m_all <> "") { //m_str = m_str & "" } else if($m_msgctr == 0) { $m_str = $m_str . ""; } if ($m_totalmsg > 0) { $m_str = $m_str . ""; } $m_str = $m_str . "
".$m_gif."
". $dt ."f("subheading")."\" target=\"_blank\" class=text >" . $caption . "
". $dt ."" . $caption . " ".$image."
". $dt ."" . $caption . " ".$image."
No important news available.
Page: "; $m_pgno = 1; for ($ctr = 1; $ctr<=$m_totalmsg; $ctr+=$m_msgpg) { if ($m_page == $m_pgno) $m_str = $m_str . "" . $m_pgno . " | "; else $m_str = $m_str . "" . $m_bold . $m_pgno . $m_bolde . " | "; $m_pgno = $m_pgno + 1; if($m_pgno > 25) break; } $m_str = $m_str . "
"; //$q->close_connection(); echo $m_str; ?>