IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

Passer les paramètres à la 2me page


Sujet :

PHP & Base de données

  1. #1
    Membre régulier
    Inscrit en
    Septembre 2008
    Messages
    204
    Détails du profil
    Informations forums :
    Inscription : Septembre 2008
    Messages : 204
    Points : 77
    Points
    77
    Par défaut Passer les paramètres à la 2me page
    bonjour, veuillez m'aider SVP
    j'ai fai une page des statistique des nombre d'eleves selon plusieurs critère j'ai le nombre de l'enseignement CEM, nbre d'enseignement LYCEE et le nombre d'eleves qui sont en formation en comptabilité.
    j'ai fait une vu de deux table, puis la selection de cette vue.mais bien que l'affichage prend bcp de temps jai fait une page pour l'enseignement CEM, une page pour l'enseignement LYCEE et la 3eme pour la formation en comptabilité.
    avant d'acceder ala page de l'enseignement CEM, je doit passer par la page la ou je selectionne le centre de formation et l'annee scolaire (2champs sou forme de deux liste deroulante)je clique sur OK ça me donne les stat du MOYEN mais quand je clique sur le bouton "suivant" que j'ai creé pour aller a la page secondaire il s'afich le message 'no database selected'.
    la base de données il la recupere a partir d'une fonction.
    alors comment faire passer le parametre de la fonction?
    Vola le code de la page qui contien les listes deroulante:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>إحصاء التسجيلات</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
    <!--
    body {
    	background-color: #004080;
    }
    .Style8 {color: #333399;
    	font-size: 18pt;
    }
    .Style9 {
    	color: #000066;
    	font-weight: bold;
    }
    -->
    </style></head>
     
    <body>
    <?
    if ($_GET) 
    {
    $ncrefd=$_GET['ncrefd']; 
    $crefd=$_GET['crefd']; 
    $cr=$_GET['cr']; 
    }
     
    elseif ($_POST) 
    {
    $ncrefd=$_POST['ncrefd']; 
    $crefd=$_POST['crefd']; 
    $cr=$_POST['cr']; 
    }
    if (isset($ncrefd)==FALSE)
                  {
                  ?>
                  <script language="javascript">
                   <!--
                     //document.bgColor = "red";
    	          document.location = "authentification/index.php";
                     -->
                  </script>
     
                <?
                exit();
                 }
    			 ?>
    <?php  include ("tamadros.php"); ?>
    <table width="588" align="center" bgcolor="#FFFFFF">
      <tr>
        <td width="539" height="27" bgcolor="#B0C1D3"><div align="center" class="Style9">إحصاء التسجيلات حسب الولايات </div></td>
      </tr>
      <tr>
        <td height="225"><form action="stat_inscri_wilaya_cem.php" method="post" name="form1" target="_blank">
          <table width="276" align="center">
            <tr>
              <td width="88">&nbsp;</td>
              <td width="176">&nbsp;</td>
            </tr>
            <tr>
              <td height="60"><div align="right">
                <select name="iannee" id="iannee" style="{color: #333399;
    	font-size: 14pt;
    } ">
                  <option>كل السنوات</option>
    			  <option>2015/2014</option>
                  <option>2014/2013</option>            
                  <option>2013/2014</option>
                  <option>2012/2011</option>
    			  <option>2011/2010</option>
    			  <option>2010/2009</option>
    			  <option>2009/2008</option>
                  <option>2008/2007</option>
                  <option>2007/2006</option>
                  <option>2006/2005</option>
                  <option>2005/2004</option>
                  <option>2004/2003</option>
                  <option>2003/2002</option>
                  <option>2002/2001</option>
                  <option>2001/2000</option>
                  <option>2000/1999</option>
                  <option>1999/1998</option>
                </select>
              </div></td>
              <td class="Style8"><strong>السنة الدراسية </strong></td>
            </tr>
            <tr>
              <td height="21"><select name="ncrefd" id="ncrefd">
     
    		    <option>أدرار  </option>
                <option>الشلف</option>
                <option>الأغواط</option>
                <option>بجاية</option>
    			 <option>بسكرة</option>
                <option>بشار</option>
                <option>تبسة</option>
                <option>تلمسان</option>
    			 <option>تيارت  </option>
                <option>تيزي وزو</option>
                <option>الجزائر</option>
                <option>الجلفة</option>
    			 <option>سطيف  </option>
                <option>سعيدة</option>
                <option>سكيكدة</option>
                <option>عنابة</option>
    			 <option>قسنطينة  </option>
                <option>المدية</option>
                <option>مستغانم</option>
                <option>ورقلة</option>
    			<option>وهران</option>
     
     
     
     
     
              </select></td>
     
            <td height="21" class="Style8"><strong> المركز الجهوي</strong></td>
            </tr>
            <tr>
              <td colspan="2"><div align="right">
              </div>            
                <div align="center">
                  <input type="submit" name="Submit" value="استعراض">&nbsp;&nbsp;
                   <input type="reset" name="Submit2" value="مسح">
                </div></td>
              </tr>
          </table>
          <p>&nbsp;        </p>
          <p>
              <input name="ncrefd2" type="hidden" id="ncrefd2">      
              <input name="crefd" type="hidden" id="crefd" value="<?php echo $_GET['crefd'];   ?>">
              <input name="cr" type="hidden" id="cr" value="<?php echo $_GET['cr'];   ?>">
              <?php //echo $_GET['ncrefd'];   ?>
              <?php //echo $_GET['crefd'];   ?>
              <?php //echo $_GET['cr'];   ?>    
          </p>
        </form>      </td>
      </tr>
    </table>
    </body>
    </html>
    Et voila le code de la page CEM(stat_inscri_wilaya_CEM.php).


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Document sans nom</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
    <!--
    .Style1 {
    	font-size: 24px;
    	font-weight: bold;
    }
    .Style2 {
    	font-size: 18px;
    	font-weight: bold;
    	font-style: normal;
    	line-height: normal;
    	color: #000066;
    }
    body {
    	background-color: #004080;
    }
    .Style10 {font-weight: bold}
    -->
    </style>
    </head>
     
    <body>
     
    <?  set_time_limit(0);
    include"fonction.php";
    //include"fonction_wil.php";
     include ("tamadros.php");
    $code_crefd="00";
    $wil_crefd1='';
    $wil_crefd2='';
    $wil_crefd3='';
    $wil_crefd4='';
    $nb_wil_crefd=0;
    if ($_POST) 
    {
    $ncrefd=$_POST["ncrefd"]; 
    $crefd=$_POST['crefd']; 
    $cr=$_POST['cr']; 
    $iannee=$_POST['iannee'];
    nom_directeur($ncrefd);
     
     
    }
     
    ?>
    <div align="right">
      <table width="953" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="176" valign="top" bgcolor="#FFFFFF"><div align="center" class="Style2">
            <p align="center">&nbsp;</p>
            <p align="center"><strong>(خاص بمراكز إعادة التربية) </strong><strong></strong></p>
          </div></td>
          <td width="771" bgcolor="#FFFFFF"><div align="center" class="Style1">الديوان الوطني للتعليم والتكوين عن بعد </div>
            <p align="center" class="Style1"><? if($ncrefd<>'كل المراكز') {echo "المركز الجهوي لـ ".$ncrefd;} else {echo 'كل المراكز';}?>  <?php // echo $ncrefd; ?></p>
            <p align="center" class="Style1">تسجيلات الطلبة معيدون- مقبولون - جدد </p>        
            <p align="center"> <span class="Style1">التسجيلات الإجمالية للطلبة في التعليم العام والتكوينات المهنية <?php echo $iannee;  ?></span></p>
          </td>
        </tr>
      </table>
       <?php
     
     
    if (isset($ncrefd)==FALSE)
                  {
                  ?>
                  <p>
                  <script language="javascript">
                   <!--
                     //document.bgColor = "red";
    	          document.location = "authentification/index.php";
                     -->
                  </script>
     
                <?
                exit();
                 }
     
    $iannee=$_POST["iannee"];
    $con1=mysql_connect("localhost","root","");
    if ($con1==FALSE)
    die("erreur de connexion au srv");
     
     
    			////////////////////////////////////////////////////////////////////////////////////////////////////
     
    ?>
              </p>
                  <p>&nbsp;    </p>
                <table width="425" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
                  <tr>
                    <td height="21"><div align="center"></div></td>
                    <td colspan="3"><div align="center"><strong>التعليم المتوسط </strong></div></td>
                    <td width="108" rowspan="2"><p><strong>نوع التعليم</strong></p>
                        <p align="right"><strong>الولايات </strong></p></td>
                  </tr>
                  <tr>
                    <td width="122" height="21"><div align="center"><strong>المجموع </strong></div></td>
                    <td width="61"><div align="center"><strong>جدد</strong></div></td>
                    <td width="61"><div align="center"><strong>مقبولون</strong></div></td>
                    <td width="61"><div align="center"><strong>معيدون</strong></div></td>
                  </tr>
                  <tr>
                    <td class="Style10"><div align="center"><? echo (val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'معيد')+ val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'مقبول')+ val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'جديد'));
     
     ?></div></td>
                    <td class="Style10"><div align="center" class="Style10">
                      <? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'جديد'); ?> </div></td>
                    <td class="Style10"><div align="center" class="Style10">
                      <? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'مقبول'); ?> </div></td>
                    <td class="Style10"><div align="center" class="Style10"><? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'معيد');
     
     ?></div></td>
                    <td><div align="center"><strong><? echo $wil_crefd1; ?></strong></div></td>
                  </tr>
                  <tr>
                    <td class="Style10"><div align="center"><? echo (val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'معيد')+ val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'مقبول')+ val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'جديد'));
     
     ?></div></td>
                    <td class="Style10"><div align="center" class="Style10"><? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'جديد'); ?> </div></td>
                    <td class="Style10"><div align="center" class="Style10"> <? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'مقبول'); ?> </div></td>
                    <td class="Style10"><div align="center" class="Style10"><? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'معيد');
     
     ?></div></td>
                    <td><div align="center"><strong><? echo $wil_crefd2 ;?></strong></div></td>
                  </tr>
    <?php if  ($nb_wil_crefd>2)
    {?>
     
    			  <tr>
    			    <td class="Style10"><div align="center"><? echo (val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'معيد')+ val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'مقبول')+ val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'جديد'));
     
     ?></div></td>
    			    <td class="Style10"><div align="center" class="Style10"><? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'جديد'); ?> </div></td>
    			    <td class="Style10"><div align="center" class="Style10"> <? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'مقبول'); ?> </div></td>
    			    <td class="Style10"><div align="center" class="Style10"><? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'معيد');
     
     ?></div></td>
    			    <td><div align="center"><strong><? echo $wil_crefd3 ;?> </strong></div></td>
                  </tr>
      <?php } ?>
     
     
    			<?php if  ($nb_wil_crefd==4)
    {?>  		  
                  <tr>
                    <td class="Style10"><div align="center"><? echo (val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'معيد')+ val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'مقبول')+ val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'جديد'));
     
     ?></div></td>
                    <td class="Style10"><div align="center" class="Style10"><? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'جديد'); ?> </div></td>
                    <td class="Style10"><div align="center" class="Style10"> <? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'مقبول'); ?> </div></td>
                    <td class="Style10"><div align="center" class="Style10"><? echo val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'معيد');
     
     ?></div></td>
                    <td><div align="center"><strong><? echo $wil_crefd4 ;?> </strong></div></td>
     
                  </tr>
    			  <?php }?>
                  <tr>
                    <td class="Style10"><div align="center"><? echo (val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'معيد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'معيد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'معيد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'معيد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'مقبول')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'مقبول')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'مقبول')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'مقبول')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'جديد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'جديد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'جديد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'جديد')); ?></div></td>
                    <td class="Style10"><div align="center"><? echo (val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'جديد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'جديد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'جديد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'جديد')); ?></div></td>
                    <td class="Style10"><div align="center"><? echo (val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'مقبول')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'مقبول')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'مقبول')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'مقبول')); ?></div></td>
                    <td class="Style10"><div align="center"><? echo (val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,'معيد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd2,'معيد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd3,'معيد')+val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd4,'معيد')); ?>
    				</div></td>
                    <td><div align="center"><strong>المجموع</strong></div></td>
                  </tr>
                </table>
                <p align="center" class="Style1">&nbsp;</p>
                <table width="776" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="321" bgcolor="#FFFFFF"><div align="right"><strong><? if($ncrefd<>'كل المراكز') {echo " مدير المركز الجهوي".":".nom_directeur($ncrefd);} else {echo '';}?> </strong></div></td>
          <td width="455" bgcolor="#FFFFFF"><div align="right"><strong>الجزائريوم:  
            <?php
    $date = date("d-m-Y");
    Print(" $date ");
    ?>
          </strong></div></td>
        </tr>
      </table>
                          <form action="stat_inscri_wilaya_cat_lyc.php" method="post" name="form1" target="_blank">
     
                            <div align="center" class="Style2">
                              <input name="valid_code" type="hidden" id="valid_code" value=" <? echo valid_code($code) ;?>">
                              <input name="code_crefd" type="hidden" id="code_crefd" value=" <?php echo $code_crefd; ?>" 
                    >
                      <input name="ncrefd" type="hidden" id="ncrefd" value=" <?php echo $ncrefd; ?>" 
                    >
                      <input name="crefd" type="hidden" id="crefd" value="<? echo $crefd; ?>">
                      <input name="cr" type="hidden" id="cr" value="<? echo $cr; ?>">
                      <input name="iannee" type="hidden" id="iannee" value=" <? echo $iannee;?>">
                      <input name=" nom_directeur($ncrefd)" type="hidden" id=" nom_directeur($ncrefd)" value="<? echo nom_directeur($ncrefd)?>;">
                      <input name="Submit" type="submit" class="Style2" value="الانتقال إلى إحصاءات التعليم الثانوي">
                            </div>
      </form>
      <p align="center">&nbsp;</p>
    </div>
     
    </body>
    </html>
    "nom_directeur($ncrefd)" c'est la fonction qui recupere le numero de la base de donnee
    "val_wil_cem" c'est la fonction qui calcul le nombre.
    le fichier "fonction.php" il contien tous les fonction que je travail avec ds le prgrm.
    voila le code du fichier "fonction.php"
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    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
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
     
    <body>
    <?php 
     
    function nom_directeur($ncrefd) 
    {
        global $code_crefd,$wil_crefd1,$wil_crefd2,$wil_crefd3,$wil_crefd4,$nb_wil_crefd;
        $chef="";
        switch ($ncrefd) 
                  {
                     case "أدرار" :
     
    					$chef=" أحمد بن سليمان";
    					$code_crefd="01";
                        $wil_crefd1='أدرار';
                        $wil_crefd2='تامنراست';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
     
     
                     break ;
     
                     case "الشلف" :
     
    					$chef=" بورعدة عبد القادر";
    					$code_crefd="02";
                        $wil_crefd1='الشلف';
                        $wil_crefd2='عين الدفلى';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
                     break ;
     
                     case "الأغواط" :
     
    					$chef=" لحرش عيسى";
    					$code_crefd="03";
                        $wil_crefd1='الأغواط';
                        $wil_crefd2='غرداية';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
                     case "بجاية" :
     
    					$chef=" وعلي عبد الحفيظ";
    					$code_crefd="06";
                        $wil_crefd1='بجاية';
                        $wil_crefd2='جيجل';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
                     case "بسكرة" :
     
    					$chef="عطار محمد شريف ";
    					$code_crefd="07";
                        $wil_crefd1='بسكرة';
                        $wil_crefd2='الواد';
                        $wil_crefd3='باتنة';
                        $wil_crefd4='';
                        $nb_wil_crefd=3;
     
                     break ;
     
                     case "بشار" :
                        $chef="بودي محمد ";
    					$code_crefd="07";
                        $wil_crefd1='بشار';
                        $wil_crefd2='تندوف';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
     
                     break ;
     
                     case "تبسة" :
    				 $chef=" براعي عبد الله";
    				 $code_crefd="12";
                        $wil_crefd1='تبسة';
                        $wil_crefd2='سوق اهراس';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
                     case "تلمسان" :
                       $chef=" هديلي سمير ";
    				    $code_crefd="13";
                        $wil_crefd1='تلمسان';
                        $wil_crefd2='عين تموشنت';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
    				  case "تيارت" :
     
    					$chef=" بلحسين سليمان";
    					$code_crefd="14";
                        $wil_crefd1='تيارت';
                        $wil_crefd2='تيسمسيلت';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
                     case "تيزي وزو" :
     
    					$chef=" لارباس أرزقي";
    					$code_crefd="15";
                        $wil_crefd1='تيزي وزو';
                        $wil_crefd2='البويرة';
                        $wil_crefd3='بومرداس';
                        $wil_crefd4='';
                        $nb_wil_crefd=3;
     
                     break ;
     
                     case "الجزائر" :
     
    					$chef=" براهيمي صادق";
    					$code_crefd="16";
                        $wil_crefd1='الجزائر';
                        $wil_crefd2='تيبازة';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
                     case "الجلفة" :
     
    					$chef="طويسات بن سالم ";
    					$code_crefd="17";
                        $wil_crefd1='الجلفة';
                        $wil_crefd2='المسيلة';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
                     case "سطيف" :
     
    					$chef="درادرة حسين ";
    					$code_crefd="19";
                        $wil_crefd1='سطيف';
                        $wil_crefd2='برج بوعريريج';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
                     case "سعيدة" :
     
    					$chef=" ختو بوعلام ";
    					$code_crefd="20";
                        $wil_crefd1='سعيدة';
                        $wil_crefd2='البيض';
                        $wil_crefd3='النعامة';
                        $wil_crefd4='معسكر';
                        $nb_wil_crefd=4;
     
                     break ;
     
                     case "سكيكدة" :
     
    					$chef="طيار عبد الله ";
    					$code_crefd="21";
                        $wil_crefd1='سكيكدة';
                        $wil_crefd2='ميلة';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
                     break ;
     
                     case "عنابة" :
     
    					$chef=" براني لعيد";
    					$code_crefd="23";
                        $wil_crefd1='عنابة';
                        $wil_crefd2='قالمة';
                        $wil_crefd3='الطارف';
                        $wil_crefd4='';
                        $nb_wil_crefd=3;
     
                     break ;
    				   case "قسنطينة" :
     
    					$chef=" حرابي كمال";
    					$code_crefd="25";
                        $wil_crefd1='قسنطينة';
                        $wil_crefd2='أم البواقي';
                        $wil_crefd3='خنشلة';
                        $wil_crefd4='';
                        $nb_wil_crefd=3;
     
                     break ;
     
                     case "المدية" :
     
    					$chef=" بن جدة رابح";
    					$code_crefd="26";
    					$wil_crefd1='المدية';
                        $wil_crefd2='البليدة';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
                     case "مستغانم" :
     
    					$chef="بلعبدي معمر ";
    					$code_crefd="27";
    					$wil_crefd1='مستغانم';
                        $wil_crefd2='غليزان';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
                     case "ورقلة" :
     
    					$chef=" زيدوري محمد";
    					$code_crefd="30";
    					$wil_crefd1='ورقلة';
                        $wil_crefd2='إليزي';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
     
                     break ;
     
                     case "وهران" :
     
    					$chef="باقي جمال الدين ";
    					$code_crefd="31";
    					$wil_crefd1='وهران';
                        $wil_crefd2='سيدي بلعباس';
                        $wil_crefd3='';
                        $wil_crefd4='';
                        $nb_wil_crefd=2;
     
                     break ;
     
    }
     
    return($chef);
    }
     
     
    function valid_code($code) 
    {
    $valide=0;
      switch ($code) 
      {
          case "01" :
    	  $valide=1;	
           break;
           case "02" :
    	  $valide=1;	
           break;
    	    case "03" :
    	  $valide=1;	
           break;
    	    case "06" :
    	  $valide=1;	
           break;
    	    case "07" :
    	  $valide=1;	
           break;
    	   case "08" :
    	  $valide=1;	
           break;
           case "12" :
    	  $valide=1;	
           break;
    	    case "13" :
    	  $valide=1;	
           break;
    	    case "14" :
    	  $valide=1;	
           break;
    	    case "15" :
    	  $valide=1;	
           break;
    	   case "16" :
    	  $valide=1;	
           break;
           case "17" :
    	  $valide=1;	
           break;
    	    case "19" :
    	  $valide=1;	
           break;
    	    case "20" :
    	  $valide=1;	
           break;
    	    case "21" :
    	  $valide=1;	
           break;
    	   case "23" :
    	  $valide=1;	
           break;
           case "25" :
    	  $valide=1;	
           break;
    	    case "26" :
    	  $valide=1;	
           break;
    	    case "27" :
    	  $valide=1;	
           break;
    	    case "30" :
    	  $valide=1;	
           break;
    	    case "31" :
    	  $valide=1;	
           break;
     
         }				
    return($valide);
    }
     
    //*****
    ///////////////////////////**************/*******stat_inscri_wilaya CEM 
     
     
    function stat_cen_ann_wil_cem($code_crefd,$iannee,$wil_crefd1,$statut)   // calcul nombre d'eleves pour 1 centre , 1 annee 
    {
     $db1=mysql_select_db("scolarite".$code_crefd);
     $sql="select * from age_wil_eleve  where  IANNEE='$iannee' AND (ICODE='104' OR ICODE='204' OR ICODE='304' OR ICODE='404')  AND WILAYA ='$wil_crefd1' AND STATUT='$statut'  " ;  
     
     
     $res_wil=mysql_query($sql);
     if ($res_wil==FALSE)
    echo mysql_error();
    return(mysql_num_rows($res_wil));		
     
    }	
     
     
    function stat_cen_wil_cem($code_crefd,$wil_crefd1,$STATUT)   // calcul nombre d'eleves pour 1 centre , 1 code , tous les annee **AND inscription.IANNEEINS=eleve.ANNEEINS  AND inscription.INSEQ=eleve.NSEQ
    {
    $db1=mysql_select_db("scolarite".$code_crefd);
    $sql="select * from age_wil_eleve where  (ICODE='104' OR ICODE='204' OR ICODE='304' OR ICODE='404')  AND WILAYA ='$wil_crefd1' AND STATUT='$statut' "; 
    $res_wil=mysql_query($sql);
    if ($res_wil==FALSE)
    echo mysql_error();
    return(mysql_num_rows($res_wil));			  	   
     
    }	
     
    ///////////********
    function val_wil_cem($ncrefd,$iannee,$code_crefd,$wil_crefd1,$statut) 
     
    {    
    if ($iannee<>'كل السنوات')  
                        {
     
    					 $result_wil_cem= stat_cen_ann_wil_cem($code_crefd,$iannee,$wil_crefd1,$statut);
    					}
     
    			       else // 	 			
    		          {
    			      $result_wil_cem= stat_cen_wil_cem($code_crefd,$wil_crefd1,$STATUT);
    				  }
    return($result_wil_cem);
     
    }
     
    ///////////////////////////**************/*******stat_inscri_wilaya CEM CATEGORIE
     
     
    function stat_cen_ann_wil_cem_cat($code_crefd,$iannee,$wil_crefd1,$statut)   // calcul nombre d'eleves pour 1 centre , 1 annee 
    {
     $db1=mysql_select_db("scolarite".$code_crefd);
     $sql="select * from age_wil_eleve  where  IANNEE='$iannee' AND (ICODE='104' OR ICODE='204' OR ICODE='304' OR ICODE='404')  AND (CATEGORIE= 'مؤسسة إعادة التربية' OR CATEGORIE= 'مؤسسة إعادة التأهيل') AND WILAYA ='$wil_crefd1' AND STATUT='$statut'  " ;  
     
     
     $res_wil=mysql_query($sql);
     if ($res_wil==FALSE)
    echo mysql_error();
    return(mysql_num_rows($res_wil));		
     
    }	
     
     
    function stat_cen_wil_cem_cat($code_crefd,$wil_crefd1,$STATUT)   // calcul nombre d'eleves pour 1 centre , 1 code , tous les annee **AND inscription.IANNEEINS=eleve.ANNEEINS  AND inscription.INSEQ=eleve.NSEQ
    {
    $db1=mysql_select_db("scolarite".$code_crefd);
    $sql="select * from age_wil_eleve where  (ICODE='104' OR ICODE='204' OR ICODE='304' OR ICODE='404')  AND WILAYA ='$wil_crefd1' AND STATUT='$statut'  AND (CATEGORIE= 'مؤسسة إعادة التربية' OR CATEGORIE= 'مؤسسة إعادة التأهيل')"; 
    $res_wil=mysql_query($sql);
    if ($res_wil==FALSE)
    echo mysql_error();
    return(mysql_num_rows($res_wil));			  	   
     
    }	
     
    ///////////********
    function val_wil_cem_cat($ncrefd,$iannee,$code_crefd,$wil_crefd1,$statut) 
     
    {    
    if ($iannee<>'كل السنوات')  
                        {
     
    					 $result_wil_cem= stat_cen_ann_wil_cem_cat($code_crefd,$iannee,$wil_crefd1,$statut);
    					}
     
    			       else // 	 			
    		          {
    			      $result_wil_cem= stat_cen_wil_cem_cat($code_crefd,$wil_crefd1,$STATUT);
    				  }
    return($result_wil_cem);
     
    }
     
    //****////***///***///******
    la fonctio "valid" elle valide le code du centre de formation qui existent.
    Merci

  2. #2
    Membre expert
    Avatar de ThomasR
    Homme Profil pro
    Directeur technique
    Inscrit en
    Décembre 2007
    Messages
    2 230
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Directeur technique
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Décembre 2007
    Messages : 2 230
    Points : 3 972
    Points
    3 972
    Par défaut
    Bonjour,

    Tu appelles ta fonction de requête DB avant même de t'être connecté. En PHP le code est interprêté linéairement.

    Dans la page stat_...wilaya_cem.php appelles les fonction mysql_connect(); et mysql_select_db(); avant la fonction nom_directeur();.

  3. #3
    Membre régulier
    Inscrit en
    Septembre 2008
    Messages
    204
    Détails du profil
    Informations forums :
    Inscription : Septembre 2008
    Messages : 204
    Points : 77
    Points
    77
    Par défaut
    mais le fichier stat_inscri_wilaya_CEM.php que j'accede a partir du formliste_iscri_wilaya.php (liste deroulante) il fonctionne, celui qui ne fonctionne pas c'est celui ci stat_inscri_wilaya_lyc.php que j'accede avec un bouton a partir du fichier stat_inscri_wilaya_CEM.

    et si je met directement le lien de formliste_iscri_wilaya.php et a ce fichier stat_inscri_wilaya_lyc.php , il fonctionne aussi,

    mais le passage du fichier stat...CEM au fichier stat...LYC ne fonctionne pas .
    ilya quelque chose qui manque dans les parametre qu'il faut passer.
    voila les paramettre que G fait passé
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    <input name="valid_code" type="hidden" id="valid_code" value=" <? echo valid_code($code) ;?>">
                              <input name="code_crefd" type="hidden" id="code_crefd" value=" <?php echo $code_crefd; ?>" 
                    >
                      <input name="ncrefd" type="hidden" id="ncrefd" value=" <?php echo $ncrefd; ?>" 
                    >
                      <input name="crefd" type="hidden" id="crefd" value="<? echo $crefd; ?>">
                      <input name="cr" type="hidden" id="cr" value="<? echo $cr; ?>">
                      <input name="iannee" type="hidden" id="iannee" value=" <? echo $iannee;?>">
                      <input name=" nom_directeur($ncrefd)" type="hidden" id=" nom_directeur($ncrefd)" value="<? echo nom_directeur($ncrefd)?>;">
                      <input name="Submit" type="submit" class="Style2" value="الانتقال إلى إحصاءات التعليم الثانوي">
    $code_crefd="00" ce code c'est avec qu'il selectionne la base de donnee

Discussions similaires

  1. Réponses: 11
    Dernier message: 04/10/2007, 08h02
  2. passer les paramètres d'un formulaire
    Par techtonyc dans le forum Général JavaScript
    Réponses: 17
    Dernier message: 24/04/2007, 13h58
  3. Réponses: 2
    Dernier message: 20/10/2006, 08h23
  4. Réponses: 1
    Dernier message: 29/05/2006, 10h04
  5. passer un & dans les paramètres de la page
    Par see++ dans le forum Balisage (X)HTML et validation W3C
    Réponses: 3
    Dernier message: 08/03/2006, 15h48

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo