Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
- $display1=$display1+1;
- echo '
- <tr class="tablerow">
- <td>' . $row['id'] . '</td>
- <td><p class="state">' . $row['name'] . '</p></td>
- <td><p class="state">' . $row['surname'] . '</p></td>
- <td>' . $row['country'] . '</td>
- <td>' . $row['city'] . '</td>
- <td>' . $row['category'] . '</td>
- </tr>';
- if($row['id']==$_GET['showrow'])
- {
- echo '
- <tr class="subtable" style="display:none;">';
- echo '<td colspan="3" class="detalji"></td>
- <td align="left" colspan="3" class="detalji"></td>
- </tr>';}} // End of WHILE loop.
- echo '</table>';
- /* Table row click */
- $(".tablerow").click(function()
- {
- $(".subtable").show();
- });
- $(".subtable").click(function()
- {
- $(".subtable").hide();
- });
- $(".tablerow").click(function() {
- // Hideing all the tr with class subtable rows initially
- $('.subtable').hide();
- // Find the next tr which has class subclass in current context
- $(this).next('.subtable').show();
- });
- $(".subtable").click(function() {
- // Hide current row that has class subtable
- $(this).hide();
- });
- $(".tablerow").click(function()
- {
- $(this).next(".subtable").slideDown("slow");
- });
- $(".subtable").click(function()
- {
- $(".subtable").hide();
- });
Add Comment
Please, Sign In to add comment