\n"; if($validation==0){ $validation=1; echo ""; echo ""; echo ""; // choix scrutin $sql="select scrutin,libelle from ".DB_PREFIXE."scrutin where solde is false"; $res = $f -> db -> query($sql); $f->isDatabaseError($res); echo ""; echo "
"._("affectation_automatique_des_heures")." - "._("table")." \"periode\"

Selectionner un scrutin :

"; echo ""; echo "  "._("attention")." "._("toute")." "._("les")." "._("saisies")." "._("seront_ecrasees")." !"; echo ""; echo "
"; }else{ // validation = 1 echo "
"; $sql="select candidature,periode,debut,fin,nom,prenom from ".DB_PREFIXE."candidature inner join ".DB_PREFIXE."agent on agent.agent=candidature.agent where scrutin='". $scrutin."' and decision is true order by nom"; $res = $f -> db -> query($sql); echo "
"._("candidature")." "._("concernees").""; echo ""; echo ""; echo ""; echo ""; echo ""; $f->isDatabaseError($res); while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ $sql = "select debut from ".DB_PREFIXE."periode where periode ='".$row['periode']."'"; $debut = $f -> db -> getOne($sql); //if(is_object($debut)) $debut='00:00'; $sql = "select fin from ".DB_PREFIXE."periode where periode ='".$row['periode']."'"; $fin = $f -> db -> getOne($sql); echo ""; echo ""; $sql="update ".DB_PREFIXE."candidature set debut='".$debut."', fin = '".$fin. "' where candidature=".$row['candidature']; $res1 = $f -> db -> query($sql); $f->isDatabaseError($res1); } echo ""; echo ""; echo "
"._("affectation des heures")."
"; echo $row['candidature']."".$row['nom']."".$row['prenom']."".$row['periode'].""._("debut")." : ".$debut.""._("fin")." : ".$fin."
"; echo "
"; echo ""._("affectation")." "._("heures")." "._("effectuee")." !"; echo "
"; echo "
"; } echo ""; ?>