root/alternc-stats/branches/INIT/admin/stat_list.php
| Revision 1340, 24.7 kB (checked in by anonymous, 4 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | <?php |
| 2 | |
| 3 | require_once("../class/config.php"); |
| 4 | require_once("stat_functions.php"); |
| 5 | |
| 6 | if ($back) { |
| 7 | header("location: ".$ABSWEB."stat.php"); |
| 8 | } |
| 9 | |
| 10 | $qname=trim($qname); |
| 11 | |
| 12 | if ($compute) { |
| 13 | if (($r=="a" || $r=="b") && !count($ra)) { |
| 14 | $error="Il faut au moins choisir un champ ! "; |
| 15 | } else { |
| 16 | |
| 17 | // Calcul maintenant : on fait faire le calcul ailleurs :) |
| 18 | include("stat_dolist.php"); |
| 19 | } |
| 20 | } |
| 21 | if ($saveit && !$qname) { |
| 22 | $error=_("Vous devez spécifier un nom de requête pour pouvoir la sauver !"); |
| 23 | } |
| 24 | if ($saveit && $qname) { |
| 25 | // Sauvegarde de la requete type : |
| 26 | stripslashes_rec($_POST); |
| 27 | unset($_POST[qname]); |
| 28 | unset($_POST[saveit]); |
| 29 | |
| 30 | $db->query("INSERT INTO bw_stats SET name='$qname', uid='$cuid', params='".addslashes(serialize($_POST))."';"); |
| 31 | $error=_("Requête sauvegardée avec succès"); |
| 32 | } |
| 33 | |
| 34 | |
| 35 | include("head.php"); |
| 36 | |
| 37 | |
| 38 | ?> |
| 39 | <h1><?php __("Moteur de statistiques de consommation de bande passante"); ?></h1> |
| 40 | <form method="post" action="stat_list.php" id="st" name="st"> |
| 41 | <?php |
| 42 | if ($error) { |
| 43 | echo "<h6>$error</h6>"; |
| 44 | } |
| 45 | ?> |
| 46 | <p> |
| 47 | Vous souhaitez dresser un listing, choisissez tout d'abord sur quoi portera cette liste, |
| 48 | <br />puis utilisez les restrictions |
| 49 | <br />enfin, choisissez le format de sortie (tableau, graphique, csv ...) |
| 50 | </p> |
| 51 | <p> |
| 52 | |
| 53 | <?php |
| 54 | // on veut dresser une liste. |
| 55 | $apa=array( |
| 56 | "z"=>"-- Choisir --", |
| 57 | "a"=>"La bande passante utilisée par un site web", |
| 58 | "b"=>"Le nombre de hits d'un site web", |
| 59 | ); |
| 60 | ?> |
| 61 | Ma requête porte sur : <br /> |
| 62 | <select class="inl" name="pa" onchange="document.forms.st.submit()"> |
| 63 | <?php array_sel($pa,$apa); ?> |
| 64 | </select><br /> |
| 65 | |
| 66 | <!-- ########################################### --> |
| 67 | <?php |
| 68 | |
| 69 | // RESTRICTIONS : |
| 70 | |
| 71 | if ( |
| 72 | $pa && ($pa=="a" || $pa=="b") |
| 73 | ) { // AJOUTER LES AUTRES CAS POSSIBLES ICI. |
| 74 | $aq=array( |
| 75 | "z"=>"-- Choisir --", |
| 76 | "a"=>"Pour les domaines ci-dessous ...", |
| 77 | "b"=>"La somme les domaines ci-dessous ...", |
| 78 | ); |
| 79 | |
| 80 | |
| 81 | // Selon les droits, on restreint automatiquement : |
| 82 | if ($mem->checkright()) { |
| 83 | $aq[c]="Pour les comptes AlternC ci-dessous ..."; |
| 84 | $aq[d]="La somme des comptes AlternC ci-dessous ..."; |
| 85 | } |
| 86 | |
| 87 | if (!$q) $q="z"; |
| 88 | ?> |
| 89 | Domaine de production de statistiques : <br /> |
| 90 | <select class="inl" name="q" onchange="document.forms.st.submit()"> |
| 91 | <?php array_sel($q,$aq); ?> |
| 92 | </select><br /> |
| 93 | |
| 94 | |
| 95 | <?php |
| 96 | |
| 97 | if ($q=="a" || $q=="b") { |
| 98 | $aqa=array(); |
| 99 | // Choix parmi les domaines accessibles à l'utilisateur courant : |
| 100 | if ($mem->checkright()) { |
| 101 | // Liste des domaines pointant en local pour MOI uniquement. |
| 102 | $db->query("SELECT sub, domaine, login FROM sub_domaines s, membres m WHERE m.uid=s.compte AND m.creator='$cuid' ORDER BY sub,domaine;"); |
| 103 | while ($db->next_record()) { |
| 104 | $aqa[$db->f("sub").(($db->f("sub"))?".":"").$db->f("domaine")]=$db->f("sub").(($db->f("sub"))?".":"").$db->f("domaine")." (compte ".$db->f("login").")"; |
| 105 | } |
| 106 | } else { |
| 107 | // Liste des domaines de tous les comptes que JE gère, pointant en local. |
| 108 | $db->query("SELECT sub,domaine FROM sub_domaines WHERE compte='$cuid' AND type=0 ORDER BY sub,domaine;"); |
| 109 | while ($db->next_record()) { |
| 110 | $aqa[$db->f("sub").(($db->f("sub"))?".":"").$db->f("domaine")]=$db->f("sub").(($db->f("sub"))?".":"").$db->f("domaine"); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | if (count($aqa)<8) $hh=count($aqa); else $hh=8; |
| 115 | |
| 116 | // On fait choisir le(s) domaines voulus : |
| 117 | if (!$qa) $qa=array(); |
| 118 | ?> |
| 119 | Choisissez les domaines concernés : <br /> |
| 120 | <select class="inl" name="qa[]" multiple="multiple" size="<?php echo $hh; ?>"> |
| 121 | <?php array_multiple($qa,$aqa); ?> |
| 122 | </select><br /> |
| 123 | |
| 124 | <?php |
| 125 | } // Par domaines |
| 126 | if ($q=="c" || $q=="d") { |
| 127 | $aqc=array(); |
| 128 | $db->query("SELECT login FROM membres WHERE creator='$cuid' ORDER BY login;"); |
| 129 | while ($db->next_record()) { |
| 130 | $aqc[$db->f("login")]=$db->f("login"); |
| 131 | } |
| 132 | |
| 133 | if (count($aqc)<8) $hh=count($aqc); else $hh=8; |
| 134 | |
| 135 | if (!$qc) $qc=array(); |
| 136 | ?> |
| 137 | Choisissez les comptes AlternC concernés : <br /> |
| 138 | <select class="inl" name="qc[]" multiple="multiple" size="<?php echo $hh; ?>"> |
| 139 | <?php array_multiple($qc,$aqc); ?> |
| 140 | </select><br /> |
| 141 | |
| 142 | <?php |
| 143 | |
| 144 | } // Par compte AlternC |
| 145 | |
| 146 | } // Q = A or B. (bw http ou hit http) |
| 147 | ?> |
| 148 | |
| 149 | |
| 150 | <!-- ########################################### --> |
| 151 | |
| 152 | |
| 153 | <?php |
| 154 | if ($pa!="z") { |
| 155 | // Choix de la date ou de la période couverte. |
| 156 | $ar=array( |
| 157 | "z" => "-- Choix --", |
| 158 | "a" => "Pour une date en particulier", |
| 159 | "b" => "Entre 2 dates (tous les jours)", |
| 160 | "c" => "Entre 2 dates (cumul)", |
| 161 | "d" => "Entre 2 mois (tous les mois)", |
| 162 | "e" => "Les 7 derniers jours", |
| 163 | ); |
| 164 | if (!$r) $r="z"; |
| 165 | ?> |
| 166 | Choisissez la période de calcul / d'affichage : <br /> |
| 167 | <select class="inl" name="r" onchange="document.forms.st.submit()"> |
| 168 | <?php array_sel($r,$ar); ?> |
| 169 | </select><br /> |
| 170 | |
| 171 | <?php |
| 172 | |
| 173 | if ($r=="a") { |
| 174 | // choix d'une date particulière : |
| 175 | ?> |
| 176 | Entrez la date de statistique voulue (jj/mm/aaaa) : <br /> |
| 177 | <input class="int" type="text" size="10" maxlength="10" name="ra" value="<?php echo $ra; ?>" /> |
| 178 | <br /> |
| 179 | <?php |
| 180 | |
| 181 | } // ra |
| 182 | |
| 183 | if ($r=="b" || $r=="c") { |
| 184 | // choix de 2 dates particulières : |
| 185 | ?> |
| 186 | Entrez l'interval de dates voulu (jj/mm/aaaa) : <br /> |
| 187 | Du <input class="int" type="text" size="10" maxlength="10" name="rba" value="<?php echo $rba; ?>" /> au <input class="int" type="text" size="10" maxlength="10" name="rbb" value="<?php echo $rbb; ?>" /> |
| 188 | <br /> |
| 189 | <?php |
| 190 | |
| 191 | } // rb rc |
| 192 | |
| 193 | if ($r=="d") { |
| 194 | // choix de 2 mois particuliers : |
| 195 | ?> |
| 196 | Entrez l'interval des mois voulus (bornes incluses) (mm/aaaa) : <br /> |
| 197 | Du <input class="int" type="text" size="7" maxlength="7" name="rda" value="<?php echo $rda; ?>" /> au <input class="int" type="text" size="7" maxlength="7" name="rdb" value="<?php echo $rdb; ?>" /> |
| 198 | <br /> |
| 199 | <?php |
| 200 | |
| 201 | } // rd |
| 202 | |
| 203 | } // Dates (r) |
| 204 | |
| 205 | |
| 206 | ?> |
| 207 | |
| 208 | <!-- ########################################### --> |
| 209 | |
| 210 | |
| 211 | <?php |
| 212 | |
| 213 | if ( $pa!="z" && |
| 214 | (($pa=="a" || $pa=="b") && $q!="z" |
| 215 | ) && |
| 216 | $r!="z" |
| 217 | ) { |
| 218 | |
| 219 | // FORMAT DE SORTIE : |
| 220 | if (!$z) $z="z"; |
| 221 | |
| 222 | $az=array( |
| 223 | "z"=>"-- Choisir --", |
| 224 | "a"=>"Tableau Web", |
| 225 | "b"=>"Format Excel (csv)", |
| 226 | "c"=>"Tableau Web avec graphique", |
| 227 | ); |
| 228 | ?> |
| 229 | <hr /> |
| 230 | Format de sortie : <br /> |
| 231 | <select class="inl" name="z" onchange="document.forms.st.submit()"> |
| 232 | <?php array_sel($z,$az); ?> |
| 233 | </select><br /> |
| 234 | <?php |
| 235 | |
| 236 | if ($z!="z") { |
| 237 | // Ok, on affiche le bouton ou la sauvegarde... |
| 238 | ?> |
| 239 | |
| 240 | <p> |
| 241 | Vous avez rempli tous les critères, vous pouvez maintenant procéder au calcul ou sauver cette requête pour plus tard |
| 242 | </p> |
| 243 | <p> |
| 244 | <input class="inb" type="submit" name="compute" value="- = - = - Procéder au calcul - = - = -" /> |
| 245 | <br /> |
| 246 | <input class="inb" type="submit" name="saveit" value="Sauver cette requête (entrez un nom ci-contre)" /> |
| 247 | Nom de la requête : <input class="int" type="text" name="qname" value="<?php echo fl(stripslashes($qname)); ?>" size="30" maxlength="255" /> |
| 248 | </p> |
| 249 | |
| 250 | |
| 251 | <?php |
| 252 | |
| 253 | |
| 254 | } |
| 255 | |
| 256 | } // Format de sortie |
| 257 | |
| 258 | ?> |
| 259 | |
| 260 | <p> |
| 261 | <input class="inb" type="submit" name="back" value="Annuler, Retour" style="margin: 3px" /> |
| 262 | </p> |
| 263 | |
| 264 | <?php |
| 265 | |
| 266 | exit(); |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | /* |
| 289 | |
| 290 | ?> |
| 291 | <select name="q" onchange="document.forms.st.submit()"> |
| 292 | <?php array_sel($q,$aaq); ?> |
| 293 | </select><br /> |
| 294 | <?php |
| 295 | if ($q=="a") { |
| 296 | unset($qb); |
| 297 | if (!$qa) $qa=$ctid; |
| 298 | ?> |
| 299 | <select name="qa" onchange="document.forms.st.submit()"> |
| 300 | <?php select_territoire($qa); ?> |
| 301 | </select><br /> |
| 302 | |
| 303 | <?php } // Choix d'un territoire |
| 304 | ?> |
| 305 | |
| 306 | <?php |
| 307 | if ($q=="b") { |
| 308 | unset($qa); |
| 309 | if (!$qb) $qb=$creg; |
| 310 | echo "<b>Région ".get_region($qb)."</b><input type=\"hidden\" name=\"qb\" value=\"$creg\" /><br />"; |
| 311 | |
| 312 | } // Choix d'une region |
| 313 | |
| 314 | } elseif ($right==3 || $right==4) { // restriction au territoire :) |
| 315 | if (!$q) $q="a"; |
| 316 | ?> |
| 317 | Restriction Geographique : <br /> |
| 318 | <b><?php echo get_territoire($ctid); ?></b> |
| 319 | <input type="hidden" name="q" value="a" /> |
| 320 | <input type="hidden" name="qa" value="<?php echo $ctid; ?>" /> |
| 321 | <br /> |
| 322 | <?php |
| 323 | $q="a"; |
| 324 | $qa=$ctid; |
| 325 | } elseif ($right==1 || $right==5 || $right==6) { // national :) |
| 326 | if (!$q) $q="z"; |
| 327 | ?> |
| 328 | Restriction Geographique : <br /> |
| 329 | <select name="q" onchange="document.forms.st.submit()"> |
| 330 | <?php array_sel($q,$aq); ?> |
| 331 | </select><br /> |
| 332 | |
| 333 | <?php |
| 334 | |
| 335 | if ($q=="a") { |
| 336 | unset($qb); |
| 337 | ?> |
| 338 | <select name="qa" onchange="document.forms.st.submit()"> |
| 339 | <option value="">-- Choix d'un territoire -- </option> |
| 340 | <?php select_territoire($qa,-1); ?> |
| 341 | </select><br /> |
| 342 | |
| 343 | <?php } // Choix d'un territoire |
| 344 | ?> |
| 345 | |
| 346 | <?php |
| 347 | if ($q=="b") { |
| 348 | unset($qa); |
| 349 | ?> |
| 350 | <select name="qb" onchange="document.forms.st.submit()"> |
| 351 | <option value="">-- Choix d'une région -- </option> |
| 352 | <?php select_region($qb); ?> |
| 353 | </select><br /> |
| 354 | |
| 355 | <?php } // Choix d'une region |
| 356 | |
| 357 | if ($q!="a" && $q!="b") { |
| 358 | unset($qa); unset($qb); |
| 359 | } |
| 360 | ?> |
| 361 | |
| 362 | |
| 363 | <?php } // Zone geo (q) |
| 364 | } |
| 365 | else { |
| 366 | unset($qa); unset($qb); |
| 367 | } |
| 368 | ?> |
| 369 | |
| 370 | <!-- ########################################### --> |
| 371 | <?php |
| 372 | if ($pa && $pa!="e" && $pa!="f" && $pa!="z") { |
| 373 | // RESTRICTIONS PROJET : |
| 374 | $ao=array( |
| 375 | "z"=>"Pas de critère de Projets / Types de projet", |
| 376 | "b"=>"Choix des projets ci-dessous", |
| 377 | "c"=>"Choix d'un type de projet ci-dessous", |
| 378 | ); |
| 379 | if (!$o) $o="z"; |
| 380 | ?> |
| 381 | Restriction par Projet / Type de projet : <br /> |
| 382 | <select name="o" onchange="document.forms.st.submit()"> |
| 383 | <?php array_sel($o,$ao); ?> |
| 384 | </select><br /> |
| 385 | |
| 386 | <?php |
| 387 | if ($o=="b") { |
| 388 | |
| 389 | // on dresse la liste des projets : |
| 390 | if ($qa) { // d'un territoire |
| 391 | $re=mq("SELECT id,concat(nom,' - ',ville) as n FROM projets WHERE tid='$qa' ORDER BY nom ;"); |
| 392 | } |
| 393 | elseif ($qb) { // d'une region |
| 394 | $re=mq("SELECT p.id, concat(p.nom,' - ',t.territoire,' - ',p.ville) AS n FROM projets p INNER JOIN territoires t ON t.id=p.tid WHERE t.region='$qb' ORDER BY p.tid,p.nom;"); |
| 395 | } |
| 396 | else { // tous les projets |
| 397 | $re=mq("SELECT p.id, concat(p.nom,' - ',t.territoire,' - ',p.ville) AS n FROM projets p INNER JOIN territoires t ON t.id=p.tid ORDER BY p.tid,p.nom;"); |
| 398 | } |
| 399 | $hh=8; |
| 400 | if (mysql_num_rows($re)<8) $hh=mysql_num_rows($re); |
| 401 | while ($c=mysql_fetch_array($re)) { |
| 402 | $aob["p".$c[id]]=$c[n]; |
| 403 | } |
| 404 | if (!is_array($ob)) { |
| 405 | $ob=array(); |
| 406 | } |
| 407 | ?> |
| 408 | Choisir le(s) projet(s) sélectionnés : <br /> |
| 409 | <select name="ob[]" multiple="multiple" size="<?php echo $hh; ?>"> |
| 410 | <?php array_multiple($ob,$aob); ?> |
| 411 | </select><br /> |
| 412 | |
| 413 | <?php } // Choix d'un projet |
| 414 | |
| 415 | if ($o=="c") { |
| 416 | // on dresse la liste des types de projet. |
| 417 | $re=mq("SELECT id,data FROM type_actions ORDER BY data"); |
| 418 | while ($c=mysql_fetch_array($re)) { |
| 419 | $aoc["p".$c[id]]=$c[data]; |
| 420 | } |
| 421 | ?> |
| 422 | <select name="oc" onchange="document.forms.st.submit()"> |
| 423 | <?php array_sel($oc,$aoc); ?> |
| 424 | </select><br /> |
| 425 | <?php |
| 426 | } |
| 427 | } |
| 428 | ?> |
| 429 | |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | <!-- ########################################### --> |
| 437 | <?php |
| 438 | if ($pa && $pa=="b") { |
| 439 | // RESTRICTIONS PAR UNIVERSITE |
| 440 | $as=array( |
| 441 | "z"=>"Pas de restriction par université", |
| 442 | "b"=>"Uniquement les étudiants de l'université ci-dessous", |
| 443 | ); |
| 444 | if (!$s) $s="z"; |
| 445 | ?> |
| 446 | Restriction par Université : <br /> |
| 447 | <select name="s" onchange="document.forms.st.submit()"> |
| 448 | <?php array_sel($s,$as); ?> |
| 449 | </select><br /> |
| 450 | |
| 451 | <?php |
| 452 | if ($s=="b") { |
| 453 | |
| 454 | // on dresse la liste des universités |
| 455 | if ($qa) { // d'un territoire |
| 456 | // on capte la région du territoire : |
| 457 | $trr=get_terr_reg($qa); |
| 458 | $re=mq("SELECT p.id, concat(p.nom,' - ',t.territoire,' - ',p.ville) AS n FROM univ p INNER JOIN territoires t ON t.id=p.tid WHERE t.region='$trr' ORDER BY p.tid,p.nom;"); |
| 459 | } |
| 460 | elseif ($qb) { // d'une region |
| 461 | $re=mq("SELECT p.id, concat(p.nom,' - ',t.territoire,' - ',p.ville) AS n FROM univ p INNER JOIN territoires t ON t.id=p.tid WHERE t.region='$qb' ORDER BY p.tid,p.nom;"); |
| 462 | } |
| 463 | else { // tous les projets |
| 464 | $re=mq("SELECT p.id, concat(p.nom,' - ',t.territoire,' - ',p.ville) AS n FROM univ p INNER JOIN territoires t ON t.id=p.tid ORDER BY p.tid,p.nom;"); |
| 465 | } |
| 466 | $hh=8; |
| 467 | if (mysql_num_rows($re)<8) $hh=mysql_num_rows($re); |
| 468 | while ($c=mysql_fetch_array($re)) { |
| 469 | $asb["p".$c[id]]=$c[n]; |
| 470 | } |
| 471 | |
| 472 | ?> |
| 473 | Choisir l'université : <br /> |
| 474 | <select name="sb" > |
| 475 | <?php array_sel($sb,$asb); ?> |
| 476 | </select><br /> |
| 477 | |
| 478 | <?php } // Choix d'une université |
| 479 | |
| 480 | } |
| 481 | ?> |
| 482 | |
| 483 | |
| 484 | |
| 485 | <!-- ########################################### --> |
| 486 | <?php |
| 487 | |
| 488 | // Critères spécifiques aux enfants |
| 489 | if ($pa=='d') { |
| 490 | ?> |
| 491 | Critères spécifiques aux enfants : <br /> |
| 492 | |
| 493 | Classe de l'enfant <select name="ta"> |
| 494 | <option value="0">Peu importe</option> |
| 495 | <?php select_classe($ta); ?> |
| 496 | </select> <br /> |
| 497 | |
| 498 | Sexe de l'enfant : <select name="tb"> |
| 499 | <option value="0">Peu importe</option> |
| 500 | <option value="1"<?php if ($tb==1) echo " selected=\"selected\""; ?>>Garçon</option> |
| 501 | <option value="2"<?php if ($tb==2) echo " selected=\"selected\""; ?>>Fille</option> |
| 502 | </select> <br /> |
| 503 | |
| 504 | <?php |
| 505 | // RESTRICTIONS PAR ETABLISSEMENT |
| 506 | $atc=array( |
| 507 | "z"=>"Pas de restriction par établissement", |
| 508 | "b"=>"Uniquement les enfants de l'établissement ci-dessous", |
| 509 | "c"=>"Uniquement les enfants des établissements du type ci-dessous", |
| 510 | ); |
| 511 | if (!$tc) $tc="z"; |
| 512 | ?> |
| 513 | Restriction par Etablissement : <br /> |
| 514 | <select name="tc" onchange="document.forms.st.submit()"> |
| 515 | <?php array_sel($tc,$atc); ?> |
| 516 | </select><br /> |
| 517 | |
| 518 | <?php |
| 519 | if ($tc=="b") { |
| 520 | |
| 521 | // on dresse la liste des etablissements |
| 522 | if ($qa) { // d'un territoire |
| 523 | $re=mq("SELECT p.id, concat(p.nom,' - ',p.ville) AS n FROM ets p WHERE p.tid='$qa' ORDER BY p.nom;"); |
| 524 | } |
| 525 | elseif ($qb) { // d'une region |
| 526 | $re=mq("SELECT p.id, concat(p.nom,' - ',t.territoire,' - ',p.ville) AS n FROM ets p INNER JOIN territoires t ON t.id=p.tid WHERE t.region='$qb' ORDER BY p.tid,p.nom;"); |
| 527 | } |
| 528 | else { // tous les établissements |
| 529 | $re=mq("SELECT p.id, concat(p.nom,' - ',t.territoire,' - ',p.ville) AS n FROM ets p INNER JOIN territoires t ON t.id=p.tid ORDER BY p.tid,p.nom;"); |
| 530 | } |
| 531 | $hh=8; |
| 532 | if (mysql_num_rows($re)<8) $hh=mysql_num_rows($re); |
| 533 | while ($c=mysql_fetch_array($re)) { |
| 534 | $atcb["p".$c[id]]=$c[n]; |
| 535 | } |
| 536 | |
| 537 | ?> |
| 538 | Choisir l'établissement : <br /> |
| 539 | <select name="tcb" > |
| 540 | <?php array_sel($tcb,$atcb); ?> |
| 541 | </select><br /> |
| 542 | |
| 543 | <?php } // Choix d'un etablissement |
| 544 | if ($tc=="c") { // Type d'établissement |
| 545 | |
| 546 | ?> |
| 547 | Choisir le type d'établissement : <br /> |
| 548 | <select name="tcc" > |
| 549 | <?php select_typeets($tcc); ?> |
| 550 | </select><br /> |
| 551 | |
| 552 | <?php } // Choix d'un type d'etablissement |
| 553 | ?> |
| 554 | |
| 555 | |
| 556 | |
| 557 | <?php } // Enfant |
| 558 | ?> |
| 559 | |
| 560 | <!-- ########################################### --> |
| 561 | |
| 562 | <?php if ($pa=="e") { // ETABLISSEMENTS |
| 563 | |
| 564 | // RESTRICTIONS PAR ETABLISSEMENT |
| 565 | $ate=array( |
| 566 | "z"=>"Tous les types d'établissement", |
| 567 | "a"=>"Uniquement les établissements du type ci-dessous", |
| 568 | ); |
| 569 | if (!$te) $te="z"; |
| 570 | ?> |
| 571 | Restriction : <br /> |
| 572 | <select name="te" onchange="document.forms.st.submit()"> |
| 573 | <?php array_sel($te,$ate); ?> |
| 574 | </select><br /> |
| 575 | |
| 576 | <?php |
| 577 | if ($te=="a") { |
| 578 | |
| 579 | ?> |
| 580 | Choisir le type d'établissement : <br /> |
| 581 | <select name="tea" > |
| 582 | <?php select_typeets($tea); ?> |
| 583 | </select><br /> |
| 584 | |
| 585 | <?php } // Choix d'un type d'etablissement |
| 586 | |
| 587 | |
| 588 | } // ETABLISSEMENTS |
| 589 | |
| 590 | ?> |
| 591 | |
| 592 | <!-- ########################################### --> |
| 593 | |
| 594 | <?php if ($pa=="f") { // UNIVERSITE |
| 595 | |
| 596 | // RESTRICTIONS PAR UNIVERSITE |
| 597 | $atf=array( |
| 598 | "z"=>"Tous les types d'université", |
| 599 | "a"=>"Uniquement les universités du type ci-dessous", |
| 600 | ); |
| 601 | if (!$tf) $tf="z"; |
| 602 | ?> |
| 603 | Restriction : <br /> |
| 604 | <select name="tf" onchange="document.forms.st.submit()"> |
| 605 | <?php array_sel($tf,$atf); ?> |
| 606 | </select><br /> |
| 607 | |
| 608 | <?php |
| 609 | if ($tf=="a") { |
| 610 | |
| 611 | ?> |
| 612 | Choisir le type d'universite : <br /> |
| 613 | <select name="tfa" > |
| 614 | <?php select_typeuniv($tfa); ?> |
| 615 | </select><br /> |
| 616 | |
| 617 | <?php } // Choix d'un type d'universite |
| 618 | |
| 619 | |
| 620 | } // UNIVERSITES |
| 621 | |
| 622 | ?> |
| 623 | |
| 624 | |
| 625 | <!-- ########################################### --> |
| 626 | <?php |
| 627 | |
| 628 | // Critères spécifiques aux étudiants |
| 629 | if ($pa=='b') { |
| 630 | ?> |
| 631 | Critères spécifiques aux étudiants : <br /> |
| 632 | |
| 633 | Filière de l'étudiant <select name="nr"> |
| 634 | <option value="0">Peu importe</option> |
| 635 | <?php select_filiere($nr); ?> |
| 636 | </select> <br /> |
| 637 | |
| 638 | Tranche d'age ? <select name="nl" onchange="document.forms.st.submit()"> |
| 639 | <option value="0">Peu importe</option> |
| 640 | <option value="1"<?php if ($nl==1) echo " selected=\"selected\""; ?>>Antre les âges ci-dessous</option> |
| 641 | </select> <br /> |
| 642 | <?php |
| 643 | if ($nl==1) { |
| 644 | ?> |
| 645 | Entre <select name="nla"> |
| 646 | <?php |
| 647 | for($i=10;$i<=30;$i++) { |
| 648 | echo "<option"; |
| 649 | if ($nla==$i) echo " selected=\"selected\""; |
| 650 | echo ">$i</option>"; |
| 651 | } |
| 652 | ?> |
| 653 | </select> ans (inclus) et <select name="nlb"> |
| 654 | <?php |
| 655 | for($i=10;$i<=40;$i++) { |
| 656 | echo "<option"; |
| 657 | if ($nlb==$i) echo " selected=\"selected\""; |
| 658 | echo ">$i</option>"; |
| 659 | } |
| 660 | ?> |
| 661 | </select> ans (exclus) <br /> |
| 662 | <?php |
| 663 | } |
| 664 | ?> |
| 665 | |
| 666 | Etudiant Adhérent ? <select name="na"> |
| 667 | <option value="0">Peu importe</option> |
| 668 | <option value="1"<?php if ($na==1) echo " selected=\"selected\""; ?>>Oui</option> |
| 669 | <option value="2"<?php if ($na==2) echo " selected=\"selected\""; ?>>Non</option> |
| 670 | </select> <br /> |
| 671 | Etudiant Référent ? <select name="nb"> |
| 672 | <option value="0">Peu importe</option> |
| 673 | <option value="1"<?php if ($nb==1) echo " selected=\"selected\""; ?>>Oui</option> |
| 674 | <option value="2"<?php if ($nb==2) echo " selected=\"selected\""; ?>>Non</option> |
| 675 | </select> <br /> |
| 676 | De niveau d'étude <select name="nd" onchange="document.forms.st.submit()"> |
| 677 | <option value="0">Peu importe</option> |
| 678 | <option value="1"<?php if ($nd==1) echo " selected=\"selected\""; ?>> Choisir les années post-bac ... </option> |
| 679 | </select> |
| 680 | <?php |
| 681 | |
| 682 | if (!is_array($ne)) $ne=array(); |
| 683 | if ($nd==1) { ?> |
| 684 | <br /> |
| 685 | |
| 686 | <table><tr><td> |
| 687 | <select name="ne[]" size="9" multiple=\"multiple\"> |
| 688 | <?php |
| 689 | $nea=array(); |
| 690 | for($a=0;$a<=8;$a++) $nea[$a]="Bac +$a"; |
| 691 | array_multiple($ne,$nea); |
| 692 | ?> |
| 693 | </select> |
| 694 | </td> |
| 695 | </td><td style="padding-left: 40px"> |
| 696 | Vous pouvez effectuer une sélection multiple dans cette liste<br /> |
| 697 | Sur PC utilisez la touche <Control> et cliquez sur les élements<br /> |
| 698 | pour les sélectionner / désélectionner. <br /> |
| 699 | Sur Mac, utilisez la touche <Pomme> |
| 700 | </td></tr></table> |
| 701 | |
| 702 | <?php } ?> |
| 703 | <br /> |
| 704 | Statut de l'étudiant : <select name="nf"> |
| 705 | <option value="0">Peu importe</option> |
| 706 | <?php |
| 707 | for ($a=1;$a<=count($a_sta_etu);$a++) { |
| 708 | echo "<option value=\"$a\""; |
| 709 | if ($nf==$a) echo " selected=\"selected\""; |
| 710 | echo ">".$a_sta_etu[$a]."</option>"; |
| 711 | } |
| 712 | ?> |
| 713 | </select> <br /> |
| 714 | |
| 715 | L'étudiant a un véhicule : <select name="ng"> |
| 716 | <option value="0">Peu importe</option> |
| 717 | <option value="1"<?php if ($ng==1) echo " selected=\"selected\""; ?>>Oui</option> |
| 718 | <option value="2"<?php if ($ng==2) echo " selected=\"selected\""; ?>>Non</option> |
| 719 | </select> <br /> |
| 720 | |
| 721 | Sexe de l'étudiant : <select name="nh"> |
| 722 | <option value="0">Peu importe</option> |
| 723 | <option value="1"<?php if ($nh==1) echo " selected=\"selected\""; ?>>Garçon</option> |
| 724 | <option value="2"<?php if ($nh==2) echo " selected=\"selected\""; ?>>Fille</option> |
| 725 | </select> <br /> |
| 726 | |
| 727 | Mode d'arrivée de l'étudiant : <select name="ni"> |
| 728 | <option value="0">Peu importe</option> |
| 729 | <?php |
| 730 | select_modearr($ni); |
| 731 | ?> |
| 732 | </select> <br /> |
| 733 | |
| 734 | L'Etudiant lit son mail régulièrement : <select name="nj"> |
| 735 | <option value="0">Peu importe</option> |
| 736 | <option value="1"<?php if ($nj==1) echo " selected=\"selected\""; ?>>Oui</option> |
| 737 | <option value="2"<?php if ($nj==2) echo " selected=\"selected\""; ?>>Non</option> |
| 738 | </select> <br /> |
| 739 | |
| 740 | |
| 741 | |
| 742 | <?php } ?> |
| 743 | |
| 744 | <?php |
| 745 | // spécifique étudiant / salariés |
| 746 | if ($pa=='a' || $pa=='b' || $pa=='c' || $pa=='d') { |
| 747 | |
| 748 | if ($pa=='a') echo "Salariés"; |
| 749 | if ($pa=='b') echo "Etudiants"; |
| 750 | if ($pa=='c') echo "Salariés ou Etudiants"; |
| 751 | if ($pa=='d') echo "Enfants"; |
| 752 | ?> |
| 753 | dont le NOM contient <input type="text" name="nc" value="<?php echo fl($nc); ?>" /> <br /> |
| 754 | <?php if ($pa!='d') { ?> |
| 755 | dont l'ADRESSE 2 contient <input type="text" name="ncb" value="<?php echo fl($ncb); ?>" /> <br /> |
| 756 | <?php } ?> |
| 757 | <?php } ?> |
| 758 | |
| 759 | <!-- ########################################### --> |
| 760 | |
| 761 | <?php |
| 762 | |
| 763 | // FORMAT DE SORTIE : |
| 764 | |
| 765 | $ar=array( |
| 766 | "z"=>"-- Choisir --", |
| 767 | "a"=>"Liste Web", |
| 768 | "b"=>"Format Excel (csv)", |
| 769 | "c"=>"Etiquettes d'adresses en pdf (Avery dp245 8/3)", |
| 770 | "d"=>"Envoyer un email aux personnes de cette liste", |
| 771 | "e"=>"CALCUL sorti en liste web", |
| 772 | ); |
| 773 | ?> |
| 774 | <hr /> |
| 775 | Format de sortie : <br /> |
| 776 | <select name="r" onchange="document.forms.st.submit()"> |
| 777 | <?php array_sel($r,$ar); ?> |
| 778 | </select><br /> |
| 779 | |
| 780 | <?php |
| 781 | |
| 782 | if ($r=="a" || $r=="b") { |
| 783 | // Proposer le choix des champs. |
| 784 | switch ($pa) { |
| 785 | case "a": // salariés |
| 786 | $ara=array("nom"=>"Nom","prenom"=>"Prénom", |
| 787 | "email"=>"Email","adresse"=>"Adresse postale", |
| 788 | "zip"=>"Code Postal","ville"=>"Ville", |
| 789 | "tel"=>"Numéro de téléphone","portable"=>"Téléphone Portable", |
| 790 | "birth"=>"Date de naissance","struct"=>"Structure associée", |
| 791 | "tid"=>"Territoire de rattachement","rid"=>"Région de rattachement", |
| 792 | "droit"=>"Droit d'accès (numéro)","login"=>"Nom d'utilisateur" |
| 793 | ); |
| 794 | break; |
| 795 | case "b": // etudiants |
| 796 | $ara=array("nom"=>"Nom","prenom"=>"Prénom", |
| 797 | "email"=>"Email","adresse"=>"Adresse postale", |
| 798 | "zip"=>"Code Postal","ville"=>"Ville", |
| 799 | "tel"=>"Numéro de téléphone","portable"=>"Téléphone Portable", |
| 800 | "birth"=>"Date de naissance", |
| 801 | "tid"=>"Territoire de rattachement","rid"=>"Région de rattachement", |
| 802 | "login"=>"Nom d'utilisateur","adherent"=>"Est-ce un adhérent", |
| 803 | "referent"=>"Est-ce un référent", |
| 804 | "voiture"=>"A-t-il une voiture", "readmail"=>"Lit-il son mail", |
| 805 | "datearr"=>"Date d'arrivée à l'afev", |
| 806 | "niveau"=>"Niveau d'étude","etusta"=>"Etat de l'étudiant (numéro)", |
| 807 | "modearr"=>"Mode d'arrivée","filiere"=>"Filière étudiante", |
| 808 | "solidaire"=>"A-t-il déjà participé en solidarité","soldetail"=>"Détail de sa participation solidaire", |
| 809 | "univ"=>"Université de rattachement (nom)","univtype"=>"Type de l'université de rattachement", |
| 810 | "univville"=>"Ville de l'université de rattachement","sexe"=>"Sexe", |
| 811 | "adresse2"=>"Adresse postale secondaire","zip2"=>"Code postal secondaire", |
| 812 | "ville2"=>"Ville secondaire", |
| 813 | ); |
| 814 | break; |
| 815 | case "c": // les deux |
| 816 | $ara=array("nom"=>"Nom","prenom"=>"Prénom", |
| 817 | "email"=>"Email","adresse"=>"Adresse postale", |
| 818 | "zip"=>"Code Postal","ville"=>"Ville", |
| 819 | "tel"=>"Numéro de téléphone","portable"=>"Téléphone Portable", |
| 820 | "birth"=>"Date de naissance", |
| 821 | "tid"=>"Territoire de rattachement","rid"=>"Région de rattachement", |
| 822 | "droit"=>"Droit d'accès (numéro)","login"=>"Nom d'utilisateur", |
| 823 | "type"=>"Type : etudiant ou salarié", |
| 824 | ); |
| 825 | break; |
| 826 | case "d": // enfants |
| 827 | $ara=array("nom"=>"Nom","prenom"=>"Prénom", "adresse"=>"Adresse postale", |
| 828 | "zip"=>"Code Postal","ville"=>"Ville", |
| 829 | "tel"=>"Numéro de téléphone","birth"=>"Date de naissance", |
| 830 | "tid"=>"Territoire de rattachement","rid"=>"Région de rattachement", |
| 831 | "eid"=>"Etablissement de rattachement (nom)","eidtype"=>"Type d'établissement de rattachement", |
| 832 | "projet" => "Projet de rattachmenet", "sexe"=>"Sexe", "classe"=>"Classe" |
| 833 | ); |
| 834 | break; |
| 835 | case "e": // etablissements |
| 836 | $ara=array("nom"=>"Nom","adresse"=>"Adresse postale", |
| 837 | "zip"=>"Code Postal","ville"=>"Ville", |
| 838 | "tel"=>"Numéro de téléphone","email"=>"Email", |
| 839 | "etype"=>"Type d'établissement", |
| 840 | "tid"=>"Territoire de rattachement","rid"=>"Région de rattachement", |
| 841 | ); |
| 842 | break; |
| 843 | case "f": // universités |
| 844 | $ara=array("nom"=>"Nom","adresse"=>"Adresse postale", |
| 845 | "zip"=>"Code Postal","ville"=>"Ville", |
| 846 | "tel"=>"Numéro de téléphone","email"=>"Email", |
| 847 | "etype"=>"Type d'universite", |
| 848 | "tid"=>"Territoire de rattachement","rid"=>"Région de rattachement", |
| 849 | ); |
| 850 | |
| 851 | break; |
| 852 | } |
| 853 | if (is_array($ara)) { |
| 854 | if (!is_array($ra)) { |
| 855 | // Par défaut, on sélectionne tous les champs : |
| 856 | //$ra=array_keys($ara); |
| 857 | // ou aucun champ ... |
| 858 | $ra=array(); |
| 859 | } |
| 860 | ?> |
| 861 | |
| 862 | <table><tr><td> |
| 863 | Choisissez les champs à afficher sur la page résultat : <br /> |
| 864 | <select name="ra[]" size="14" multiple="multiple" > |
| 865 | <?php array_multiple($ra,$ara); ?> |
| 866 | </select> |
| 867 | </td><td style="padding-left: 40px"> |
| 868 | Vous pouvez effectuer une sélection multiple dans cette liste<br /> |
| 869 | Sur PC utilisez la touche <Control> et cliquez sur les élements<br /> |
| 870 | pour les sélectionner / désélectionner. <br /> |
| 871 | Sur Mac, utilisez la touche <Pomme> |
| 872 | </td></tr></table> |
| 873 | <br /> |
| 874 |
