Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"/>
- <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/dt/dt-1.10.10/datatables.css"/>
- <link rel="stylesheet" type="text/css" href="https://yadcf-showcase.appspot.com/resources/css/jquery.dataTables.yadcf.css"/>
- <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.js"></script>
- <script type="text/javascript" src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
- <script type="text/javascript" src="https://cdn.datatables.net/s/dt/dt-1.10.10/datatables.js"></script>
- <script type="text/javascript" src="https://yadcf-showcase.appspot.com/resources/js/jquery.dataTables.yadcf.js"></script>
- <meta charset="utf-8">
- <script>
- $(document).ready(function() {
- // Initialize DataTables
- var table = $("#example").DataTable( {
- "processing": true,
- "serverSide": true,
- "ajax": "serverSide.php",
- } );
- yadcf.init(table, [
- { column_number: 0,
- filter_type: "range_number",
- }
- ]);
- } );
- </script>
- <title>Date filter bugs</title>
- </head>
- <body>
- <table id="example">
- <thead>
- <tr>
- <th>Date Created</th>
- </tr>
- </thead>
- <tbody></tbody>
- </table>
- </body>
- </html>
- <?php
- // DB table to use
- $table = 'orders';
- // Table's primary key
- $primaryKey = 'id';
- // Array of database columns which should be read and sent back to DataTables.
- // The `db` parameter represents the column name in the database, while the `dt`
- // parameter represents the DataTables column identifier. In this case simple
- // indexes
- $columns = array(
- array( 'db' => 'id', 'dt' => 0 ),
- array( 'db' => 'status', 'dt' => 1 ),
- array( 'db' => 'deadline', 'dt' => 2 ),
- array( 'db' => 'master', 'dt' => 3 ),
- array( 'db' => 'type', 'dt' => 4 ),
- array( 'db' => 'brand', 'dt' => 5 ),
- array( 'db' => 'device', 'dt' => 6 ),
- array( 'db' => 'defect', 'dt' => 7 ),
- array( 'db' => 'client', 'dt' => 8 ),
- array( 'db' => 'cost', 'dt' => 9 ),
- array( 'db' => 'icons', 'dt' => 10),
- );
- // SQL server connection information
- $sql_details = array(
- 'user' => 'root',
- 'pass' => '',
- 'db' => 'gsmcms',
- 'host' => 'localhost'
- );
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * If you just want to use the basic configuration for DataTables with PHP
- * server-side, there is no need to edit below this line.
- */
- require( 'ssp.class.php' );
- echo json_encode(
- SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
- );
- ?>
Add Comment
Please, Sign In to add comment