Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 18.225.156.91
<?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);
if ($_GET['hugo'] == 1){
echo "SELECT year( sys_date ) AS franc_year FROM equipes_hist WHERE `hist_parent` ='".$id_equipe."' GROUP BY year( sys_date )".'<br>';
echo $first_franchise_year . "<br>" . $last_franchise_year."<br>";
echo "SELECT id,date_start,date_end FROM `seasons` WHERE `season_type` =1 AND YEAR(date_start) >= YEAR('" . $first_franchise_year . "-06-01') AND YEAR(date_start) <= YEAR('" . ($last_franchise_year) . "-06-01')";
}
if ($_GET['hugo'] == 1){
echo '<pre>$joueur_vedette_json : ';
print_r($joueur_vedette_json);
echo '</pre>';
//$link_LS_ids_player
}
$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'];
if ($_GET['hugo'] == 1){
echo '<pre>'.$link_LS_ids_player;
echo '</pre>';
}
//http://new.lhjmq.qc.ca/roster/2/144
//echo htmlentities($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
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;
}
}
}
//echo 'http://assets.leaguestat.com/lhjmq/logos/164x219/'.$link_LS_ids_images;
$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);
//echo 'http://assets.leaguestat.com/lhjmq/168x127/'.$link_LS_ids_images;
//$image_equipe_vedette = validate_image_existe_ls('http://assets.leaguestat.com/lhjmq/logos/70x70/'.$link_LS_ids_images);
?>
<div class="tabs-menu-wrap">
<ul class="tabs-menu">
<li><a href="http://lhjmq.qc.ca/roster/<?=$link_LS_ids_roster;?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '8392' ? 'active' : '' ?>">Alignement</a></li
><li><a href="index.php?page=27844&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '27844' ? 'active' : '' ?>">Historique</a></li
><li><a href="index.php?page=74620&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '74620' ? 'active' : '' ?>">Stats / Records</a></li
><li><a href="http://lhjmq.qc.ca/transactions/<?=$link_LS_ids;?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '2210549' ? 'active' : '' ?>">Échanges</a></li
><!--<li><a href="index.php?page=127435&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '127435' ? 'active' : '' ?>">Assistances</a></li>//-->
<li><a href="http://lhjmq.qc.ca/schedule/<?=$link_LS_ids;?>">Résultats</a></li>
</ul>
</div>
<?
/*
<div class="tabs-menu-wrap">
<ul class="tabs-menu">
<li><a href="index.php?page=8392&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '8392' ? 'active' : '' ?>">Alignement</a></li
><li><a href="index.php?page=27844&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '27844' ? 'active' : '' ?>">Historique</a></li
><li><a href="index.php?page=74620&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '74620' ? 'active' : '' ?>">Stats / Records</a></li
><li><a href="index.php?page=2210549&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '2210549' ? 'active' : '' ?>">Échanges</a></li
><li><a href="index.php?page=127435&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '127435' ? 'active' : '' ?>">Assistances</a></li
><li><a href="<?= $resultlink ?>">RÉsultats</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 ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '8392' ? 'color1' : 'color2' ?>">Alignement</a
><span> | </span><a href="index.php?page=19337&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '19337' ? 'color1' : 'color2' ?>">Aréna</a
><span> | </span><a href="index.php?page=306836&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '306836' ? 'color1' : 'color2' ?>">Personnel</a
><span> | </span><a href="index.php?page=27844&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '27844' ? 'color1' : 'color2' ?>">Historique</a
><span> | </span><a href="index.php?page=74620&id_equipe=<?= $id_equipe ?>¤tseason=<?= $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 ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '238934' ? 'color1' : 'color2' ?>">Sélection</a
><span> | </span><a href="index.php?page=2210549&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '2210549' ? 'color1' : 'color2' ?>">Échanges</a
><span> | </span><a href="index.php?page=127435&id_equipe=<?= $id_equipe ?>¤tseason=<?= $season['id'] ?>" onfocus="if (this.blur)this.blur()" class="<?= $_REQUEST[page] == '127435' ? 'color1' : 'color2' ?>">Assistances</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
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'];
$nearest_pyf_season = playoff_get($mysql_link, $seasons['date_start'], $seasons['date_end']);
$id_pyf_saison = $nearest_pyf_season['id'];
$miou = 'ttttttttt';
}
else {
//Nearest regular season
$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'));
$miou = 'rrrrrrrrrrrr';
}
$iBeginYear = substr($season['date_start'], 0, 4);
$iEndYear = substr($season['date_end'], 0, 4);
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));
$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_link2 = mysql_connect('lhjmq.qc.ca', '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">
<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">
<?
}
/*<img src="<?php echo $equipe[$id_equipe][hist_pic168x127]; ?>" width="168" height="127">*/?>
<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 echo $equipe[$id_equipe][hist_contact_address]; ?>, <?php echo $equipe[$id_equipe][hist_contact_city]; ?><br />
<?php echo $equipe[$id_equipe][hist_contact_province]; ?>, <?php echo $equipe[$id_equipe][hist_contact_country]; ?>, <?php echo $equipe[$id_equipe][hist_contact_postalcode]; ?>
</p>*/?>
<?php
/*if ($showcheckplayers == "true") {
?>
<p class="blackText11px"> Tél.: <?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_fr] != "") { ?>
<p class="blackText11px">Couleurs de l'équipe<br />
<b><?php echo $equipe[$id_equipe][hist_couleur_fr]; ?></b>
</p>
<?php } */?>
</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;"><p><?php echo $franchisname['name'];?></p></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 -->
|