Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 3.144.235.195
<?php
function &local_get_participants($mysql_link, $on_date, $systype, $subtype, $letter_filter) {
$res = mysql_query($sql = 'SELECT r.*, rh.*, tpers.description_fr AS typeperson, tpers.sysType, tpers.sysSubType
FROM register_histo AS rh
LEFT JOIN types_personnels AS tpers ON tpers.id_type_pers = rh.histo_addeddata
LEFT JOIN register AS r ON r.id = rh.id_register
WHERE rh.sys_date <= "'.$on_date.' 23:59:59"
AND rh.histo_type = '.HISTO_LEAGUE.'
'.$letter_filter.'
ORDER BY rh.sys_date, rh.id', $mysql_link);
$events = array();
while ($resitem = mysql_fetch_assoc($res)) {
$events[$resitem['sys_date']][] = $resitem;
}
$participants = array();
foreach ($events as $eventday) {
if (is_array($eventday)) {
foreach ($eventday as $event) {
if ($event['histo_status'] == 'IN' && $event['sysType'] == $systype && $event['sysSubType'] == $subtype) {
$participants[$event['id_register']] = $event;
} else if ($event['histo_status'] == 'OUT') {
unset($participants[$event['id_register']]);
}
}
}
}
return $participants;
}
// Default letter if none
if (!isset($letter)) {
$letter = "A";
}
// Create the letter filter
if ($letter == 'ALL') {
$letter_filter = '';
} else {
$letter_filter = ' AND r.info_lname LIKE "'.$letter[0].'%" ';
}
// Modify the sort direction
if ($sortByMode != 'DESC') {
$sortByMode = 'ASC';
}
// Prepare the SQL
$unsorted_items = local_get_participants($mysql_link, date('Y-m-d'), 2, 0, $letter_filter);
$items = array();
foreach ($unsorted_items as $item) {
//Modify the sort if required
if ($sortBy == 'numofficiel') {
$sort_key = str_pad($item['info_basicnumber'], 3, '0', STR_PAD_LEFT);
} else if ($sortBy == 'id_type_pers') {
$sort_key = $item['typeperson'];
}
$items[$sort_key.' '.$item['info_lname'].' '.$item['info_fname']] = $item;
}
if ($sortByMode == 'DESC') {
krsort($items);
} else {
ksort($items);
}
reset($items);
?>
<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=<?php echo $page; ?>&letter=A" class="lnkBase11px"><?php if ($letter == "A") { echo "<b>A</b>"; } else { echo "A"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=B" class="lnkBase11px"><?php if ($letter == "B") { echo "<b>B</b>"; } else { echo "B"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=C" class="lnkBase11px"><?php if ($letter == "C") { echo "<b>C</b>"; } else { echo "C"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=D" class="lnkBase11px"><?php if ($letter == "D") { echo "<b>D</b>"; } else { echo "D"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=E" class="lnkBase11px"><?php if ($letter == "E") { echo "<b>E</b>"; } else { echo "E"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=F" class="lnkBase11px"><?php if ($letter == "F") { echo "<b>F</b>"; } else { echo "F"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=G" class="lnkBase11px"><?php if ($letter == "G") { echo "<b>G</b>"; } else { echo "G"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=H" class="lnkBase11px"><?php if ($letter == "H") { echo "<b>H</b>"; } else { echo "H"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=I" class="lnkBase11px"><?php if ($letter == "I") { echo "<b>I</b>"; } else { echo "I"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=J" class="lnkBase11px"><?php if ($letter == "J") { echo "<b>J</b>"; } else { echo "J"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=K" class="lnkBase11px"><?php if ($letter == "K") { echo "<b>K</b>"; } else { echo "K"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=L" class="lnkBase11px"><?php if ($letter == "L") { echo "<b>L</b>"; } else { echo "L"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=M" class="lnkBase11px"><?php if ($letter == "M") { echo "<b>M</b>"; } else { echo "M"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=N" class="lnkBase11px"><?php if ($letter == "N") { echo "<b>N</b>"; } else { echo "N"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=O" class="lnkBase11px"><?php if ($letter == "O") { echo "<b>O</b>"; } else { echo "O"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=P" class="lnkBase11px"><?php if ($letter == "P") { echo "<b>P</b>"; } else { echo "P"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=Q" class="lnkBase11px"><?php if ($letter == "Q") { echo "<b>Q</b>"; } else { echo "Q"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=R" class="lnkBase11px"><?php if ($letter == "R") { echo "<b>R</b>"; } else { echo "R"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=S" class="lnkBase11px"><?php if ($letter == "S") { echo "<b>S</b>"; } else { echo "S"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=T" class="lnkBase11px"><?php if ($letter == "T") { echo "<b>T</b>"; } else { echo "T"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=U" class="lnkBase11px"><?php if ($letter == "U") { echo "<b>U</b>"; } else { echo "U"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=V" class="lnkBase11px"><?php if ($letter == "V") { echo "<b>V</b>"; } else { echo "V"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=W" class="lnkBase11px"><?php if ($letter == "W") { echo "<b>W</b>"; } else { echo "W"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=X" class="lnkBase11px"><?php if ($letter == "X") { echo "<b>X</b>"; } else { echo "X"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=Y" class="lnkBase11px"><?php if ($letter == "Y") { echo "<b>Y</b>"; } else { echo "Y"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=Z" class="lnkBase11px"><?php if ($letter == "Z") { echo "<b>Z</b>"; } else { echo "Z"; }?></a> |
<a href="index.php?page=<?php echo $page; ?>&letter=ALL" class="lnkBase11px"><?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="50%" border="0" cellpadding="3" cellspacing="0" class="outlinetab">
<tr class="darkblueRow">
<td nowrap><a href="index.php?page=<?php echo $page; ?>&letter=<?php echo $letter; ?>&sortBy=numofficiel&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">#</a></td>
<td nowrap><a href="index.php?page=<?php echo $page; ?>&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=<?php echo $page; ?>&letter=<?php echo $letter; ?>&sortBy=id_type_pers&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">Position</a></td>
</tr>
<?php
$rowClass = "list2Reg";
foreach ($items as $item) {
if (substr($rowClass, 0, 5) == "list1") {
$rowClass = "list2Reg";
} else {
$rowClass = "list1Reg";
}
?>
<tr class="<?= $rowClass ?>">
<td nowrap class="blackText9px"><a href="?page=342874&status_type=3&id_register=<?= $item['id_register'] ?>" class="lnkBase9px"><?php echo $item['info_basicnumber']; ?></a></td>
<td nowrap class="blackText9px"><a href="?page=342874&status_type=3&id_register=<?= $item['id_register'] ?>" class="lnkBase9px"><?php echo $item['info_lname'] . ", " . $item['info_fname']; ?></a></td>
<td nowrap class="blackText9px"><?= $item['typeperson'] ?></td>
</tr>
<?php } ?>
</table>
<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>
|