{source}
<script language="javascript" type="text/javascript">

function visibilite(thingId){
    var targetElement;targetElement = document.getElementById(thingId) ;
    if (targetElement.style.display == "none")
        {targetElement.style.display = "" ;}
    else {targetElement.style.display = "none" ;}
}

</script>

<style>
</style>

<?php
require_once JPATH_SITE . '/components/com_jsn/helpers/jsnabsfunction.php';
foreach (JsnabsGetWeblogMagasin() as $a) {$is_magasin = $a->weblog_is_magasin;}
?>

<table width="100%"><tr style="height:35px; background:#3189ae; color:#fff;">
<td>
    &nbsp;&bull; Par amicale (cliquez sur le nom pour plus de détails)
</td>
<td>
    &nbsp;&bull; Par dernière connexion (les 1000 dernières connexions)
</td>
</tr>
<tr>
<td style="vertical-align : top">
<?php
    foreach(JsnabsGetAllUsersWithActivitiesForWeblog() as $a) {
        if($a->id!='463') {
        //if($is_magasin > 100 && $is_magasin < 200) {?>
            <br/><a href="/" onClick="javascript:visibilite('id_div_<?php echo $a->id;?>'); return false;" >
                <?php echo '&nbsp;&bull; '.$a->firstname.'<span>&nbsp;&nbsp;&nbsp;('.$a->username.')</span>';
                $uid = $a->id;
                $total = JsnabsGetUserActivityCount($uid);
                echo '<span> : '.$total.' connexion(s)</span>';
                ?>
            </a>
            <div id="id_div_<?php echo $a->id;?>" style="display:none;">
                <?php
                foreach(JsnabsGetUserActivities($uid) as $b) {
                    echo '<div style="padding-left: 15px;">&bull; '.date('d/m/Y H:i:s', $b->timestamp).'</div>';
                    $concount = $concount + 1;
                }
                ?>
            </div>
            <br/>
            <?php
            $count = $count + 1;
        //}
        }
    }

echo '<h2>total utilisateurs : '.$count.'</h2>';
echo '<h2>total connexions : '.$concount.'</h2>';


                
?>
</td>

<td style="vertical-align : top">
<?php
    foreach(JsnabsGetUserLastActivityForWeblog() as $c) {
        if($c->userid!='463') {
            echo '<br/><div style="color:#006DAC;">'.'&bull; '.date('d/m/Y H:i:s', $c->timestamp).'&nbsp;&nbsp;&nbsp;';
            $uid = $c->userid;
            foreach(JsnabsGetUserById($uid) as $d) {
                echo '&nbsp;&nbsp;&nbsp;'.$d->firstname.'<span>&nbsp;&nbsp;&nbsp;('.$d->username.')</span>';
                $total = JsnabsGetUserActivityCount($uid);
                echo '<span> : '.$total.' connexion(s)</span></div>';
            }
        }
    }
?>
</td>
</tr>
</table>

{/source}