<?php
/*
* Vue générée automatiquement le : 02/03/2009 à 15:40:50
* @author : Karl COSSE
*/

set_vars('pays', p('pays'));
?>
<h1><?php echo __('tj.mod.titre'); ?></h1>
<?php echo form('form', array('method' => "post", 'legend' => __('tj.mod.titre'), "class" => "tabEdition"), false, true, false); ?>
<table style="width:100%">
    <tr>
        <td>
            <table class="table-css table-css-noborder">
<?php
if (v('erreur')) {
    ?>
    <tr>
        <td colspan="3" class="erreurs"><?php echo display_erreurs(); ?></td>
    </tr>
    <?php } ?>
    <tr>
        <td class="g"></td>
        <td class="d"><label for="Date inscription"><?php echo __('com.txt.date_insc'); ?></label> -
            <?php echo date_fr(p('JOU_DATE_INS')); ?></td>
    </tr>
    <?php if (!PHPBB_INTEGRATION) { ?>
    <?php if ( !OPT_IP_ENCODE ) { ?>
    <tr>
        <td class="g"><label for="ip">IP</label></td>
        <td class="d"><a href="http://www.geoiptool.com/fr/?IP=<?php echo p('JOU_IP'); ?>" title="geo ip"><?php echo p('JOU_IP'); ?></a></td>
    </tr>
    <?php } ?>
    <tr>
        <td class="g"><label for="Login"><?php echo __('com.txt.login'); ?></label></td>
        <td class="d"><?php echo form('input', array('type' => 'text', 'maxlength' => 40, 'name' => 'JOU_LOGIN')); ?></td>
    </tr>
    <tr>
        <td class="g"><label for="Mot de passe"><?php echo __('com.txt.mdp'); ?></label></td>
        <td class="d"><?php echo form('input', array('type' => 'text', 'maxlength' => 32, 'name' => 'JOU_PASS')); ?></td>
    </tr>
    <tr>
        <td class="g"><label for="Mail"><?php echo __('com.txt.mail'); ?></label></td>
        <td class="d"><?php echo form('input', array('type' => 'text', 'maxlength' => 100, 'name' => 'JOU_MAIL')); ?></td>
    </tr>
    <?php } else { ?>
    <tr>
        <td class="g"><label for="Login"><?php echo __('com.txt.login'); ?></label></td>
        <td class="d" style="text-align:left"><strong style="font-size: 1.3em;"><?php echo p('JOU_LOGIN'); ?></strong></td>
    </tr>
    <?php } ?>
    <tr>
        <td class="g"><label for="Etat"><?php echo __('com.txt.etat'); ?></label></td>
        <td class="d"><?php echo formSelect('JOU_ETAT', array(), v('tEtats')); ?></td>
    </tr>
    <tr>
        <td class="g"><label for="Pays"><?php echo __('com.txt.pays'); ?></label></td>
        <td class="d"><?php echo do_action('liste_pays'); ?></td>
    </tr>
    <tr>
        <td class="g"><label for="Num&eacute;ro de membre"><?php echo __('com.txt.num_mem'); ?></label></td>
        <td class="d"><?php echo form('input', array('type' => 'text', 'maxlength' => 200, 'name' => 'JOU_NUM_MEMBRE')); ?></td>
    </tr>

    <tr>
        <td class="g"><label for="Nom"><?php echo __('com.txt.nom'); ?></label></td>
        <td class="d"><?php echo form('input', array('type' => 'text', 'maxlength' => 40, 'name' => 'JOU_NOM')); ?></td>
    </tr>
    <tr>
        <td class="g"><label for="Pr&eacute;nom"><?php echo __('com.txt.prenom'); ?></label></td>
        <td class="d"><?php echo form('input', array('type' => 'text', 'maxlength' => 50, 'name' => 'JOU_PRE')); ?></td>
    </tr>
    <tr>
        <td class="g"><label for="Ville"><?php echo __('com.txt.localisation'); ?></label></td>
        <td class="d"><?php echo form('input', array('type' => 'text', 'maxlength' => 30, 'name' => 'JOU_LOC')); ?></td>
    </tr>
    <tr>
        <td class="g"><label for="Sexe"><?php echo __('com.txt.sexe'); ?></label></td>
        <td class="d"><?php echo formSelect('JOU_SEXE', array(), v('tSexe'), false); ?></td>
    </tr>
    <tr>
        <td class="g"><label for="Contact (msn, aim, ...)"><?php echo __('com.txt.contact'); ?></label></td>
        <td class="d"><?php echo form('input', array('type' => 'text', 'maxlength' => 50, 'name' => 'JOU_CONTACT')); ?></td>
    </tr>

    <tr>
        <td class="g"><label for="Date de naissance"><?php echo __('com.txt.date_nai'); ?></label></td>
        <td class="d"><?php echo form('input', array('type' => 'text', 'name' => 'JOU_DATE_NAI')); ?></td>
    </tr>

    <tr>
        <td class="g"><?php echo __('com.txt.mail_pm'); ?></td>
        <td class="d"><?php echo formSelect('JOU_MAIL_MP', array(), v('tOuiNon')); ?></td>
    </tr>

    <tr>
        <td class="g"><label for="Licence, steamid, etc"><?php echo __('com.txt.licence'); ?></label></td>
        <td class="d"><?php echo form('textarea', array('name' => 'JOU_LIC', 'id' => 'JOU_LIC', 'class' => 'w100 h50px')); ?></td>
    </tr>
    <tr>
        <td class="g"><label for="A propos de moi"><?php echo __('com.txt.desc'); ?></label></td>
        <td class="d"><?php echo form('textarea', array('name' => 'JOU_DESC', 'id' => 'JOU_DESC', 'class' => 'w100 h100px')); ?></td>
    </tr>
    
    <?php foreach((array)v('Champs') as $champ){ 
    	$value = isset($_POST['ATTRIBUTS']) && isset($_POST['ATTRIBUTS']['CHA_'.$champ->get_CHA_CLE()])?$_POST['ATTRIBUTS']['CHA_'.$champ->get_CHA_CLE()]:null;
    	?>
    
    <tr>
        <td class="g"><label for="CHA_<?php echo $champ->get_CHA_CLE(); ?>"><?php echo $champ->get_CHA_NOM();echo $champ->get_CHA_REQ()?'<b style="color: red; font-size: 1.3em"> *</b>':''; ?></label></td>
        <td class="d"><?php echo form('input', array('name' => 'ATTRIBUTS[CHA_'.$champ->get_CHA_CLE().']', 'id' => 'CHA_'.$champ->get_CHA_CLE(),'value'=>$value)); ?></td>
    </tr>
    
    <?php } ?>
    <?php if (p('JOU_AVATAR') != '') { ?>
    <tr>
        <td class="g"><label for="Avatar"><?php echo __('com.txt.avatar'); ?></label></td>
        <td>
        	<?php echo form('input', array('type' => 'hidden', 'name' => 'JOU_AVATAR')); ?>
        	<input type="checkbox" name="JOU_AVATAR_RAZ" value="1"/>
        	 <?php echo __('com.action.sup'); ?> ?</td>
    </tr>
    <tr>
        <td class="g"></td>
        <td class="d"><?php echo zk_aff_logo_j(p('JOU_AVATAR')); ?></td>
    </tr>
    <?php } ?>
    <?php echo do_action('vues.admin.joueurs.modifier', p('JOU_CLE')); ?>
    <tr valign="top">
        <td></td>
        <td>
            <?php echo formSubmit('Modifier'); ?> <?php echo href('Supprimer ce joueur', array('controleur' => 'tabjoueurs', 'action' => 'supprimer', 'params' => Routage::params())); ?>
        </td>
    </tr>
            </table>
        </td>
        <td style="width: 50%; padding: 20px">
            <?php if (sizeof((array)v('Equipes')) > 0) { ?>
            <h3 align="center"><?php echo __('tj.edit.equipes'); ?></h3>
            <table width="100%" style="margin: 20px auto" class="lister h-center v-middle">
                <tr>
                    <th><?php echo __('com.txt.equipe'); ?></th>
                    <th><?php echo __('com.txt.date_insc'); ?></th>
                    <th><?php echo __('com.action'); ?></th>
                </tr>
                <?php foreach ((array)v('Equipes') as $element) { ?>
                <tr>
                    <td><?php echo href(zk_equipe($element, false), array('controleur' => 'tabequipes', 'action' => 'modifier', 'params' => $element->get_EQI_CLE())); ?></td>
                    <td align="center"><?php echo date_fr($element->get_EQI_DATE_INS(), false); ?></td>
                    <td class="action">
                        <?php echo href(img('group_edit.png', 'Cliquer ici pour modifier un equipe'), array('controleur' => 'TabEquipes', 'action' => 'Modifier', 'params' => $element->get_EQI_CLE())); ?>
                        <?php echo href(img('group_delete.png', 'Cliquer ici pour supprimer un equipe'), array('controleur' => 'TabEquipes', 'action' => 'Supprimer', 'params' => $element->get_EQI_CLE(), 'onclick' => "return confirm('Confirmez vous la suppression ?')")); ?>
                    </td>
                </tr>
                <?php } ?>
            </table>
            <?php } ?>
            <h3 align="center"><?php echo __('adm.bloc.log'); ?></h3>
            <?php load_template(DIR_TEMPLATES . 'logs.tpl'); ?></td>
    </tr>
</table>
<?php echo formClose('form'); ?>