<style type="text/css">
.container>.block {
    background: none;
}
.block .content {
    padding: 0px;
    background: none;
    border:0px none;
}

    .content .block {
        margin-top: 0px;
        margin-bottom: 20px;
    }
    .content .block > .content{
        padding: 10px 20px;
    }
</style>
<script type="text/javascript">
    jQuery(window).load(function () {
        //jQuery("div.block:first").hide();

        $("#messagerie select").change(function () {
            $("#messagerie textarea").show().animate({height:200});
            $("#messagerie div").show();
        });

        $("#messagerie input[type=button]").click(function () {
            $("#messagerie textarea").show().animate({height:200});
            $("#messagerie div").show();
        });

        jQuery("#messagerie").submit(function () {
            $("#messagerie input[type=submit]").attr("disabled", "disabled");
            if (jQuery.trim($("#messagerie textarea").val()) == '') {
                alert("Merci de saisir un message");
                return false;
            }
            jQuery.ajax({
                type:"POST",
                url:$(this).attr("action"),
                cache:false,
                data:$(this).serialize(),
                success:function (html) {
                    if (jQuery.trim(html) == 'OK') {
                        alert("Messages envoyes");
                        $("#messagerie textarea").toggle();
                        $("#messagerie div").hide();
                    } else {
                        alert("Erreur : " + html);
                    }
                },
                error:function (request, status, error) {
                    alert("Une erreur est survenue");
                }
            });
            return false;
        });
    });
</script>

<div class="grid_4 alpha">
    <?php echo block('derniers_inscrits'); ?>
    <?php echo block('dernieres_equipes_inscrites'); ?>
    <!--
             <div class="block">
                 <div class="title title_1">Activité</div>
                 <div class="content">Contenu</div>
             </div>
              -->

</div>

<div class="grid_4">
    <!--
             <div class="block">
                 <div class="title title_2">Mes competitions</div>
                 <div class="content">Contenu</div>
             </div> -->

    <?php echo block('dernieres_competitions'); ?>

    <div class="block">
        <div class="title title_4"><?php echo __('adm.index.messagerie'); ?></div>
        <div class="content">
            <form action="<?php echo WWW_ROOT; ?>admin/mail" method="post" id="messagerie">
                <label>Vers : </label>
                <select name="dest">
                    <option value="1">tous</option>
                    <?php if (sizeof(v('tNbEqiParComp')) > 0) { ?>
                    <optgroup label="par competition"> par competition</optgroup>
                    <?php
                    foreach ((array)v('tNbEqiParComp') as $TNS_CLE => $TNS_NOM) {
                        echo '<option value="C_' . $TNS_CLE . '">' . $TNS_NOM . '</option>';
                    }
                }
                    ?>
                    <optgroup label="par jeux">par jeux</optgroup>
                    <?php
                    foreach ((array)v('tNbEqiParJeu') as $jeu_cle => $jeu) {
                        echo '<option value="J_' . $jeu_cle . '">' . $jeu . '</option>';
                    }
                    ?>
                </select>
                <input type="button" value="ok"/>
                <textarea rows="2" cols="10" name="message"
                          style="width: 100%; margin: 20px 0; display: none;"></textarea>

                <div style="display: none">
                    <input type="submit" name="submit" value="envoyer"/>
                    <input type="checkbox" name="capitaines" value="1"/>
                    &nbsp;uniquement aux capitaines
                </div>
            </form>
        </div>
    </div>


    <div class="block">
        <div class="title title_1"><?php echo __('adm.index.stat'); ?></div>
        <div class="content">
            <table class="statistiques">
                <?php if (v('NB_equipes_solo') != (v('NB_membres') + v('NB_admins'))) { ?>
                <tr>
                    <td colspan="2">
                        <div class="err tac" style="width: 200px"><?php echo __('adm.index.warning1v1'); ?><br/>
                            <?php echo href(__('adm.index.generer1v1'), array('controleur' => 'tabjoueurs', 'action' => 'generereqsolo')); ?>
                        </div>
                    </td>
                </tr>
                <?php } ?>
                <tr>
                    <td class="tar"><?php echo v('NB_tournois'); echo v('max_comp') == '' ? '' : ' / ' . v('max_comp'); ?></td>
                    <td><?php echo __('adm.index.tournois'); ?></td>
                </tr>
                <tr>
                    <td class="tar"><?php echo v('NB_tournois_ouverts'); ?></td>
                    <td><?php echo __('adm.index.tournois_en_cours'); ?></td>
                </tr>
                <tr>
                    <td class="tar"><?php echo v('NB_tournois_historique'); ?></td>
                    <td><?php echo __('adm.index.tournois_clos'); ?></td>
                </tr>
                <tr>
                    <td class="tar"><?php echo v('NB_admins'); ?></td>
                    <td><?php echo __('adm.index.admin'); ?></td>
                </tr>
                <tr>
                    <td class="tar"><?php echo v('NB_membres'); ?></td>
                    <td><?php echo __('adm.index.membres'); ?></td>
                </tr>
                <tr>
                    <td class="tar"><?php echo v('NB_equipes'); echo v('max_eq') == '' ? '' : ' / ' . v('max_eq'); ?></td>
                    <td><?php echo __('adm.index.equipes'); ?></td>
                </tr>

            </table>

        </div>

    </div>

    <?php $licence = v('licence'); ?>
    <div class="block">
        <div class="title"><?php echo __('adm.index.licence.info'); ?></div>
        <div class="content">
            <table id="infos_licence" align="center">
                <tr>
                    <td class="tar"><?php echo __('adm.index.version'); ?></td>
                    <td style="color: red;"><?php echo VERSION; ?></td>
                </tr>

                <tr>
                    <td class="tar">Licence enregistré par</td>
                    <td><?php echo $licence['name']; ?></td>
                </tr>
                <tr>
                    <td class="tar">Email client</td>
                    <td><?php echo $licence['email']; ?></td>
                </tr>
                <?php if ($licence['download_expires'] > 0) { ?>
                <tr>
                    <td class="tar">Accès aux mises à jour jusqu'au</td>
                    <td><?php echo date('d/m/Y H:i', $licence['download_expires']); ?></td>
                </tr>
                <?php } ?>
                <?php if ($licence['support_expires'] > 0) { ?>
                <tr>
                    <td class="tar">Accès à l'assistance jusqu'au</td>
                    <td><?php echo date('d/m/Y H:i', $licence['support_expires']); ?></td>
                </tr>
                <?php } ?>
                <?php if ($licence['local_expires'] > 0) { ?>
                <tr>
                    <td class="tar">Expiration de la licence locale</td>
                    <td><?php echo date('d/m/Y H:i', $licence['local_expires']); ?></td>
                </tr>
                <?php } ?>
            </table>

        </div>
    </div>
</div>

<div class="grid_4 omega">
    <?php echo block('derniers_resultats'); ?>
    <?php echo block('derniers_logs'); ?>
</div>

<div class="clear">&nbsp;</div>

