fourniey Rendre au prochain | J'ai apporté les corrections et le tableau est vide maintenant!
Code :
- <body>
- <div align="center">
- <?php
- $statut = htmlspecialchars(stripslashes($_GET['statut']));
- $statut="Conseil d'administration";
- $statut=$_GET['statut'];
- $conn = Ora_Logon("php_fondation@prod", "fokilfas" ) or die(Ora_Error($conn));
- $cur = ora_open($conn) or die(Ora_Error($conn));
- ora_parse($cur,"SELECT distinct STATUT FROM FON_PHP_STATUT_VUE",$x) or die(Ora_Error($conn));
- ora_exec($cur) or die(Ora_Error($conn));
- echo '<FORM action="statut.php?" METHOD="GET">';
- echo '<p align="center">Liste disponible : <select name="statut">';
- while(ora_fetch_into($cur,$val)) {
- ?>
- //<option value="<?php echo htmlspecialchars(stripslashes($val[0])) ?>"<?php if (!(strcmp($val[0], $_GET['statut']))) {echo "selected=\"selected\"";} ?>><?php echo $val[0] ?></option>
- <option value="<?php echo $val[0] ?>"<?php if (!(strcmp($val[0], $_GET['statut']))) {echo "selected=\"selected\"";} ?>><?php echo $val[0] ?></option>
-
- <?php
- }
- echo '</select>';
- echo '<INPUT TYPE="submit" VALUE="Afficher la liste"></p>';
- echo '</FORM>';
- ?>
- <table width="800" cellpadding="10px" border="3">
- <caption><h2><?php echo $statut; ?></h2></caption>
- <tr><th colspan="5">Liste des personnes (en cours)</th></tr>
- <tr>
- <th width="30">Dossier</th>
- <th width="125">Nom</th>
- <th width="90">Prénom</th>
- <th width="40">Début</th>
- <th width="70">Poste occupé</th>
- </tr>
- <?php
- $conn = Ora_Logon("php_fondation@prod", "mdp" ) or die(Ora_Error($conn));
- $cur = ora_open($conn) or die(Ora_Error($conn));
- //ora_parse($cur,"SELECT * FROM FON_PHP_STATUT_VUE where STATUT='$statut' and FIN_AN_STATUT='1858-11-17' order by NOM_FAMILLE, PRENOM",$x) or die(Ora_Error($conn));
- $stmt = ora_parse($cur,"SELECT * FROM FON_PHP_STATUT_VUE where STATUT=:statut and FIN_AN_STATUT=:dstatut order by NOM_FAMILLE, PRENOM",$x)
- or die(Ora_Error($conn));
- oci_bind_by_name($stmt, ":statut", $statut, 32);
- oci_bind_by_name($stmt, ":dstatut", '1858-11-17', 32);
- ora_exec($cur) or die(Ora_Error($conn));
- $i_actif = 0;
- while(ora_fetch_into($cur,$detail)){
- $i_actif++;
- echo '<tr><td>';
- echo htmlspecialchars(trim($detail[0]));
- echo '<td align="left">'.htmlspecialchars(trim($detail[1])).'</td>';
- echo '<td align="Left">'.htmlspecialchars(trim($detail[2])).'</td>';
- if(htmlspecialchars(trim($detail[6]) == "58-11-17" )) {
- echo '<td align="Left"> </td>';
- }
- else {
- echo '<td align="Left">'.htmlspecialchars(substr($detail[6],6,2))."-".htmlspecialchars(substr($detail[6],3,2))."-".htmlspecialchars(substr($detail[6],0,2)).'</td>';
- }
- echo '<td align="left">'.htmlspecialchars(trim($detail[8])).'</td>';
- echo '</tr>';
- } //fin while
- echo '</td></tr>';
- echo '<tr><td colspan="6"><b>Nombre de personnes : </b>'.$i_actif;
- echo '</td></table>';
- echo '<br><br>';
- ?>
- <table width="800" cellpadding="10px" border="3">
- <tr>
- <th colspan="6">Liste des personnes (mandat terminé)</th>
- </tr>
- <tr>
- <th width="25">Dossier</th>
- <th width="150">Nom</th>
- <th width="90">Prénom</th>
- <th width="40">Début</th>
- <th width="40">Fin</th>
- <th width="70">Poste occupé</th>
- </tr>
- <?php
- $conn = Ora_Logon("php_fondation@prod", "mdp" ) or die(Ora_Error($conn));
- $cur = ora_open($conn) or die(Ora_Error($conn));
- ora_parse($cur,"SELECT * FROM FON_PHP_STATUT_VUE where STATUT='$statut' and FIN_AN_STATUT<>'1858-11-17' order by NOM_FAMILLE, PRENOM",$x) or die(Ora_Error($conn));
- ora_exec($cur) or die(Ora_Error($conn));
- $i_inactif = 0;
- while(ora_fetch_into($cur,$detail)){
- $i_inactif++;
- echo '<tr><td>';
- echo htmlspecialchars(trim($detail[0]));
- echo '<td align="left">'.htmlspecialchars(trim($detail[1])).'</td>';
- echo '<td align="Left">'.htmlspecialchars(trim($detail[2])).'</td>';
- if(htmlspecialchars(trim($detail[6]) == "58-11-17" )) {
- echo '<td align="Left"> </td>';
- }
- else {
- echo '<td align="Left">'.htmlspecialchars(substr($detail[6],6,2))."-".htmlspecialchars(substr($detail[6],3,2))."-".htmlspecialchars(substr($detail[6],0,2)).'</td>';
- }
- if(htmlspecialchars(trim($detail[7]) == "58-11-17" )) {
- echo '<td align="Left"> </td>';
- }
- else {
- echo '<td align="Left">'.htmlspecialchars(substr($detail[7],6,2))."-".htmlspecialchars(substr($detail[7],3,2))."-".htmlspecialchars(substr($detail[7],0,2)).'</td>';
- }
- echo '<td align="left">'.htmlspecialchars(trim($detail[8])).'</td>';
- echo '</tr>';
- } //fin while
- echo '</td></tr>';
- echo '<tr><td colspan="6"><b>Nombre de personnes : </b>'.$i_inactif;
- echo '</table>';
- ?>
-
- </div>
- </body>
- </html>
|
Message édité par fourniey le 29-05-2008 à 15:01:45
|