3. Veuillez prendre la peine de créer un message clair et concis.
N'hésitez pas à utiliser les balisesCode : Tout sélectionner
et [php] afin de rendre l'affichage de votre code lisible et compréhensible par tous. [b]De plus, prenez le temps de bien rédiger votre message afin d'y inclure le plus de détails possibles. Les messages du style "ça marche pas" n'aident d'aucune façon la résolution du problème. Question précise, réponse précise! L'inverse est aussi valable : Question de mer**, réponse de mer**. [/b][/quote]
if ($idUser) {
$DB_CX->DbQuery("SELECT util_nom, util_prenom, util_login, util_interface, util_debut_journee, util_fin_journee, util_telephone_vf, util_planning, util_partage_planning, util_email, util_autorise_affect, util_alert_affect, util_precision_planning, util_semaine_type, util_duree_note, util_rappel_delai, util_rappel_type, util_rappel_email FROM ${PREFIX_TABLE}utilisateur WHERE util_id=".$idUser);
$rsProfil = $DB_CX->DbNextRow();
$ztAction = "UPDATE";
$nouveau = "Nouveau mot de passe";
$labelBouton = "Modifier";
$actionForm = "agenda_traitement.php";
$btnAnnul = "btAnnul()";
$titrePage = "Modification de votre profil";
}
else {
$idUser = 0;
$ztAction = "INSERT";
$nouveau = "Mot de passe";
$labelBouton = "Enregistrer";
$actionForm = "index.php";
$btnAnnul = "window.location.href='index.php?msg=5'";
$titrePage = "Création d'un nouveau compte";
}
// Génération des variables pour les jours affichés par défaut dans le planning mensuel
for ($i=1; $i<8; $i++) {
${"bt".$i} = substr($rsProfil[13],$i-1,1);
}
$iColor = 1;
?>
<!-- MODULE GESTION DU PROFIL -->
<SCRIPT language="JavaScript">
<!--
//Génére automatiquement un login
function loginAuto() {
var theForm = document.frmProfil;
var prenomUtil, nomUtil, loginUtil;
if ((theForm.ztNom.value != "") && (theForm.ztPrenom.value != "")) {
prenomUtil = theForm.ztPrenom.value;
nomUtil = theForm.ztNom.value;
loginUtil = prenomUtil.substr(0,1) + nomUtil.replace(/ +/gi, "");
loginUtil = loginUtil.substr(0,12);
theForm.ztLogin.value = loginUtil.toLowerCase();
}
else {
window.alert("Veuillez saisir votre nom et votre prénom au préalable.");
theForm.ztNom.focus();
}
}
function genereListe(_liste, _tabTexte, _tabValue, _tailleTab) {
for (var i=0; i<_tailleTab; i++)
_liste.options[i]=new Option(_tabTexte[i], _tabValue[i]);
}
function bubbleSort(_tabText, _tabValue,_tailleTab) {
var i,s;
do {
s=0;
for (i=1; i<_tailleTab; i++)
if (_tabText[i-1] > _tabText[i]) {
y = _tabText[i-1];
_tabText[i-1] = _tabText[i];
_tabText[i] = y;
y = _tabValue[i-1];
_tabValue[i-1] = _tabValue[i];
_tabValue[i] = y;
s = 1;
}
} while (s);
}
function videListe(_liste) {
var cpt = _liste.options.length;
for(var i=0; i<cpt; i++) {
_liste.options[0] = null;
}
}
var vPartage = <?php echo $rsProfil[8]; ?>;
var vAffecte = <?php echo $rsProfil[10]; ?>;
function selectUtil(_listeSource, _listeDest) {
var i,j;
var ok = false;
var tabDestTexte = new Array();
var tabDestValue = new Array();
var tailleTabDest = 0;
for (i=0; i<_listeDest.options.length; i++) {
tabDestTexte[tailleTabDest] = _listeDest.options[i].text;
tabDestValue[tailleTabDest++] = _listeDest.options[i].value;
}
for (j=_listeSource.options.length-1; j>=0; j--) {
if (_listeSource.options[j].selected) {
ok = true;
tabDestTexte[tailleTabDest] = _listeSource.options[j].text;
tabDestValue[tailleTabDest++] = _listeSource.options[j].value;
_listeSource.options[j] = null;
}
}
if (ok) {
//Trie du tableau
bubbleSort(tabDestTexte, tabDestValue, tailleTabDest);
//Vide la liste destination
videListe(_listeDest);
//Recrée la liste
genereListe(_listeDest, tabDestTexte, tabDestValue, tailleTabDest);
}
if (vPartage==2)
document.frmProfil.rdPartage[1].checked = true;
if (vAffecte==3)
document.frmProfil.zlAffectation.selectedIndex = 2;
}
function selectTous(_listeSource, _listeDest) {
for (var i=0; i<_listeSource.options.length; i++) {
_listeSource.options[i].selected = true;
}
selectUtil(_listeSource, _listeDest);
}
function recupSelection(_liste, _champ) {
_champ.value = "";
for (var i=0; i<_liste.options.length; i++) {
_champ.value += ((i) ? "+" : "") + _liste.options[i].value;
}
}
//Vérifie la saisie
function saisieOK(theForm) {
recupSelection(theForm.zlPartage, theForm.ztPartage);
recupSelection(theForm.zlAffecte, theForm.ztAffecte);
if (theForm.ztNom.value == "") {
alert("Veuillez saisir votre Nom");
theForm.ztNom.focus();
return (false);
}
if (theForm.ztPrenom.value == "") {
alert("Veuillez saisir votre Prénom");
theForm.ztPrenom.focus();
return (false);
}
if (theForm.ztLogin.value == "") {
window.alert("Vous devez saisir votre login");
theForm.ztLogin.focus();
return (false);
}
<?php if ($ztAction == "UPDATE") { ?>
if (theForm.ztPasswd.value != "") {
if (theForm.ztOldPasswd.value == "") {
window.alert("Veuillez saisir votre ancien mot de passe");
theForm.ztOldPasswd.focus();
return (false);
}
if (theForm.ztPasswd.value != theForm.ztConfirmPasswd.value) {
window.alert("Mots de passe différents");
theForm.ztPasswd.value = "";
theForm.ztConfirmPasswd.value = "";
theForm.ztPasswd.focus();
return (false);
}
}
<?php } else { ?>
if (theForm.ztPasswd.value == "") {
window.alert("Un mot de passe est obligatoire");
theForm.ztPasswd.focus();
return (false);
}
if (theForm.ztPasswd.value != theForm.ztConfirmPasswd.value) {
window.alert("Mots de passe différents");
theForm.ztPasswd.value = "";
theForm.ztConfirmPasswd.value = "";
theForm.ztPasswd.focus();
return (false);
}
<?php } ?>
if (theForm.zlHeureDebut.selectedIndex > theForm.zlHeureFin.selectedIndex) {
window.alert("Veuillez sélectionner une heure de fin\npostérieure à l'heure de début");
theForm.zlHeureFin.focus();
return (false);
}
theForm.submit();
return (true);
}
//-->
</SCRIPT>
<TABLE cellspacing="0" cellpadding="0" width="<?php echo ($idUser) ? "100%" : "565"; ?>" border="0">
<TR>
<TD height="28" class="sousMenu"><?php echo $titrePage; ?></TD>
</TR>
</TABLE>
<BR>
<FORM action="<?php echo $actionForm; ?>" method="post" name="frmProfil">
<INPUT type="hidden" name="sid" value="<?php echo $sid; ?>">
<INPUT type="hidden" name="ztAction" value="<?php echo $ztAction; ?>">
<INPUT type="hidden" name="tcPlg" value="<?php echo $tcPlg; ?>">
<INPUT type="hidden" name="ztFrom" value="profil">
<INPUT type="hidden" name="sd" value="<?php echo date("Y-n-j", $sd); ?>">
<TABLE cellspacing="0" cellpadding="0" width="<?php echo ($idUser) ? "585" : "565"; ?>" border="0">
<TR bgcolor="<?php echo $bgColor[$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Nom</TD>
<TD width="436" class="tabInput"><INPUT type="text" class="Texte" name="ztNom" size="25" maxlength="32" tabindex="1" value="<?php echo htmlspecialchars(stripslashes($rsProfil[0])); ?>" style="text-transform: <?php echo ($AUTO_UPPERCASE == true) ? "uppercase" : "capitalize"; ?>;"></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Prénom</TD>
<TD class="tabInput"><INPUT type="text" class="Texte" name="ztPrenom" size="25" maxlength="32" tabindex="2" value="<?php echo htmlspecialchars(stripslashes($rsProfil[1])); ?>" style="text-transform: capitalize;"></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Login</TD>
<TD class="tabInput"><INPUT type="text" class="Texte" name="ztLogin" size="15" maxlength="12" tabindex="3" value="<?php echo htmlspecialchars(stripslashes($rsProfil[2])); ?>"> <INPUT type="button" class="Bouton" value="Auto" name="btAutoLogin" onclick="javascript: loginAuto();"></TD>
</TR>
<?php if ($ztAction == "UPDATE") { ?>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" nowrap height="20">Ancien mot de passe</TD>
<TD class="tabInput"><INPUT type="password" class="Texte" name="ztOldPasswd" size="15" maxlength="12" tabindex="4" value=""></TD>
</TR>
<?php } ?>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" nowrap height="20"><?php echo $nouveau ?> </TD>
<TD class="tabInput"><INPUT type="password" class="Texte" name="ztPasswd" size="15" maxlength="12" tabindex="5" value=""></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Confirmation</TD>
<TD class="tabInput"><INPUT type="password" class="Texte" name="ztConfirmPasswd" size="15" maxlength="12" tabindex="6" value=""></TD>
</TR>
<?php if (function_exists("mail")) { ?>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Email</TD>
<TD class="tabInput"><INPUT type="text" class="Texte" name="ztEmail" size="35" maxlength="50" tabindex="7" value="<?php echo htmlspecialchars(stripslashes($rsProfil[9])); ?>"> (Pour le rappel des notes)</TD>
</TR>
<?php } ?>
<?php
if ($rsProfil[15] && $idUser) {
$rdR1 = "";
$rdR2 = " checked";
}
else {
$rdR1 = " checked";
$rdR2 = "";
}
?>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Rappel par défaut à la création d'une note</TD>
<TD class="tabInput" style="padding:0px;"><TABLE cellspacing="0" cellpadding="0" width="100%" border="0">
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD height="20" nowrap><IMG src="image/trans.gif" alt="" width="2" height="1" border="0"><LABEL for="rdR1"><INPUT type="radio" name="rdRappel" id="rdR1" value="1" class="Case"<?php echo $rdR1; ?>> Pas de rappel</LABEL></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD height="20"><IMG src="image/trans.gif" alt="" width="2" height="1" border="0"><LABEL for="rdR2"><INPUT type="radio" name="rdRappel" id="rdR2" value="2" class="Case"<?php echo $rdR2; ?>> Rappel</LABEL> <SELECT name="zlRappelDelai">
<?php
if (!$rsProfil[15])
$rsProfil[15] = 5;
for ($i=1;$i<60;$i++) {
$selected = ($rsProfil[15]==$i) ? " selected" : "";
echo " <OPTION value=\"".$i."\"".$selected.">".$i."</OPTION>\n";
}
?>
</SELECT>
<SELECT name="zlRappelType">
<OPTION value="1"<?php if ($rsProfil[16]==1) echo " selected"; ?>>minute(s)</OPTION>
<OPTION value="60"<?php if ($rsProfil[16]==60) echo " selected"; ?>>heure(s)</OPTION>
<OPTION value="1440"<?php if ($rsProfil[16]==1440) echo " selected"; ?>>jour(s)</OPTION>
</SELECT> à l'avance<?php if (function_exists("mail")) { ?> <LABEL for="AlEmail"><INPUT type="checkbox" name="ckRappelEmail" value="1" class="Case" id="AlEmail"<?php if ($rsProfil[17]==1) echo " checked"; ?>> copie par mail</LABEL><?php } ?></TD>
</TR>
</TABLE></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Journée type</TD>
<TD nowrap class="tabInput"><TABLE cellspacing="0" cellpadding="0" width="320" border="0">
<TR bgcolor="<?php echo $bgColor[$iColor%2]; ?>">
<TD width="50%" nowrap>Débute à <SELECT name="zlHeureDebut">
<?php
for ($i=0; $i<23.5;$i=$i+0.5) {
$selected = ($i == $rsProfil[4]) ? " selected" : "";
echo " <OPTION value=\"".$i."\"".$selected.">".date("H:i",mktime(floor($i),($i*60)%60,0,1,1,2000))."</OPTION>\n";
}
?>
</SELECT></TD>
<TD width="50%" nowrap>Termine à <SELECT name="zlHeureFin">
<?php
for ($i=0.5; $i<24;$i=$i+0.5) {
$selected = ($i == $rsProfil[5]) ? " selected" : "";
echo " <OPTION value=\"".$i."\"".$selected.">".date("H:i",mktime(floor($i),($i*60)%60,0,1,1,2000))."</OPTION>\n";
}
?>
</SELECT></TD>
</TR>
</TABLE></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Téléphone VF</TD>
<TD class="tabInput"><LABEL for="vf"><INPUT type="radio" name="rdTelephone" value="O" class="Case" id="vf"<?php if ($rsProfil[6]!="N") echo " checked"; ?>> Oui</LABEL> <LABEL for="novf"><INPUT type="radio" name="rdTelephone" value="N" class="Case" id="novf"<?php if ($rsProfil[6]=="N") echo " checked"; ?>> Non</LABEL> (Affiche les numéros de téléphone en XX.XX.XX.XX.XX)</TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Interface</TD>
<TD class="tabInput"><SELECT name="zlInterface" size="1">
<?php
// Récupération des noms d'interface directement dans les fichiers du répertoire "skins"
$rep = opendir('./skins');
while ($file = readdir($rep)) {
if ($file != '..' && $file != '.' && $file != '') {
if (!is_dir($file) && $fd = @fopen('./skins/'.$file, "r")) {
$ligne = fread($fd, 50);
$pos1 = @strpos($ligne,"\"");
$pos2 = @strpos(substr($ligne,$pos1+1),"\"");
$tabInterface[substr($file,0,1)] = @substr($ligne,$pos1+1,$pos2);
fclose($fd);
}
}
}
closedir($rep);
clearstatcache();
for ($i=0; $i<count($tabInterface); $i++) {
$selected = ($rsProfil[3] == $i) ? " selected" : "";
echo " <OPTION value=\"".$i."\"".$selected.">".$tabInterface[$i]."</OPTION>\n";
}
?>
</SELECT></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Planning par défaut</TD>
<TD class="tabInput"><SELECT name="zlPlanning" size="1">
<OPTION value="0"<?php if ($rsProfil[7]==0) echo " selected"; ?>>Quotidien</OPTION>
<OPTION value="1"<?php if ($rsProfil[7]==1) echo " selected"; ?>>Hebdomadaire</OPTION>
<OPTION value="2"<?php if ($rsProfil[7]==2) echo " selected"; ?>>Mensuel</OPTION>
</SELECT></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Semaine type</TD>
<TD class="tabInput"><LABEL for="lundi"><INPUT type="checkbox" name="bt1" value="1"<?php if ($bt1==1) echo " checked"; ?> class="case" id="lundi"> Lun</LABEL>
<LABEL for="mardi"><INPUT type="checkbox" name="bt2" value="1"<?php if ($bt2==1) echo " checked"; ?> class="case" id="mardi"> Mar</LABEL>
<LABEL for="mercredi"><INPUT type="checkbox" name="bt3" value="1"<?php if ($bt3==1) echo " checked"; ?> class="case" id="mercredi"> Mer</LABEL>
<LABEL for="jeudi"><INPUT type="checkbox" name="bt4" value="1"<?php if ($bt4==1) echo " checked"; ?> class="case" id="jeudi"> Jeu</LABEL>
<LABEL for="vendredi"><INPUT type="checkbox" name="bt5" value="1"<?php if ($bt5==1) echo " checked"; ?> class="case" id="vendredi"> Ven</LABEL>
<LABEL for="samedi"><INPUT type="checkbox" name="bt6" value="1"<?php if ($bt6==1) echo " checked"; ?> class="case" id="samedi"> Sam</LABEL>
<LABEL for="dimanche"><INPUT type="checkbox" name="bt7" value="1"<?php if ($bt7==1) echo " checked"; ?> class="case" id="dimanche"> Dim</LABEL></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Précision d'affichage</TD>
<TD class="tabInput"><SELECT name="zlPrecision" size="1">
<OPTION value="1"<?php if ($rsProfil[12]==1) echo " selected"; ?>>30 minutes</OPTION>
<OPTION value="2"<?php if ($rsProfil[12]==2) echo " selected"; ?>>15 minutes</OPTION>
</SELECT> (Dans le planning quotidien et hebdomadaire)</TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Durée d'une note</TD>
<TD class="tabInput"><SELECT name="zlDureeNote" size="1">
<OPTION value="1"<?php if ($rsProfil[14]==1) echo " selected"; ?>>15 minutes</OPTION>
<OPTION value="2"<?php if ($rsProfil[14]==2) echo " selected"; ?>>30 minutes</OPTION>
<OPTION value="3"<?php if ($rsProfil[14]==3) echo " selected"; ?>>45 minutes</OPTION>
<OPTION value="4"<?php if ($rsProfil[14]==4) echo " selected"; ?>>1 heure</OPTION>
</SELECT> (Sélection automatique de l'heure de fin d'une note)</TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" nowrap>Partage du planning<BR>en consultation</TD>
<TD style="padding-bottom:2px;" class="tabInput">Personnes autorisées à consulter mon planning<BR>
<LABEL for="prive"><INPUT type="radio" name="rdPartage" value="0" class="Case" id="prive"<?php if ($rsProfil[8]=="0") echo " checked"; ?> onclick="javascript: vPartage=0; selectTous(document.frmProfil.zlPartage, document.frmProfil.zlUtilisateur);"> Non partagé</LABEL> <LABEL for="selectif"><INPUT type="radio" name="rdPartage" value="2" class="Case" id="selectif"<?php if ($rsProfil[8]=="2") echo " checked"; ?> onclick="javascript: vPartage=2;"> Au choix</LABEL> <LABEL for="public"><INPUT type="radio" name="rdPartage" value="1" class="Case" id="public"<?php if ($rsProfil[8]=="1") echo " checked"; ?> onclick="javascript: vPartage=1; selectTous(document.frmProfil.zlUtilisateur, document.frmProfil.zlPartage);"> Tout le monde</LABEL>
<BR><BR><TABLE cellspacing="0" cellpadding="0" width="100%" border="0" align="center">
<TR>
<TD><SELECT name="zlUtilisateur" id="zlUtilisateur" size="6" multiple style="width:200px;border: <?php echo $FormulaireBordureInput; ?>;">
<?php
// On récupere la liste des personnes concernees par le partage sauf l'utilisateur courant
if ($nc!=1) { // On n'est pas le cas d'une création de compte
$DB_CX->DbQuery("SELECT ppl_consultant_id FROM ${PREFIX_TABLE}planning_partage WHERE ppl_util_id=".$idUser." AND ppl_consultant_id!=".$idUser);
while ($enr = $DB_CX->DbNextRow())
$tabPartage[] = $enr[0];
} else {
$tabPartage = explode("+", $ztPartage);
}
// On récupère la liste des utilisateurs sauf l'utilisateur courant
$DB_CX->DbQuery("SELECT util_id, CONCAT(util_nom,' ',util_prenom) AS nomUtil FROM ${PREFIX_TABLE}utilisateur WHERE util_id!=".$idUser." ORDER BY nomUtil");
while ($rsUtil = $DB_CX->DbNextRow()) {
$selected = "";
for ($i=0; $i<count($tabPartage) && empty($selected); $i++) {
if ($tabPartage[$i] == $rsUtil[0])
$selected = " selected";
}
echo " <OPTION value=\"".$rsUtil[0]."\"".$selected.">".$rsUtil[1]."</OPTION>\n";
}
?>
</SELECT></TD>
<TD align="center" valign="middle"><TABLE border=0 cellpadding=0 cellspacing=0>
<TR>
<TD> <INPUT type="button" class="PickList" name="btSelect" id="btSelect" value="»" title="Ajouter" onClick="javascript: vPartage=2; selectUtil(document.frmProfil.zlUtilisateur, document.frmProfil.zlPartage);"> </TD>
</TR>
<TR>
<TD height="6"></TD>
</TR>
<TR>
<TD nowrap> <INPUT type="button" class="PickList" name="btDeselect" id="btDeselect" value="«" title="Enlever" onClick="javascript: vPartage=2; selectUtil(document.frmProfil.zlPartage, document.frmProfil.zlUtilisateur);"> </TD>
</TR>
</TABLE></TD>
<TD><SELECT name="zlPartage" id="zlPartage" size="6" multiple style="width:200px"></SELECT></TD>
</TR>
</TABLE><INPUT type="hidden" name="ztPartage" value=""></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" nowrap>Partage du planning<BR>en modification</TD>
<SCRIPT language="JavaScript">
<!--
function selectAffect(_list) {
switch (_list) {
case '1' : vAffecte=1; selectTous(document.frmProfil.zlUtilisateur2, document.frmProfil.zlAffecte); break;
case '2' : vAffecte=2; selectTous(document.frmProfil.zlAffecte, document.frmProfil.zlUtilisateur2); break;
case '3' : vAffecte=3; break;
default : vAffecte=0; selectTous(document.frmProfil.zlAffecte, document.frmProfil.zlUtilisateur2);
}
}
//-->
</SCRIPT>
<TD style="padding-bottom:1px;" class="tabInput">Personne(s) pouvant m'affecter une note<BR><SELECT name="zlAffectation" size="1" onchange="selectAffect(this.value);">
<OPTION value="0"<?php if ($rsProfil[10]==0) echo " selected"; ?>>Aucune</OPTION>
<OPTION value="2"<?php if ($rsProfil[10]==2) echo " selected"; ?>>Celles qui peuvent consulter mon planning</OPTION>
<OPTION value="3"<?php if ($rsProfil[10]==3) echo " selected"; ?>>Au choix</OPTION>
<OPTION value="1"<?php if ($rsProfil[10]==1) echo " selected"; ?>>Tout le monde</OPTION>
</SELECT><BR><BR>
<TABLE cellspacing="0" cellpadding="0" width="100%" border="0" align="center">
<TR>
<TD><SELECT name="zlUtilisateur2" id="zlUtilisateur2" size="6" multiple style="width:200px;border: <?php echo $FormulaireBordureInput; ?>;">
<?php
$tabPartage = array();
// On récupere la liste des personnes concernees par l'affectation sauf l'utilisateur courant
if ($nc!=1) { // On n'est pas le cas d'une création de compte
$DB_CX->DbQuery("SELECT paf_consultant_id FROM ${PREFIX_TABLE}planning_affecte WHERE paf_util_id=".$idUser." AND paf_consultant_id!=".$idUser);
while ($enr = $DB_CX->DbNextRow())
$tabPartage[] = $enr[0];
} else {
$tabPartage = explode("+", $ztAffecte);
}
// On récupère la liste des utilisateurs sauf l'utilisateur courant
$DB_CX->DbQuery("SELECT util_id, CONCAT(util_nom,' ',util_prenom) AS nomUtil FROM ${PREFIX_TABLE}utilisateur WHERE util_id!=".$idUser." ORDER BY nomUtil");
while ($rsUtil = $DB_CX->DbNextRow()) {
$selected = "";
for ($i=0; $i<count($tabPartage) && empty($selected); $i++) {
if ($tabPartage[$i] == $rsUtil[0])
$selected = " selected";
}
echo " <OPTION value=\"".$rsUtil[0]."\"".$selected.">".$rsUtil[1]."</OPTION>\n";
}
?>
</SELECT></TD>
<TD align="center" valign="middle"><TABLE border=0 cellpadding=0 cellspacing=0>
<TR>
<TD> <INPUT type="button" class="PickList" name="btSelect" id="btSelect" value="»" title="Ajouter" onClick="javascript: vAffecte=3; selectUtil(document.frmProfil.zlUtilisateur2, document.frmProfil.zlAffecte);"> </TD>
</TR>
<TR>
<TD height="6"></TD>
</TR>
<TR>
<TD nowrap> <INPUT type="button" class="PickList" name="btDeselect" id="btDeselect" value="«" title="Enlever" onClick="javascript: vAffecte=3; selectUtil(document.frmProfil.zlAffecte, document.frmProfil.zlUtilisateur2);"> </TD>
</TR>
</TABLE></TD>
<TD><SELECT name="zlAffecte" id="zlAffecte" size="6" multiple style="width:200px"></SELECT></TD>
</TR>
</TABLE><INPUT type="hidden" name="ztAffecte" value=""><BR>
<LABEL for="email"><INPUT type="checkbox" name="ckAlertEmail" value="O" class="Case" id="email"<?php if ($rsProfil[11]=="O") echo " checked"; ?>> M'informer par mail lorsqu'une note m'est affectée</LABEL></TD>
</TR>
</TABLE>
<BR><INPUT type="button" name="btEnregistre" value="<?php echo $labelBouton; ?>" onClick="javascript: return saisieOK(document.frmProfil);" class="bouton"> <INPUT type="button" name="btAnnule" value="Annuler" onclick="javascript: <?php echo $btnAnnul ?>;" class="bouton">
</FORM>
<!-- FIN MODULE GESTION DU PROFIL -->
3. Veuillez prendre la peine de créer un message clair et concis.
N'hésitez pas à utiliser les balisesCode : Tout sélectionner
et [php][/color][/b] afin de rendre l'affichage de votre [b][color=red]code lisible et compréhensible[/color][/b] par tous. De plus, prenez le temps de bien rédiger votre message afin d'y inclure le plus de détails possibles. Les messages du style "ça marche pas" n'aident d'aucune façon la résolution du problème. Question précise, réponse précise! L'inverse est aussi valable : Question de mer**, réponse de mer**. [/quote] [color=red] J'édite le message pour toi mais c'est ma seule fois. Est-ce que tu peut isoler le problème afin de réduire la tartine de code que tu nous as donné ?[/color]
<?php
if (!$rsProfil[15])
$rsProfil[15] = 5;
for ($i=1;$i<60;$i++) {
$selected = ($rsProfil[15]==$i) ? " selected" : "";
echo " <OPTION value=\"".$i."\"".$selected.">".$i."</OPTION>\n";
}
?>
</SELECT>
<SELECT name="zlRappelType">
<OPTION value="1"<?php if ($rsProfil[16]==1) echo " selected"; ?>>minute(s)</OPTION>
<OPTION value="60"<?php if ($rsProfil[16]==60) echo " selected"; ?>>heure(s)</OPTION>
<OPTION value="1440"<?php if ($rsProfil[16]==1440) echo " selected"; ?>>jour(s)</OPTION>
</SELECT> à l'avance<?php if (function_exists("mail")) { ?> <LABEL for="AlEmail"><INPUT type="checkbox" name="ckRappelEmail" value="1" class="Case" id="AlEmail"<?php if ($rsProfil[17]==1) echo " checked"; ?>> copie par mail</LABEL><?php } ?></TD>
</TR>
</TABLE></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Journée type</TD>
<TD nowrap class="tabInput"><TABLE cellspacing="0" cellpadding="0" width="320" border="0">
<TR bgcolor="<?php echo $bgColor[$iColor%2]; ?>">
<TD width="50%" nowrap>Débute à <SELECT name="zlHeureDebut">
<?php
for ($i=0; $i<23.5;$i=$i+0.5) {
$selected = ($i == $rsProfil[4]) ? " selected" : "";
echo " <OPTION value=\"".$i."\"".$selected.">".date("H:i",mktime(floor($i),($i*60)%60,0,1,1,2000))."</OPTION>\n";
}
?>
</SELECT></TD>
<TD width="50%" nowrap>Termine à <SELECT name="zlHeureFin">
<?php
for ($i=0.5; $i<24;$i=$i+0.5) {
$selected = ($i == $rsProfil[5]) ? " selected" : "";
echo " <OPTION value=\"".$i."\"".$selected.">".date("H:i",mktime(floor($i),($i*60)%60,0,1,1,2000))."</OPTION>\n";
}
?>
</SELECT></TD>
</TR>
</TABLE></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Téléphone VF</TD>
<TD class="tabInput"><LABEL for="vf"><INPUT type="radio" name="rdTelephone" value="O" class="Case" id="vf"<?php if ($rsProfil[6]!="N") echo " checked"; ?>> Oui</LABEL> <LABEL for="novf"><INPUT type="radio" name="rdTelephone" value="N" class="Case" id="novf"<?php if ($rsProfil[6]=="N") echo " checked"; ?>> Non</LABEL> (Affiche les numéros de téléphone en XX.XX.XX.XX.XX)</TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Interface</TD>
<TD class="tabInput"><SELECT name="zlInterface" size="1">
<?php
// Récupération des noms d'interface directement dans les fichiers du répertoire "skins"
$rep = opendir('./skins');
while ($file = readdir($rep)) {
if ($file != '..' && $file != '.' && $file != '') {
if (!is_dir($file) && $fd = @fopen('./skins/'.$file, "r")) {
$ligne = fread($fd, 50);
$pos1 = @strpos($ligne,"\"");
$pos2 = @strpos(substr($ligne,$pos1+1),"\"");
$tabInterface[substr($file,0,1)] = @substr($ligne,$pos1+1,$pos2);
fclose($fd);
}
}
}
closedir($rep);
clearstatcache();
for ($i=0; $i<count($tabInterface); $i++) {
$selected = ($rsProfil[3] == $i) ? " selected" : "";
echo " <OPTION value=\"".$i."\"".$selected.">".$tabInterface[$i]."</OPTION>\n";
}
?>
</SELECT></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Planning par défaut</TD>
<TD class="tabInput"><SELECT name="zlPlanning" size="1">
<OPTION value="0"<?php if ($rsProfil[7]==0) echo " selected"; ?>>Quotidien</OPTION>
<OPTION value="1"<?php if ($rsProfil[7]==1) echo " selected"; ?>>Hebdomadaire</OPTION>
<OPTION value="2"<?php if ($rsProfil[7]==2) echo " selected"; ?>>Mensuel</OPTION>
</SELECT></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Semaine type</TD>
<TD class="tabInput"><LABEL for="lundi"><INPUT type="checkbox" name="bt1" value="1"<?php if ($bt1==1) echo " checked"; ?> class="case" id="lundi"> Lun</LABEL>
<LABEL for="mardi"><INPUT type="checkbox" name="bt2" value="1"<?php if ($bt2==1) echo " checked"; ?> class="case" id="mardi"> Mar</LABEL>
<LABEL for="mercredi"><INPUT type="checkbox" name="bt3" value="1"<?php if ($bt3==1) echo " checked"; ?> class="case" id="mercredi"> Mer</LABEL>
<LABEL for="jeudi"><INPUT type="checkbox" name="bt4" value="1"<?php if ($bt4==1) echo " checked"; ?> class="case" id="jeudi"> Jeu</LABEL>
<LABEL for="vendredi"><INPUT type="checkbox" name="bt5" value="1"<?php if ($bt5==1) echo " checked"; ?> class="case" id="vendredi"> Ven</LABEL>
<LABEL for="samedi"><INPUT type="checkbox" name="bt6" value="1"<?php if ($bt6==1) echo " checked"; ?> class="case" id="samedi"> Sam</LABEL>
<LABEL for="dimanche"><INPUT type="checkbox" name="bt7" value="1"<?php if ($bt7==1) echo " checked"; ?> class="case" id="dimanche"> Dim</LABEL></TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Précision d'affichage</TD>
<TD class="tabInput"><SELECT name="zlPrecision" size="1">
<OPTION value="1"<?php if ($rsProfil[12]==1) echo " selected"; ?>>30 minutes</OPTION>
<OPTION value="2"<?php if ($rsProfil[12]==2) echo " selected"; ?>>15 minutes</OPTION>
</SELECT> (Dans le planning quotidien et hebdomadaire)</TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" height="20">Durée d'une note</TD>
<TD class="tabInput"><SELECT name="zlDureeNote" size="1">
<OPTION value="1"<?php if ($rsProfil[14]==1) echo " selected"; ?>>15 minutes</OPTION>
<OPTION value="2"<?php if ($rsProfil[14]==2) echo " selected"; ?>>30 minutes</OPTION>
<OPTION value="3"<?php if ($rsProfil[14]==3) echo " selected"; ?>>45 minutes</OPTION>
<OPTION value="4"<?php if ($rsProfil[14]==4) echo " selected"; ?>>1 heure</OPTION>
</SELECT> (Sélection automatique de l'heure de fin d'une note)</TD>
</TR>
<TR bgcolor="<?php echo $bgColor[++$iColor%2]; ?>">
<TD class="tabIntitule" nowrap>Partage du planning<BR>en consultation</TD>
<TD style="padding-bottom:2px;" class="tabInput">Personnes autorisées à consulter mon planning<BR>
<LABEL for="prive"><INPUT type="radio" name="rdPartage" value="0" class="Case" id="prive"<?php if ($rsProfil[8]=="0") echo " checked"; ?> onclick="javascript: vPartage=0; selectTous(document.frmProfil.zlPartage, document.frmProfil.zlUtilisateur);"> Non partagé</LABEL> <LABEL for="selectif"><INPUT type="radio" name="rdPartage" value="2" class="Case" id="selectif"<?php if ($rsProfil[8]=="2") echo " checked"; ?> onclick="javascript: vPartage=2;"> Au choix</LABEL> <LABEL for="public"><INPUT type="radio" name="rdPartage" value="1" class="Case" id="public"<?php if ($rsProfil[8]=="1") echo " checked"; ?> onclick="javascript: vPartage=1; selectTous(document.frmProfil.zlUtilisateur, document.frmProfil.zlPartage);"> Tout le monde</LABEL>
<BR><BR><TABLE cellspacing="0" cellpadding="0" width="100%" border="0" align="center">
<TR>
<TD><SELECT name="zlUtilisateur" id="zlUtilisateur" size="6" multiple style="width:200px;border: <?php echo $FormulaireBordureInput; ?>;">
<?php
// On récupere la liste des personnes concernees par le partage sauf l'utilisateur courant
if ($nc!=1) { // On n'est pas le cas d'une création de compte
$DB_CX->DbQuery("SELECT ppl_consultant_id FROM ${PREFIX_TABLE}planning_partage WHERE ppl_util_id=".$idUser." AND ppl_consultant_id!=".$idUser);
while ($enr = $DB_CX->DbNextRow())
$tabPartage[] = $enr[0];
} else {
$tabPartage = explode("+", $ztPartage);
}
// On récupère la liste des utilisateurs sauf l'utilisateur courant
$DB_CX->DbQuery("SELECT util_id, CONCAT(util_nom,' ',util_prenom) AS nomUtil FROM ${PREFIX_TABLE}utilisateur WHERE util_id!=".$idUser." ORDER BY nomUtil");
while ($rsUtil = $DB_CX->DbNextRow()) {
$selected = "";
for ($i=0; $i<count($tabPartage) && empty($selected); $i++) {
if ($tabPartage[$i] == $rsUtil[0])
$selected = " selected";
Tu sais que tu dois chercher ces valeurs ou bien une division qui des heures qui aboutit à ces valeurs.soit en 15 min, 30 min ou 1 heure
Ah bon ?je suis debutant et je ne connais pas les division pour trouver ces valeurs