voici mon code source:
Code php : 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
<?php 
 
 require_once "include/connexion.php";
  require_once "include/calcul_hs.php";
$po=$_POST['matricule'];
  $po1=$_POST['datedeb1'];
  $po2=$_POST['datedeb2'];
  var_dump($po1);
  var_dump($po2);
 
 if (empty($po)) {
$sql= "SELECT * FROM heuresup h,personne p 
WHERE h.matricule=p.matricule 

AND h.datedebut BETWEEN '$po1' AND '$po2'";}
 
elseif (isset($po)) {
$sql= "SELECT * FROM heuresup h,personne p 
WHERE h.matricule=p.matricule 
AND h.matricule='$po';
AND h.datedebut BETWEEN '$po1' AND '$po2'";}
 
$res=mysql_query($sql);
//var_dump($res);
 
 ?>
 <a href="formulaireheure.php">===</a><br>
 <table border cellspacing="0" cellpadding="6">
    <thead>
      <th>Nom </th>
      <th>Date debut </th>
      <th>Date fin </th>
      <th>Heure debut</th>
      <th>Heure fin</th>
      <th>Jour à 50%</th>
        <th>Jour à 75%</th>
        <th>Jour à 150%</th>
    </thead>
    <tbody>
 <?php
  $Total50 = 0;
$Total75 = 0;
$Total150 = 0;
while($sa = mysql_fetch_array($res)) {
 
  ?>
      <tr>
        <td><?php  echo $sa['nom'];?></td>
 
<td><?php   echo date("d-m-20y",strtotime($sa['datedebut']));?></td>
<td><?php  echo date("d-m-20y",strtotime($sa['datefin']));?></td>
<td><?php  /*echo $sa['datedebut'];*/echo date('H:i',strtotime($sa['datedebut']));
        ?></td>
        <td><?php /* echo $sa['datefin'];*/echo date('H:i',strtotime($sa['datefin']));?></td>
<?php 
       $date1 =date_create($sa['datedebut']);
         $date2 = date_create($sa['datefin']);
         $HS=$calculer_HS($date1,$date2);
 
$Total50 += $HS['Type50'];
$Total75 += $HS['Type75'];
$Total150 += $HS['Type150'];
 
 
 ?> 
 <td>
   <?php
 
    $s4=$HS['Type50']*3600;
$hours = floor($s4/ 3600);
$minutes = floor(($s4 / 60) % 60);
$seconds = $s4 % 60;
if($hours>=1){
printf("%02dH%02d", $hours, $minutes);
}
 
   ?>
 </td>
            <td>
<?php 
$s5= $HS['Type75']*3600;
$hours = floor($s5/ 3600);
$minutes = floor(($s5 / 60) % 60);
$seconds = $s5% 60;
if($hours>=1){
printf("%02dH%02d", $hours, $minutes);
}
 
 
?>
        </td>
                 <td>
         <?php 
 
         $s6=$HS['Type150']*3600;
$hours = floor($s6/ 3600);
$minutes = floor(($s6 / 60) % 60);
$seconds = $s6% 60;
if($hours>=1){
printf("%02dH%02d", $hours, $minutes);
}
 
 
 
         ?>
        </td>
 
      </tr>
<?php } ?>
</tbody>
 </table>
<?php
$s10=$Total50*3600;
$hour = floor($s10/ 3600);
$minute = floor(($s10 / 60) % 60);
$second = $s10% 60;
printf("le nombre total de type de 50 est %02dH%02d", $hour, $minute);    echo "</br>";
$s11=$Total75*3600;
$hour = floor($s11/ 3600);
$minute = floor(($s11 / 60) % 60);
$second = $s11% 60;
printf("le nombre total de type de 75 est %02dH%02d", $hour, $minute);    echo "</br>";
$s12=$Total150*3600;
$hour = floor($s12/ 3600);
$minute = floor(($s12 / 60) % 60);
$second = $s12% 60;
printf(" le nombre total de type de 150 est %02dH%02d", $hour, $minute);    echo "</br>";
//echo "le nombre des heure de type de 75% est      $Total75";echo "</br>";
//echo "le nombre des heure de type de 150% est       $Total150";
?>
 
 
        <td><?php 
 
 
        ?></td>
 
</tr><?php ?>
</tbody>
 </table><?php 
      ?>
je veux exécuter chaque requete,mais le probleme que je rentre est comme suit:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\savon\select_heure.php on line 44
.Donc comment je peut executer chaque requete