AlaK4X
Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64



Your IP : 18.117.94.221


Current Path : /var/www/lhjmq-records.qc.ca/public_html/lang_en/teams/
Upload File :
Current File : /var/www/lhjmq-records.qc.ca/public_html/lang_en/teams/teamstats.php

<?php

	$str_url = $_SERVER["SCRIPT_NAME"];
	$server_name = $_SERVER['SERVER_NAME'];
	$xsl_record_call = '';

	if($str_url)
		$str_lang = strpos($str_url, 'lang_fr') ? 'fr' : 'en';
	else
		$str_lang = 'fr';


	if(isset($_REQUEST['status_type']))
	{
		$status_type_path = 'status_' . $_REQUEST['status_type'] . '/';
	}
	else
	{
		$status_type_path = 'status_1/';
	}


	if (isset($_GET['currentseason']) && $_GET['currentseason'] != ""){
		$season = season_get($mysql_link, $_GET['currentseason']);
	}
	else
	{
		//Get the current season
		$season = season_get_current_customize($mysql_link);
	}

	$temp_season_id = mysql_fetch_assoc(mysql_query($sql = "SELECT date_start FROM seasons WHERE id = " . $season['id'] . "", $mysql_link));

	$temp_var = explode("-", $temp_season_id[date_start]);
	$season_id = $temp_var[0];

	$season_xml_file_name = $status_type_path . $_GET['id_equipe'] . '.xml';
	$xml_file_name = $season_id . "/" . $status_type_path . $_GET['id_equipe'] . '.xml';
	$team_xml_file_stats_selection = file_exists('../xsl/teams_stats/stats/match/' . $xml_file_name) ? $xml_file_name : 'default.xml';
	$team_xml_file_tab02_selection = file_exists('../xsl/teams_stats/stats/byseasons/' . $season_xml_file_name) ? $season_xml_file_name : 'false';

	echo '<script>
			var default_currentseason = \'' . $_GET['currentseason'] . '\';
			var default_xml_file = \'' . $team_xml_file_stats_selection . '\';
			var selected_tabs = \'\';
		 </script>';

	//$player_xml_file_records_selection = file_exists('../xsl/players_stats/record/all/' . $xml_file_name) ? $xml_file_name : 'default.xml';
	//$player_xml_file_records_tab02_selection = file_exists('../xsl/players_stats/record/his/' . $xml_file_name) ? $xml_file_name : 'false';

	if (isset($_GET['currentseason']) && $_GET['currentseason'] != ""){
		$season = season_get($mysql_link, $_GET['currentseason']);
		//Get the team data
		$equipe = team_get_data($mysql_link, $id_equipe, $season['date_start']);
		$nearest_reg_season = $season;
		$id_reg_saison = $_GET['currentseason'];
		$nearest_pyf_season = playoff_get($mysql_link, $season['date_start'], $season['date_end']);
		$id_pyf_saison = $nearest_pyf_season['id'];

	}
	else
	{
		//Nearest regular season
		$seasons = season_list_customize($mysql_link, SEASON_TYPE_REG, 'DESC');
		$keys = array_keys($seasons);
		$id_reg_saison = $keys[0];
		$nearest_reg_season = $seasons[$id_reg_saison];
		//Nearest regular season
		$seasons = season_list_customize($mysql_link, SEASON_TYPE_PYF, 'DESC');
		$keys = array_keys($seasons);
		$id_pyf_saison = $keys[0];
		$nearest_pyf_season = $seasons[$id_pyf_saison];
		//Get the team data
		$equipe = team_get_data($mysql_link, $id_equipe, date('Y-m-d'));
	}

	$franchiseasons = @mysql_query($sql = "SELECT year(sys_date) AS franc_year FROM equipes_hist WHERE hist_parent = '".$id_equipe."' GROUP BY year( sys_date )", $mysql_link);
	$countfranchiseid = 0;
	while ($franchiseason = @mysql_fetch_assoc($franchiseasons))
	{
		if ($countfranchiseid == 0)
		{
			$first_franchise_year = $franchiseason['franc_year'];
		}

		$last_franchise_year = $franchiseason['franc_year'];

		$countfranchiseid = $countfranchiseid + 1;
	}

	//echo $first_franchise_year . "<br>" . $last_franchise_year."<br>";

	$franchisids = @mysql_query($sql = "SELECT id, date_start, date_end FROM seasons WHERE season_type = 1 AND date_start >= '" . $first_franchise_year . "-06-01' AND date_start <= '" . ($last_franchise_year + 1) . "-06-01'", $mysql_link);



	$showcheckplayers = "false";

	$check_season_id = season_get_current_customize($mysql_link);

	if ($season['id'] == $check_season_id['id'] ){
		$showcheckplayers = "true";
	}

?>

<link href="../css/tabpane.css" rel="stylesheet" type="text/css">
<script src="../scripts/tabpane_mini.js" type="text/javascript"></script>
<script src="../xsl/js/_functions00.js" type="text/javascript"></script>


<?php
	echo '<script>
		window.onload = function()
		{

			if(document.getElementById("team_spec"))
			{
				/*
				if(readCookie("selected_tabs"))
					selected_tabs = readCookie("selected_tabs");
				else
					selected_tabs = 0;
				*/

				load_and_transform(\'../xsl/teams_stats/xml/root.xml\', \'../xsl/teams_stats/xsl/stats.xsl\', \'stats\', {xml_file_name: \'' . $team_xml_file_stats_selection . '\', lang: \'' . $str_lang . '\', tab02:\'' . $team_xml_file_tab02_selection . '\', id_num: \'0\', status_type: \'' . $status_type_path . '\', seasonsid: \'123456\', id_equipe: \'' . $_REQUEST['id_equipe'] . '\', currentseason: \'' . $_REQUEST['currentseason'] . '\', is_playoff: document.getElementById("get_showplayoff").value, preselection: selected_tabs, subtab: \'' . $_REQUEST['subtab'] . '\'} )

				document.getElementById("team_spec").style.display = "block";
			}

			/*
			if(document.cookie)
			{
				if(selected_tabs == 0)
				{
					if(document.getElementById("season_btn2"))
					{
						document.getElementById("season_btn2").style.color = "#ff9900"
					}
				}
				else if(selected_tabs == 1)
				{
					if(document.getElementById("match_btn2"))
					{
						document.getElementById("match_btn2").style.color = "#ff9900"
					}
				}
				else if(selected_tabs == 2)
				{
					if(document.getElementById("scores_btn2"))
					{
						document.getElementById("scores_btn2").style.color = "#ff9900"
					}
				}
				else if(selected_tabs == 3)
				{
					if(document.getElementById("records_btn2"))
					{
						document.getElementById("records_btn2").style.color = "#ff9900"
					}
				}
			}
			else
			{
				if(document.getElementById("season_btn2"))
				{
					document.getElementById("season_btn2").style.color = "#ff9900"
				}
			}
			*/

		}
	</script>';
?>

<div id="pteam">
	
	<br />

	<?php include('teams/teamdata.php'); ?>
	
	<div class="team_title"><strong><br>Statistics / Records <?= $iBeginYear.'-'.$iEndYear ?></strong></div>
	
	<hr class="sep">
	
	<input type="hidden" id="get_showplayoff" name="get_showplayoff" value="<?php echo $showplayoff; ?>" />

    <div id="team_spec">

		<div id="stats"></div>

		<?php
		$result = mysql_fetch_assoc(mysql_query($sql = "SELECT * FROM lhjmq_variables WHERE id_var = '".$_GET[id_equipe]."-en-equipes-statistiques'", $mysql_link));
		?>
		<?= $result[var_text] ?>
		
	</div>	

</div>
<?php

$footer_background_color = '#ececec';

?>