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


Current Path : /var/www/lhjmq-records.qc.ca/public_html/administration/csr_evaluation/
Upload File :
Current File : /var/www/lhjmq-records.qc.ca/public_html/administration/csr_evaluation/reportcsr1.php

<?php

session_start();

include_once('inc/headers.inc.php');

// Check the stage
if ( ! isset($_GET[stage]) || $_GET[stage] == '') {
	//$_GET[stage] = 1;
}



if (isset($_GET[id_season])){	
	$id_season = $_GET[id_season];	
}


if (isset($_POST[id_season])){	
	$id_season = $_POST[id_season];	
}

if ($sSortDirLink == ""){
				$sSortDirLink = "asc";	
}
			


if (isset($_GET[team_id])){



		if (isset($_GET[dir])){
			$sSortDirLink = $_GET[dir];
		}	


	if (isset($_GET[sort]) ){
		

		
		if ($_GET[sort] == 'taille1'){
			$_GET[sort] = "taille1 $sSortDirLink, taille2 $sSortDirLink, taille3";
		}
		
		$sortorder = " order by " . $_GET[sort] . " " . $sSortDirLink; 
	}
	else
	{
		$sortorder = "";
	}
	
	
	if (isset($_GET[sort1]) ){
		
	
		if ($_GET[sort1] == 'taille1'){
			$_GET[sort1] = "taille1 $sSortDirLink, taille2 $sSortDirLink, taille3";
		}
		
		if ($_GET[sort2] == 'taille1'){
			$_GET[sort2] = "taille1 $sSortDirLink, taille2 $sSortDirLink, taille3";
		}
		
		if ($_GET[sort3] == 'taille1'){
			$_GET[sort3] = "taille1 $sSortDirLink, taille2 $sSortDirLink, taille3";
		}
		
		if ($_GET[sort1] != ""){
			$tmp = $tmp . $_GET[sort1];
			
		}
				
		if ($_GET[sort2] != ""){
			$tmp = $tmp .','. $_GET[sort2];
		}
		
		if ($_GET[sort3] != ""){
			$tmp = $tmp .','. $_GET[sort3];
		}
				
				if (right($tmp,1) == ","){
						$tmp = left($tmp,strlen($tmp)-1);
				}
										
		//$tmp = "$_GET[sort1],$_GET[sort2],$_GET[sort3] ";
		
		$sortorder = " order by " . $tmp . " " . $sSortDirLink; 
	}
	
//echo "sortorder : $sortorder";


if ($_GET[team_id] == "all"){

	$whereforteam = "";	
}
else{
	$whereforteam = " AND id_team = ".$_GET[team_id]." ";	
	}


$TeamDatasql = "
		SELECT profiles.*,levels.level_abbreviation,teams.team_name,states.state_name
		FROM lhjmqcsr_season_0708_pii.profiles 
		LEFT JOIN lhjmqcsr_season_0708_pii.levels ON levels.id = profiles.level_id  
		LEFT JOIN lhjmqcsr_season_0708_pii.teams ON teams.id = profiles.id_team 
		LEFT JOIN lhjmqcsr_season_0708_pii.states ON states.id = profiles.province_id
		WHERE profiles.saison_id = ".$_GET[id_season]." " . $whereforteam .$sortorder;

//echo $TeamDatasql;
		
	$aTeamDatacount = mysql_query($TeamDatasql, $mysql_link);
	
	if ($sSortDirLink == "asc")
	{
		$sSortDirLink = "desc";
	}
	else
	{
		$sSortDirLink = "asc";
	}
	
}

if (isset($_GET[id_season])){
	$saisoninfo = mysql_fetch_assoc(mysql_query($sql = "SELECT * FROM lhjmqcsr_season_0708_pii.season_data where id = ".$_GET[id_season]." ", $mysql_link)); 
}

?>
	<style>
	.input_err0 { background: #CCFF99; }
	.input_err1 { background: #FFFF00; }
	.input_err2 { background: #CCFFFF; }
	.input_err3 { background: #FFEEEE; }
	.input_err4 { background: #FFAFFF; }
	.input_err5 { background: #00FFF0; }
	.input_err6 { background: #B2FFDF; }
	.input_err7 { background: #FFDD9B; }
	.input_err8 { background: #FBFFBC; }
	.input_err9 { background: #E3E5FF; }
	
	.input_in  { background: #E8E9F5; }
	.input_out { background: #FFFFFF; }
	</style>
	
	
	
	<script type="text/javascript">
<!--
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Revised by: DeWayne Whitaker :: http://www.aecdfw.com
Original by: Andrew Berry */

var arrItems1 = new Array();
var arrItemsGrp1 = new Array();

arrItems1[3] = "Nom";
arrItemsGrp1[3] = "Nom";
arrItems1[4] = "Prenom";
arrItemsGrp1[4] = "Prenom";
arrItems1[5] = "Numero";
arrItemsGrp1[5] = "Numero";

arrItems1[6] = "Nom";
arrItemsGrp1[6] = "Nom";
arrItems1[7] = "Prenom";
arrItemsGrp1[7] = "Prenom";

arrItems1[0] = "Planes";
arrItemsGrp1[0] = 3;
arrItems1[1] = "Ultralight";
arrItemsGrp1[1] = 3;
arrItems1[2] = "Glider";
arrItemsGrp1[2] = 3;

var arrItems2 = new Array();
var arrItemsGrp2 = new Array();

arrItems2[21] = "747";
arrItemsGrp2[21] = 0
arrItems2[22] = "Cessna";
arrItemsGrp2[22] = 0

arrItems2[31] = "Kolb Flyer";
arrItemsGrp2[31] = 1
arrItems2[34] = "Kitfox";
arrItemsGrp2[34] = 1

arrItems2[35] = "Schwietzer Glider";
arrItemsGrp2[35] = 2

arrItems2[99] = "Chevy Malibu";
arrItemsGrp2[99] = 5
arrItems2[100] = "Lincoln LS";
arrItemsGrp2[100] = 5
arrItems2[57] = "BMW Z3";
arrItemsGrp2[57] = 5

arrItems2[101] = "F-150";
arrItemsGrp2[101] = 3
arrItems2[102] = "Tahoe";
arrItemsGrp2[102] = 3

arrItems2[103] = "Freight Train";
arrItemsGrp2[103] = 4
arrItems2[104] = "Passenger Train";
arrItemsGrp2[104] = 4

arrItems2[105] = "Oil Tanker";
arrItemsGrp2[105] = 6
arrItems2[106] = "Fishing Boat";
arrItemsGrp2[106] = 6

arrItems2[200] = "Los Angelas Class";
arrItemsGrp2[200] = 7
arrItems2[201] = "Kilo Class";
arrItemsGrp2[201] = 7
arrItems2[203] = "Seawolf Class";
arrItemsGrp2[203] = 7

function selectChange(control, controlToPopulate, ItemArray, GroupArray) {
  var myEle ;
  var x ;
  // Empty the second drop down box of any choices
  for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
  if (control.name == "firstChoice") {
    // Empty the third drop down box of any choices
    for (var q=form.thirdChoice.options.length;q>=0;q--) form.thirdChoice.options[q] = null;
 }
  // ADD Default Choice - in case there are no values
  myEle = document.createElement("option") ;
  myEle.value = 0 ;
  myEle.text = "[SELECT]" ;
  // controlToPopulate.add(myEle) ;
  controlToPopulate.appendChild(myEle)
  // Now loop through the array of individual items
  // Any containing the same child id are added to
  // the second dropdown box
  for ( x = 0 ; x < ItemArray.length  ; x++ ) {
    if ( GroupArray[x] == control.value ) {
      myEle = document.createElement("option") ;
      //myEle.value = x ;
      myEle.setAttribute('value',x);
      // myEle.text = ItemArray[x] ;
      var txt = document.createTextNode(ItemArray[x]);
      myEle.appendChild(txt)
      // controlToPopulate.add(myEle) ;
      controlToPopulate.appendChild(myEle)
    }
  }
}

function selectChange(control, controlToPopulate, ItemArray, GroupArray) {
  var myEle ;
  var x ;
  // Empty the second drop down box of any choices
  for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
  if (control.name == "firstChoice") {
    // Empty the third drop down box of any choices
    for (var q=form.thirdChoice.options.length;q>=0;q--) form.thirdChoice.options[q] = null;
  }
  // ADD Default Choice - in case there are no values
  myEle=document.createElement("option");
  theText=document.createTextNode("[SELECT]");
  myEle.appendChild(theText);
  myEle.setAttribute("value","0");
  controlToPopulate.appendChild(myEle);
  // Now loop through the array of individual items
  // Any containing the same child id are added to
  // the second dropdown box
  for ( x = 0 ; x < ItemArray.length  ; x++ ) {
    if ( GroupArray[x] == control.value ) {
      myEle = document.createElement("option") ;
      //myEle.value = x ;
      myEle.setAttribute("value",x);
      // myEle.text = ItemArray[x] ;
      var txt = document.createTextNode(ItemArray[x]);
      myEle.appendChild(txt)
      // controlToPopulate.add(myEle) ;
      controlToPopulate.appendChild(myEle)
    }
  }
}
// -->
</script>

	</head>

	<body bgcolor="#BBBFCE" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>
	<?php
	$sHeaderSlogan = "Rapport d'evaluation des joueurs";
	include_once('inc/page_top.inc.php');
	?>



		<table cellpadding=0 cellspacing=0 border=0 width="100%">
			<tr>
				<td>
				<?php
		
					$sDestination = 'reportcsr1';
					include_once('inc/season_select.inc.php');
					
					
					if ($sThisDbExists) {
						$aGamesData = mysql_query($sql = "SELECT * FROM lhjmqcsr_season_0708_pii.teams where saison_id = ".$_GET[id_season]." ORDER BY team_name DESC", $mysql_link);
						
						if (mysql_num_rows($aGamesData) > 0) {
							?>
								<table cellpadding=0 cellspacing=0 border=0>
									<tr><td height=20></td></tr>
								</table>
								
								
								<table cellpadding=0 cellspacing=0 border=0 width=940>
									<tr>
										<td  valign=top>
											<table width=100% cellpadding=0 cellspacing=0 border=0 class="blackText11px">
												<tr>
													<td colspan=2><b>Choisir un equipe :</b></td>
												</tr>
												<tr>
													<td height=10></td>
												</tr>
												<tr>
													<td>
														<form action="" method="GET" name="season_games_form" id="season_games_form">
														<select name="team_id" id="team_id" class="blackText11px" onchange='season_games_form.submit();'>
															<option value="">Choisissez une equipe...</option>		
															<option value="all" <?if($_GET[team_id] == "all" ){echo "selected"; }?> >Tous les equipes</option>						
															<?							
															while ($aGameData = mysql_fetch_assoc($aGamesData)) {
																if($_GET[team_id] == $aGameData[id] ){$selectstatut = "selected"; }else{$selectstatut = "";}
																echo '<option value="'.$aGameData[id].'" '.$selectstatut.'>'.$aGameData[team_name].'</option>';																															
															}							
															?>
														</select>
														<input type=hidden name="id_season" value="<?echo $id_season;?>">
													</form>
													</td>
													<td align=right>
														<form name=form>
														Sort by 
													<select name="sort1">
															<option value="">Select Fisrst Column...</option>
															<option value="rend_mi_saison" <?if($_GET[sort1] == "rend_mi_saison"){echo 'Selected';}?> >Ev4</option>
															<option value="rend_fin_saison" <?if($_GET[sort1] == "rend_fin_saison"){echo 'Selected';}?> >Rang</option>
															<option value="type_joueur" <?if($_GET[sort1] == "type_joueur"){echo 'Selected';}?> >Ev3</option>
															<option value="projection" <?if($_GET[sort1] == "projection"){echo 'Selected';}?> >Ev2</option>
															<option value="class_csr" <?if($_GET[sort1] == "class_csr"){echo 'Selected';}?> >Ev1</option>															
															<option value="nom" <?if($_GET[sort1] == "nom"){echo 'Selected';}?> >Nom</option>
															<option value="prenom" <?if($_GET[sort1] == "prenom"){echo 'Selected';}?> >Prenom</option>
															<option value="numero" <?if($_GET[sort1] == "numero"){echo 'Selected';}?> >numero</option>
															<option value="taille1" <?if($_GET[sort1] == "taille1"){echo 'Selected';}?> >Taille</option>
															<option value="Poids" <?if($_GET[sort1] == "Poids"){echo 'Selected';}?> >Poids</option>
															<option value="datenais" <?if($_GET[sort1] == "datenais"){echo 'Selected';}?> >Age</option>
															<option value="datenais" <?if($_GET[sort1] == "datenais"){echo 'Selected';}?> >DDN</option>
															<option value="pos" <?if($_GET[sort1] == "pos"){echo 'Selected';}?> >Pos</option>
															<option value="tir" <?if($_GET[sort1] == "tir"){echo 'Selected';}?> >Tir</option>
															<option value="team_name" <?if($_GET[sort1] == "team_name"){echo 'Selected';}?> >Equipe</option>
															<option value="level_abbreviation" <?if($_GET[sort1] == "level_abbreviation"){echo 'Selected';}?> >Classe</option>
															<option value="province_id" <?if($_GET[sort1] == "province_id"){echo 'Selected';}?> >Province</option>
														</select>
														<select name="sort2">
															<option value="">Select Second Column...</option>
															<option value="rend_mi_saison" <?if($_GET[sort2] == "rend_mi_saison"){echo 'Selected';}?> >Ev4</option>
															<option value="rend_fin_saison" <?if($_GET[sort2] == "rend_fin_saison"){echo 'Selected';}?> >Rang</option>
															<option value="type_joueur" <?if($_GET[sort2] == "type_joueur"){echo 'Selected';}?> >Ev3</option>
															<option value="projection" <?if($_GET[sort2] == "projection"){echo 'Selected';}?> >Ev2</option>
															<option value="class_csr" <?if($_GET[sort2] == "class_csr"){echo 'Selected';}?> >Ev1</option>
															<option value="nom" <?if($_GET[sort2] == "nom"){echo 'Selected';}?> >Nom</option>
															<option value="prenom" <?if($_GET[sort2] == "prenom"){echo 'Selected';}?> >Prenom</option>
															<option value="numero" <?if($_GET[sort2] == "numero"){echo 'Selected';}?> >numero</option>
															<option value="taille1" <?if($_GET[sort2] == "taille1"){echo 'Selected';}?> >Taille</option>
															<option value="Poids" <?if($_GET[sort2] == "Poids"){echo 'Selected';}?> >Poids</option>
															<option value="datenais" <?if($_GET[sort2] == "datenais"){echo 'Selected';}?> >Age</option>
															<option value="datenais" <?if($_GET[sort2] == "datenais"){echo 'Selected';}?> >DDN</option>
															<option value="pos" <?if($_GET[sort2] == "pos"){echo 'Selected';}?> >Pos</option>
															<option value="tir" <?if($_GET[sort2] == "tir"){echo 'Selected';}?> >Tir</option>
															<option value="team_name" <?if($_GET[sort2] == "team_name"){echo 'Selected';}?> >Equipe</option>
															<option value="level_abbreviation" <?if($_GET[sort2] == "level_abbreviation"){echo 'Selected';}?> >Classe</option>
															<option value="province_id" <?if($_GET[sort2] == "province_id"){echo 'Selected';}?> >Province</option>
														</select>
														<select name="sort3">
															<option value="">Select Third Column...</option>
															<option value="rend_mi_saison" <?if($_GET[sort3] == "rend_mi_saison"){echo 'Selected';}?> >Ev4</option>
															<option value="rend_fin_saison" <?if($_GET[sort3] == "rend_fin_saison"){echo 'Selected';}?> >Rang</option>
															<option value="type_joueur" <?if($_GET[sort3] == "type_joueur"){echo 'Selected';}?> >Ev3</option>
															<option value="projection" <?if($_GET[sort3] == "projection"){echo 'Selected';}?> >Ev2</option>
															<option value="class_csr" <?if($_GET[sort3] == "class_csr"){echo 'Selected';}?> >Ev1</option>															
															<option value="nom" <?if($_GET[sort3] == "nom"){echo 'Selected';}?> >Nom</option>
															<option value="prenom" <?if($_GET[sort3] == "prenom"){echo 'Selected';}?> >Prenom</option>
															<option value="numero" <?if($_GET[sort3] == "numero"){echo 'Selected';}?> >numero</option>
															<option value="taille1" <?if($_GET[sort3] == "taille1"){echo 'Selected';}?> >Taille</option>
															<option value="Poids" <?if($_GET[sort3] == "Poids"){echo 'Selected';}?> >Poids</option>
															<option value="datenais" <?if($_GET[sort3] == "datenais"){echo 'Selected';}?> >Age</option>
															<option value="datenais" <?if($_GET[sort3] == "datenais"){echo 'Selected';}?> >DDN</option>
															<option value="pos" <?if($_GET[sort3] == "pos"){echo 'Selected';}?> >Pos</option>
															<option value="tir" <?if($_GET[sort3] == "tir"){echo 'Selected';}?> >Tir</option>
															<option value="team_name" <?if($_GET[sort3] == "team_name"){echo 'Selected';}?> >Equipe</option>
															<option value="level_abbreviation" <?if($_GET[sort3] == "level_abbreviation"){echo 'Selected';}?> >Classe</option>
															<option value="province_id" <?if($_GET[sort3] == "province_id"){echo 'Selected';}?> >Province</option>
														</select>
														<input type="submit" value="Sort">
														<input type=hidden name="id_season" value="<?echo $_GET[id_season];?>">
														<input type=hidden name="team_id" value="<?echo $_GET[team_id];?>">
														<input type="hidden" name="dir" value="<?echo $sSortDirLink;?>">
													</form>
														<!--	
	
															
															<table align="center">
															  <tr>
															    <td>
															      <select id="firstChoice" name="firstChoice" onchange="selectChange(this, form.secondChoice, arrItems1, arrItemsGrp1);">
															        <option value="0" selected>[SELECT]</option>
															        <option value="Nom">Nom</option>
															        <option value="Prenom">Prenom</option>
															        <option value="Numero">Numero</option>
															      </select>
															    </td><td>
															      <select id="secondChoice" name="secondChoice" onchange="selectChange(this, form.thirdChoice, arrItems2, arrItemsGrp2);">
															      </select>
															      <select id="thirdChoice" name="thirdChoice">
															      </select>
															    </td>
															  </tr>
															</table>
															</form>	
																						//-->						
													</td>
												</tr>
											</table>
										</td>	
									</tr>
								</table>

							<?
						}
						
						?>
					
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
					
					<?	
		
					}
				?>
<br><br>
				<?				
					if (isset($_GET[id_season]) && isset($_GET[team_id]) && $_GET[team_id] != ""){	
						
						if (mysql_num_rows($aTeamDatacount) > 0){	
						
							echo '<table border=0 cellpadding=2 cellspacing=0 class="outlinetab" bgcolor=white>
								<tr class="darkblueRow">
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									
									<td nowrap class="orangeText11px">'.($sSortString=='nom' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=rend_mi_saison&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par nom" class="orangeText11px lnkBaseOrange">Ev4</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='prenom' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=rend_fin_saison&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par prenom" class="orangeText11px lnkBaseOrange">Rang</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='numero' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=type_joueur&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par numero" class="orangeText11px lnkBaseOrange">Ev3</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>							
									
									<td nowrap class="orangeText11px">'.($sSortString=='prenom' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=projection&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par prenom" class="orangeText11px lnkBaseOrange">Ev2</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='numero' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=class_csr&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par numero" class="orangeText11px lnkBaseOrange">Ev1</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>															
									
									
									<td nowrap class="orangeText11px">'.($sSortString=='nom' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=nom&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par nom" class="orangeText11px lnkBaseOrange">Nom</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='prenom' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=prenom&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par prenom" class="orangeText11px lnkBaseOrange">Prenom</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='numero' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=numero&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par numero" class="orangeText11px lnkBaseOrange">#</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									
									
									<td nowrap class="orangeText11px">'.($sSortString=='taille' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=taille1&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par taille" class="orangeText11px lnkBaseOrange">Taille</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='poids' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=poids&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par poids" class="orangeText11px lnkBaseOrange">Pds</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='datenais' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=datenais&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par age" class="orangeText11px lnkBaseOrange">Age</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='datenais' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=datenais&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par ddn" class="orangeText11px lnkBaseOrange">DDN</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='pos' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=pos&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par position" class="orangeText11px lnkBaseOrange">Pos</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='tir' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=tir&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par tir" class="orangeText11px lnkBaseOrange">Tir</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='team_name' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=team_name&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par Equipe" class="orangeText11px lnkBaseOrange">Equipe</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>
									
									<td nowrap class="orangeText11px">'.($sSortString=='class_csr' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=level_abbreviation&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par classe" class="orangeText11px lnkBaseOrange">Classe</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>																																																																								
				
									<td nowrap class="orangeText11px">'.($sSortString=='province_id' ? $sSortArrow : "").'<b><a href="'.$_SERVER[PHP_SELF].'?sort=province_id&team_id='.$_GET[team_id].'&dir='.$sSortDirLink.'" title="Ordonner par province" class="orangeText11px lnkBaseOrange">PV</a></b></td>
									<td><img src="images/blank.gif" width=10 height=1 border=0 /></td>						
									
	
								</tr>';
												
									}
								$i = 0;
						
						while ($aStatesData = mysql_fetch_assoc($aTeamDatacount)) {	
						//while ($aStatesData = mysql_fetch_assoc(mysql_query($TeamDatasql, $mysql_link))) {
							$iCurrentRow = $i % 2;
							if ($iCurrentRow != 0) {
								$sRowClass = 'blue_row';
							} else {
								$sRowClass = '';
							}
							
							$sDeleteId = 'delete_'.$aStatesData[id];
							
							echo '
								<tr class="'.$sRowClass.'">
									<td></td>
									
									<td nowrap class="blackText11px">'.$aStatesData[rend_mi_saison].'</td>
									<td></td>
									
									<td nowrap class="blackText11px">'.$aStatesData[rend_fin_saison].'</td>
									<td></td>
									
									<td nowrap class="blackText11px">'.$aStatesData[type_joueur].'</td>
									<td></td>				
									
									<td nowrap class="blackText11px">'.$aStatesData[projection].'</td>
									<td></td>
									
									<td nowrap class="blackText11px">'.$aStatesData[class_csr].'</td>
									<td></td>
																					
									
									
									<td nowrap class="blackText11px">'.$aStatesData[nom].'</td>
									<td></td>
									
									<td nowrap class="blackText11px">'.$aStatesData[prenom].'</td>
									<td></td>
									
									<td nowrap class="blackText11px">'.$aStatesData[numero].'</td>
									<td></td>
									
									<td nowrap class="blackText11px">'.$aStatesData[taille1].'\''.$aStatesData[taille2].' '.$aStatesData[taille3].'</td>
									<td></td>
									
									<td nowrap class="blackText11px">'.$aStatesData[poids].'</td>
									<td></td>

									<td nowrap class="blackText11px">'.birthday($aStatesData[datenais],$saisoninfo['season_date_end']).'</td>
									<td></td>		
																		
									<td nowrap class="blackText11px">'.$aStatesData[datenais].'</td>
									<td></td>		
									
									<td nowrap class="blackText11px">'.$aStatesData[pos].'</td>
									<td></td>		
									
									<td nowrap class="blackText11px">'.$aStatesData[tir].'</td>
									<td></td>				
									
									<td nowrap class="blackText11px">'.$aStatesData[team_name].'</td>
									<td></td>																										
																																		
									<td nowrap class="blackText11px">'.$aStatesData[level_abbreviation].'</td>
									<td></td>			
									
									<td nowrap class="blackText11px">'.$aStatesData[state_name].'</td>
									<td></td>												
																	
	
								</tr>
							';
							
							$i++;
						}
					}	
						echo '</table>';
						echo '</form>';
								
								?>
								
<br>	
			
				
				</td>
			</tr>
		</table>
	</body>
</html>



<?
//calculate years of age (input string: YYYY-MM-DD)
  function birthdayold ($birthday){
    list($year,$month,$day) = explode("-",$birthday);
    $year_diff  = date("Y") - $year;
    $month_diff = date("m") - $month;
    $day_diff   = date("d") - $day;
    if ($day_diff < 0 || $month_diff < 0)
      $year_diff--;
    return $year_diff;
  }


//calculate month of year (input string: YYYY-MM-DD)
  function lateplayer ($birthday){
    list($year,$month,$day) = explode("-",$birthday);
    $month_diff = $month;
    
    if ($month_diff >= 10 && $month_diff <= 12){
      $result = 'L';
    } 
    else
    {
    	$result = '';
    } 
    return $result;
  }  
  
  function left($str,$nbr) {
   return substr($str,0,$nbr);
	}
	
	function right($str,$nbr) {
   return substr($str,-$nbr);
}

  function birthday ($birthday,$enddate){
    list($year,$month,$day) = explode("-",$birthday);
    list($syear,$smonth,$sday) = explode("-",$enddate);
    /*$year_diff  = date("Y") - $year;
    $month_diff = date("m") - $month;
    $day_diff   = date("d") - $day;*/
    
    $syear = $syear - 1;
    $syear = $syear - $year;
    
   /* $year_diff  = $syear - $year;
    $month_diff = $smonth - $month;
    $day_diff   = $sday - $day;
    
    if ($day_diff < 0 || $month_diff < 0)
      $year_diff--;
    */
    
    $month_diff = $month;
    
    if ($month_diff >= 10 && $month_diff <= 12){
      $result = 'L';
    } 
    else
    {
    	$result = '';
    } 
    
    $result = $syear . " " . $result;
    
    
    
    return $result;
  }
?>