- Kod: Zaznacz cały
<?php
require('conn.php');
$result = mysql_query("SELECT * FROM klienci ;");
?>
<script type="text/javascript" src="jqSortowanie/jquery-1.7.1.js"></script>
<script type="text/javascript" src="jqSortowanie/jquery.tablesorter.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<script>
// increase the default animation speed to exaggerate the effect
$.fx.speeds._default = 1000;
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
show: "blind",
hide: "explode",
height: "auto",
width: "auto"
});
$( "#opener" ).click(function() {
$( "#dialog" ).dialog( "open" );
return false;
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$("table").tablesorter({
// pass the headers argument and assing a object
headers: {
// assign the secound column (we start counting zero)
0: {
// disable it by setting the property sorter to false
sorter: false
},
// assign the third column (we start counting zero)
4: {
// disable it by setting the property sorter to false
sorter: false
},
5: {
// disable it by setting the property sorter to false
sorter: false
},
6: {
// disable it by setting the property sorter to false
sorter: false
}
}
});
});
</script>
<div class="right_content"> <br>
<table id="rounded-corner" class="tablesorter {headers: 3:(sorter:false)}}" summary="2007 Major IT Companies' Profit">
<thead>
<tr>
<th scope="col" class="rounded-company"></th>
<th scope="col" class="rounded">Imie</th>
<th scope="col" class="rounded">Nazwisko</th>
<th scope="col" class="rounded">Data dodania</th>
<th scope="col" class="rounded">Przegladaj</th>
<th scope="col" class="rounded">Edytuj</th>
<th scope="col" class="rounded-q4">Usun</th>
</tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<?php
while ($row = mysql_fetch_assoc($result)) {
echo ('<tr>
<td>
<input type="checkbox" value="'.$row['nr_klienta'].'" name="nr_klienta" /></td>
<td>'. $row['imie'].'</td>
<td>'. $row['nazwisko'].'</td>
<td>'. $row['data_wprowadzenia'].'</td>
<td>');
?>
<div id="dialog" title="<?php echo $row['imie'].(' ').$row['nazwisko']; ?>">
<table id="rounded-corner" class="tablesorter {headers: 2:(sorter:false)}}">
<thead>
<tr>
<th scope="col" class="rounded-company"></th>
<th scope="col" class="rounded">Imie</th>
<th scope="col" class="rounded">Nazwisko</th>
<th scope="col" class="rounded">Data dodania</th>
<th scope="col" class="rounded">Firma</th>
<th scope="col" class="rounded">Nr. karty kredyt.</th>
<th scope="col" class="rounded">ulica</th>
<th scope="col" class="rounded">Nr</th>
<th scope="col" class="rounded">miasto</th>
</tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<?php
$nr_klienta2=$row['nr_klienta'];
$result2 = mysql_query("SELECT * FROM klienci WHERE `klienci`.`nr_klienta` ='$nr_klienta2' ;");
while ($row2= mysql_fetch_assoc($result2)) {
echo ('<tr>
<td>
<input type="checkbox" name="'.$row2['nr_klienta'].'" /></td>
<td>'. $row2['imie'].'</td>
<td>'. $row2['nazwisko'].'</td>
<td>'. $row2['data_wprowadzenia'].'</td>
<td>'. $row2['firma'].'</td>
<td>'. $row2['ulica'].'</td>
<td>'. $row2['numer'].'</td>
<td>'. $row2['miasto'].'</td>
</tr>');
}
?>
</tbody>
</table>
</div>
<button id="opener" value="<?php echo($row['nr_klienta']); ?>" name="nr_klienta"><img src="images/search.png" alt="" title="" border="0">
</button>
<?php echo ('
</td>
<form action="edit.php" method="post" class="niceform">
<td><a href="edit.php?nr_klienta='.$row['nr_klienta'].'"><img src="images/user_edit.png" alt="" title="" border="0" /></a></td>
</form>
<form action="delete.php" method="post" class="niceform">
<td>
<a href="delete.php?nr_klienta='.$row['nr_klienta'].'" class="ask"><img src="images/trash.png" alt="" title="" border="0" /></a>
</td>
</form>
</tr>');
}
?>
</tbody>
</table>
<div align="center" class="sidebarmenu"><br>
<a class="menuitem_green" href="./pdf/generator.php">Generuj PDF</a>
</div>
<div class="pagination">
<span class="disabled"><< poprzedni</span><span class="current">1</span><a href="">2</a><a href="">3</a><a href="">4</a><a href="">5</a>...<a href="">10</a><a href="">11</a><a href="">12</a>...<a href="">100</a><a href="">101</a><a href="">nastepny >></a>
</div>
</div>
gdy zmienię result2 i row2 na samo result i row tak jak za pierwszym razem to na stronie wyświetla się jeden użytkownik, przysisk przeglądaj działa perfekcyjnie. problem w tym czemu niue wyświetla reszty... Mam nadzieje że pomożecie... Korzystałem z UI jquery z góry dziękuje za zainteresowanie tematem.