generateur_rapports.inc.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <?php
  2. // --------
  3. // Sécurité
  4. // --------
  5. if (isValidConstant() != 1) {
  6. fermeSessionUtilisateur();
  7. }
  8. // ----------------------
  9. // Droit de l'utilisateur
  10. // ----------------------
  11. if ($_SESSION['gestion_site'] < 'Oui') {
  12. exit;
  13. }
  14. // ------------------------------
  15. // Caractéristiques du module
  16. // ------------------------------
  17. unset($module);
  18. $module = array(
  19. "titre" => "Générateur de rapports",
  20. "urldest" => $SCRIPT_NAME . "?page=generateur_rapports",
  21. "recherche" => array("engin" => false),
  22. "jeton" => $jeton,
  23. "compte" => 0
  24. );
  25. ?>
  26. <script type="text/javascript">
  27. $(document).ready(function () {
  28. $('#datedebut').datepicker({
  29. onSelect: function () {
  30. activeBoutonDateFin();
  31. },
  32. showOn: "x", // Hack pour ne pas permettre l'affichage immédiat du calendrier
  33. changeYear: true
  34. });
  35. $("#datefin").datepicker({showOn: "x", changeYear: true});
  36. $("#frmModif").validate();
  37. });
  38. function activeBoutonDateDebut() {
  39. $('#datedebut').datepicker('show');
  40. }
  41. function activeBoutonDateFin(reset) {
  42. if ((document.getElementById("optiondate").selectedIndex === 4 && $("#datedebut").val() !== "") && !reset) {
  43. $("#datefin").removeAttr("readonly");
  44. var dateactuelle = creerDate($("#datedebut").val());
  45. if (dateactuelle.getMonth() + 1 < 10)
  46. var mois = "0" + (dateactuelle.getMonth() + 1);
  47. else
  48. var mois = (dateactuelle.getMonth() + 1);
  49. if (dateactuelle.getDate() + 1 < 10)
  50. var jour = "0" + (dateactuelle.getDate() + 1);
  51. else
  52. var jour = (dateactuelle.getDate() + 1);
  53. $("#datefin").val(dateactuelle.getFullYear() + "-" + mois + "-" + jour);
  54. $("#datefin").datepicker("show");
  55. } else {
  56. $("#datefin").attr("readonly", "readonly");
  57. $("#datefin").val("");
  58. $("#datefin").datepicker("hide");
  59. }
  60. }
  61. function estEmployeurSelectionne(rapport, car) {
  62. var ctl = document.menu2.ListeEmployeurs;
  63. if (ctl.selectedIndex > 0) {
  64. ouvrefenetre(rapport + car + obtientValeurs(document.menu2), 1000);
  65. } else {
  66. jAlert("Veuillez sélectionné un employeur!", "Employeur manquant");
  67. }
  68. }
  69. </script>
  70. <?php
  71. print preparerModule($module);
  72. ?>
  73. <form name="menu2" id="menu2" action="">
  74. <table border="0" width="100%">
  75. <tbody>
  76. <tr>
  77. <td>
  78. <table align="center" border="0">
  79. <tbody>
  80. <tr>
  81. <td class="Style0" style="height: 2cm; width: 10cm;"> Rapports avec paramètres </td>
  82. <td>&nbsp;</td>
  83. <td>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td><input class="Style1" value="Liste des libérations" style="height: 1cm; width: 8.5cm; font-size: 12pt;" type="button"
  88. onclick="ouvrefenetre('rapport_liberations.php?jeton=<?= $jeton; ?>&' + obtientValeurs(document.menu2), 600);"></td>
  89. <td style="font-size: 12pt;"> Relation :</td>
  90. <td>
  91. <fieldset id="CadreA" style="font-size: 12pt;">
  92. <?php
  93. if ($_SESSION['gestion_site'] >= 'Oui') {
  94. print "<label> <input value='1' id='radio1' name='relation' type='radio' onclick=\"requestEmploye('1',document.getElementById('ListeEmployeurs').value, '$jeton');\"> Aucune relation </label>\n";
  95. print "<label> <input value='2' id='radio2' checked name='relation' type='radio' onclick=\"requestEmploye('2',document.getElementById('ListeEmployeurs').value, '$jeton');\"> Employés par employeur </label>\n";
  96. } else {
  97. print "<label> <input value='2' id='radio2' name='relation' type='radio' checked> Employés par employeur </label>\n";
  98. }
  99. ?>
  100. </fieldset>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td>
  105. <?php
  106. if ($_SESSION['gestion_site'] >= 'Oui') {
  107. print "<input class=\"Style1\" value=\"Liste des employés par employeur\" style=\"height: 1cm; width: 8.5cm; font-size: 12pt;\" type=\"button\"";
  108. print "onclick=\"estEmployeurSelectionne('rapport_employes_employeur.php','?jeton=$jeton?>&');\">\n";
  109. } else {
  110. print "<input class=\"Style1\" value=\"Compilation de documents\" style=\"height: 1cm; width: 8.5cm; font-size: 12pt;\" type=\"button\"";
  111. print "onclick=\"ouvrefenetre('index2.php?page=compilation_documents&jeton=$jeton'+obtientValeurs(document.menu2),600);\">\n";
  112. }
  113. ?>
  114. </td>
  115. <td style="font-size: 12pt;">
  116. Employeur :
  117. </td>
  118. <td>
  119. <?php
  120. $condition = "";
  121. // Liste des employeurs
  122. unset($result2);
  123. $result2 = getEmployeurs($_SESSION["gestion_site"]);
  124. unset($param);
  125. $param["form"] = "menu2";
  126. $param["nom"] = "ListeEmployeurs";
  127. $param["etq"] = "";
  128. if ($_SESSION['gestion_site'] >= 'Oui') {
  129. $param["defaut"] = -1;
  130. } else {
  131. $param["defaut"] = $_SESSION["employeur"];
  132. }
  133. $param["donnees"] = $result2;
  134. $param["menu"] = true;
  135. if ($_SESSION["gestion_site"] == "Oui") {
  136. $param["evt"] = "onchange=\"requestEmploye(getCheckedValue(document.forms['menu2'].elements['relation']),this.value,'$jeton');\"";
  137. } else {
  138. $param["evt"] = " ";
  139. }
  140. print formListbox2($param);
  141. ?>
  142. </td>
  143. </tr>
  144. <tr>
  145. <?php
  146. if ($_SESSION['gestion_site'] >= 'Oui') {
  147. ?>
  148. <td>
  149. <input class="Style1" value="Liste des libérations selon le paiement" style="height: 1cm; width: 8.5cm; font-size: 12pt;" type="button"
  150. onclick="ouvrefenetre('rapport_liberations_paiement.php?' + obtientValeurs(document.menu2), 600);">
  151. </td>
  152. <?php
  153. } else {
  154. print "<td></td>\n";
  155. }
  156. ?>
  157. <td style="font-size: 12pt;">
  158. Employé :
  159. </td>
  160. <td>
  161. <?php
  162. unset($result2);
  163. $result2 = getEmployes($_SESSION["employeur"], "gestion_site", true);
  164. unset($param);
  165. $param["form"] = "menu2";
  166. $param["nom"] = "ListeEmployes";
  167. $param["etq"] = "";
  168. $param["defaut"] = -1;
  169. $param["donnees"] = $result2;
  170. $param["menu"] = true;
  171. $param["evt"] = " ";
  172. print formListbox2($param);
  173. ?>
  174. </td>
  175. </tr>
  176. <tr>
  177. <td>
  178. <?php
  179. if ($_SESSION['gestion_site'] >= 'Oui') {
  180. print "<input class=\"Style1\" value=\"Compilation de documents\" style=\"height: 1cm; width: 8.5cm; font-size: 12pt;\" type=\"button\"";
  181. print "onclick=\"ouvrefenetre('index2.php?page=compilation_documents&jeton=$jeton'+obtientValeurs(document.menu2),600);\">\n";
  182. }
  183. ?>
  184. </td>
  185. <td rowspan="2" valign='top' style="font-size: 12pt;">Article :</td>
  186. <td rowspan="2">
  187. <select name='ListeArticles' id='ListeArticles' class='Style12' style='width: 8.6cm;' size='4' multiple='multiple'>
  188. <option>--------------------</option>
  189. <?php
  190. unset($sqlparam);
  191. $sqlparam["table"][] = "articles";
  192. $sqlparam["champs"][] = "refarticle";
  193. $sqlparam["champs"][] = "noarticle";
  194. $sqlparam["ordre"][] = "length(noarticle)";
  195. $sqlparam["ordre"][] = "noarticle";
  196. unset($resultart);
  197. $resultart = executerRequeteSql($sqlparam);
  198. foreach ($resultart as $clef => $champs) {
  199. print "<option value='" . $champs["refarticle"] . "'>" . $champs["noarticle"] . "</option>";
  200. }
  201. ?>
  202. </select>
  203. </td>
  204. </tr>
  205. <tr>
  206. <?php
  207. if ($_SESSION['gestion_site'] >= 'Oui') {
  208. ?>
  209. <td>
  210. <input class="Style1" value="Compilation du solde" style="height: 1cm; width: 8.5cm; font-size: 12pt;" type="button"
  211. onclick="estEmployeurSelectionne('index2.php?page=compilation_soldes&jeton=<?php print $jeton; ?>&tag=N', '');">
  212. </td>
  213. <?php
  214. } else {
  215. print "<td></td>\n";
  216. }
  217. ?>
  218. </tr>
  219. <tr>
  220. <td>&nbsp;
  221. </td>
  222. <td style="font-size: 12pt;">Date de début :</td>
  223. <td>
  224. <input name="datedebut" size="10" maxlength="10" style="height: 0.5cm; width: 3.463cm;" type="text" id="datedebut" class="date">
  225. <img alt="Calendrier" src="images/calendar.gif" class="calendrier" id="butdatedebut" onclick="activeBoutonDateDebut();" >
  226. <select name="optiondate" style="width:72px;" id="optiondate" size="1" onchange="activeBoutonDateFin();">
  227. <option value="0">-----</option>
  228. <option value="1">Égale</option>
  229. <option value="2">Inférieure</option>
  230. <option value="3">Supérieure</option>
  231. <option value="4">Entre</option>
  232. </select>
  233. </td>
  234. </tr>
  235. <tr>
  236. <td> &nbsp;
  237. </td>
  238. <td style="font-size: 12pt;">Date de fin :</td>
  239. <td>
  240. <input name="datefin" size="10" maxlength="10" style="height: 0.5cm; width: 3.463cm;" type="text" id="datefin" readonly="readonly" class="date">
  241. <img alt="Calendrier" src="images/calendar.gif" class="calendrier" id="butdatefin" onclick="activeBoutonDateFin();" disabled="disabled">
  242. </td>
  243. </tr>
  244. <?php
  245. if ($_SESSION['gestion_site'] >= 'Oui') {
  246. ?>
  247. <tr>
  248. <td class="Style0" style="height: 1.5cm; width: 6.412cm;">
  249. États instantanés
  250. </td>
  251. <td style="font-size: 12pt;">Commentaire :</td>
  252. <td>
  253. <input name="Commentaire" size="20" maxlength="20" style="height: 0.5cm; width: 8.5cm;" type="text" id="commentaire">
  254. </td>
  255. </tr>
  256. <tr>
  257. <td class="Style0" style="height: 2cm; width: 6.412cm;">
  258. <input class="Style1" value="Liste des membres du CA" style="height: 1cm; width: 8.5cm; font-size: 12pt;" type="button" onclick="ouvrefenetre('rapport_membre_ca.php', 600);">
  259. </td>
  260. <td style="font-size: 12pt;">Assumée par :</td>
  261. <td>
  262. <fieldset id="CadreB" style="width: 7.9cm;font-size: 12pt;">
  263. <label> <input value="1" name="Assumerpar" type="radio"> Syndicat</label>
  264. <label> <input value="2" name="Assumerpar" type="radio"> Employeur </label>
  265. </fieldset>
  266. </td>
  267. </tr>
  268. <tr>
  269. <td>
  270. <input class="Style1" value="Liste des employés par ordre croissant" style="height: 1cm; width: 8.5cm; font-size: 12pt;" type="button" onclick="ouvrefenetre('rapport_employes_croissant.php', 600);">
  271. </td>
  272. <td style="font-size: 12pt;">Paiement :</td>
  273. <td>
  274. <fieldset id="CadreC" style="width: 7.9cm;font-size: 12pt;">
  275. <label> <input value="1" name="Paiement" type="radio"> Payées</label>
  276. <label> <input value="2" name="Paiement" type="radio"> À payer </label>
  277. </fieldset>
  278. </td>
  279. </tr>
  280. <?php
  281. }
  282. ?>
  283. <tr>
  284. <td>
  285. &nbsp;
  286. </td>
  287. <td>&nbsp;</td>
  288. <td>
  289. <input value="Effacer" class="Style1" style="height: 1cm; width: 8.6cm; font-size: 12pt;" type="reset" onclick="activeBoutonDateFin(true);
  290. $('#radio1').focus();
  291. <?php
  292. if ($_SESSION["gestion_site"] == "Oui") {
  293. print "requestEmploye('1',document.getElementById('ListeEmployeurs').value, '$jeton');";
  294. }
  295. ?>">
  296. </td>
  297. </tr>
  298. </tbody>
  299. </table>
  300. </td>
  301. </tr>
  302. </tbody>
  303. </table>
  304. </form>
  305. <SCRIPT type="text/javascript">
  306. function requestEmploye(valeur, prm1, jeton) {
  307. switch (valeur) {
  308. case "":
  309. case "1":
  310. $("#ListeEmployes").load("obtemploye3.php", {prm1: -1, jeton : jeton});
  311. break;
  312. case "2":
  313. $("#ListeEmployes").load("obtemploye3.php", {prm1: prm1, jeton : jeton});
  314. break;
  315. }
  316. }
  317. </SCRIPT>