obtformlib.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. <?php
  2. // ------------------------------
  3. // Caractéristiques du module
  4. // ------------------------------
  5. unset($module);
  6. $module = array(
  7. "titre" => "Gestion des libérations",
  8. "urldest" => $SCRIPT_NAME . "?page=liste_liberations",
  9. "recherche" => array("engin" => true),
  10. "jeton" => $jeton,
  11. "opradmin" => "Ajouter une libération",
  12. "fenetre" => array(
  13. "nom" => "liste_liberations",
  14. "titre" => "titre",
  15. "largeur" => "1024",
  16. "hauteur" => "500",
  17. "champs" => array("lemploye") //, "lpresentation", "lnom", "lprenom", "ladresse1", "ladresse2", "lville", "lcodepostal", "ltelephone", "lemail", "lmembreca", "lnoemployeur", "lnumero")
  18. ),
  19. "msgajoutbouton" => "Ajout de la libération",
  20. //"actionajoutbouton" => "Ajouter la lib�ration",
  21. "msgmodifbouton" => "Modification de la libération",
  22. //"actionmodifbouton" => "Modifier la fiche de l'employ�",
  23. "nombre_a_afficher" => array(
  24. 0 => array("refid" => 15, "valeur" => 15),
  25. 1 => array("refid" => 30, "valeur" => 30),
  26. 2 => array("refid" => 45, "valeur" => 45),
  27. 3 => array("refid" => 60, "valeur" => 60),
  28. 4 => array("refid" => 120, "valeur" => 120),
  29. 5 => array("refid" => 240, "valeur" => 240)
  30. ),
  31. "lientri" => true,
  32. "entete" => array(
  33. 1 => array("Employé" => "concat(employes.nomfamille,employes.prenom)", "largeur" => "130px"),
  34. 2 => array("Type" => "liberations.typeoperation", "largeur" => "78px"),
  35. 3 => array("Date de libération" => "ligneliberations.dateliberation", "largeur" => "141px"),
  36. 4 => array("Article" => "articles.noarticle", "largeur" => "65px"),
  37. 5 => array("Commentaire" => "ligneliberations.commentaire", "largeur" => "204px"),
  38. 6 => array("Durée" => "duree.duree", "largeur" => "61px"),
  39. 7 => array("Lieu" => "ligneliberations.lieu", "largeur" => "79px"),
  40. 8 => array("Assumer par" => "ligneliberations.quipaye", "largeur" => "105px"),
  41. 9 => array("Paiement" => "ligneliberations.paiement", "largeur" => "84px"),
  42. 10 => array("En date du" => "ligneliberations.datepaiement", "largeur" => "90px"),
  43. 11 => array("<img alt=\"Save\" src=\"../images/icones/icones_12.png\">" => "-1", "largeur" => "23px", "droit" => array("gestion_site" => "Oui")),
  44. 12 => array("<img alt=\"Pdf\" src=\"../images/pdficon_small.gif\">" => "-1", "largeur" => "22px")
  45. ),
  46. "msg" => array(
  47. "maj_ok" => "Création de la libération effectuée avec succès.",
  48. "maj_echec" => "L'opération de création de la libération a échouée",
  49. "rech_ok" => "La recherche a réussie.",
  50. "rech_echec" => "La recherche a été infructueuse ou a échouée.",
  51. "employeur_invalide" => "Employeur introuvable ou inconnu.",
  52. )
  53. );
  54. session_start();
  55. require (__DIR__ . '/vendor/autoload.php');
  56. require_once("lib/libconfig.inc.php");
  57. require_once("lib/libsession.inc.php");
  58. require_once("lib/libfonctions.inc.php");
  59. require_once("lib/libmysql.inc.php");
  60. require_once("lib/libencode.inc.php");
  61. require_once("lib/libforms.inc.php");
  62. require_once("lib/libcourriel.inc.php");
  63. require_once("lib/libliberations.inc.php");
  64. require_once("lib/lib2fa.inc.php");
  65. ini_set('display_errors', 'off');
  66. //Encodage des caractères
  67. header('Content-Type: text/html; charset=$ENCODAGE');
  68. //Pour test local avec des appels directs, transformer les INPUT_POST en INPUT_GET
  69. //INPUT_POST
  70. //INPUT_GET
  71. $SCRIPT_NAME = "index2.php";
  72. $jeton = filter_input(INPUT_POST, "jeton");
  73. $rsearch1 = filter_input(INPUT_POST, "prm1");
  74. if (!empty($rsearch1)) {
  75. if ($rsearch1 == "-1" || intval($rsearch1) > 0) {
  76. unset($cpt, $vide);
  77. $cpt = 0;
  78. if (intval($rsearch1) > 0) {
  79. unset($sqlparam);
  80. $sqlparam["table"][] = "liberations";
  81. $sqlparam["table"][] = "ligneliberations";
  82. $sqlparam["table"][] = "employes";
  83. $sqlparam["table"][] = "articles";
  84. $sqlparam["table"][] = "employeurs";
  85. $sqlparam["table"][] = "duree";
  86. $sqlparam["join"][] = "ligneliberations.refliberation = liberations.refliberation";
  87. $sqlparam["join"][] = "employes.refemploye = liberations.refemploye";
  88. $sqlparam["join"][] = "ligneliberations.refarticle = articles.refarticle";
  89. $sqlparam["join"][] = "employes.refemployeur=employeurs.refemployeur";
  90. $sqlparam["join"][] = "ligneliberations.duree=duree.refduree";
  91. $sqlparam["champs"][] = "liberations.refliberation";
  92. $sqlparam["champs"][] = "ligneliberations.refligneliberation";
  93. $sqlparam["champs"][] = "employes.numemploye";
  94. $sqlparam["champs"][] = "CONCAT(employes.prenom,' ',employes.nomfamille) as nomemploye";
  95. $sqlparam["champs"][] = "liberations.typeoperation";
  96. $sqlparam["champs"][] = "UNIX_TIMESTAMP(liberations.datedemande) as datedemande";
  97. $sqlparam["champs"][] = "unix_timestamp(ligneliberations.dateliberation) as dateliberation";
  98. $sqlparam["champs"][] = "duree.duree";
  99. $sqlparam["champs"][] = "articles.noarticle";
  100. $sqlparam["champs"][] = "ligneliberations.commentaire";
  101. $sqlparam["champs"][] = "ligneliberations.lieu";
  102. $sqlparam["champs"][] = "ligneliberations.quipaye";
  103. $sqlparam["champs"][] = "ligneliberations.paiement";
  104. $sqlparam["champs"][] = "IF(ligneliberations.paiement=2,UNIX_TIMESTAMP(ligneliberations.datepaiement),'') as datepaiement";
  105. $sqlparam["where"][] = sprintf("liberations.refliberation=%d", $rsearch1);
  106. unset($resultlib);
  107. //$sqlparam["debug"]=2;
  108. $resultlib = executerRequeteSql($sqlparam);
  109. $cpt = count($resultlib) - 1;
  110. $vide = false;
  111. } else {
  112. $cpt = 0;
  113. $vide = true;
  114. $resultlib = array();
  115. }
  116. //Si syndicat régionaux, on limite l'accès aux articles.
  117. unset($sqlparam);
  118. $sqlparam["table"][] = "articles";
  119. $sqlparam["champs"][] = "refarticle";
  120. $sqlparam["champs"][] = "noarticle";
  121. if ($_SESSION['gestion_site'] == 'Non') {
  122. $sqlparam["where"][] = "noarticle='7.04' OR noarticle='7.09'";
  123. }
  124. unset($resultart);
  125. $resultart = executerRequeteSql($sqlparam);
  126. //Lecture des durées de temps
  127. unset($sqlparam);
  128. $sqlparam["table"][] = "duree";
  129. $sqlparam["champs"][] = "refduree";
  130. $sqlparam["champs"][] = "duree";
  131. unset($resultduree);
  132. $resultduree = executerRequeteSql($sqlparam);
  133. // Formulaire de saisie
  134. print " <table width='100%' border='0' >\n";
  135. print " <tr>\n";
  136. print " <td align='center' width='100%'>\n";
  137. print " <div style='background:#f2f6f7'>\n";
  138. print " <form action='" . $SCRIPT_NAME . "?page=liste_liberations&jeton=" . $jeton . "' method='post' id='frmModif' name='frmModif' "; //>\n";
  139. if (isset($param["validation"])) {
  140. print " onSubmit='return ValidationFormulaire();'";
  141. }
  142. print " autocomplete='off'>\n";
  143. print " <table width='100%'>\n";
  144. print " <tr>\n";
  145. print " <td colspan='2'>\n";
  146. print " <table width='100%'>\n";
  147. print " <tr>\n";
  148. print " </tr>\n";
  149. print " </table>\n";
  150. print " </td>\n";
  151. print " </tr>\n";
  152. print "<INPUT TYPE='hidden' name='action'>\n";
  153. print "<INPUT TYPE='hidden' name='noliberation'>\n";
  154. print "<table width='100%' border='0'>\n";
  155. print "<tr>\n";
  156. print "<td valign=top style='width:300px;'>Type d'op&eacute;ration : </td>\n";
  157. print "<td style='width:305px;'>\n";
  158. if ($vide) {
  159. print "<table style='width:265px; padding-left:20px; padding-right: 20px; border:1px solid #cfcfcf;'>\n";
  160. print "<tr>\n";
  161. print "<td>\n";
  162. print "<label for='opr1'>\n";
  163. print "<input style='margin-right:10px;' type='radio' id='opr1' name='ltypeopr' value='1'> Demande&nbsp;&nbsp;\n";
  164. print "</label>\n";
  165. print "<label for='opr2'>\n";
  166. print "<input style='margin-right:10px;' type='radio' id='opr2' name='ltypeopr' value='2'> Annulation&nbsp;&nbsp;\n";
  167. print "</label>\n";
  168. print "</td>\n";
  169. print "</tr>\n";
  170. print "</table>\n";
  171. } else {
  172. unset($vtypeopr);
  173. $vtypeopr = ($resultlib[0]["typeoperation"] == 1) ? "Demande" : "Annulation";
  174. print $vtypeopr;
  175. print "<input type='hidden' id='opr' name='ltypeopr' value='" . $resultlib[0]["typeoperation"] . "'>\n";
  176. print "<input type='hidden' name='liberation' value='$rsearch1'>\n";
  177. }
  178. print "</td>\n";
  179. print "<td style='text-align:right; width:200px;'>\n";
  180. print "<INPUT class='styled vsolde' TYPE='button' VALUE='Voir le solde' id='vsolde' onclick='voirsolde();'>\n";
  181. print "<div style='position: relative; margin-left:85px;'>\n";
  182. print "<div class='voirsolde' id='voirsolde' style='display:none; padding:2px;'></div>\n";
  183. print "</div>\n";
  184. print "</td>\n";
  185. print "</tr>\n";
  186. print "<tr>\n";
  187. print "<td valign=top>\n";
  188. print "Employ&eacute; :\n";
  189. print "</td>\n";
  190. print "<td colspan='2'>\n";
  191. unset($condition1, $condition2, $condition3);
  192. $condition1 = "Recherche";
  193. $condition2 = "";
  194. $condition3 = date("Y-m-d");
  195. if (!$vide) {
  196. $condition1 = $resultlib[0]["nomemploye"];
  197. $condition2 = ($resultlib[0]["typeoperation"] == 2) ? "checked" : "";
  198. $condition3 = date("Y-m-d", $resultlib[0]["datedemande"]);
  199. }
  200. if ($vide) {
  201. print "<input type='text' value='$condition1' id='zonerecherche2' name='zonerecherche2' onfocus=\"this.value='';\">\n";
  202. } else {
  203. print ucfirst($condition1);
  204. }
  205. print "<input type='hidden' value='$condition2' id='lreference2' name='lreference'>\n";
  206. print "<div id='zoneresultats2' style='max-height:300px;'>\n";
  207. print "</div>\n";
  208. print "</td>\n";
  209. print "</tr>\n";
  210. print "<tr>\n";
  211. print "<td>Date de la cr&eacute;ation du document de lib&eacute;ration : </td>\n";
  212. print "<td colspan='2'>\n";
  213. if ($vide) {
  214. print "<INPUT TYPE='text' NAME='ldatecreation' id='datecreation' Value='$condition3'> (Format : AAAA-MM-JJ)\n";
  215. } else {
  216. print "$condition3";
  217. print "<INPUT TYPE='hidden' NAME='ldatecreation' id='datecreation' Value='$condition3'>";
  218. }
  219. print "</td>\n";
  220. print "</tr>\n";
  221. print "<tr>\n";
  222. print "<td colspan='3'>\n";
  223. print "<br>\n";
  224. //<!-- Il faut conserver 2 rangées pour cette table, l'entête et la seconde
  225. //qui sert de modèle pour l'insertion des rangées virtuelles subséquentes.-->
  226. print "<table id='liberations' cellspacing='0' style='width:100%; border-collapse:collapse; border:1px solid #cfcfcf;'>";
  227. print "<tbody>\n";
  228. print "<tr>\n";
  229. print "<th class='liberationsdetail'>Date de lib&eacute;ration</th>\n";
  230. print "<th class='liberationsdetail'>Article</th>\n";
  231. print "<th class='liberationsdetail'>Commentaire</th>\n";
  232. print "<th class='liberationsdetail'>Dur&eacute;e</th>\n";
  233. print "<th class='liberationsdetail'>Lieu</th>\n";
  234. print "<th class='liberationsdetail'>Assum&eacute;e par</th>\n";
  235. if (!$vide) {
  236. print "<th class='liberationsdetail'>Paiement</th>";
  237. print "<th class='liberationsdetail'>En date du</th>";
  238. } else {
  239. // Colonne visible seulement en mode ajout
  240. print "<th style=class='liberationsdetail'>&nbsp;</th>\n";
  241. }
  242. print "</tr>\n";
  243. // Boucle d'affichage des lignes de détail
  244. unset($x);
  245. $tableauid = array();
  246. for ($x = 0; $x <= $cpt; $x++) {
  247. unset($liberation);
  248. $liberation["refliberation"] = "";
  249. $liberation["date"] = "";
  250. $liberation["article"] = "";
  251. $liberation["commentaire"] = "";
  252. $liberation["duree"] = "";
  253. $liberation["lieu"] = "";
  254. $liberation["assumerpar"] = "";
  255. $liberation["paiement"] = "";
  256. $liberation["datepaiement"] = "";
  257. if (!$vide) {
  258. $liberation["refliberation"] = $resultlib[$x]["refliberation"];
  259. $liberation["date"] = date("Y-m-d", $resultlib[$x]["dateliberation"]);
  260. $liberation["article"] = $resultlib[$x]["noarticle"];
  261. $liberation["commentaire"] = htmlentities(stripslashes($resultlib[$x]["commentaire"]), ENT_QUOTES, $ENCODAGE);
  262. $liberation["duree"] = $resultlib[$x]["duree"];
  263. $liberation["lieu"] = htmlentities(stripslashes($resultlib[$x]["lieu"]), ENT_QUOTES, $ENCODAGE);
  264. $liberation["assumerpar"] = $resultlib[$x]["quipaye"];
  265. $liberation["paiement"] = $resultlib[$x]["paiement"];
  266. $liberation["datepaiement"] = ($resultlib[$x]["paiement"] == 2) ? date("Y-m-d", $resultlib[$x]["datepaiement"]) : "";
  267. $liberation["refligneliberation"] = $resultlib[$x]["refligneliberation"];
  268. }
  269. print "<tr class='ligne' id='ligne$x'>\n";
  270. print "<td class='liberationsdetail'>\n";
  271. print "<input name=\"ancdate[]\" value=\"" . $liberation["date"] . "\" id='idanc$x'\" type=\"hidden\">";
  272. print "<input name='datelib[]' style='min-width:80px;' value='" . $liberation["date"] . "' id='id$x' onblur=\"verifieDate('id$x','lart$x');\" onfocus='verifieinfo();' >";
  273. print "<img alt='Calendrier' src='images/calendar.gif' class='calendrier' id='butdate$x' onclick=\"calendrier('id$x');\">\n";
  274. print "</td>\n";
  275. print "<td class='liberationsdetail'>\n";
  276. print "<select name='larticle[]' id='lart$x' onfocus='verifieinfo();' onblur=\"reponseBoolDate=true;verifieDate('id$x','lart$x');\" >\n";
  277. print "<option>--------</option>\n";
  278. if (isset($resultart) && is_array($resultart) && count($resultart) > 0) {
  279. foreach ($resultart as $clef => $champs) {
  280. unset($selected);
  281. $selected = "";
  282. if ($champs["noarticle"] == $liberation["article"]) {
  283. $selected = "selected";
  284. }
  285. print "<option $selected value=\"" . $champs["refarticle"] . "\">" . $champs["noarticle"] . "</option>";
  286. }
  287. }
  288. print "</select>\n";
  289. print "</td>\n";
  290. print "<td class='liberationsdetail'>\n";
  291. print "<input name='commentaire[]' id='com$x' value=\"" . $liberation["commentaire"] . "\" onfocus='verifieinfo();' >\n";
  292. print "</td>\n";
  293. print "<td class='liberationsdetail'>\n";
  294. print "<select name='lduree[]' id='ldur$x' onfocus='verifieinfo();' >\n";
  295. print "<option>------</option>\n";
  296. if (isset($resultduree) && is_array($resultduree) && count($resultduree) > 0) {
  297. foreach ($resultduree as $clef => $champs) {
  298. unset($selected);
  299. $selected = "";
  300. if ($champs["duree"] == $liberation["duree"]) {
  301. $selected = "selected";
  302. }
  303. print "<option $selected value=\"" . $champs["refduree"] . "\">" . $champs["duree"] . "</option>";
  304. }
  305. }
  306. print "</select>\n";
  307. print "</td>\n";
  308. print "<td class='liberationsdetail'>\n";
  309. print "<input name='lieu[]' value=\"" . $liberation["lieu"] . "\" id='lie$x' onfocus='verifieinfo();' >\n";
  310. print "</td>\n";
  311. print "<td class='liberationsdetail'>\n";
  312. print "<select NAME='lassumerpar[]' id='las$x' onfocus='verifieinfo();' >\n";
  313. print "<option>--------</option>\n";
  314. unset($selected1, $selected2);
  315. $selected1 = "";
  316. $selected2 = "";
  317. if ($liberation["assumerpar"] == "Syndicat") {
  318. $selected1 = "selected";
  319. } elseif ($liberation["assumerpar"] == "Employeur") {
  320. $selected2 = "selected";
  321. }
  322. print "<option $selected1 value='Syndicat'>Syndicat</option>\n";
  323. print "<option $selected2 value='Employeur'>Employeur</option>\n";
  324. print "</select>\n";
  325. print "</td>\n";
  326. if (!$vide) {
  327. print "<td class='liberationsdetail'>";
  328. print "<select NAME=\"lpaiement[]\" id=\"lpa$x\" onchange=\"creeDatePaiement('lpa$x','datepaiement$x');\"\">";
  329. print "<option value=\"0\">--------</option>";
  330. unset($condition1, $condition2);
  331. $condition1 = ($liberation["paiement"] == "1") ? "Selected" : "";
  332. $condition2 = ($liberation["paiement"] == "2") ? "Selected" : "";
  333. print "<option value=\"1\" $condition1>Non</option>";
  334. print "<option value=\"2\" $condition2>Oui</option>";
  335. print "</td>\n";
  336. print "<td class='liberationsdetail'>";
  337. print "<input name=\"datepaiement[]\" id=\"datepaiement$x\" size=\"10\" maxlength=\"10\" type=\"text\" readonly=\"readonly\" value=\"" . $liberation["datepaiement"] . "\">";
  338. print sprintf("<input type='hidden' id='ligneliberation$x' name='ligneliberation[]' value='%d'>", $liberation["refligneliberation"]);
  339. print "</td>\n";
  340. } else {
  341. // La suppression de ligne seulement en mode ajout d'une libération
  342. print "<td class='liberationsdetail'>\n";
  343. print "<input type='button' class='supprimer' onclick='supprimeLigne(this);' value='' id='$x'>\n";
  344. print "</td>\n";
  345. }
  346. $tableauid[] = "$(\"#id$x\").datepicker({
  347. autoSize: true,
  348. onSelect:function(){
  349. reponseBoolDate=true;
  350. verifieDate('id$x','lart$x');
  351. }
  352. });\n
  353. $(\"#id$x\").datepicker(\"hide\");\n";
  354. print "</tr>\n";
  355. }
  356. // Fin de la boucle
  357. print "</tbody>\n";
  358. print "</table>\n";
  359. print "<script type=\"text/javascript\">$(document).ready(function() {\n";
  360. if ($vide) {
  361. print "
  362. // Calendrier pour la date de demande
  363. $( \"#datecreation\" ).datepicker({
  364. showOn: \"button\",
  365. buttonImage: \"images/calendar.gif\",
  366. buttonImageOnly: true
  367. });\n";
  368. }
  369. foreach ($tableauid as $clef) {
  370. print $clef;
  371. }
  372. print "});</script>";
  373. // L'ajout de ligne seulement en mode ajout d'une libération
  374. if (!$vide) {
  375. print "<div style='height:25px;'></div>\n";
  376. } else {
  377. print "<div class='user' style='cursor:pointer;' tabindex='0' onclick=\"addRow('liberations');\">Ajouter une ligne</div>\n";
  378. }
  379. print "<div style='width:auto; text-align:center;'>\n";
  380. print "<INPUT class='styled' TYPE='button' VALUE='Aper&ccedil;u' onclick='apercuLiberation();'>\n";
  381. if ($vide) {
  382. print "<INPUT class='styled' TYPE='button' VALUE='Accepter et imprimer' onclick='ValidationFormulaire(this.value);'>\n";
  383. print "<INPUT class='styled' TYPE='button' VALUE='Accepter et envoyer par courriel' onclick='ValidationFormulaire(this.value);'>\n";
  384. } else {
  385. print "<INPUT class='styled' TYPE='button' VALUE='Modifier' onclick='ValidationFormulaire(this.value);'>\n";
  386. print "<INPUT class='styled' TYPE='button' VALUE='Modifier et imprimer' onclick='ValidationFormulaire(this.value);'>\n";
  387. print "<INPUT class='styled' TYPE='button' VALUE='Annuler la libération' onclick='AnnuleLiberation(this.value,".$liberation["refliberation"] .");'>\n";
  388. }
  389. if ($vide) {
  390. print "<INPUT class='styled' TYPE='button' VALUE='Effacer' onclick='recommencer();'>";
  391. }
  392. unset($titretemp);
  393. //$datepaiement = ($champs[6] == 2) ? date("Y-m-d", $champs[8]) : "&nbsp;";
  394. if (isset($module["actionajoutbouton"])) {
  395. $titretemp = $module["actionajoutbouton"];
  396. }
  397. $titretemp = '';
  398. print "</div>\n";
  399. print " <tr>\n";
  400. print " <td colspan='3' style='height:50px; text-align:center;'>\n";
  401. $style = "font-size:10pt; font-family:arial, helvetica, sans-serif; margin-left:5px; margin-right:5px; text-align:center;";
  402. //TODO
  403. //Suspendu pour l'instant, je ne vois pas d'assignation de la variable $titre.....
  404. //SG 2023-09-30
  405. /*
  406. if (is_array($titre)) {
  407. foreach ($titre as $clef) {
  408. print "<input style='$style' type=\"submit\" id='boutonaction' name=\"action\" value=\"" . $clef . "\">&nbsp;\n";
  409. }
  410. } else {
  411. if ($titre != '') {
  412. print " <input style='$style' type=\"submit\" id='boutonaction' name=\"action\" value=\"" . $titre . "\">\n";
  413. }
  414. }
  415. */
  416. print "<input class='styled' type=\"button\" id='boutonaction' value=\"Annuler\" onclick='fermerfenetremodale();'>&nbsp;\n";
  417. print " </td>\n";
  418. print " </tr>\n";
  419. print " </table>\n";
  420. print " </form>\n";
  421. print " </div>\n";
  422. print " </td>\n";
  423. print " </tr>\n";
  424. print " </table>\n";
  425. //fenetremodalefin($titretemp);
  426. ?>
  427. <script>
  428. $(document).ready(function () {
  429. // Paramètres pour la seconde zone de recherche
  430. $("#zonerecherche2").focus(function () {
  431. if ($("#zonerecherche2").val() === 'Recherche') {
  432. $("#zonerecherche2").val('');
  433. }
  434. });
  435. $("#zonerecherche2").blur(function () {
  436. $("#zoneresultats2").slideUp();
  437. });
  438. $("#zonerecherche2").keyup(function () {
  439. var SearchText = $("#zonerecherche2").val();
  440. if (SearchText.length > 0) {
  441. $("#zoneresultats2").load("ajaxsearch.php", {zonerecherche: SearchText, id: 2});
  442. $("#zoneresultats2").slideDown();
  443. } else {
  444. $("#zoneresultats2").slideUp();
  445. }
  446. });
  447. $("#zoneresultats2").slideUp();
  448. });
  449. </script>
  450. <?php
  451. }
  452. }