Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 18.117.104.132
<?php
//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, 1, $letter_filter);
$items = array();
foreach ($unsorted_items as $item) {
//Modify the sort if required
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);
function &local_get_participants($mysql_link, $on_date, $systype, $subtype, $letter_filter) {
$res = mysql_query($sql='SELECT r.*, rh.*, tpers.description_en 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;
}
?>
<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=<?= $page ?>&letter=A" class="lnkBase9px"><?php if ($letter == "A") { echo "<b>A</b>"; } else { echo "A"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=B" class="lnkBase9px"><?php if ($letter == "B") { echo "<b>B</b>"; } else { echo "B"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=C" class="lnkBase9px"><?php if ($letter == "C") { echo "<b>C</b>"; } else { echo "C"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=D" class="lnkBase9px"><?php if ($letter == "D") { echo "<b>D</b>"; } else { echo "D"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=E" class="lnkBase9px"><?php if ($letter == "E") { echo "<b>E</b>"; } else { echo "E"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=F" class="lnkBase9px"><?php if ($letter == "F") { echo "<b>F</b>"; } else { echo "F"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=G" class="lnkBase9px"><?php if ($letter == "G") { echo "<b>G</b>"; } else { echo "G"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=H" class="lnkBase9px"><?php if ($letter == "H") { echo "<b>H</b>"; } else { echo "H"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=I" class="lnkBase9px"><?php if ($letter == "I") { echo "<b>I</b>"; } else { echo "I"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=J" class="lnkBase9px"><?php if ($letter == "J") { echo "<b>J</b>"; } else { echo "J"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=K" class="lnkBase9px"><?php if ($letter == "K") { echo "<b>K</b>"; } else { echo "K"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=L" class="lnkBase9px"><?php if ($letter == "L") { echo "<b>L</b>"; } else { echo "L"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=M" class="lnkBase9px"><?php if ($letter == "M") { echo "<b>M</b>"; } else { echo "M"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=N" class="lnkBase9px"><?php if ($letter == "N") { echo "<b>N</b>"; } else { echo "N"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=O" class="lnkBase9px"><?php if ($letter == "O") { echo "<b>O</b>"; } else { echo "O"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=P" class="lnkBase9px"><?php if ($letter == "P") { echo "<b>P</b>"; } else { echo "P"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=Q" class="lnkBase9px"><?php if ($letter == "Q") { echo "<b>Q</b>"; } else { echo "Q"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=R" class="lnkBase9px"><?php if ($letter == "R") { echo "<b>R</b>"; } else { echo "R"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=S" class="lnkBase9px"><?php if ($letter == "S") { echo "<b>S</b>"; } else { echo "S"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=T" class="lnkBase9px"><?php if ($letter == "T") { echo "<b>T</b>"; } else { echo "T"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=U" class="lnkBase9px"><?php if ($letter == "U") { echo "<b>U</b>"; } else { echo "U"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=V" class="lnkBase9px"><?php if ($letter == "V") { echo "<b>V</b>"; } else { echo "V"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=W" class="lnkBase9px"><?php if ($letter == "W") { echo "<b>W</b>"; } else { echo "W"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=X" class="lnkBase9px"><?php if ($letter == "X") { echo "<b>X</b>"; } else { echo "X"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=Y" class="lnkBase9px"><?php if ($letter == "Y") { echo "<b>Y</b>"; } else { echo "Y"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=Z" class="lnkBase9px"><?php if ($letter == "Z") { echo "<b>Z</b>"; } else { echo "Z"; }?></a> |
<a href="index.php?page=<?= $page ?>&letter=ALL" class="lnkBase9px"><?php if ($letter == "ALL") { echo "<b>All</b>"; } else { echo "All"; }?></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" cellspacing="0" cellpadding="3" class="outlinetab">
<tr class="darkblueRow">
<td nowrap><a href="index.php?page=<?= $page ?>&letter=<?= $letter ?>&sortBy=nom&sortByMode=<?php if ($sortByMode == "ASC") { echo "DESC"; } else { echo "ASC"; } ?>" class="lnkHdr12px">Name</a></td>
<td nowrap><a href="index.php?page=<?= $page ?>&letter=<?= $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="index.php?page=2147483648&id_register=<?= $item['id_register'] ?>" class="lnkBase9px"><?= $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>
|