Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 3.147.103.33
<?php
global $mysql_link;
//Get the season's structure
$struct = struct_get_tree($mysql_link, $_GET['sys_date'], $_GET['sys_date']);
//Function that draws the items in the data passed according to type of node
function site_draw_struct($data, $superior_type, $display_team_links) {
$rowidx = $cellidx = 0;
foreach($data as $keyname => $struct_node) {
//Testing
//Only draw nodes that are inferior in type to the one that called them (can't display a conference in a division or division in a team)
if(isset($struct_node['sys_struct_data']['struct_type']) && $struct_node['sys_struct_data']['struct_type'] > $superior_type) {
//Select the draw type
if($struct_node['sys_struct_data']['struct_type'] == STRUCT_LIGUE_CONF_NODE) {
if($cellidx < count($data)-3) {
$addedstyles = 'border-right: 1px solid #546085';
}
else { $addedstyles = ''; }
$table[$rowidx+0][$cellidx] .= '<TD align="center" class="blackText12px"><B>';
$table[$rowidx+0][$cellidx] .= $struct_node['sys_struct_data']['struct_nodename_fr'];
$table[$rowidx+0][$cellidx] .= '</B></TD>';
$table[$rowidx+1][$cellidx] .= '<TD valign="top" class="blackText12px" style="padding: 3px 0px 3px 0px;">';
$table[$rowidx+1][$cellidx] .= '<img src="/images/nouvelles/simplelignes.gif" width="100%" height="3">';
$table[$rowidx+1][$cellidx] .= '</TD>';
$table[$rowidx+2][$cellidx] .= '<TD valign="top" style="'.$addedstyles.'" class="blackText12px">';
$table[$rowidx+2][$cellidx] .= site_draw_struct($struct_node, $data['sys_struct_data']['struct_type'], $display_team_links);
$table[$rowidx+2][$cellidx] .= '</TD>';
$cellidx++;
}
else if($struct_node['sys_struct_data']['struct_type'] == STRUCT_LIGUE_DIV_NODE) {
if($cellidx < count($data)-3) {
$addedstyles = 'border-right: 1px solid #CCCCCC';
}
else { $addedstyles = ''; }
$table[$rowidx+0][$cellidx] .= '<TD align="center" class="blackText12px">';
$table[$rowidx+0][$cellidx] .= $struct_node['sys_struct_data']['struct_nodename_fr'];
$table[$rowidx+0][$cellidx] .= '</TD>';
$table[$rowidx+1][$cellidx] .= '<TD valign="top" class="blackText12px" style="padding: 3px 0px 3px 0px;">';
$table[$rowidx+1][$cellidx] .= '<img src="/images/nouvelles/simplelignes.gif" width="100%" height="3">';
$table[$rowidx+1][$cellidx] .= '</TD>';
$table[$rowidx+2][$cellidx] .= '<TD valign="top" style="'.$addedstyles.'" class="blackText12px">';
$table[$rowidx+2][$cellidx] .= site_draw_struct($struct_node, $data['sys_struct_data']['struct_type'], $display_team_links);
$table[$rowidx+2][$cellidx] .= '</TD>';
$cellidx++;
}
else if($struct_node['sys_struct_data']['struct_type'] == STRUCT_LIGUE_TEAM_NODE) {
if($rowidx < count($data)-3) {
$addedstyles = 'border-bottom: 1px solid #CCCCCC';
}
else { $addedstyles = ''; }
$table[$rowidx][$cellidx] .= '<TD align="center" valign="top" style="padding: 5px; height: 75px; '.$addedstyles.'" class="blackText9px">';
$table[$rowidx][$cellidx] .= '<A href="main.php?ltab=options&rtab=teamlist&histo_directdata='.$struct_node['sys_node_data']['hist_parent'].'&sys_date='.$_GET['sys_date'].'" class="lnkBase11px">';
$table[$rowidx][$cellidx] .= '<B>';
$table[$rowidx][$cellidx] .= '<IMG src="'.$struct_node['sys_node_data']['hist_pic56x62'].'" border="0" align="left">';
$table[$rowidx][$cellidx] .= '<BR>'.$struct_node['sys_node_data']['hist_name'];
$table[$rowidx][$cellidx] .= '<BR>'.$struct_node['sys_node_data']['hist_city'];
$table[$rowidx][$cellidx] .= '</B>';
$table[$rowidx][$cellidx] .= '</A>';
$table[$rowidx][$cellidx] .= '</TD>';
$rowidx++;
}
}
else if($keyname != 'sys_node_data' && $keyname != 'sys_struct_data') {
trigger_error('Fatal error, got a sub node which matched a higher or equal type than its top node. Superior type = '.$superior_type.' and node type = '.$struct_node['sys_struct_data']['struct_type']);
}
}
//Build the final table
$html_fb .= '<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">';
if(isset($table) && is_array($table)) {
foreach($table as $row) {
$html_fb .= '<TR>';
foreach($row as $cell) {
$html_fb .= $cell;
}
$html_fb .= '</TR>';
}
}
$html_fb .= '</TABLE>';
return $html_fb;
}
?>
<TABLE width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
<TR>
<TD>
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%">
<?php foreach($struct as $league_struct) { ?>
<TR>
<TD class="whiteText12px" bgcolor="#546085" style="padding: 2px 5px 2px 5px"><B><?php echo $league_struct['sys_node_data']['description_fr']; ?></B></TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD>
<?php echo site_draw_struct($league_struct, -1, false); ?>
</TD>
</TR>
<?php } ?>
</TABLE>
</TD>
</TR>
</TABLE>
|