RCDRL Classes

[insert_php]

$showDivision=1;

$clubList=array(‘1’=>’RCDRL Texas’,’2’=>’RCDRL California’,’3’=>’RCDRL Louisiana’);$levelNeeded=0;

$mainCol=null;
$page_title=’Class Information’;
$RNA=null;

$currentSeasonA=mysql_fetch_array(@mysql_query(“SELECT season from rcdrlc5_dragtrac.event where season>’2000′ order by season desc limit 1”));
$currentSeason=$todayyear=$currentSeasonA[0];
$currentSeason=$userSeason;

$titleRow=’


Class
Type

Qual Runs
Active Class
Current Champ
Track Record
Record Holder – Date Set

‘;

foreach ($clubList as $key => $value)
{
$leftCol.=”$value

“;
$mainCol.=”
$value
“;
$query=”SELECT className, classType,maxQualified,qualifyingRuns,activeClass,clubRecord, date_format(dateRecordSet,’%m/%d/%y’),classNumber,recordHeldBy, prevYearChamp, laneChoiceBy, qualPointsBy,qualPositionBy, bonusSetTime from rcdrlc5_dragtrac.class where clubNumber=’$key’ and activeClass=’Y’ order by activeClass desc,className”;
$result=@mysql_query ($query);
$num=mysql_num_rows($result);
if ($num >0)
{
$mainCol.=$titleRow;
while ($row=mysql_fetch_array($result,MYSQL_NUM))
{ $classTypeA[$row[7]]=$row[1];
if ($row[1]==’B’) {$row[1]=’Bracket’;$row[5]=’-‘;$row[6]=null;} elseif ($row[1]==’H’) { $row[1]=’H2H’;}
$heldBy=$row[8];$champ=$row[9];

if (!isset($RNA[$heldBy])) { $rnaArray=mysql_fetch_array(@mysql_query(“SELECT racerFirst,racerLast from rcdrlc5_dragtrac.racers where racerNumber=’$heldBy’ limit 1″)); $RNA[$heldBy]=”$rnaArray[0] $rnaArray[1]”;}

if (!isset($RNA[$champ])) { $rnaArray=mysql_fetch_array(@mysql_query(“SELECT racerFirst,racerLast from rcdrlc5_dragtrac.racers where racerNumber=’$champ’ limit 1″)); $RNA[$champ]=”$rnaArray[0] $rnaArray[1]”;}

if ($row[12]==’E’) { $row[12]=’ET’;} if ($row[12]==’R’) { $row[12]=’RT’;} if ($row[12]==’D’) { $row[12]=’Dial’;} // Qual Pos By
if ($row[10]==’E’) { $row[10]=’ET’;} if ($row[10]==’R’) { $row[10]=’RT’;} if ($row[10]==’D’) { $row[10]=’Dial’;} // LaneChoice By
if ($row[13]==’Q’) { $row[13]=’Qual Pos’;} if ($row[13]==’R’) { $row[13]=”R1 $row[11]T”;} // qual points time

if ($row[1]==’H2H’) { $recordHolder=”
Record Holder:
$RNA[$heldBy]
$row[5] – $row[6]
“;} else { $recordHolder=”;}

$rInfo[$row[7]]=”

  $clubList[$key]    
      $row[0]$row[2]$row[3]$row[12]$row[10]$row[13]$RNA[$champ]$row[5]$RNA[$heldBy]
$row[6]

“;

$vertStyle[$row[7]]=’‘.$clubList[$key].’
‘.”$row[0]
Max Field: $row[2]
Qual Rounds: $row[3]
Qual Pos By: $row[12]
Lane Choice By: $row[10]
Bonus Points: $row[13]

Current Champ:
$RNA[$champ]
$recordHolder”.’‘;

} //end of while
} //end of if num>0
$mainCol.=’
‘;

} //end of foreach

$leftCol.=’Class Rules/Directory
‘;

$leftCol=null;

$recordTableHeader=’

Division
Class NameMax
FieldQual
RdsQual
ByLane
ChoiceBonus
PtsCurrent ChampDivision
RecordRecord Holder
Date Set

‘;

## Figure and show overall Directory, Rules, Notables
$query=”SELECT cdNumber,className,rules,numberMatrix,activeIn from rcdrlc5_dragtrac.classDirectory order by className asc”;
$result=@mysql_query($query);
$num=mysql_num_rows($result);
if ($num >0)
{ $mainCol2=’
‘;
while ($row=mysql_fetch_array($result,MYSQL_NUM))
{
$activeInArray= explode(‘|’,”$row[4]” );
$matrix= explode(‘|’, “$row[3]” );

$classShortcut.=’‘.”$row[1]“;

$classForType=$matrix[0];
$classType=$classTypeA[$classForType];

$mainCol2.=”
$row[1]
Official in:
“;
foreach ($matrix as $value)
{ $officialA=mysql_fetch_array(mysql_query(“SELECT officialYears,clubNumber,classType from rcdrlc5_dragtrac.class where classNumber=’$value’ limit 1”));
if (strpos($officialA[0],$todayyear)!==FALSE) { $mainCol2.= ‘ ‘.$clubList[$officialA[1]].’       ‘;}

}

$mainCol2.= “

$row[2]

“;

$findClasses=null; $ThisSeason=null;$AllTime=null;$EAllTime=null;$EThisSeason=null; $showRecords=null;$showVertStyle=null;
unset($classTop); unset($seasonTop); unset ($EclassTop); unset($EseasonTop);

foreach($matrix as $value) { $findClasses.=” or classNumber=’$value’ “; $showRecords.=$rInfo[$value]; $showVertStyle.=$vertStyle[$value];}
$findClasses=substr($findClasses,3);

$topQuery=”SELECT racerNumber,season,eventNumber from rcdrlc5_dragtrac.races where status=’W’ and ( $findClasses) and round>’R0′”;
$topResult=@mysql_query($topQuery); $topNum=mysql_num_rows($topResult);
if ($topNum>0)
{ while ($topRow=mysql_fetch_array($topResult,MYsql_NUM))
{ $classTop[$topRow[0]]++; if ($currentSeason==$topRow[1]) { $seasonTop[$topRow[0]]++; } $eSeason[$topRow[2]]=$topRow[1];}
}

$EtopQuery=”SELECT racerNumber,eventNumber from rcdrlc5_dragtrac.classEntrys where outcome=’W’ and currentRound=’FIN’ and ($findClasses)”;
$EtopResult=@mysql_query($EtopQuery); $EtopNum=mysql_num_rows($EtopResult);
if ($EtopNum>0)
{ while ($EtopRow=mysql_fetch_array($EtopResult,MYsql_NUM))
{ $EclassTop[$EtopRow[0]]++; if ($eSeason[$EtopRow[1]]==$currentSeason) { $EseasonTop[$EtopRow[0]]++; } }
}

$mainCol2.=’‘;

#$mainCol2.=”\n
$showVertStyle\n
\n
“;
$mainCol2.=’


‘;

}
}

echo $classShortcut.’

‘;

echo ‘Class Information & Rules
(check Rulebook for any changes)
For more detailed information including track records, field sizes, and current Champs, check DragTrac.com
If a class is listed as official within a division, that championship points are awarded at each points event and a season champion will be recognized.
‘;

echo $mainCol2;

[/insert_php]

Web Statistics