headerhtml (); $f -> collectivite (); $f -> droit ($obj); $f -> header (1, $ent); $f->isAuthorized($obj); echo "\n
\n"; if($validation==0){ $validation=1; echo ""; echo ""; echo ""; // choix scrutin $sql="select scrutin,libelle from scrutin where solde !='Oui'"; $res = $f -> db -> query($sql); if (DB :: isError($res)) die($res->getMessage()."erreur SELECT ".$sql); echo ""; If ($_SESSION['profil'] >= $f -> droit){ echo "
".$f -> lang("affectation_automatique_des_heures")." - ".$f -> lang("table")." \"periode\"

Selectionner un scrutin :


"; echo ""; echo "
".$f -> lang("attention")." ".$f -> lang("toute").$f -> lang("pluriel")." ".$f -> lang("les")." ".$f -> lang("saisie").$f -> lang("pluriel")." ".$f -> lang("seront_ecrasees")." !"; }else echo "
Droits insuffisants ou reconnectez-vous."; echo ""; echo "
"; }else{ // validation = 1 echo "
"; $sql="select candidature,periode,debut,fin,nom,prenom from candidature inner join agent on agent.agent=candidature.agent where scrutin='". $scrutin."' and decision ='Oui' order by nom"; $res = $f -> db -> query($sql); echo "
".$f -> lang("candidature").$f -> lang("pluriel")." ".$f -> lang("concernee").$f -> lang("pluriel").""; if (DB :: isError($res)) die($res->getMessage()."erreur SELECT ".$sql); while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ $sql = "select debut from periode where periode ='".$row['periode']."'"; $debut = $f -> db -> getOne($sql); //if(is_object($debut)) $debut='00:00'; $sql = "select fin from periode where periode ='".$row['periode']."'"; $fin = $f -> db -> getOne($sql); echo "
  ".$row['candidature']."  ".$row['nom']."  ".$row['prenom']."    ".$row['periode']."    ".$f -> lang("debut")." : ".$debut."      ".$f -> lang("fin")." : ".$fin."
"; $sql="update candidature set debut='".$debut."', fin = '".$fin. "' where candidature=".$row['candidature']; $res1 = $f -> db -> query($sql); if (DB :: isError($res1)) die($res1->getMessage()."erreur maj ".$sql); } echo "
"; echo "
".$f -> lang("affectation")." ".$f -> lang("heure").$f -> lang("pluriel").""; echo "".$f -> lang("affectation")." ".$f -> lang("heure").$f -> lang("pluriel")." ".$f -> lang("effectuee")." !"; echo "
"; echo "
"; } echo "
"; $f -> footer (); $f -> deconnexion (); $f -> footerhtml (); ?>