<?php
$oJ = v('oJ');
$liste_equipes = v('liste_equipes');
$champs = array('JOU_DESC','JOU_SEXE', 'JOU_NOM', 'JOU_PRE', 'JOU_NUM_MEMBRE', 'JOU_LOC', 'JOU_CONTACT', 'JOU_LIC');
?>
<div class="row">
    <div id="side_equipe" class="span2">
        <?php echo zk_aff_logo_j($oJ->get_JOU_AVATAR()); ?>
        <?php if (is_logued() && s('JOU_CLE') != $oJ->get_JOU_CLE()) { ?>
        <div id="action-bar">
            <?php echo href('<i class="icon-envelope icon-white"></i> ' . __('com.action.mp'), array('controleur' => 'messagerie', 'action' => 'ecrire', 'params' => $oJ->get_JOU_CLE(), 'class' => 'awesome awesome-small green ajax btn btn-success btn-small ajax')); ?>
        </div>
        <?php } ?>

        <table class="table">
            <tr>
                <td class="champ-cle">équipe solo</td>
            </tr>
            <tr>
                <td class="champ-valeur"><?php echo zk_equipe(v('EquipeSolo')); ?></td>
            </tr>

            <?php
            if (sizeof((array)$liste_equipes) > 0) {
                ?>
                <tr>
                    <td class="champ-cle">&nbsp;</td>
                </tr>
                <?php
                foreach ((array)$liste_equipes as $EQI_JEU => $Equipes) {
                    ?>
                    <tr>
                        <td class="champ-cle"><?php echo zk_jeu($EQI_JEU); ?></td>
                    </tr>
                    <?php
                    foreach ((array)$Equipes as $Equipe) {
                        ?>
                        <tr>
                            <td class="champ-valeur"><?php echo zk_equipe($Equipe); ?></td>
                        </tr>
                        <?php
                    }
                }
            } ?>
            <tr>
                <td class="champ-cle">&nbsp;</td>
            </tr>
            <?php
            foreach ($champs as $champ) {
                $valeur = call_user_func(array($oJ, 'get_' . $champ));
                if (!empty($valeur)) {
                    ?>
                    <tr>
                        <td class="champ-cle"><?php echo __('com.champ.' . $champ); ?></td>
                    </tr>
                    <tr>
                        <td class="champ-valeur"><?php echo $valeur; ?></td>
                    </tr>
                    <?php
                }
            }
            $Values = v('Values');
            foreach ((array)v('Champs') as $champ) {
                if (!isset($Values[$champ->get_CHA_CLE()])) {
                    continue;
                }
                $value = isset($Values) && isset($Values[$champ->get_CHA_CLE()]) ? $Values[$champ->get_CHA_CLE()] : null;
                ?>

                <tr>
                    <td class="champ-cle">
                        <?php echo $champ->get_CHA_NOM(); ?>
                    </td>
                </tr>
                <tr>
                    <td class="champ-valeur"><?php echo $Values[$champ->get_CHA_CLE()]; ?></td>
                </tr>

                <?php
            } ?>

            <?php
            if (!$oJ->isConnected() && $oJ->get_JOU_ACTIVITE() > 0) {
                ?>
                <tr>
                    <td class="champ-cle">Dernière connexion</td>
                </tr>
                <tr>
                    <td class="champ-valeur"><?php echo $oJ->get_lastConnexion(); ?></td>
                </tr>
                <?php
            }
            ?>

        </table>

    </div>
    <div class="span6" id="infos-joueur">
        <div id="nom-joueur">
            <?php echo zk_joueur($oJ); ?>
            <small>#<?php echo $oJ->get_JOU_CLE(); ?></small>
        </div>

        <?php mur('JOU', $oJ->get_JOU_CLE()); ?>

    </div>
</div>
