All pastes #755252 Raw Edit

schedule_calib0rx

public text v1 · immutable
#755252 ·published 2007-10-30 16:14 UTC
rendered paste body
function create_schedule_main($type, $limit)
{
  switch($type)
    {
      case "nascar": $sql = "SELECT id, DATE_FORMAT( date,  '%m.%d.%y' ) AS date, series, race, race_href, track, track_href, location FROM schedule WHERE CURRENT_DATE()  <= date AND series='nascar' ORDER BY schedule.date ASC LIMIT $limit";
      break;
    }
  $ret = db_query($sql);
  $schedule = '';
  while (($row = mysql_fetch_array($ret)) !== FALSE) 
    { 
       {
          $schedulemain['ID']   = $row['id'];
          $schedulemain['DATE'] = $row['date'];
          if(strlen(trim($row['race_href']))) {
              $schedulemain['RACE'] = "<a href="$row['race_href']" target=\"_blank\">"$row['race']"</a>";
          } else {
              $schedulemain['RACE'] = $row['race'];
          }
          $schedulemain['LOCATION'] = $row['location'];
       }
       $schedule .= template('/schedule/row.tpl', $schedulemain, 1);
    }
  return $schedule;
}