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
|
<?php
session_cache_limiter('private'); /* Configure le limiteur de cache à 'private' */
$cache_limiter = session_cache_limiter();
session_cache_expire (30); /* Configure le délai d'expiration à 30 minutes */
$cache_expire = session_cache_expire();
session_start(); /* Démarre la session */
require('../scripts/connexion.php');
$connexion = mysql_connect($hostname, $username, $password) or die("Connexion impossible au serveur $hostname par $username");
mysql_select_db($database, $connexion);
// On recherche le nombre d'evenements associé au site courant
$sql = "SELECT * FROM event WHERE id_site = '".$_SESSION['id_site']."' AND event_is_valid='1' ORDER BY id_tir DESC";
$req = mysql_query($sql) or die(mysql_error());
$event = mysql_fetch_array($req);
$current_tir = $event['id_tir'] ;
$nb_tirs_total = 1 ;
$inc = 1;
// On recherche le nombre de tirs differents
while($event = mysql_fetch_array($req))
{
if($event['id_tir']!=$current_tir)
{
$nb_tirs_total++ ;
$current_tir = $event['id_tir'] ;
}
}
?>
<table width="89%" border="1" align="center" class="event" cellpadding="0" cellspacing="0">
<tr align="center">
<td width="15%" bgcolor="#E7F0FE">Tir</td>
<td width="20%" bgcolor="#E7F0FE">Caract.</td>
<?php
$nb_network = get_nb_network($_SESSION['id_site']);
$width_entete = 50/$nb_network."%" ;
$width = 25/$nb_network."%" ;
echo $width_entete ;
for( $inc=1 ; $inc <= $nb_network ; $inc++ )
{
?>
<td width="<?php echo $width; ?>" bgcolor="#E7F0FE">
<table width="100%">
<tr>
<th colspan="2">
<?php
$sql = "SELECT * FROM network WHERE id_network = '".$inc."'";
$req = mysql_query($sql) or die(mysql_error());
$network = mysql_fetch_array($req);
echo $network['network_name']."<br />".$network['network_desc'] ;
?>
</th>
</tr>
<tr>
<td width="<?php echo $width; ?>" bgcolor="#E7F0FE" align="center">Vitesse Particulaire max. mm/s</td>
<td width="<?php echo $width; ?>" bgcolor="#E7F0FE" align="center">Fréquence dominante en Hz</td>
</tr>
</table>
</td>
<?php
}
?>
<td width="15%" bgcolor="#E7F0FE">Actions</td>
</tr>
<tr>
<td width="20%" bgcolor="#C4DBFD">
<table width="100%" class="event_interieur">
<tr align="center">
<td width="10%">Tir</td>
<td width="50%">Date</td>
<td width="40%">Heure</td>
</tr>
</table>
</td>
<td width="20%" bgcolor="#C4DBFD">
<table width="100%" class="event_interieur">
<tr align="center">
<td width="20%">Mode</td>
<td width="20%">nb Trou</td>
<td width="20%">Q inst.</td>
<td width="20%">Q unit.</td>
<td width="20%">Q spec.</td>
</tr>
</table>
</td>
<?php
$nb_network = get_nb_network($_SESSION['id_site']);
$width = 25/$nb_network."%" ;
for( $inc=1 ; $inc <= $nb_network ; $inc++ )
{
?>
<td width="<?php echo $width; ?>" bgcolor="#C4DBFD">
<table width="100%" bgcolor="#C4DBFD">
<tr>
<td width="<?php echo $width; ?>">
<table width="100%" class="event_interieur" bgcolor="#C4DBFD">
<tr align="center">
<td width="33%">V</td>
<td width="33%">H1</td>
<td width="33%">H2</td>
</tr>
</table>
</td>
<td width="<?php echo $width; ?>">
<table width="100%" class="event_interieur" bgcolor="#C4DBFD">
<tr align="center">
<td width="33%">V</td>
<td width="33%">H1</td>
<td width="33%">H2</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<?php
}
?>
<td width="10%" bgcolor="#C4DBFD">
</td>
</tr>
<?php
require('../scripts/connexion.php');
$connexion = mysql_connect($hostname, $username, $password) or die("Connexion impossible au serveur $hostname par $username");
mysql_select_db($database, $connexion);
if($nb_tirs_total <= 5)
{
$nb_tirs = $nb_tirs_total ;
}
else
{
$nb_tirs = 5 ;
}
// On affiche une ligne par tirs
for($i=$nb_tirs_total ; $i > ($nb_tirs_total-$nb_tirs) ; $i-- )
{
// On recherche le nombre d'evenements associé au site courant
$sql = "SELECT * FROM event WHERE id_site = '".$_SESSION['id_site']."' AND event_is_valid='1' AND id_tir = '".$i."'";
$req = mysql_query($sql) or die(mysql_error());
$event = mysql_fetch_array($req);
?>
<tr bgcolor="#FFFFFF">
<td width="20%">
<table width="100%" class="event_interieur2">
<tr align="center">
<td width="10%"><?php echo $event['id_tir']; ?></td>
<td width="50%"><?php echo $event['event_date']; ?></td>
<td width="40%"><?php echo $event['event_time']; ?></td>
</tr>
</table>
</td>
<?php
$res = "SELECT * FROM tirs WHERE id_tir = '".$event['id_tir']."'";
$sub = mysql_query($res) or die(mysql_error());
$tir = mysql_fetch_array($sub)
?>
<td width="20%">
<table width="100%" class="event_interieur2">
<tr align="center">
<td width="20%"><?php echo $tir['mode']; ?></td>
<td width="20%"><?php echo $tir['nb_trou']; ?></td>
<td width="20%"><?php echo $tir['Q_inst']; ?></td>
<td width="20%"><?php echo $tir['Q_unit']; ?></td>
<td width="20%"><?php echo $tir['Q_spec']; ?></td>
</tr>
</table>
</td>
<?php
$nb_network = get_nb_network($_SESSION['id_site']);
$width = 25/$nb_network."%" ;
for( $inc=1 ; $inc <= $nb_network ; $inc++ )
{
?>
<td width="<?php echo $width_entete; ?>">
<table>
<tr align="center">
<td width="<?php echo $width; ?>" align="center">
<table width="100%" class="event_interieur2" align="center" border="1">
<tr align="center" width="50%">
<?php
$res = "SELECT * FROM event WHERE id_site = '".$_SESSION['id_site']."' AND event_is_valid='1' AND id_tir = '".$i."' AND id_network = '".$inc."'";
$sub = mysql_query($res) or die(mysql_error());
while($event = mysql_fetch_array($sub))
{
?>
<td align="center"><?php echo $event['event_value']; ?></td>
<?php
}
?>
</tr>
</table>
</td>
<td width="<?php echo $width; ?>" align="center">
<table width="100%" class="event_interieur2" align="center" border="1">
<tr align="center">
<?php
$res = "SELECT * FROM event WHERE id_site = '".$_SESSION['id_site']."' AND event_is_valid='1' AND id_tir = '".$i."' AND id_network = '".$inc."'";
$sub = mysql_query($res) or die(mysql_error());
while($event = mysql_fetch_array($sub))
{
?>
<td width="33%" align="center"><?php echo $event['event_frq']; ?></td>
<?php
}
?>
</tr>
</table>
</td>
</tr>
</table>
</td>
<?php
}
?>
<td width="10%">
<table width="100%" border="0" class="event_interieur2">
<tr align="center" valign="middle">
<td width="20%"> </td>
<td width="20%"><img src="../images/loupe.png" class="transparent"></td>
<td width="20%"> </td>
<td width="20%"><img src="../images/acroread.png" class="transparent"></td>
<td width="20%"> </td>
</tr>
</table>
</td>
</tr>
<?php
}
?>
</table> |
Partager