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


Current Path : /var/www/lhjmq-records.qc.ca/public_html/lang_fr/registrariat/
Upload File :
Current File : /var/www/lhjmq-records.qc.ca/public_html/lang_fr/registrariat/seanceselplayers.php

<?php
//Default letter if none
if (!isset($letter)) {
	$letter = "A";
}

//Modify the sort if required
if ($sortBy == "numero" && $sortByMode == "ASC") {
	$sortBy = "REPLACE(LPAD(numero, 3, '0'), '000', '100')";
} else if ($sortBy == "numero" && $sortByMode == "DESC") {
	$sortBy = "LPAD(numero, 3, '0')";
}

//Prepare the SQL
$seance = mysql_fetch_assoc(mysql_query('SELECT * FROM csr_seance_sel WHERE id = '.$id_seance, $mysql_link));
$sql = "SELECT * FROM csr_list_entries_".$seance['listechoix']." AS lst";

//Get the players
if ($letter == "ALL") {
	//Add the personalized sorting
	if (isset($sortBy)) {
		//Check that the sort mode is present or set it to ASC
		if (!isset($sortByMode)) { $sortByMode = "ASC"; }
		//Add the mode to the list
		$sql .= " ORDER BY $sortBy $sortByMode, nom, prenom, numero";
	} else {
		$sql .= " ORDER BY nom, prenom, numero";
	}
	$players = mysql_query($sql, $mysql_link);
} else {
	$sql .= " AND lst.nom LIKE '$letter%'";
	//Add the personalized sorting
	if (isset($sortBy)) {
		//Check that the sort mode is present or set it to ASC
		if (!isset($sortByMode)) { $sortByMode = "ASC"; }
		//Add the mode to the list
		$sql .= " ORDER BY $sortBy $sortByMode, nom, prenom, numero";
	} else {
		$sql .= " ORDER BY nom, prenom, numero";
	}
	$players = mysql_query($sql, $mysql_link);
}

echo $sql;
?>
<table width="631" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td>
      <table width="621" border="0" cellpadding="0" cellspacing="0" class="outlinetab" height="26">
        <tr>
          <td class="blackText11px" align="center">
            <P>
								<a href="index.php?page=36785432&letter=A" class="lnkBase9px"><?php if ($letter == "A") { echo "<b>A</b>"; } else { echo "A"; }?></a> |
								<a href="index.php?page=36785432&letter=B" class="lnkBase9px"><?php if ($letter == "B") { echo "<b>B</b>"; } else { echo "B"; }?></a> |
								<a href="index.php?page=36785432&letter=C" class="lnkBase9px"><?php if ($letter == "C") { echo "<b>C</b>"; } else { echo "C"; }?></a> |
								<a href="index.php?page=36785432&letter=D" class="lnkBase9px"><?php if ($letter == "D") { echo "<b>D</b>"; } else { echo "D"; }?></a> |
              	<a href="index.php?page=36785432&letter=E" class="lnkBase9px"><?php if ($letter == "E") { echo "<b>E</b>"; } else { echo "E"; }?></a> |
								<a href="index.php?page=36785432&letter=F" class="lnkBase9px"><?php if ($letter == "F") { echo "<b>F</b>"; } else { echo "F"; }?></a> |
								<a href="index.php?page=36785432&letter=G" class="lnkBase9px"><?php if ($letter == "G") { echo "<b>G</b>"; } else { echo "G"; }?></a> |
								<a href="index.php?page=36785432&letter=H" class="lnkBase9px"><?php if ($letter == "H") { echo "<b>H</b>"; } else { echo "H"; }?></a> |
              	<a href="index.php?page=36785432&letter=I" class="lnkBase9px"><?php if ($letter == "I") { echo "<b>I</b>"; } else { echo "I"; }?></a> |
								<a href="index.php?page=36785432&letter=J" class="lnkBase9px"><?php if ($letter == "J") { echo "<b>J</b>"; } else { echo "J"; }?></a> |
								<a href="index.php?page=36785432&letter=K" class="lnkBase9px"><?php if ($letter == "K") { echo "<b>K</b>"; } else { echo "K"; }?></a> |
								<a href="index.php?page=36785432&letter=L" class="lnkBase9px"><?php if ($letter == "L") { echo "<b>L</b>"; } else { echo "L"; }?></a> |
              	<a href="index.php?page=36785432&letter=M" class="lnkBase9px"><?php if ($letter == "M") { echo "<b>M</b>"; } else { echo "M"; }?></a> |
								<a href="index.php?page=36785432&letter=N" class="lnkBase9px"><?php if ($letter == "N") { echo "<b>N</b>"; } else { echo "N"; }?></a> |
								<a href="index.php?page=36785432&letter=O" class="lnkBase9px"><?php if ($letter == "O") { echo "<b>O</b>"; } else { echo "O"; }?></a> |
								<a href="index.php?page=36785432&letter=P" class="lnkBase9px"><?php if ($letter == "P") { echo "<b>P</b>"; } else { echo "P"; }?></a> |
              	<a href="index.php?page=36785432&letter=Q" class="lnkBase9px"><?php if ($letter == "Q") { echo "<b>Q</b>"; } else { echo "Q"; }?></a> |
								<a href="index.php?page=36785432&letter=R" class="lnkBase9px"><?php if ($letter == "R") { echo "<b>R</b>"; } else { echo "R"; }?></a> |
								<a href="index.php?page=36785432&letter=S" class="lnkBase9px"><?php if ($letter == "S") { echo "<b>S</b>"; } else { echo "S"; }?></a> |
								<a href="index.php?page=36785432&letter=T" class="lnkBase9px"><?php if ($letter == "T") { echo "<b>T</b>"; } else { echo "T"; }?></a> |
              	<a href="index.php?page=36785432&letter=U" class="lnkBase9px"><?php if ($letter == "U") { echo "<b>U</b>"; } else { echo "U"; }?></a> |
								<a href="index.php?page=36785432&letter=V" class="lnkBase9px"><?php if ($letter == "V") { echo "<b>V</b>"; } else { echo "V"; }?></a> |
								<a href="index.php?page=36785432&letter=W" class="lnkBase9px"><?php if ($letter == "W") { echo "<b>W</b>"; } else { echo "W"; }?></a> |
								<a href="index.php?page=36785432&letter=X" class="lnkBase9px"><?php if ($letter == "X") { echo "<b>X</b>"; } else { echo "X"; }?></a> |
              	<a href="index.php?page=36785432&letter=Y" class="lnkBase9px"><?php if ($letter == "Y") { echo "<b>Y</b>"; } else { echo "Y"; }?></a> |
								<a href="index.php?page=36785432&letter=Z" class="lnkBase9px"><?php if ($letter == "Z") { echo "<b>Z</b>"; } else { echo "Z"; }?></a> |
								<a href="index.php?page=36785432&letter=ALL" class="lnkBase9px"><?php if ($letter == "ALL") { echo "<b>Tous</b>"; } else { echo "Tous"; }?></a></p>
          </td>
        </tr>
			</table>
      <!--##### TAB DATE ##### -->
			<table width="621" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="../../images/tabbar/tabligneshadow.gif" width="621" height="3"></td>
          </tr>
          <tr>
            <td><img src="../../images/spacer.gif" width="1" height="5"></td>
          </tr>
      </table>
    
      <!--##### TAB DATE ##### -->
			<table width="621" border="0" cellspacing="0" cellpadding="3" class="outlinetab">
        <tr class="darkblueRow">
          <td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=abreviation_1&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">Eq</a></td>
          <td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=numero&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">#</a></td>
					<td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=nom&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">Nom</a></td>
					<td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=lnh&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">LNH</a></td>
					<td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=id_type_pos&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">Pos</a></td>
					<td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=recrues&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">*</a></td>
					<td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=date_nais&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">Date Nais.</a></td>
					<td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=taille&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">Gr.</a></td>
					<td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=poid&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">Pds</a></td>
					<td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=tir&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">L</a></td>
					<td nowrap><a href="index.php?page=36785432&letter=<?php echo $letter; ?>&sortBy=lieu_nais&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">Lieu Nais.</a></td>
        </tr>
				<?php
				$rowClass = "list2Reg";
				while ($player = mysql_fetch_array($players)) {
					if (substr($rowClass, 0, 5) == "list1") {
						$rowClass = "list2Reg";
					} else {
						$rowClass = "list1Reg";
					}
				?>
        <tr class="<?php echo $rowClass; ?>">
          <td nowrap class="blackText9px"><?php echo $player[abreviation_1]; ?></td>
          <td align="right" nowrap class="blackText9px"><?php if ($player[numero] != 0) { echo $player[numero]; } ?></td>
					<td nowrap><a href="index.php?page=2147483647&id_saison_personnel=<?php echo $player[id_saison_personnel]; ?>" class="lnkBase9px"><?php echo $player[nom] . ", " . $player[prenom]; ?></a></td>
					<td nowrap class="blackText9px"><?php echo $player[lnh]; ?></td>
					<td nowrap class="blackText9px"><?php echo $player[description_fr]; ?></td>
					<td nowrap class="blackText9px"><?php echo $player[recrues]; ?></td>
					<td nowrap class="blackText9px"><?php if ($player[date_nais] == '0000-00-00') { echo "-"; } else { echo $player[date_nais]; } ?></td>
					<?php
					//calculate the dage using current date and birthdate
					$birthDateExpl = explode("-", $player[date_nais]);
					$birthYear = $birthDateExpl[0];
					$birthMonth = $birthDateExpl[1];
					$birthDay = $birthDateExpl[2];
					?>
          <?php
					//Calculate the height
					$feet = floor($player[taille] / 12);
					$inch = $player[taille] % 12;
					// Modify by MT : 11/09/2002
					if ($player[poid] <= 0) {
						$player[poid] = '-'; }
					if ($inch < 10) {
						$inch = "0".$inch; }
					?>
          <td nowrap class="blackText9px"><?php if ($player[taille] < 36) { echo "-"; } else { echo $feet . '\'' . $inch . "&quot;"; } ?></td>
					<td nowrap class="blackText9px"><?php echo $player[poid]; ?></td>
					<?php
					if ($player[tir] == 1) {
						$tir = "D";
					} else if ($player[tir] == 0) {
						$tir = "G";
					} else {
						$tir = '-';
					}	
					?>
          <td nowrap class="blackText9px"><?php echo $tir; ?></td>
					<?php
					//Concatenation of birth location
					$sep = $lieu_nais = "";
					if ($player[ville_nais] != "") {
						$lieu_nais = $player[ville_nais];
						$sep = ", ";
					}
					if ($player[prov_nais] != "") {
						$lieu_nais .= $sep . $player[prov_nais];
						$sep = ", ";
					}
					if ($player[pays_nais] != "" && strtolower($player[pays_nais]) != "canada") {
						$lieu_nais .= $sep . $player[pays_nais];
						$sep = ", ";
					}
					?>
				  <td nowrap class="blackText9px"><?php echo $lieu_nais; ?></td>
        </tr>
				<?php
				}
				?>
      </table>
			<br /><span class="BlackText9px">*: Recrue</span><br />
			<br />
      <table width="621" border="0" cellspacing="0" cellpadding="0" bgcolor="#546085">
        <tr>
          <td><img src="../../images/spacer.gif" width="621" height="1"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>