Php bdd jquery
Résolu
zeckiis
Messages postés
197
Date d'inscription
Statut
Membre
Dernière intervention
-
A.Nonymous -
A.Nonymous -
Bonjour,
je developpe sur dreamweaver une petite application web, avec un code en php pour se connecter à la base de données mysql.
j'ai 2 tables avec 3500 enregistrements.
Pour le moment, jarrive à avoir les données sous forme de tableau avec des ligne d'enregistrement.
Mon objectif c'est de pouvoir cliquer sur une ligne et d'avoir une fenétre modal jquery avec comme contenu les details qui proviennent de l'autre table.
Pour le popup j'ai trouvé un petit script comme celui -ci: http://sohtanaka.developpez.com/tutoriels/javascript/creez-fenetre-modale-avec-css-et-jquery/
voici les codes pour mon tableau de données:
<table id="datatables" class="display">
<thead>
<tr>
<th>CIP</th>
<th>COPHASE</th>
<th>DCI</th>
<th>DOSAGE</th>
<th>SPECIALITE</th>
<th>FORME</th>
<th>CLASSE</th>
<th>PRIX_loc</th>
<th>LISTE</th>
<th>LABO</th>
<th>MEDIC</th>
</tr>
</thead>
<tbody>
<?php
while ($row_req1 = mysql_fetch_array($result)) {
?>
<tr>
<td><?php echo $row_req1['med_cip']; ?></td>
<td><?php echo $row_req1['med_cophase']; ?></td>
<td><?php echo $row_req1['med_dci']; ?></td>
<td><?php echo $row_req1['med_dosage']; ?></td>
<td><?php echo $row_req1['med_specialite']; ?></td>
<td><?php echo $row_req1['med_forme']; ?></td>
<td><?php echo $row_req1['med_classe']; ?></td>
<td><?php echo $row_req1['med_prix_loc']; ?></td>
<td><?php echo $row_req1['med_liste']; ?></td>
<td><?php echo $row_req1['med_laboratoire']; ?></td>
<td><?php if ( $row_req1['med_me'] != 0 ){ echo "<img src=\"sort_desc.png\">"; } else { echo "0"; } ?></td>
</tr>
<?php }?>
</tbody>
</table>
merci d'avance de votre soutien
je developpe sur dreamweaver une petite application web, avec un code en php pour se connecter à la base de données mysql.
j'ai 2 tables avec 3500 enregistrements.
Pour le moment, jarrive à avoir les données sous forme de tableau avec des ligne d'enregistrement.
Mon objectif c'est de pouvoir cliquer sur une ligne et d'avoir une fenétre modal jquery avec comme contenu les details qui proviennent de l'autre table.
Pour le popup j'ai trouvé un petit script comme celui -ci: http://sohtanaka.developpez.com/tutoriels/javascript/creez-fenetre-modale-avec-css-et-jquery/
voici les codes pour mon tableau de données:
<table id="datatables" class="display">
<thead>
<tr>
<th>CIP</th>
<th>COPHASE</th>
<th>DCI</th>
<th>DOSAGE</th>
<th>SPECIALITE</th>
<th>FORME</th>
<th>CLASSE</th>
<th>PRIX_loc</th>
<th>LISTE</th>
<th>LABO</th>
<th>MEDIC</th>
</tr>
</thead>
<tbody>
<?php
while ($row_req1 = mysql_fetch_array($result)) {
?>
<tr>
<td><?php echo $row_req1['med_cip']; ?></td>
<td><?php echo $row_req1['med_cophase']; ?></td>
<td><?php echo $row_req1['med_dci']; ?></td>
<td><?php echo $row_req1['med_dosage']; ?></td>
<td><?php echo $row_req1['med_specialite']; ?></td>
<td><?php echo $row_req1['med_forme']; ?></td>
<td><?php echo $row_req1['med_classe']; ?></td>
<td><?php echo $row_req1['med_prix_loc']; ?></td>
<td><?php echo $row_req1['med_liste']; ?></td>
<td><?php echo $row_req1['med_laboratoire']; ?></td>
<td><?php if ( $row_req1['med_me'] != 0 ){ echo "<img src=\"sort_desc.png\">"; } else { echo "0"; } ?></td>
</tr>
<?php }?>
</tbody>
</table>
merci d'avance de votre soutien
A voir également:
- Php bdd jquery
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour a la ligne php - Forum Webmastering
- Alert php - Forum PHP
- Retour a la ligne php ✓ - Forum PHP
2 réponses
Le plugin jQuery ColorBox ( http://www.jacklmoore.com/colorbox/ ) peut répondre à la demande :
HTML :
<table>
<tr>
<td>Demo</td>
<td><a class='iframe' href="http://www.commentcamarche.net/forum/affich-26059568-php-bdd-jquery">Php bdd jquery</a></td>
</tr>
<tr>
<td>ColorBox</td>
<td><a class="iframe" href="http://www.jacklmoore.com/colorbox/">http://www.jacklmoore.com/colorbox/</a>
</td>
</tr>
</table>
Javascript :
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});?
Demo : http://jsfiddle.net/ah6D3/
HTML :
<table>
<tr>
<td>Demo</td>
<td><a class='iframe' href="http://www.commentcamarche.net/forum/affich-26059568-php-bdd-jquery">Php bdd jquery</a></td>
</tr>
<tr>
<td>ColorBox</td>
<td><a class="iframe" href="http://www.jacklmoore.com/colorbox/">http://www.jacklmoore.com/colorbox/</a>
</td>
</tr>
</table>
Javascript :
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});?
Demo : http://jsfiddle.net/ah6D3/
super, ca marche au bout de 2 jours de test. merci, en effet il a fallu que j'ajoute tt le code javascript:
<script type="text/javascript">
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".iframe").colorbox({iframe:true, width:"60%", height:"60%"});
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#fff000", "color":"#999", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".iframe").colorbox({iframe:true, width:"60%", height:"60%"});
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#fff000", "color":"#999", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>