1. <?php
  2. $con = mysql_connect("localhost", "root", "");
  3.  
  4. if (!$con) {
  5. die("Error: " . mysql_error());
  6. }
  7.  
  8. mysql_select_db("kurier", $con);
  9.  
  10. $result = mysql_query("SELECT * FROM klienci");
  11. ?>
  12. <!DOCTYPE html>
  13. <head>
  14. <title>DataTables</title>
  15. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  16.  
  17. <link rel="stylesheet" href=" /kurier/inc/wybierz.css " type="text/css" />
  18.  
  19. <script src="/kurier/media/js/jquery.js" type="text/javascript"></script>
  20. <script src="/kurier/media/js/jquery.dataTables.js" type="text/javascript"></script>
  21.  
  22. <style type="text/css">
  23. @import "/kurier/media/css/demo_table_jui.css";
  24. @import "/kurier/media/themes/smoothness/jquery-ui-1.8.4.custom.css";
  25. </style>
  26.  
  27. *{
  28. font-family: arial;
  29. }
  30. </style>
  31. <script type="text/javascript" charset="utf-8">
  32.  
  33.  
  34.  
  35. $(document).ready(function() {
  36. $('#form').submit( function() {
  37. var sData = $('input', oTable.fnGetNodes()).serialize();
  38. alert( "The following data would have been submitted to the server: \n\n"+sData );
  39. return false;
  40. } );
  41.  
  42. /* Init the table */
  43. oTable = $('#datatables').dataTable({
  44. "sPaginationType":"full_numbers",
  45. "aaSorting":[[2, "desc"]],
  46. "bJQueryUI":true
  47. });
  48. } );
  49.  
  50.  
  51. /* Get the rows which are currently selected */
  52.  
  53.  
  54.  
  55. </script>
  56.  
  57. </head>
  58. <body>
  59. <div id="wyb_kl">
  60. <form id="form">
  61. <div style="text-align:right; padding-bottom:1em;">
  62.  
  63. <button type="submit">Submit form</button>
  64. </div>
  65. <table id="datatables" class="display">
  66. <tr>
  67. <th>ID</th>
  68. <th>Nazwa</th>
  69. <th>Nip</th>
  70. <th>Kod Pocztowy</th>
  71. <th>Ulica</th>
  72. <th>Nr domu</th>
  73. <th>Nr lokalu</th>
  74. <th>Tel</th>
  75. <th>Email</th>
  76. <th>Data</th>
  77. </tr>
  78. </thead>
  79. <?php
  80. while ($row = mysql_fetch_array($result)) {
  81. ?>
  82. <tr>
  83. <td><?=$row['ID_klient']?></td>
  84. <td><?=$row['nazwa']?></td>
  85. <td><?=$row['nip']?></td>
  86. <td><?=$row['kod']?></td>
  87. <td><?=$row['ulica']?></td>
  88. <td><?=$row['nr_domu']?></td>
  89. <td><?=$row['nr_lokalu']?></td>
  90. <td><?=$row['telefon']?></td>
  91. <td><?=$row['email']?></td>
  92. <td><?=$row['data']?></td>
  93. <td><input type="radio" name="klienci[]" id="<?=$row['data']?>" value="<?=$row['data']?>" /></td>
  94.  
  95. </tr>
  96. <?php
  97. }
  98. ?>
  99. </tbody>
  100. </table>
  101. </form>
  102. </div>
  103. </body>
  104. </html>


chce zrobić tabelkę z opcja wyboru uzytkownika , ktorego id przesle do php , problem polega na tym ze automatycznie gdy dodaje kolumne z radio znika mi stylizacja plugin datatables i mozliwosc sortowania