Guest User

Untitled

a guest
Aug 31st, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"/>
  5. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/dt/dt-1.10.10/datatables.css"/>
  6. <link rel="stylesheet" type="text/css" href="https://yadcf-showcase.appspot.com/resources/css/jquery.dataTables.yadcf.css"/>
  7. <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.js"></script>
  8. <script type="text/javascript" src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
  9. <script type="text/javascript" src="https://cdn.datatables.net/s/dt/dt-1.10.10/datatables.js"></script>
  10. <script type="text/javascript" src="https://yadcf-showcase.appspot.com/resources/js/jquery.dataTables.yadcf.js"></script>
  11. <meta charset="utf-8">
  12. <script>
  13. $(document).ready(function() {
  14. // Initialize DataTables
  15. var table = $("#example").DataTable( {
  16. "processing": true,
  17. "serverSide": true,
  18. "ajax": "serverSide.php",
  19. } );
  20. yadcf.init(table, [
  21. { column_number: 0,
  22. filter_type: "range_number",
  23. }
  24. ]);
  25. } );
  26. </script>
  27. <title>Date filter bugs</title>
  28. </head>
  29. <body>
  30.  
  31. <table id="example">
  32. <thead>
  33. <tr>
  34. <th>Date Created</th>
  35. </tr>
  36. </thead>
  37. <tbody></tbody>
  38. </table>
  39.  
  40. </body>
  41. </html>
  42.  
  43. <?php
  44.  
  45. // DB table to use
  46. $table = 'orders';
  47.  
  48. // Table's primary key
  49. $primaryKey = 'id';
  50.  
  51. // Array of database columns which should be read and sent back to DataTables.
  52. // The `db` parameter represents the column name in the database, while the `dt`
  53. // parameter represents the DataTables column identifier. In this case simple
  54. // indexes
  55. $columns = array(
  56. array( 'db' => 'id', 'dt' => 0 ),
  57. array( 'db' => 'status', 'dt' => 1 ),
  58. array( 'db' => 'deadline', 'dt' => 2 ),
  59. array( 'db' => 'master', 'dt' => 3 ),
  60. array( 'db' => 'type', 'dt' => 4 ),
  61. array( 'db' => 'brand', 'dt' => 5 ),
  62. array( 'db' => 'device', 'dt' => 6 ),
  63. array( 'db' => 'defect', 'dt' => 7 ),
  64. array( 'db' => 'client', 'dt' => 8 ),
  65. array( 'db' => 'cost', 'dt' => 9 ),
  66. array( 'db' => 'icons', 'dt' => 10),
  67.  
  68.  
  69.  
  70. );
  71.  
  72. // SQL server connection information
  73. $sql_details = array(
  74. 'user' => 'root',
  75. 'pass' => '',
  76. 'db' => 'gsmcms',
  77. 'host' => 'localhost'
  78. );
  79.  
  80.  
  81. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  82. * If you just want to use the basic configuration for DataTables with PHP
  83. * server-side, there is no need to edit below this line.
  84. */
  85.  
  86. require( 'ssp.class.php' );
  87.  
  88. echo json_encode(
  89. SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
  90. );
  91. ?>
Add Comment
Please, Sign In to add comment