large.php 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /* MySQL connection */
  3. include( $_SERVER['DOCUMENT_ROOT']."/datatables/mysql.php" ); /* ;-) */
  4. $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or
  5. die( 'Could not open connection to server' );
  6. mysql_select_db( $gaSql['db'], $gaSql['link'] ) or
  7. die( 'Could not select database '. $gaSql['db'] );
  8. ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  9. <html>
  10. <head>
  11. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  12. <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
  13. <title>DataTables example</title>
  14. <style type="text/css" title="currentStyle">
  15. @import "../../css/demo_page.css";
  16. @import "../../css/demo_table.css";
  17. </style>
  18. <script type="text/javascript" src="../../js/jquery.js"></script>
  19. <script type="text/javascript" src="../../js/jquery.dataTables.js"></script>
  20. <script type="text/javascript" charset="utf-8">
  21. $(document).ready(function() {
  22. //if ( typeof console != 'undefined' ) {
  23. // console.profile();
  24. //}
  25. var oTable = $('#example').dataTable();
  26. //if ( typeof console != 'undefined' ) {
  27. // console.profileEnd();
  28. //}
  29. var iStart = new Date().getTime();
  30. oTable.fnSort( [[ 1, 'asc' ]] );
  31. oTable.fnSort( [[ 1, 'asc' ]] );
  32. oTable.fnSort( [[ 2, 'asc' ]] );
  33. oTable.fnSort( [[ 1, 'asc' ]] );
  34. oTable.fnSort( [[ 2, 'asc' ]] );
  35. oTable.fnSort( [[ 1, 'asc' ]] );
  36. oTable.fnSort( [[ 2, 'asc' ]] );
  37. oTable.fnSort( [[ 1, 'asc' ]] );
  38. oTable.fnSort( [[ 2, 'asc' ]] );
  39. oTable.fnSort( [[ 1, 'asc' ]] );
  40. oTable.fnSort( [[ 2, 'asc' ]] );
  41. oTable.fnSort( [[ 1, 'asc' ]] );
  42. oTable.fnSort( [[ 2, 'asc' ]] );
  43. var iEnd = new Date().getTime();
  44. document.getElementById('output').innerHTML = "Test took "+(iEnd-iStart)+" mS";
  45. } );
  46. </script>
  47. </head>
  48. <body id="dt_example">
  49. <div id="container">
  50. <div class="full_width big">
  51. <i>DataTables</i> performance test - draw
  52. </div>
  53. <div id="output"></div>
  54. <div id="demo">
  55. <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
  56. <thead>
  57. <tr>
  58. <th>id</th>
  59. <th>name</th>
  60. <th>phone</th>
  61. <th>email</th>
  62. <th>city</th>
  63. <th>zip</th>
  64. <th>state</th>
  65. <th>country</th>
  66. <th>zip2</th>
  67. </tr>
  68. </thead>
  69. <tbody>
  70. <?php
  71. $sQuery = "
  72. SELECT *
  73. FROM testData
  74. LIMIT 2000
  75. ";
  76. $rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
  77. while ( $aRow = mysql_fetch_array( $rResult ) )
  78. {
  79. echo '<tr>';
  80. echo '<td><a href="1">'.$aRow['id'].'</a></td>';
  81. echo '<td>'.$aRow['name'].'</td>';
  82. echo '<td>'.$aRow['phone'].'</td>';
  83. echo '<td>'.$aRow['email'].'</td>';
  84. echo '<td>'.$aRow['city'].'</td>';
  85. echo '<td>'.$aRow['zip'].'</td>';
  86. echo '<td>'.$aRow['state'].'</td>';
  87. echo '<td>'.$aRow['country'].'</td>';
  88. echo '<td>'.$aRow['zip2'].'</td>';
  89. echo '</tr>';
  90. }
  91. ?>
  92. </tbody>
  93. </table>
  94. </div>
  95. <div class="spacer"></div>
  96. <div id="footer" style="text-align:center;">
  97. <span style="font-size:10px;">
  98. DataTables &copy; Allan Jardine 2008-2009.
  99. </span>
  100. </div>
  101. </div>
  102. </body>
  103. </html>