Pb Nouvelle version Php 5 ou Mysql

fredo35m Messages postés 244 Date d'inscription jeudi 14 avril 2005 Statut Membre Dernière intervention 12 juillet 2006 - 8 juil. 2005 à 12:29
coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 - 9 juil. 2005 à 01:05
BOnjour,

nous venons de changer de version de php, nous avins php 4, que nous avons migré en php 5. et de Mysql 3 vers mysql 4

Nous avons relevé un problème sur des chiffres décimaux. Nous n'arrivons plus à afficher des chiffres à virgule. Nous arrivons à taper le ciffre souhaité (ex: 15,30), et lorsque l'on submit, la valeur afficher est 15,00

Ce problème est-il connu ?? Si oui comment y remedier ?!!!

Merci

7 réponses

malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
8 juil. 2005 à 12:32
Hello,



un bout de code serait le bienvenue : le formulaire, et la recuperation (et le traitement de cette donee).

Parce que non, a ma connaissance, ce n'est pas un bug de php5 ou de
mysql4. Il doit y avoir une erreur de conception quelquepart.
0
fredo35m Messages postés 244 Date d'inscription jeudi 14 avril 2005 Statut Membre Dernière intervention 12 juillet 2006
8 juil. 2005 à 12:49
Voici le code(un peu long !!!!) Mon problème est sur les champs : réalisé et prévu !!

Merci d'avance :

<html>
<head><Title>Planning></Title></head>

<?php
// temps_passe_aujourdhui_groupe_cdr.php
//
//
$version="V0.10"; // 29/10/2004
// Totalisations récapitulatifs temps passés par jour erronés
// ajout booleen $debug
// $version="v0.05"; // 03/09/2003
//
// V 0.03 12/08/2003 14:33 version a priori stabilisée
//
// V 0.03 08/08/2003 13:04
//
//


//$debug=true;
$debug=false;


//on se connecte à la base
$db = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Erreur d'accès à la base de données");
mysql_select_db(DB_NAME, $db) or die("Erreur de sélection de la base de donnée");


$mode_pw=false;
$mode_avec_charges_pw=false;
//$mode_avec_charges_pw=true;


global $charge_cumul,$realise_cumul,$charge_realise ;
global $realise_cumul_projet, $charge_cumul_projet;
global $cumul_charge_prevu, $cumul_charge_realise;
global $cumul_periode_projet_prevu, $cumul_periode_projet_realise;
global $ijour_graphe, $isemaine, $imois;
global $synthese;

require("include/dates.inc.php");
require("include/config.php");


function moisx ($x) {
$aujourdhui= mktime (0,0,0, date ("m"), date("d"), date ("Y"));
$jour_courant= (int) strftime ("%j", $aujourdhui);
$jour_x= mktime (0,0,0, date ("m"), date ("d") - $jour_courant + $x, date ("Y"));
$x_mois= (int) strftime("%m", $jour_x);
return $x_mois; }

function moisx_an ($x, $annee) {
$aujourdhui= mktime (0,0,0, date ("m"), date("d"), date ("Y"));
$jour_courant= (int) strftime ("%j", $aujourdhui);
$jour_x= mktime (0,0,0, date ("m"), date ("d") - $jour_courant + $x, $annee);
$x_mois= (int) strftime("%m", $jour_x);
return $x_mois; }

function jourmoisx ($x) {
$aujourdhui= mktime (0,0,0, date("m"),date("d"), date ("Y"));
$jour_courant= (int)strftime("%j", $aujourdhui);
$jour_x= mktime (0,0,0, date("m"),date("d")-$jour_courant+$x, date ("Y"));
$x_jourmois= (int)strftime("%d", $jour_x);
return $x_jourmois; }


function jourmoisx_an ($x, $annee) {
$aujourdhui= mktime (0,0,0, date("m"),date("d"), date ("Y"));
$jour_courant= (int)strftime("%j", $aujourdhui);
$jour_x= mktime (0,0,0, date("m"),date("d")-$jour_courant+$x, $annee);
$x_jourmois= (int)strftime("%d", $jour_x);
return $x_jourmois; }


function nomjourx ($x) {
$aujourdhui= mktime (0,0,0, date("m"), date("d"), date ("Y"));
$jour_courant= (int)strftime("%j", $aujourdhui);
$jour_x= mktime (0,0,0, date("m"),date("d")-$jour_courant+$x, date ("Y"));
$x_joursemaine= strftime("%a", $jour_x);
return $x_joursemaine; }


function numerojour($x) {
$aujourdhui= mktime (0,0,0, date("m"),date("d"), date ("Y"));
$jour_courant= (int)strftime("%j", $aujourdhui);
$jour_x= mktime (0,0,0, date("m"),date("d")-$jour_courant+$x, date ("Y"));
$x_numerojoursemaine= strftime("%w", $jour_x);
return $x_numerojoursemaine;
}

function numerosemainex($x) {
$aujourdhui= mktime (0,0,0, date("m"),date("d"), date ("Y"));
$jour_courant= (int)strftime("%j", $aujourdhui);
$jour_x= mktime (0,0,0, date("m"),date("d")-$jour_courant+$x, date ("Y"));
$x_numerosemaine= strftime("%U", $jour_x);
return $x_numerosemaine; }


function edite_zone($type_edite, $z, $d_jour, $d_mois, $d_an, $f_jour, $f_mois, $f_an, $texte, $motif, $prio )
{
echo "edite zone ",$type_edite, " ", $z, " ", $d_jour, " ", $d_mois, " ", $d_an, " ", $f_jour, " ", $f_mois, " ", $f_an, " ",
$texte, " ", $motif, " ", $prio, " ", "
";
$mois=$d_mois;
$jour=$d_jour;
$i_chaine=0;
$lg_subchaine=2;
while( moisx($z)<=$f_mois)
{
while( moisx($z)==$mois)
{
if ( (moisx($z)<>$f_mois) or
( (moisx($z)==$f_mois) and $jour<=$f_jour )
)
{
if ( ($motif=="tache") and ($prio==2) ) { echo "<td BGCOLOR=#68E5F8>"; }
if ($motif=="calendrier")
{ if ( (numerojour($z)==5) or (numerojour($z)==6)) { echo "<td BGCOLOR=#efefef>"; }
else { echo "<td BGCOLOR=#ffffff>"; }
}
if ($type_edite=="jour") { echo $jour;}
if ($type_edite=="nom")
{ if($i_chaine*$lg_subchaine<=strlen($texte))
{echo substr($texte, $i_chaine*$lg_subchaine, $lg_subchaine); }
}
if ($type_edite=="charge")
{ echo ".."; }
if ($type_edite=="vide")
{ echo ".."; }

/*echo "z ",$z;
echo " mois ",$mois;
echo " moisx ",moisx($z);
*/

echo "</td>";
}
$i_chaine+=1;
$jour+=1;
$z+=1;

}
$jour=1;
$mois=moisx($z);
// echo "mois ",$mois,"
";


}
}


function editez_zone($type_edite, $d_z, $f_z, $d_an, $f_an, $texte_num, $texte, $motif, $prio, $charge , $codeTache, $nomPersonne,
$temps_passe_tache, $temps_passe_tache_avant_periode, $num_ligne_tab)
{
// echo "edite zone ",$type_edite, " ", $d_z, " ", $f_z, " ", $d_an, " ", $f_an, " ", $texte, " ", $motif, " ", $prio, " ", "
";
global $charge_cumul,$realise_cumul,$charge_realise;
global $realise_cumul_projet, $charge_cumul_projet;
global $cumul_charge_prevu, $cumul_charge_realise;
global $cumul_periode_projet_prevu, $cumul_periode_projet_realise;
global $ijour_graphe, $isemaine, $imois;
global $synthese;
//echo "d_z ",$d_z,"f_z ",$f_z,"d_an ", $d_an,"
";
$jour=$d_z;
// calcul du nombre de jours ouvrés (on ne tient pas compte des conges et rtt, et on devrait ! )
$nbJourOuvrés=0;
while( $jour<=$f_z)
{
if ( ! ( (numerojour($jour)==0) or
(numerojour($jour)==6) ) )
{ $nbJourOuvrés+=1; }
$jour=$jour+1;
}

$jour=$d_z;
//$cumul_charge_prevu=0;
//$cumul_charge_realise=0;
while( $jour<=$f_z)
{
//echo " un jour >>
";
if ( ($motif=="tache") )
{
if ( (numerojour($jour)==0) or (numerojour($jour)==6))
{ // samedi ou dimanche
$ouvre=false;
if (!$synthese) { echo "<td BGCOLOR=#dddddd>"; }
//
if ( numerojour($jour)==6 )
{ $isemaine=$isemaine+1;
}
}
else
{ $ouvre=true;
switch ($prio)
{
case 1 : break ;
case 2 : break;
case 3 : break;
case 10 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#DDDDDD>"; }
break ;
case 11 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#008000>"; }
break ;
case 12 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#00aa00>"; }
break;
case 13 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#00dd00>"; }
break;
case 100 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#FFFF00>"; }
break ;

default : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#68E5F8>"; }
break;
}
}
if ( ($type_edite=="charge") and $ouvre )
{
$charge_cumul[$ijour_graphe]=$charge_cumul[$ijour_graphe]+ ($charge/$nbJourOuvrés);
$cumul_charge_prevu+=$charge/$nbJourOuvrés;

// charge deja realisée
$db = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Erreur d'accès à la base de données");
mysql_select_db(DB_NAME, $db) or die("Erreur de sélection de la base de donnée");
//on exécute la requète permettant de remplir les champs
//$table="temps";
//$sSql="SELECT * FROM ".$table." WHERE ANNEE=".$d_an." and JOUR=".$jour." and CODEPERS="".$nomPersonne. "" and CODETCH=".$codeTache ;
// quel est le mois associé
$mois=moisx_an($jour, $d_an);
$jour_mois=jourmoisx_an($jour, $d_an);
$table2="temps_v2";
$sSql2="SELECT * FROM ".$table2." WHERE ANNEE=".$d_an." and MOIS=".$mois." and CODEPERS="".$nomPersonne.
"" and CODETCH=".$codeTache ;

//echo $sSql2;

$res2 = mysql_query ($sSql2 );
if ($enreg2 = mysql_fetch_array ($res2))
{
$varPasseJ="PasseJ".$jour_mois;
$temps_passe=$enreg2[$varPasseJ];
//echo "tempsPasse ".$varPasseJ."=".$temps_passe;
$temps_passe=str_replace(".",",",$temps_passe);
$temps_passe=doubleval($temps_passe);
$temps_passe_v2_existe=true;
}
else
{ $temps_passe=0;
$temps_passe_v2_existe=false;
}
$cumul_charge_realise+=$temps_passe;
//!!!!!
//echo "<TD>";
//echo "codeTache",$codeTache,"cumul_charge_realise=",$cumul_charge_realise,"
cumul_charge_prevu=",$cumul_charge_prevu,"
charge",$charge,"";
//echo "</TD>";

// barre de progression de tache :
// le réalisé est supérieur au cumul des charges prévues sur la période :
if ( ($temps_passe_tache>=$cumul_charge_prevu) and ($temps_passe_tache<=$charge) )
{ switch ($prio)
{
case 1 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#408040>"; }
break ;
case 2 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#80aa80>"; }
break;
case 3 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#a0dda0>"; }
break;
}
}
else if ( (($temps_passe_tache-$temps_passe_tache_avant_periode)>=$cumul_charge_prevu)
and
($temps_passe_tache>=$charge) )
//else if ( ($temps_passe_tache>=$charge) )
{
// echo "
".$temps_passe_tache."
".
// $temps_passe_tache_avant_periode."
".$cumul_charge_prevu."
".
// $temps_passe_tache."
".$charge."
";
switch ($prio)
{
case 1 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#f03010>"; }
break ;
case 2 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#f05030>"; }
break;
case 3 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#f0a050>"; }
break;
}
}
else
{
switch ($prio)
{
case 1 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#60FFFF>"; }
break ;
case 2 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#68E5F8>"; }
break;
case 3 : if (!$synthese) { echo "<td ROWSPAN="1" BGCOLOR=#CC8080>"; }
break;
}
}

if (!$synthese)
{ printf("%03.2f", $charge/$nbJourOuvrés);
echo " </TD>";
}


if (!$synthese)
{
echo "<td>";
// form 1
echo "";
// form 2
echo "";
// form 3
echo "";
// form 4
echo "";
echo "</td>";
// form 5
echo "";
echo "</td>";
// form 6
echo "";
echo "</td>";
// form 7
echo "";
echo "</td>";
}

}


}

if ($motif=="calendrier")
{ if ( (numerojour($jour)==0) or (numerojour($jour)==6))
{ $ouvre=false;
if ( ($type_edite=="jour") or ($type_edite=="mois")or ($type_edite=="vide"))
{ echo "<td BGCOLOR=#dddddd>"; echo "</td>"; }
}
else
{ $ouvre=true; }

if ( ($type_edite=="jour")and $ouvre ) { echo "<td BGCOLOR=#ffff00>"; echo jourmoisx($jour);echo "</td>";}
if ( ($type_edite=="mois")and $ouvre ) { echo "<td BGCOLOR=#ffff00>"; echo moisx($jour);echo "</td>";}

if ($type_edite=="nom")
{ if (!$synthese)
{ echo "<td BGCOLOR=#ffffff>";
if($i_chaine*$lg_subchaine<=strlen($texte))
{echo substr($texte, $i_chaine*$lg_subchaine, $lg_subchaine); }
echo "</td>";
}
}
if ( ($type_edite=="charge") and $ouvre )
{ if (!$synthese)
{ echo "<td BGCOLOR=#ffffff>";
printf("%03.2f", $charge/$nbJourOuvrés);
echo "</td>";
}
$charge_cumul[$ijour_graphe]=$charge_cumul[$ijour_graphe]+ ($charge/$nbJourOuvrés);

// if ($charge<>0) { echo " ijour=",$ijour_graphe, " charge_cumul=",$charge_cumul[$ijour_graphe], "
" ;}
}
if ( ( $type_edite=="vide" ) and $ouvre )
{ if (!$synthese)
{ echo "<td BGCOLOR=#ffffff>";
echo "..";
echo "</td>";
}
}
}

/*echo "z ",$z;
echo " mois ",$mois;
echo " moisx ",moisx($z);
*/

$jour=$jour+1;
$ijour_graphe=$ijour_graphe+1;
}
//echo "fin boucle un jour >>
";


}


function editer_lignes_calendrier($modulo_calendrier, $zdgraphe, $zfgraphe,
$debgraphe_an, $fingraphe_an, $prio)
{
global $synthese;
if ($modulo_calendrier=="jour")
{
echo "<tr>";
// premiere colonne
//echo "<TD COLSPAN="2" ROWSPAN="2" class="textmini" >Edité le ".date ("D d M Y - H : i : s ")."</TD>";
echo "<TD COLSPAN="2" ROWSPAN="2" class="textmini" ></TD>";
// deuxieme colonne
//echo "<TD></TD>";
if ($synthese )
{ echo "<TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD>"; }
if (!$synthese )
{ echo "<TD></TD><TD></TD><TD></TD>"; }
editez_zone( "jour", $zdgraphe, $zfgraphe, $debgraphe_an, $fingraphe_an,
"", "Nom de la tache", "calendrier", $prio, 0, 0, "",0 , 0, 0);
echo "</tr>";
echo "<tr>";
// premiere colonne
//echo "<TD></TD>";
// deuxieme colonne
//echo "<TD></TD>";
if ($synthese )
{ echo "<TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD>"; }
$prio=2;
if (!$synthese )
{ echo "<TD></TD><TD></TD><TD>Prévu</TD>"; }
editez_zone( "mois", $zdgraphe, $zfgraphe, $debgraphe_an, $fingraphe_an,
"", "Nom de la tache", "calendrier", $prio, 0, 0, "",0, 0,0);
echo "</tr>";
}
}


/////////////// debut du code
/* echo "Trace dans planning_cdr/temps passes aujourd hui groupe cdr :
";
echo "user: ",$user,"
";
echo "user2: ",$user2,"
";
echo "submit: ",$submit,"
";
*/
$user=$user2;



if ($submit=="enregistrer")
{

//echo "Mise à jour des données
";
//echo $nb_ligne_tab."lignes de données
";
// pour chaque tache, mettre à jour la charge du jour
for ( $i_ligne=1; $i_ligne<=$nb_ligne_tab; $i_ligne++)
{
$nom_var_annee="annee".$i_ligne;
$nom_var_mois="mois".$i_ligne;
$nom_var_jour_mois="jour_mois".$i_ligne;
$nom_var_codetch="codetch".$i_ligne;
$nom_var_codepers="codepers".$i_ligne;
$nom_var_saisie="saisie".$i_ligne;
$nom_var_saisie_old="saisieold".$i_ligne;
if (false)
{
echo $i_ligne."
";
echo "annee: ".${$nom_var_annee}."
";
echo "mois: ".${$nom_var_mois}."
";
echo "jour_mois: ".${$nom_var_jour_mois}."
";
echo "codetch: ".${$nom_var_codetch}."
";
echo "codepers: ".${$nom_var_codepers}."
";
echo "saisie: ".${$nom_var_saisie}."
";
echo "saisieold: ".${$nom_var_saisie_old}."
";
}
$annee=${$nom_var_annee};
$mois=${$nom_var_mois};
$jour_mois=${$nom_var_jour_mois};
$codetch=${$nom_var_codetch};
$codepers=${$nom_var_codepers};
$saisie=${$nom_var_saisie};
$saisie_old=${$nom_var_saisie_old};

if ($saisie<>$saisie_old)
{
// mise à jour en base
$table_temps_v2="temps_v2";
$sSql2="SELECT * FROM ".$table_temps_v2.
" where CODEPERS='".$codepers."' and CODETCH='".$codetch.
"' and ANNEE='".$annee."' and MOIS='".$mois."' " ;
//echo $sSql2."
";

$res2 = mysql_query ($sSql2 );
if ($enreg2 = mysql_fetch_array ($res2) )
{ // il y a déjà un enregistrement
//echo " mise à jour
";
$var_passe_jour=sprintf("PasseJ%d",${$nom_var_jour_mois});
$sSql2A="UPDATE ".$table_temps_v2." SET ".$var_passe_jour."=".$saisie.
" where CODEPERS='".$codepers."' and CODETCH='".$codetch.
"' and ANNEE='".$annee."' and MOIS='".$mois."' " ;
//echo $sSql2A."
";
$res2A = mysql_query ($sSql2A );
}
else
{ // il n y a rien
//echo " nouveau
";
$var_passe_jour=sprintf("PasseJ%d",${$nom_var_jour_mois});
$sSql2A="INSERT into ".$table_temps_v2." ( ANNEE, MOIS,CODEPERS,CODETCH,".$var_passe_jour." ) VALUES ('".
$annee."', '".$mois."','".$codepers."', '".$codetch."', '".$saisie."')";
//echo $sSql2A."
";
$res2A = mysql_query ($sSql2A );
}
} // fin si saisie<>saisieold
}
$submit="";
}// submit == enregistrer

?>

<script language="JavaScript">
function js_total_jour(num_jour)
{ form0_nb_elements=7;
document.saisie_temps.total_jour.value=0;
//document.saisie_temps.total_jour.value=document.saisie_temps.total1.value;
//document.write ('message '.document.saisie_temps.nb_ligne_tab.'
');
for (ligne=1; ligne<=document.saisie_temps.nb_ligne_tab.value; ligne++)
{ i_l=form0_nb_elements*(ligne-1);
//document.saisie_temps.total_jour.value=(document.saisie_temps.total_jour.value*1)+
// (document.forms[0].elements[il].value*1);
document.saisie_temps.total_jour.value=(document.saisie_temps.total_jour.value*1)+
(document.forms[0].elements[i_l].value*1);
}
}


</script>


<form name="saisie_temps" action="fprinc2.php?page=temps_passe_aujourdhui_groupe_cdr.php&user2=<? echo $user2?>" method="POST">

<?
// la date du jour
$nowArray=getdate();
$DebArray=getdate(time()-(0*24*60*60));
$j=$nowArray[mday];
$dj=$DebArray[mday];

$m=$nowArray[mon];
$dm=$DebArray[mon];
$a=$nowArray[year];
$da=$DebArray[year];


$deb=$dj."/".$dm."/".$da;
$deb=$j."/".$m."/".$a;
$fin=$j."/".$m."/".$a;
//echo $deb;
//echo $fin;
//exit;

// le nom utilisateur est dans $user
// echo $user;

// http://srv-msg.audiar.net:8082/phproject/addons/Planning_CDR/pageReportGantt.php?
// modulo_calendrier=jour&user=lbo&mode_edit=prj_non_vide&
// http://srv-msg.audiar.net:8082/phproject/addons/Planning_CDR/pageReportGantt.php?modulo_calendrier=jour&user=lbo&mode_edit=prj_non_vide&
//req=select+TACHES.CODETCH%2C+TACHES.NOMTCH%2C+TACHES.DDEBTCH%2C+TACHES.DFINPTCH%2C%0D%0A%09%09++++++++++++++++++TACHES.PRIOTCH%2C+TACHES.ChargeJ%2C+TACHES.CODEPERS%2C+TACHES.GROUPTCH%2C+TACHES.OKTermine%2C%0D%0A%09++++++++++++++++++++PERSONNE.LOGIN%2C%0D%0A%09%09%09%09%09%09TACHES.CODEPROJ%2C+%0D%0A%09++++++++++++++++++++PROJET.CODEPROJ%2C+PROJET.NOMPROJ%2C+PROJET.CODEAUDIAR+%0D%0A%09+++++from+TACHES%2C+PERSONNE%2C+PROJET+where+TACHES.CODEPERS%3DPERSONNE.CODEPERS+and+%0D%0A%09++++++++++++++++++++++++++++++%28+%28TACHES.CODEPROJ%3DPROJET.CODEPROJ%29+%29+and%0D%0A%09+++++++%28+%28PERSONNE.LOGIN%3D%27lbo%27%29+%0D%0A%09%09+++%29+order+by+PERSONNE.LOGIN%2C+PROJET.CODEAUDIAR%2C+PROJET.CODEPROJ%2C+TACHES.GROUPTCH%2C+TACHES.DDEBTCH%2C+TACHES.PRIOTCH%2C+TACHES.DFINPTCH&deb=01/02/2004&fin=29/02/2004&titre=Planning indicatif CDR
$requete="select TACHES.CODETCH, TACHES.NOMTCH, TACHES.DDEBTCH, TACHES.DFINPTCH,
TACHES.PRIOTCH, TACHES.ChargeJ, TACHES.CODEPERS, TACHES.GROUPTCH, TACHES.OKTermine,
PERSONNE.LOGIN,
TACHES.CODEPROJ,
PROJET.CODEPROJ, PROJET.NOMPROJ, PROJET.CODEAUDIAR
from TACHES, PERSONNE, PROJET ";
$requete=$requete.
"where TACHES.CODEPERS=PERSONNE.CODEPERS and
TACHES.CODEPROJ=PROJET.CODEPROJ and
PERSONNE.LOGIN='".$user."' ";
$requete=$requete.
"order by PROJET.CODEAUDIAR, TACHES.GROUPTCH, TACHES.CODETCH";


if ($synthese=="") { $synthese = false ; }
else { $synthese = true ; }

//on se connecte à la base
$db = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Erreur d'accès à la base de données");
mysql_select_db(DB_NAME, $db) or die("Erreur de sélection de la base de donnée");


//on exécute la requète puis on récupère ses résultats sous la forme d'un tabeau
//de tableaux associatifs
$requete=stripslashes($requete);

//>>
//echo $requete;

$res = mysql_query ($requete);
if ($debug)
{ echo "requete $requete
";
echo "res $res
";
echo "deb $deb
" ;
echo "fin $fin
" ;
}


// les parametres du graphe
$param=explode("/",$deb );
if ( $param[0][0]==0) { $param[0]=$param[0][1]; }
if ( $param[1][0]==0) { $param[1]=$param[1][1]; }
if ( $param[2][0]==0) { $param[2]=$param[2][1]; }
$debgraphe_jour=$param[0];
$debgraphe_mois=$param[1];
$debgraphe_an=$param[2];
$param=explode("/",$fin );
if ( $param[0][0]==0) { $param[0]=$param[0][1]; }
if ( $param[1][0]==0) { $param[1]=$param[1][1]; }
if ( $param[2][0]==0) { $param[2]=$param[2][1]; }
$fingraphe_jour=$param[0];
$fingraphe_mois=$param[1];
$fingraphe_an=$param[2];

$debgraphe_timestamp=mktime(0,0,0,$debgraphe_mois,$debgraphe_jour,$debgraphe_an);
$fingraphe_timestamp=mktime(0,0,0,$fingraphe_mois,$fingraphe_jour,$fingraphe_an);
$zdgraphe=date("z", $debgraphe_timestamp);
$zdgraphe+=1;
$zfgraphe=date("z", $fingraphe_timestamp);
$zfgraphe+=1;



echo "\";
setlocale(\"LC_ALL\", \"fr\");

//******************************************************************************************
//******************************************************************************************
$mode_boucle=2;
//$synthese=true;
//$modulo_calendrier=\"an\";

if ($mode_boucle==2)
{

//******************************************************************************************
//*******************************************************************************************
$nomPersonne=\"personne\";
$personne_precedente=\"personne\";
$codeProjet=\"vide\";
$codeTache=\"vide\";
$nb_lignes=0;
$projet_precedent_vide=\"vide\";

// derniere tache valide affichée
$enreg_derniere_tache_affichee = -1;
// enregistrement courant
$enreg = mysql_fetch_array ($res);
$nomPersonne=$enreg[\"CODEPERS\"];
$codeProjet=$enreg[\"CODEPROJ\"];
$codeSousProjet=$enreg[\"GROUPTCH\"];
$codeTache=$enreg[\"CODETCH\"];

//
$code_projet_derniere_tache_affichee=\"vide\";
//
$enreg_tache_suivante = mysql_fetch_array ($res);
$num_ligne_tab=0;
// la boucle sur les taches commence ici
while ($enreg) // tant qu'il y a des taches dans le résultat de la requete
{
if ($debug)
{ echo \"----
nomPersonne=$nomPersonne codeProjet=$codeProjet codeSousProjet=$codeSousProjet codeTache=$codeTache, \";
}
if ( ($codeProjet <> $code_projet_derniere_tache_affichee) or
( strtoupper($nomPersonne) <> strtoupper($personne_precedente) ) )
// c est un nouveau code projet : et il y a avait au moins une tache
// ou bien on change de personne
{
if ($projet_precedent_vide<>\"vide\")
{
// edition du bilan de projet
if ( ($code_projet_derniere_tache_affichee<>\"vide\") and
($code_projet_derniere_tache_affichee<>\"\") )
{ $recap_periode_prevu=$recap_periode_prevu+$cumul_periode_projet_prevu;
$recap_periode_realise=$recap_periode_realise+$cumul_periode_projet_realise;
$projet_precedent_vide=\"vide\";
}
}
}

// est-ce une nouvelle personne
if ( (strtoupper($nomPersonne)<>strtoupper($personne_precedente)) ) // and ($nomPersonne<>\"\")
{
// $code_projet_derniere_tache_affichee<>\"vide\";

// c est une nouvelle personne ( et on n'est pas au debut du traitement )
if ( ( $personne_precedente<>\"\") and ($personne_precedente<>\"personne\") )
{
// début edition suffixe de personne
if (!$synthese)
{
// quelques lignes pour de nouvelles taches
echo \"----
\";
// premiere colonne
echo \"AJOUTS, \";
// deuxieme colonne
echo \", \";
echo \"Nouvelles taches ", $personne_precedente,
" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",$personne_precedente,", \",\"\";
for ($i_newtache=1;$i_newtache<=4;$i_newtache++)
{
$ijour_graphe=1;
echo \"----
\";
// premiere colonne
echo \", \";
// deuxieme colonne
echo \", \";
echo \"",
"","Tache n°&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"," ",
"Nom tache &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp",
"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp",
"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp",
"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp",
"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp",
"",
" Prio:"," 1 / 2 / 3 "," Charge de la période:","",
"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp J &nbsp&nbsp",
"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp H",
"", ", \";
echo \"\";
echo \"----
\";
// premiere colonne
echo \"Prév, \";
// deuxieme colonne
echo \", \";
editez_zone( \"vide\", $zdgraphe, $zfgraphe, $debgraphe_an, $deb_an, \"\",\"\",
\"calendrier\", $prio, 0, $codeTache, $personne_precedente,0,0,0);
echo \"\";
echo \"----
\";
// premiere colonne
echo \"Réal, \";
// deuxieme colonne
echo \", \";
editez_zone( \"vide\", $zdgraphe, $zfgraphe, $debgraphe_an, $deb_an, \"\",\"\",
\"calendrier\", $prio, 0, $codeTache, $personne_precedente,0,0,0);
echo \"\";

$nb_lignes+=1;
} // end for ($i_newtache=1;$i_newtache<=10;$i_newtache++)
// fin quelques lignes pour de nouvelles taches
} // fin si !synthese

// récapitulatif synthese
echo \"----
\";
echo \"Total Période, \";
//echo \"","",", \";
//echo \"\";
printf(\"Réalisé , %03.2f H",$recap_periode_realise*7.8);
printf(", %03.2f J, \",$recap_periode_realise);
//echo \"\";
//echo \"----
\";
printf(\"Prévu, %03.2f H",$recap_periode_prevu*7.8);
printf(", %03.2f J, \",$recap_periode_prevu);
echo \"\";

echo \"----
\";
// premiere colonne
echo \", \";
// deuxieme colonne
echo \", \";

if ($synthese )
{ echo \", , , , , , , \".
\", \";
}

echo \"Total ", $personne_precedente," >>>>>>>>>>>>>>>".
">>>>>>>>>>>>>>>>>>>",$personne_precedente,", \",\"\";

// prévu
echo \"----
\";

if ($synthese )
{ echo \", , , , , , , \".
\", , \";
}

// 'premiere' colonne
echo \"Prév, \";
// 'deuxieme' colonne
echo \", \";
if ( $modulo_calendrier==\"jour\" )
{
for ($ijour_graphe=1;$ijour_graphe<=$zfgraphe-$zdgraphe;$ijour_graphe++)
{ if ($charge_cumul[$ijour_graphe]>1)
{ echo \"";
printf("%03.2f",$charge_cumul[$ijour_graphe]);
echo ", \";
}
else
{ echo \"";
printf("%03.2f",$charge_cumul[$ijour_graphe]);
echo ", \";
}
}
}
if ( $modulo_calendrier==\"an\" )
{ $zjour=$zdgraphe;
$cumul_modulo=0;
$mois_courant=1;
for ($ijour_graphe=1;$ijour_graphe<=$zfgraphe-$zdgraphe;$ijour_graphe++)
{ $cumul_modulo=$cumul_modulo+$charge_cumul[$ijour_graphe];
if ($mois_courant<>moisx($ijour_graphe) )
{ echo \"";
printf("%03.2f",$cumul_modulo);
echo ", \";
$mois_courant=moisx($ijour_graphe);
$cumul_modulo=0;
}
}
echo \"";
printf("%03.2f",$cumul_modulo);
echo ", \";

}
echo \"\";

// réalisé
echo \"----
\";

if ($synthese )
{ echo \", , , , , , , \".
\", , \";
}

// 'premiere' colonne
echo \"Réal, \";
// 'deuxieme' colonne
echo \", \";
if ( $modulo_calendrier==\"jour\" )
{
for ($ijour_graphe=1;$ijour_graphe<=$zfgraphe-$zdgraphe;$ijour_graphe++)
{ if ($charge_realise[$ijour_graphe]>1)
{ echo \"";
printf("%03.2f",$charge_realise[$ijour_graphe]);
echo ", \";
}
else
{ echo \"";
printf("%03.2f",$charge_realise[$ijour_graphe]);
echo ", \";
}
}
}
echo \"\";

echo \"----
\";
if ($synthese )
{ echo \", , , , , , , \".
\", \";
}
// premiere colonne
echo \", \";
// deuxieme colonne
echo \", \";
echo \"Fin ", $personne_precedente," <<<<<<<<<<<<<<<<<<<",
"<<<<<<<<<<<<<<<<<<",$personne_precedente,", \",\"\";
// FIN edition suffixe de personne

}
// FIN de // c est une nouvelle personne ( et on n'est pas au debut du traitement )
// // if ( ($personne_precedente<>\"\") and ($personne_precedente<>\"personne\") )

// nouveau nom utilisateur
//*******************************************************************************
echo \"----
\";
// premiere colonne
echo \", \";
// deuxieme colonne
echo \", \";

echo \", \";

for ($ijour_graphe=1;$ijour_graphe<$zfgraphe-zdgraphe;$ijour_graphe++)
{ $charge_cumul[$ijour_graphe]=0;
$realise_cumul[$ijour_graphe]=0;
$charge_realise[$ijour_graphe]=0;
}
$recap_periode_prevu=0;
$recap_periode_realise=0;

echo \"----
\";
// premiere colonne
echo \"Temps passé Version : $version ";
if ( ($debgraphe_jour==1) and ($debgraphe_mois==1) and
($fingraphe_jour==31) and ($fingraphe_mois==12) )
{ $mode_PW = true ; echo " mode PW "; }
else { $mode_PW = false ;echo " "; }
echo ", \";
// deuxieme colonne
//echo \", \";

//if (! $synthese )
//{ echo \", , , , , , ".
// ", , , , , , , , \"; }

echo \"", $nomPersonne,
" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",$nomPersonne,", \",\"\";
// afficher le calendrier avant chaque nouvel utilisateur
if ($synthese )
{ editer_lignes_calendrier($modulo_calendrier, $zdgraphe, $zfgraphe,
$debgraphe_an, $fingraphe_an, $prio);
}
else { editer_lignes_calendrier(\"jour\", $zdgraphe, $zfgraphe,
$debgraphe_an, $fingraphe_an, $prio);
}
$nb_lignes=0;
//
$codeProjet=\"vide\";
}

$nomPersonne=$enreg[\"CODEPERS\"];
$codeProjet=$enreg[\"CODEPROJ\"];
$codeSousProjet=$enreg[\"GROUPTCH\"];
$codeTache=$enreg[\"CODETCH\"];

if ( ($codeProjet<>1) and
( (substr($codeSousProjet,0,2)<>\"PW\") or ( $mode_avec_charges_pw ))
)
{

{

//echo \"une tache
\";

$param=explode(\"-\",$enreg[\"DDEBTCH\"] );
if ( $param[0][0]==0) { $param[0]=$param[0][1]; }
if ( $param[1][0]==0) { $param[1]=$param[1][1]; }
if ( $param[2][0]==0) { $param[2]=$param[2][1]; }
$deb_jour=$param[2];
$deb_mois=$param[1];
$deb_an=$param[0];

$param=explode(\"-\",$enreg[\"DFINPTCH\"] );
if ( $param[0][0]==0) { $param[0]=$param[0][1]; }
if ( $param[1][0]==0) { $param[1]=$param[1][1]; }
if ( $param[2][0]==0) { $param[2]=$param[2][1]; }
$fin_jour=$param[2];
$fin_mois=$param[1];
$fin_an=$param[0];

// OKTermine est de format AAAA-MM-JJ HH:MM:SS
// ne garder que AAAA-MM-JJ
$param=explode(\" \",$enreg[\"OKTermine\"] );
$param=$param[0];
// extraire les éléments
$param=explode(\"-\",$param );
// supprimer les 0 à gauche
if ( $param[0][0]==0) { $param[0]=$param[0][1]; }
if ( $param[1][0]==0) { $param[1]=$param[1][1]; }
if ( $param[2][0]==0) { $param[2]=$param[2][1]; }
$termine_jour=$param[2];
$termine_mois=$param[1];
$termine_an=$param[0];

if ($debug)
{ echo \"-- \".$enreg[\"OKTermine\"].\"
\";
echo \" \".$termine_jour.\" \".$termine_mois.\" \".$termine_an.\"
\";
}

if ( ($deb_mois<=0) or ($deb_jour<=0) or ($deb_an<=0) or
($deb_mois>12) or ($deb_jour>31) or ($deb_an>2055) )
{ echo \"*** ERREUR DATES TACHE \".$enreg[\"CODETCH\"].\" \".$enreg[\"CODEPERS\"].
\" *** deb_mois \".$deb_mois.\" deb_jour \".$deb_jour.\" deb_an \".$deb_an.\"
\"; }
$deb_timestamp=mktime(0,0,0,$deb_mois,$deb_jour,$deb_an);
$fin_tache_timestamp=mktime(0,0,0,$fin_mois,$fin_jour,$fin_an);
$zf_t=date(\"z\", $fin_tache_timestamp);
$zf_t+=1;

// la tache est terminée : prendre la date de terminaison de la tache
$date_termine_valide=false;
if ( $enreg[\"PRIOTCH\"]>=10 )
{ if ($debug)
{ echo \"-- \".$enreg[\"OKTermine\"].\"
\";
echo \" \".$termine_jour.\" \".$termine_mois.\" \".$termine_an.\"
\";
}
//$fin_timestamp=mktime(0,0,0,$termine_mois,$termine_jour,$termine_an);
// si la date de terminaison est plausible
if ( ($termine_mois<= $fin_mois) and
($termine_jour<= $fin_jour) and
($termine_an <= $fin_an ) and
($termine_mois >= 1 ) and ($termine_mois <= 12 ) and
($termine_jour >= 1 ) and ($termine_jour <= 31 ) and
($termine_an >= 1900 ) and ($termine_an <= 3000 ) )
{ $date_termine_valide=true;
$termine_timestamp=mktime(0,0,0,$termine_mois,$termine_jour,$termine_an);
$fin_timestamp=$termine_timestamp;
}
// fin // si la date de terminaison est plausible
// sinon garder la date de fin de tache
else
{ $date_termine_valide=false;
$fin_timestamp=mktime(0,0,0,$fin_mois,$fin_jour,$fin_an);
}
}
// fin si la tache est terminée : prendre la date de terminaison de la tache
// sinon prendre la date de fin de tache
else
{ $fin_timestamp=mktime(0,0,0,$fin_mois,$fin_jour,$fin_an);
}
$zd=date(\"z\", $deb_timestamp);
$zd+=1;
$zf=date(\"z\", $fin_timestamp);
$zf+=1;
$zt=date(\"z\", $termine_timestamp);
$zt+=1;

$charge_totale_tache=$enreg[\"ChargeJ\"];

$charge_totale_tache=str_replace(\".\",\",\",$charge_totale_tache);
$charge_totale_tache=doubleval($charge_totale_tache);

// -----------!-------------!--------------
// ??****]
if ( ( $fin_timestamp >= $debgraphe_timestamp ) and ( $fin_timestamp <= $fingraphe_timestamp ) )
{
// -----------!-------------!--------------
// [**************]
if ( $deb_timestamp < $debgraphe_timestamp )
{ $charge_periode_tache=$charge_totale_tache*($fin_timestamp-$debgraphe_timestamp)/($fin_timestamp-$deb_timestamp);
}
// -----------!-------------!--------------
// [******]
if ( $deb_timestamp >= $debgraphe_timestamp )
{ $charge_periode_tache=$charge_totale_tache;
}
}

// -----------!-------------!--------------
// [******??
if ( ( $deb_timestamp >= $debgraphe_timestamp ) and ( $deb_timestamp <= $fingraphe_timestamp ) )
{
// -----------!-------------!--------------
// [****************]
if ( $fin_timestamp > $fingraphe_timestamp )
{ $charge_periode_tache=$charge_totale_tache*($fingraphe_timestamp-$deb_timestamp)/($fin_timestamp-$deb_timestamp);
}
// -----------!-------------!--------------
// [******]
if ( $deb_timestamp >= $debgraphe_timestamp )
{ $charge_periode_tache=$charge_totale_tache;
}
}

// -----------!-------------!--------------
// [************************]
if ( ( $deb_timestamp <= $debgraphe_timestamp ) and ( $fin_timestamp >= $fingraphe_timestamp ) )
{ //echo $charge_periode_tache,\" \",$charge_totale_tache,\" \",$fingraphe_timestamp,\" \",$debgraphe_timestamp,\" \",$fin_timestamp,\" \",$deb_timestamp,\"
\";
//echo ($fingraphe_timestamp-$debgraphe_timestamp),\" \",($fin_timestamp-$deb_timestamp),\" \",($fingraphe_timestamp-$debgraphe_timestamp)/($fin_timestamp-$deb_timestamp),\"
\" ;
if ($fin_timestamp==$deb_timestamp) { $charge_periode_tache=$charge_totale_tache;}
else { $charge_periode_tache=$charge_totale_tache*($fingraphe_timestamp-$debgraphe_timestamp)/($fin_timestamp-$deb_timestamp); }

}

if ( ( ( ( $fin_timestamp >= $debgraphe_timestamp ) and ( $fin_timestamp <= $fingraphe_timestamp ) ) or
( ( $deb_timestamp >= $debgraphe_timestamp ) and ( $deb_timestamp <= $fingraphe_timestamp ) ) or
( ( $deb_timestamp <= $debgraphe_timestamp ) and ( $fin_timestamp >= $fingraphe_timestamp ) ) )
)
{
//
// nouveau projet ?
//if ( ($codeProjet <> $code_projet_derniere_tache_affichee) or
// ( $nomPersonne <> $personne_precedente ) )
if ( true or
( strtoupper($nomPersonne) <> strtoupper($personne_precedente) ) )
// c est un nouveau code projet : et il y a avait au moins une tache
// ou bien on change de personne
{

// Edition de l entete de projet
if (!$synthese)
{
$num_ligne_tab++;
echo \"----
\";
if ($projet_precedent_vide<>\"vide\")
{
echo \"Projet"," P",
$enreg["CODEAUDIAR"]," ",
$enreg["NOMPROJ"],", \";
}
//echo \"----
\";
//echo \", \";
//echo \"\";
// editer ligne entete de projet
else
{
// premiere colonne
// deuxieme colonne : le code projet
echo \"Projet"," P",
$enreg["CODEAUDIAR"]," ",
$enreg["NOMPROJ"],", \";
}
}

$nomPersonne=$enreg[\"CODEPERS\"];
$codeProjet=$enreg[\"CODEPROJ\"];

$codeTache=$enreg[\"CODETCH\"];

// totalisations récapitulatifs sur la période
$recap_periode_prevu=$recap_periode_prevu+$cumul_periode_projet_prevu;
$recap_periode_realise=$recap_periode_realise+$cumul_periode_projet_realise;

// raz des totalisations de niveau projet
$recap_periode_projet_real=0;
$recap_semaine_projet_real=0;
$recap_mois_projet_real=0;

$cumul_periode_projet_prevu=0;
$cumul_periode_projet_realise=0;
$cumul_projet_consomme=0;

}
// FIN de // if ( ($codeProjet <> $code_projet_derniere_tache_affichee) or
// ( $nomPersonne <> $personne_precedente ) )
// c est un nouveau code projet : et il y a avait au moins une tache
// ou bien on change de personne

//
if ( $fin_timestamp > $fingraphe_timestamp ) { $zf = $zfgraphe; }
if ( $deb_timestamp < $debgraphe_timestamp ) { $zd = $zdgraphe; }
$ijour_graphe=1;
$db = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(\"Erreur d'accès à la base de données\");
mysql_select_db(DB_NAME, $db) or die(\"Erreur de sélection de la base de donnée\");
//on exécute la requète permettant de remplir les champs
$table=\"temps\";
$sSqlTps=\"SELECT * FROM \".$table.\" WHERE ANNEE=\".$deb_an.\" and CODEPERS=\\"\".$nomPersonne. \"\\" and CODETCH=\".$codeTache ;
//$sSql=\"SELECT * FROM TEMPS WHERE ANNEE=\".$d_an.\";
//
//echo $sSqlTps;
$resTps = mysql_query ($sSqlTps );
settype($temps_passe_tache, \"double\");
//settype($enregTps[\"PasseJ\"], \"double\");
settype($enreg_tps_PasseJ, \"double\");

$temps_passe_tache=0.0;
$temps_passe_tache_avant_periode=0.0;
//if ($enregTps = mysql_fetch_array ($resTps))
//{
// $enreg_tps_PasseJ=$enregTps[\"PasseJ\"];
// $enreg_tps_PasseJ=str_replace(\".\",\",\",$enreg_tps_PasseJ);
// $temps_passe_tache=doubleval($enreg_tps_PasseJ);

while ($enregTps = mysql_fetch_array ($resTps))
{
$enreg_tps_PasseJ=$enregTps[\"PasseJ\"];
$enreg_tps_PasseJ=str_replace(\".\",\",\",$enreg_tps_PasseJ);
$enreg_tps_PasseJ=doubleval($enreg_tps_PasseJ);
$temps_passe_tache = $temps_passe_tache + $enreg_tps_PasseJ;
// selon la date du temps passé : si c est avant la période affichée :
// la date de début de période affichée est :
// on récupère le numéro de jour de l 'année
$param_tps_PasseJ=$enregTps[\"JOUR\"] ;
//echo \"param_tps_PasseJ \".$param_tps_PasseJ.\" zd \".$zd.\"
\";
if ( $param_tps_PasseJ <= $zd )
{ $temps_passe_tache_avant_periode = $temps_passe_tache_avant_periode + $enreg_tps_PasseJ; }
}
//}
//else
//{ //echo \"<<\";
// $temps_passe_tache=0 ;
//}

if (!$synthese)
{
//echo \"----
\";
if ($enreg[\"PRIOTCH\"]>=10)
{
// premiere colonne
echo \"T".$codeTache.", \";
// deuxieme colonne
echo \" terminée, \";
}
else
{
// premiere et deuxieme colonne
echo \"T".$codeTache.", Terminer, \";
}
//edite_zone( \"nom\", $z, $deb_jour, $deb_mois, $deb_an, $fin_jour, $fin_mois, $fin_an, $enreg[\"NOMTCH\"], \"tache\", $enreg[\"PRIOTCH\"]);
echo \"";

echo "";

// il y a un sous projet
if ($enreg["GROUPTCH"]<>"") { echo $enreg["GROUPTCH"]."-"; }
echo $enreg["NOMTCH"];
echo "";

}

$cumul_charge_prevu=0;
$cumul_charge_realise=0;

//echo " total =", $temps_passe_tache;
editez_zone( "vide", $zdgraphe, $zd-1, $debgraphe_an, $deb_an, "","Nom de la tache",
"calendrier", $prio, 0, 0, $nomPersonne,
0 , 0, $num_ligne_tab);

//echo ", **\".$codeTache.\"**</TD>\" ;

editez_zone( \"charge\", $zd, $zf, $deb_an, $fin_an, $enreg[\"CODETCH\"],
$enreg[\"NOMTCH\"], \"tache\", $enreg[\"PRIOTCH\"],
$charge_periode_tache, $codeTache, $nomPersonne,
$temps_passe_tache, $temps_passe_tache_avant_periode, $num_ligne_tab);
if ( $date_termine_valide )
{
//echo \"valide"." ".$zf." ".$zf_t." ".", \";
editez_zone( \"charge\", $zf+1, $zf_t, $deb_an, $fin_an, $enreg[\"CODETCH\"],
$enreg[\"NOMTCH\"], \"tache\", $enreg[\"PRIOTCH\"],
0, $codeTache, $nomPersonne,
$temps_passe_tache, $temps_passe_tache_avant_periode, $num_ligne_tab);
}

if (!$synthese)
{
echo \"\";
} // FIN de if (!$synthese)
//echo \"charge \".$charge_periode_tache;
if ($debug)
{ echo \"----
cumul_periode_projet_prevu $cumul_periode_projet_prevu, \";
}
$cumul_periode_projet_prevu = $cumul_periode_projet_prevu + $charge_periode_tache;
if ($debug)
{ echo \" charge_periode_tache $charge_periode_tache, \";
echo \" cumul_periode_projet_prevu $cumul_periode_projet_prevu, \";
}
//$cumul_periode_projet_realise=$cumul_periode_projet_realise+$temps_passe_tache;
$cumul_periode_projet_realise=$cumul_periode_projet_realise+$cumul_charge_realise;

$cumul_projet_consomme=$cumul_projet_consomme+$temps_passe_tache;

if (!$synthese)
{ $nb_lignes+=1; }
$enreg_derniere_tache_affichee = $enreg;
$projet_precedent_vide=$codeTache;
$code_projet_derniere_tache_affichee=$enreg_derniere_tache_affichee[\"CODEPROJ\"];

}
else
{ // $projet_precedent_vide=\"vide\";
}

if ($debug) { echo \"----
recap_periode_prevu : $recap_periode_prevu, \"; }

if ($nb_lignes>=8)
{ $nb_lignes=0;
if ($synthese )
{ editer_lignes_calendrier($modulo_calendrier, $zdgraphe, $zfgraphe,
$debgraphe_an, $fingraphe_an, $prio);
}
else { editer_lignes_calendrier(\"jour\", $zdgraphe, $zfgraphe,
$debgraphe_an, $fingraphe_an, $prio);
}
}

} // end else // if ( ($codeProjet<>$enreg[\"CODEPROJ\"]) and ($codeProjet<>\"vide\") )

} // FIN de // codeProjet <> 1

$personne_precedente=$enreg[\"CODEPERS\"];

$enreg = $enreg_tache_suivante;
$codeTache=$enreg[\"CODETCH\"];
$nomPersonne=$enreg[\"CODEPERS\"];
$codeProjet=$enreg[\"CODEPROJ\"];

$enreg_tache_suivante = mysql_fetch_array ($res);

} // fin // tant qu'il y a des taches dans le résultat de la requete
// end while ($enreg = mysql_fetch_array ($res))

//********************************************************************************************
//********************************************************************************************

} // fin mode_boucle

//********************************************************************************************
//********************************************************************************************

if ($projet_precedent_vide<>\"vide\")
{
// edition du bilan de projet
if ( ($code_projet_derniere_tache_affichee<>\"vide\") and
($code_projet_derniere_tache_affichee<>\"\") )
{ //
$recap_periode_prevu=$recap_periode_prevu+$cumul_periode_projet_prevu;
$recap_periode_realise=$recap_periode_realise+$cumul_periode_projet_realise;
$projet_precedent_vide=\"vide\";
}
}
// FIN de // IF projet precedent non vide
// // edition du bilan de projet

// c est une nouvelle personne ( et on n'est pas au debut du traitement )
if ( ($personne_precedente<>\"\") and ($personne_precedente<>\"personne\") )
{
// récapitulatif synthese
echo \"----
\";
echo \"Total Période, \";
echo \"Prévu: ";
printf(" %03.2f H",$recap_periode_prevu*7.8);
echo " - Réalisé: ";
printf(" %03.2f H, \",$recap_periode_realise*7.8);
echo \", \";
printf(\"Réalisé %3.2f J, \",$recap_periode_realise);
printf(\"Prévu %3.2f J, \",$recap_periode_prevu);

echo \"\";

echo \"----
\";
// premiere colonne
echo \", \";
// deuxieme colonne
echo \", \";

if ($synthese )
{ echo \", , , , , ".
", , , , , , , , , \";
}

echo \"Total ", $personne_precedente," >>>>>>>>>>>>>>>".
">>>>>>>>>>>>>>>>>>>",$personne_precedente,", \";
echo \"";
echo "";

// prévu
echo "----
";

if ($synthese )
{ echo ", </TD>, , , ".
", , , , , , , , , , \";
}

// 'premiere' colonne
echo \"Prév, \";
// 'deuxieme' colonne
echo \", \";
if ( $modulo_calendrier==\"jour\" )
{
for ($ijour_graphe=1;$ijour_graphe<=$zfgraphe-$zdgraphe;$ijour_graphe++)
{ if ($charge_cumul[$ijour_graphe]>1)
{ echo \"";
printf("%03.2f",$charge_cumul[$ijour_graphe]);
echo ", \";
}
else
{ echo \"";
printf("%03.2f",$charge_cumul[$ijour_graphe]);
echo ", \";
}
}
}
if ( $modulo_calendrier==\"an\" )
{ $zjour=$zdgraphe;
$cumul_modulo=0;
$mois_courant=1;
for ($ijour_graphe=1;$ijour_graphe<=$zfgraphe-$zdgraphe;$ijour_graphe++)
{ $cumul_modulo=$cumul_modulo+$charge_cumul[$ijour_graphe];
if ($mois_courant<>moisx($ijour_graphe) )
{ echo \"";
printf("%03.2f",$cumul_modulo);
echo ", \";
$mois_courant=moisx($ijour_graphe);
$cumul_modulo=0;
}
}
echo \"";
printf("%03.2f",$cumul_modulo);
echo ", \";

}
echo \"\";

// réalisé
echo \"----
\";

if ($synthese )
{ echo \", , , , , , ".
", , , , , , , , \";
}

// 'premiere' colonne
echo \"Réal, \";
// 'deuxieme' colonne
echo \", \";
if ( $modulo_calendrier==\"jour\" )
{
for ($ijour_graphe=1;$ijour_graphe<=$zfgraphe-$zdgraphe;$ijour_graphe++)
{ if ($charge_realise[$ijour_graphe]>1)
{ echo \"";
printf("%03.2f",$charge_realise[$ijour_graphe]);
echo ", \";
}
else
{ echo \"";
printf("%03.2f",$charge_realise[$ijour_graphe]);
echo ", \";
}
}
}
echo \"\";

echo \"----
\";
if ($synthese )
{ echo \", , , , , , , , , , ,
, , , \";
}
// premiere colonne
echo \", \";
// deuxieme colonne
echo \", \";
echo \"Fin ", $personne_precedente," <<<<<<<<<<<<<<<<<<<",
"<<<<<<<<<<<<<<<<<<",$personne_precedente,", \",\"\";
// FIN edition suffixe de personne

}
// FIN de // c est une nouvelle personne ( et on n'est pas au debut du traitement )
// // if ( ($personne_precedente<>\"\") and ($personne_precedente<>\"personne\") )

if ($synthese )
{ editer_lignes_calendrier($modulo_calendrier, $zdgraphe, $zfgraphe,
$debgraphe_an, $fingraphe_an, $prio);
}
else { editer_lignes_calendrier(\"jour\", $zdgraphe, $zfgraphe,
$debgraphe_an, $fingraphe_an, $prio);
}

echo "
";


?>
" >

</form>

</html>
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
8 juil. 2005 à 12:54
Argh, j'en demandais pas tant....juste les bouts interessants .-(
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
8 juil. 2005 à 12:56
Bon enfin rapidement comme ca, vous n'auriez pas non plus change de navigateur depuis le temps...?

Le html est pourri.

ca peut venir de la, peut-etre, vais faire un test. En tous cas, c'est
important : les attributs en html sont entre double quotes! C#est tres
important pour les input, notamment, car

cela delimite la valeur mise dans value="". Sans ca, un espace dans cette valeur et tout ce qui est apres l'espace est perdu.
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
8 juil. 2005 à 13:02
Non ca ne vient pas de la (mais c'est quand meme a changer)...

Le code est trop long franchement pour que je le decortique.

mais de 15,30 a 15,00 cela ressemble a : 15 a ete pris uniquement, puis converti en float avec 2 decimales.
0
jonguignolo Messages postés 92 Date d'inscription samedi 8 mars 2003 Statut Membre Dernière intervention 19 avril 2022
8 juil. 2005 à 13:02
pour les nombres a virgule,

en fait c un point et non pas une virgule qu'il faut
donc à la creation de ta table :

CREATE TABLE `ma_table`

`Tarif` DOUBLE PRECISION(4,2) NOT NULL,

....

en effet DOUBLE PRECISION te permet de gérer les nombre a virgule, ici un par defaut donc si champ vide tu aura : 00.00

certes il y a aussi FLOAT mais beaucoup plus couteux que DOUBLE



DOUBLE ET DOUBLE PRECISION sont des synonymes.



http://dev.mysql.com/doc/internals/en/floating-point-types.html

NB : tu peux bien entendu te mettre en
PhPeteur
0
coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 44
9 juil. 2005 à 01:05
perso, vu ma taille d'écran, je trouves ça difficile de coriger un code
aussi long, mais je peux quand même dire qu'ici, il y a plein de (int),
et que ça peut vennir de ces conversions...

In a dream, I saw me, drop dead... U was here, U cried... It was just a deam, if I die, U won't cry, maybe, U'll be happy

http://coucou747.hopto.org
0
Rejoignez-nous