Advertisement
Guest User

server_processing

a guest
Sep 28th, 2014
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1. <?php
  2. $table = 'guru';
  3. // Table's primary key
  4. $primaryKey = 'idguru';
  5. // Array of database columns which should be read and sent back to DataTables.
  6. // The `db` parameter represents the column name in the database, while the `dt`
  7. // parameter represents the DataTables column identifier. In this case simple
  8. // indexes
  9. $columns = array(
  10.     array( 'db' => 'idguru', 'dt' => 0 ),
  11.     array( 'db' => 'nama',  'dt' => 1 ),
  12.     array( 'db' => 'jeniskelamin',   'dt' => 2 ),
  13.     array( 'db' => 'tanggal',     'dt' => 3 ),
  14.     array( 'db' => 'alamat', 'dt' => 4 ),
  15.     array( 'db' => 'telp',  'dt' => 5 ),
  16.     array( 'db' => 'pekerjaan',   'dt' => 6 ),
  17.     array( 'db' => 'golongan',     'dt' => 7 ),
  18.     array( 'db' => 'jabatan',     'dt' => 8 ),
  19. );
  20.  
  21. // SQL server connection information
  22. $sql_details = array(
  23.     'user' => 'root',
  24.     'pass' => '',
  25.     'db'   => 'gaji',
  26.     'host' => 'localhost'
  27. );
  28.  
  29. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  30.  * If you just want to use the basic configuration for DataTables with PHP
  31.  * server-side, there is no need to edit below this line.
  32.  */
  33.  
  34. require( 'js\DataTables-1.10.2\examples\server_side\scripts\ssp.class.php' );
  35.  
  36. echo json_encode(
  37.     SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
  38. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement