<?php 
loadDB('TabMessages');
$Messages = TabMessages_DB::getMessagesForJou(s('JOU_CLE'));


//add_vars('js',DIR_JS.'jquery.js');
add_vars('js', DIR_JS . 'jquery-1.3.2.min.js');
add_vars('js', DIR_JS . 'jquery-ui-organisation.min.js');
add_vars('js', DIR_JS . 'jquery.blockUI.js');
add_vars('js', DIR_JS . 'thickbox.js');
add_vars('js', DIR_JS . 'jquery-ui-1.7.1.tabs.min.js');
add_vars('js', WWW_WEBROOT . 'js/jquery.fcbkcomplete.min.js');
add_vars('js', WWW_WEBROOT . 'js/uploadify/jquery.uploadify.v2.1.4.min.js');
add_vars('js', WWW_WEBROOT . 'js/uploadify/swfobject.js');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <?php echo zk_header(); ?>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta name="description" content="<?php echo get_option('zk_description'); ?>" />
    <meta name="keywords" content="zKup, tournoi, php, script, gestion" />
    <title><?php echo TITLE; ?></title>

    <link rel="stylesheet" type="text/css" href="<?php echo www_css(); ?>reset.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo www_css(); ?>960.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo www_css(); ?>default.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo www_css(); ?>thickbox.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo www_css(); ?>tabs.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo www_css(); ?>ui/custom.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo www_css(); ?>superfish.css" media="screen"/>
    <link rel="stylesheet" type="text/css" href="<?php echo www_js(); ?>bubbletip/bubbletip.css"/>
    <!--[if IE]>
    <link href="js/bubbletip/bubbletip-IE.css" rel="stylesheet" type="text/css"/>
    <![endif]-->
    <?php echo v('css'); ?>
    <?php echo v('js'); ?>
    <script type="text/javascript" src="<?php echo www_js(); ?>hoverIntent.js"></script>
    <script type="text/javascript" src="<?php echo www_js(); ?>superfish.js"></script>
    <script type="text/javascript" src="<?php echo www_js(); ?>bubbletip.js"></script>
    <script type="text/javascript" src="<?php echo www_js(); ?>jquery.hint-with-password.js"></script>

    <script type="text/javascript">

        // initialise plugins
        $(document).ready(function() {
            function autresCellules() {
                var idEquipe = $(this).find('.uneequipe').attr('rel');
                return $('.equipe-' + idEquipe).parents('.eq');
            }

            $("td.eq")
                    .mouseenter(function () {
                        autresCellules.call(this).css('background-position-y', '-1px');
                    })
                    .mouseleave(function () {
                        autresCellules.call(this).css('background-position-y', '-18px');
                    });

            $(".blockOverlay").live('click',function () {
                $.unblockUI();
            });
            $(document).keyup(function(e) {
              if (e.keyCode == 27) { $.unblockUI(); }   // esc
            });

            $("#box_ui").hide();
            $("a.ajax").live('click',function(e) {
                var elt = $(this);
                e.preventDefault();
                $("#box_ui").html("chargement en cours");
                $.ajax({
                    url: elt.attr('href'),
                    cache: false,
                    success: function(html) {
                        $("#box_ui").html(html);
                    },
                    error: function (request, status, error) {
                        $.unblockUI();
                    }
                });

                $.blockUI({
                    message: $('#box_ui'),
                    css: { top: '10%', width: '500px', height: '380px' }
                });

                return false;
            });

            $("a.ajax-wide").live('click',function(e) {
                var elt = $(this);
                e.preventDefault();
                $("#box_ui").html("chargement en cours");
                $.ajax({
                    url: elt.attr('href'),
                    cache: false,
                    success: function(html) {
                        $("#box_ui").html(html);
                    },
                    error: function (request, status, error) {
                        $.unblockUI();
                    }
                });

                $.blockUI({
                    message: $('#box_ui'),
                    css: { top: '10%', left: '5%', width: '90%', height: '80%' }
                });

                return false;
            });

            //Placer ce code après tout appel Javascript

            $('#nav').superfish({
                delay:       100,                            // one second delay on mouseout
                animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation
                speed:       'fast'                         // faster animation speed
            });

            $('#tip_messages').bubbletip($('#t_messages'), {
                deltaDirection: 'down'
            });
            $('#tip_connexion').bubbletip($('#t_connexion'), {
                deltaDirection: 'down'
            });

            $('input[title!=""]').hint();

        });

    </script>

    <!--Start of Zopim Live Chat Script-->
    <script type="text/javascript">
    window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
    d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
    _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
    $.src='//cdn.zopim.com/?omqr8F5HtFUKHCop9RIdwzfPevL2IwMq';z.t=+new Date;$.
    type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');
    </script>
    <!--End of Zopim Live Chat Script-->

</head>

<body>

<div id="wrapper">
    <div id="header">
        <a href="#" title="Accueil"><img src="<?php echo www_t(); ?>images/logo.jpg" alt="logo"/></a>

        <div id="topnav" class="right">
            <?php echo __('adm.template.bienvenue'); ?><strong><?php echo encode(s('JOU_LOGIN')); ?></strong> !
            <img src="<?php echo www_t(); ?>icons/mail.png" alt="mails"/>
            <a href="#messages" title="<?php echo __('adm.template.mess1'); ?>"
               id="tip_messages"><strong><?php echo sizeof((array)$Messages); ?></strong><?php echo __('adm.template.mess2'); ?>
            </a>
            <!--
			<img src="<?php echo www_t(); ?>icons/lock.png" alt="mails" />
			<a href="#login" title="login" id="tip_connexion">Connexion</a>
			 -->
            <img src="<?php echo www_t(); ?>icons/logout.png" alt="Deconnexion"/>
            <?php echo href(__('com.menu.admin.deconnexion'), array('controleur' => 'espacemembre', 'action' => 'logout')); ?>
        </div>
    </div>
    <ul class="sf-menu" id="nav">
        <?php echo do_action('admin.menu.debut'); ?>
        <li>
            <?php echo href(__('com.menu.admin.site'), '/'); ?>
        </li>
        <li>
            <?php echo href(__('com.menu.admin.admin'), '/admin'); ?>
        </li>
        <?php if (!ZAuth::isResponsable() || ZAuth::isAuth(9)) { ?>
        <li>
            <?php echo href(img('icons/cup.png', 'competitions') . __('com.menu.admin.comp'), '/admin/tournoigerer'); ?>
            <ul>
                <li><a href="#" title="<?php echo __('com.action.aj'); ?>"><?php echo __('com.action.creer'); ?> …</a>
                    <ul>
                        <li><?php echo href(__('com.sel.types_tournoi.tournoi'), '/admin/tournoi-ajouter'); ?></li>
                        <li><?php echo href(__('com.sel.types_tournoi.coupe'), '/admin/tournoi-ajouter'); ?></li>
                        <li><?php echo href(__('com.sel.types_tournoi.champ'), '/admin/tournoi-ajouter'); ?></li>
                        <li><?php echo href(__('com.sel.types_tournoi.ladder'), '/ladder/creation'); ?></li>
                        <li><?php echo href(__('com.sel.types_tournoi.ligue'), '/admin/tournoi-ajouter'); ?></li>
                    </ul>
                </li>
                <li><?php echo href(__('com.action.gerer'), '/admin/tournoigerer'); ?></li>
                <li><?php echo href(__('com.menu.admin.reg'), '/tabreglements/lister'); ?>
                    <ul>
                        <li><?php echo href(__('com.action.aj'), '/tabreglements/ajouter'); ?></li>
                        <li><?php echo href(__('com.action.lister'), '/tabreglements/lister'); ?></li>
                    </ul>
                </li>
                <li><?php echo href(__('com.menu.admin.lister'), '/tabtournois/lister'); ?></li>
                <!--
                    <li><a title="Gerer les competitions" href="/tabtournois/lister.html">Voir par jeu</a></li>
                    <li><a title="Gerer les competitions" href="/tabtournois/lister.html">Voir par type</a></li> -->
            </ul>
        </li>
        <li>
            <?php echo href(img('icons/equipes.gif', 'equipes') . __('com.menu.admin.eq'), '/tabequipes/lister'); ?>
            <ul>
                <li><?php echo href(__('com.action.creer'), '/tabequipes/ajouter'); ?></li>
                <li><?php echo href(__('com.action.gerer'), '/tabequipes/lister'); ?></li>
                <li><?php echo href(__('com.action.exporter'), '/tabequipes/exportcsv'); ?></li>
                <!-- <li><a href="#" title="Contacter">Contacter</a></li> -->
            </ul>
        </li>
        <li>
            <?php echo href(img('icons/user.png') . __('com.menu.admin.joueur'), '/tabjoueurs/lister'); ?>
            <ul>
                <li><?php echo href(__('com.action.creer'), '/tabjoueurs/ajouter'); ?></li>
                <li><?php echo href(__('com.action.gerer'), '/tabjoueurs/lister'); ?></li>
                <li><?php echo href(__('com.action.exporter'), '/tabjoueurs/exportcsv'); ?></li>
                <!-- <li><a href="#" title="Contacter">Contacter</a></li> -->
            </ul>
        </li>
        <li>
            <a href="#"
               title="<?php echo __('com.menu.admin.module'); ?>"><?php echo img('icons/plugin.gif') . __('com.menu.admin.module'); ?></a>
            <ul>
                <li><?php echo href('Gérer', '/modules/index'); ?></li>
                <li><?php echo href(__('com.menu.admin.page'), '/tabcms/lister'); ?></li>
                <li><?php echo href(__('com.menu.admin.champs'), '/tabchamps/lister'); ?></li>
                
                <li><?php echo href(__('com.menu.admin.email'), '/tabmails/lister'); ?></li>
                <li><?php echo href(__('com.menu.admin.comment'), '/tabcommentaires/lister'); ?></li>
                <li><?php echo href(__('com.menu.admin.maj_configs'), '/admin/mettreajoutconfig'); ?></li>
                <li><?php echo href(__('com.menu.admin.cache'), '/admin/cache'); ?></li>
                <li><?php echo href(__('com.menu.admin.log'), '/admin/logs'); ?></li>
                <?php echo do_action('admin.menu.modules'); ?>
                <?php if (OPT_MONITOR) { ?>
                <li><?php echo href(__('com.menu.admin.monitor'), '/admin/monitoring'); ?></li>
                <?php } ?>
            </ul>
        </li>
        <li>
            <a href="#" title="<?php echo __('com.menu.admin.aide_lg'); ?>"><img
                    src="<?php echo www_t(); ?>icons/help.png" alt="Aide"/><?php echo __('com.menu.admin.aide'); ?></a>
            <ul>
                <li><a href="http://www.zkup.net" target="blank" title="Site zKup">zKup.net</a></li>
                <li><a href="http://espaceclient.zkup.net/customers/index.php?task=helpdesk" target="blank" title="Support zKup">Assistance</a></li>
                <li><a href="http://assistance.zkup.net/" target="blank" title="Forum zKup">Forum</a></li>
                <li><a href="http://www.youtube.com/user/zKupFR" target="blank" title="Videos zKup.fr">Vidéos</a></li>
                <li><a href="http://zkup.uservoice.com/forums/74717-general" target="blank" title="donner son avis">Donner son avis</a></li>
            </ul>

        </li>
        <li class="right"><?php echo href(img('icons/key.png') . __('com.bloc.membre.compte'), '/espacemembre/compte'); ?>
        </li>
        <?php } ?>
        <?php echo do_action('admin.menu.fin'); ?>
    </ul>
    <div class="container container_12">
        <div class="block grid_12">
            <div class="content"><?php echo zk_content(); ?></div>
        </div>

        <div class="grid_12" id="copyright">copyright <a href="http://www.zkup.net" title="zKup.net">zKup.net</a> © <?php echo date('Y'); ?>
            - Tous droits réservés
        </div>
        <div class="clear">&nbsp;</div>

    </div>


</div>

<div id="t_messages" class="tip" style="display:none;">
    <h2><?php echo __('com.bloc.membre.inbox'); ?></h2>
    <?php if (sizeof((array)$Messages) > 0) { ?>
    <ul>
        <?php foreach ($Messages as $Message) { ?>
        <li><span><?php echo zk_joueur($Message, false); ?> : </span>
            <?php echo href($Message->get_MES_CONTENU_EXTRAIT(), '/messagerie/lire/' . $Message->get_MES_CLE()); ?></li>
        <?php } ?>
    </ul>
    <?php
}
    echo href(img('icons/add.png', 'nouveau') . __('adm.template.nouveau'), array('controleur' => 'messagerie', 'action' => 'nouveau', 'class' => 'add ajax'));
    ?>
</div>
<!-- 
<div id="t_connexion" class="tip" style="display: none">
	<h2>CONNEXION</h2>
	<form method="post" action="#">
	  <input id="username" name="username" value="" title="Login ou Email" tabindex="1" type="text" /><br />
	  <input id="password" name="password" value="" title="Mot de passe" tabindex="2" type="password" /><br />
	  <input id="signin_submit" value="Connexion" tabindex="3" type="submit" /><br />
	  
	  <a href="#" title="Mot de passe oublie">Mot de passe oublié ?</a><br />
	  <a href="#" title="Login oublie">Login oublié ?</a>
	</form>
</div>
 -->
<div id="box_ui" style="cursor: default"></div>

<script type="text/javascript">
  var uvOptions = {};
  (function() {
    var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
    uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/TXzL5Cm0BQlnwvZOa36GjQ.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
  })();
</script>

</body>
</html>