query($sql); $cnt=0; $tot_rec = $q1->num_rows(); if($tot_rec>0){ while ($q1->next_record()) { $scid = $q1->f("sc_scid"); $heading = $q1->f("heading"); $summary = $q1->f("summary"); $news_date = $q1->f("show_date"); $category = $q1->f("category"); $ent_date = $q1->f("ent_date"); $msg_dat=substr($ent_date,0,10); $msg_yr=substr($ent_date,0,4); $curr_dat=date("Y-m-d"); $curr_yr=date("Y"); if($curr_dat!=$msg_dat) { $date_all = explode(" ",$ent_date); $time_xpld = explode(":",$date_all[1]); $date_xpld = explode("-",$date_all[0]); if($curr_yr==$msg_yr) { $filing_dt = date("g.i A M jS", mktime($time_xpld[0], $time_xpld[1], 0, $date_xpld[1], $date_xpld[2], $date_xpld[0])); } else { $filing_dt = date("g.i A M jS Y", mktime($time_xpld[0], $time_xpld[1], 0, $date_xpld[1], $date_xpld[2], $date_xpld[0])); } } else { $filing_dt ="about ". dateTimeDiff($ent_date)." ago"; } if ($category=="Insider - Rumour Mills") { $display_category="Heard on the Street"; $disc_all="NOTE: Information displayed on the section - Heard On The Street - has not been provided to the stock exchanges, and is source-based."; } else if ($category=="CNBC Desk - Spotlight") { $display_category="Stock Signs"; $google_cha="8411011385"; $disc_all=""; } else if ($category=="News you can use") { $display_category="News"; $google_cha="8313235316"; $disc_all=""; } else if ($category=="Instant Impact") { $display_category="Stock Impact"; $google_cha="1630952773"; $disc_all=""; } else if ($category=="Market Talk") { $display_category="Market Talk"; $disc_all=""; } if ($scid != "") { $stock_det = explode("|", stock_price($scid,"BSE","split_big","1")); $disp_comp_name = $stock_det[0]; $disp_comp_price = $stock_det[1]; $stockprice = join(" ", file("/home/mc_poweryourtrade/plus/cptmarket/stockprice.php?scid=$scid")); } $cnt++; } }else{ //no records } ?>