Bonjour,
J'utilise un système de gestion maison pour gérer mes bbd et mettre à jours certaines pages de mon site web.
Dans ma page de gestion des "mise à jours software", normalement, les nouvelles mise à jours sont ajouté à l'interface automatiquement. C'est que ce situe mon problème. J'ai donc une nouvelle mise à jours à ajouté à ma liste, elle s'enregistre dans ma bbd, mais ne s'affiche pas dans ma page.
Voici le code:
Je tiens à m'excuser d'avance je suis encore en phase d'apprentissage, beaucoup de chose m'échappe encore et mon code n'est pas toujours propre!
J'utilise un système de gestion maison pour gérer mes bbd et mettre à jours certaines pages de mon site web.
Dans ma page de gestion des "mise à jours software", normalement, les nouvelles mise à jours sont ajouté à l'interface automatiquement. C'est que ce situe mon problème. J'ai donc une nouvelle mise à jours à ajouté à ma liste, elle s'enregistre dans ma bbd, mais ne s'affiche pas dans ma page.
Voici le code:
<?php
$req = mysql_query("SELECT * FROM cameras WHERE camera NOT IN ('Live') ORDER BY annee DESC");
while($cam = mysql_fetch_assoc($req)) {
$software = mysql_query("SELECT * FROM software WHERE camera='".$cam['camera']."' AND version REGEXP '^[.0-9]+$' ORDER BY version DESC LIMIT 1");
if(mysql_num_rows($software) >= 1) {
$software = mysql_fetch_assoc($software);
$descriptionFr = explode("\n", $software['descriptionFr']);
$descriptionEn = explode("\n", $software['descriptionEn']);
?>
<div class="update">
<a id="<?php echo $cam['camera']; ?>"></a>
<table>
<thead>
<tr>
<th height="40" colspan="3" align="center" valign="top">
<a onclick="javascript:window.open('software_modif.php?camera=<?php echo $cam['camera']; ?>','modifier','toolbar=no, width=500, height=600, scrollbar=no')"><img class="modif" src="../interface/images/modif.png" width="30" height="30" alt="modifier" /></a>
<a onclick="javascript:window.open('software_add.php?camera=<?php echo $cam['camera']; ?>','modifier','toolbar=no, width=500, height=600, scrollbar=no')"><img class="modif" src="../interface/images/update.png" width="30" height="30" alt="ajouter une mise a jour" /></a>
<?php echo $cam['camera']; ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td width="15%" rowspan="5" align="left" valign="top"><img src="../Images/photosProduits/<?php echo $cam['photo']; ?>" alt="" /></td>
<td width="15%" height="25" align="left" valign="top"><p>Fichier:</p></td>
<td align="left" valign="top"><p><?php echo $software['fichier'];?></p></td>
</tr>
<tr>
<td height="25" align="left" valign="top"><p>Version:</p></td>
<td align="left" valign="top"><p><?php echo $software['version'];?></p></td>
</tr>
<tr>
<td height="25" align="left" valign="top"><p>Date:</p></td>
<td align="left" valign="top"><p><?php echo $software['dateFr'];?></p>
<p><?php echo $software['dateEn'];?></p></td>
</tr>
<tr>
<td height="40" align="left" valign="top"><p>Amélioration:</p></td>
<td align="left" valign="top">
<ul class="upDate">
<?php
foreach($descriptionFr as $descfr) {
echo "<li>" . stripslashes($descfr) . "</li>";
}
?>
</ul>
<ul class="upDate">
<?php
foreach($descriptionEn as $descen) {
echo "<li>" . stripslashes($descen) . "</li>";
}
?>
</ul></td>
</tr>
<?php
$q = mysql_query("SELECT * FROM software WHERE camera = '".$cam['camera']."' AND version <> '".$software['version']."'");
if(mysql_num_rows($q) > 0) {
?>
<tr>
<td colspan="3" align="center">
<h4>Historique des versions</h4>
<?php
while($v = mysql_fetch_assoc($q)) {
?>
<div class="oldv">
<h5>
<span style="cursor:pointer;" onclick="$(this).parent().parent().children('div').slideToggle();">Version <?php echo $v['version']; ?></span>
<span style="font-weight:normal; font-style:italic;">(<?php echo $v['dateFr']; ?>)</span>
<img src="../interface/images/delete.gif" style="display:inline; vertical-align:middle; cursor:pointer;" onclick="var thi = this; $.post('ajax.deleteVersionHistory.php', { id : <?php echo $v['id']; ?> }, function(dat) { if(dat == 'true') { $(thi).parent().parent().hide(); } });" />
</h5>
<div style="display:none;">
<?php
$am = explode("\n", $v['descriptionFr']);
echo('<ul>');
foreach($am as $a) {
echo('<li>'.stripslashes($a).'</li>');
}
echo('</ul>');
?>
</div>
</div>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
}
}
?>
Je tiens à m'excuser d'avance je suis encore en phase d'apprentissage, beaucoup de chose m'échappe encore et mon code n'est pas toujours propre!