$headBuy($var1)  Sell($var2)
"; else: $prt = "

$head

$var1

$var2

"; endif; $matter = $origmat.$prt; endif; }; function tradingcheckemptyvarhtmrtnrowdtl( $head,$var1,$var2,&$matter,$id ,$arg,$tradeid) { #if ($var1 != ""): $origmat = $matter; if ($arg == '_self'): $finaldest=urlencode('http://www.indianmetals.com/trading/trading.php?for=Respond&state=Respond&tradeid='.$tradeid.'&respondtotradeid[0]='.$tradeid); $prt = "$head
"; else: $prt = "

$head

$var1

$var2

"; endif; $matter = $origmat.$prt; #endif; }; function currlist($arg){ if ($arg == '_blank'): $currlisting = ""; endif; $currlisting=$currlisting."

  Trade Listings     
"; #tradingcheckemptyvarhtmrtnrow("Date ",$date,$currlisting); $stmt="select id,name from grouping order by id"; $resultstmt=mysql_query($stmt); $totid=mysql_numrows($resultstmt); $ctr=0; $i=0; $i = 1; while ($i < 13): $id = mysql_result($resultstmt,$ctr,"id"); $name = mysql_result($resultstmt,$ctr,"name"); $tottradestmt="select count(*) as total from tradingn where groupid=$id and buysell = 1"; $resulttottradestmt = mysql_query($tottradestmt); $resulttottradestmttot= mysql_numrows($resulttottradestmt); if ($resulttottradestmttot > 0): $buytotal = mysql_result($resulttottradestmt,0,"total"); endif; $tottradestmt="select count(*) as total from tradingn where groupid=$id and buysell = 2"; $resulttottradestmt = mysql_query($tottradestmt); $resulttottradestmttot= mysql_numrows($resulttottradestmt); if ($resulttottradestmttot > 0): $selltotal = mysql_result($resulttottradestmt,0,"total"); endif; if (strlen($name) > 16): $name = substr($name,0,12)."..."; endif; tradingcheckemptyvarhtmrtnrow("$name ",$buytotal,$selltotal,$currlisting,$id,$arg); ///// $currliststmt="select tradeid,item,buysell from tradingn where groupid=$id and verified=1 ORDER BY date DESC LIMIT 5"; $currlistresultstmt=mysql_query($currliststmt); $currlisttotid=mysql_numrows($currlistresultstmt); $currlistctr=0; $currlisti=0; $currlisti = 1; while ($currlistctr < $currlisttotid): $tradedid = mysql_result($currlistresultstmt,$currlistctr,"tradeid"); $item = mysql_result($currlistresultstmt,$currlistctr,"item"); $buysell= mysql_result($currlistresultstmt,$currlistctr,"buysell"); if (strlen($item) > 15): $item = substr($item,0,20)."..."; endif; #tradingcheckemptyvarhtmrtnrow("$name ",$buytotal,$selltotal,$currlisting,$id,$arg); $b=''; $s=''; if ($buysell == 1): $disbuysell ="[Buy] "; elseif ($buysell == 2): $disbuysell ="[Sell] "; endif; tradingcheckemptyvarhtmrtnrowdtl($disbuysell."$item ",$b,$s,$currlisting,$id,$arg,$tradedid); #echo $item."
"; $currlistctr++ ; $currlisti++; endwhile; ///// $ctr = $ctr + 1; $i++; endwhile; $currlisting=$currlisting."


"; return $currlisting; }; ?> IndianMetals.com | Headlines