Merge branch 'master' into PROT-9-webservice
[proteocache.git] / webapp / resources / datatables-1.9.4 / media / unit_testing / performance / large.php
diff --git a/webapp/resources/datatables-1.9.4/media/unit_testing/performance/large.php b/webapp/resources/datatables-1.9.4/media/unit_testing/performance/large.php
new file mode 100644 (file)
index 0000000..c491152
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+  /* MySQL connection */
+       include( $_SERVER['DOCUMENT_ROOT']."/datatables/mysql.php" ); /* ;-) */
+       
+       $gaSql['link'] =  mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password']  ) or
+               die( 'Could not open connection to server' );
+       
+       mysql_select_db( $gaSql['db'], $gaSql['link'] ) or 
+               die( 'Could not select database '. $gaSql['db'] );
+
+?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+               <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
+               
+               <title>DataTables example</title>
+               <style type="text/css" title="currentStyle">
+                       @import "../../css/demo_page.css";
+                       @import "../../css/demo_table.css";
+               </style>
+               <script type="text/javascript" language="javascript" src="../../js/jquery.js"></script>
+               <script type="text/javascript" language="javascript" src="../../js/jquery.dataTables.js"></script>
+               <script type="text/javascript" charset="utf-8">
+                       $(document).ready(function() {
+                               var oTable = $('#example').dataTable();
+                               var iStart = new Date().getTime();
+                               
+                               //if ( typeof console != 'undefined' ) {
+                               //      console.profile();
+                               //}
+                               for ( var i=0 ; i<10 ; i++ )
+                               {
+                                       var oTable = $('#example').dataTable({"bDestroy": true});
+                               }
+                               //if ( typeof console != 'undefined' ) {
+                               //      console.profileEnd();
+                               //}
+                               
+                               //oTable.fnSort( [[ 1, 'asc' ]] );
+                               //oTable.fnSort( [[ 1, 'asc' ]] );
+                               //oTable.fnSort( [[ 2, 'asc' ]] );
+                               //oTable.fnSort( [[ 1, 'asc' ]] );
+                               //oTable.fnSort( [[ 2, 'asc' ]] );
+                               
+                               var iEnd = new Date().getTime();
+                               document.getElementById('output').innerHTML = "Test took "+(iEnd-iStart)+" mS";
+                       } );
+               </script>
+       </head>
+       <body id="dt_example">
+               <div id="container">
+                       <div class="full_width big">
+                               <i>DataTables</i> performance test - draw
+                       </div>
+                       <div id="output"></div>
+
+                       <div id="demo">
+<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
+       <thead>
+               <tr>
+                       <th>id</th>
+                       <th>name</th>
+                       <th>phone</th>
+                       <th>email</th>
+                       <th>city</th>
+                       <th>zip</th>
+                       <th>state</th>
+                       <th>country</th>
+                       <th>zip2</th>
+               </tr>
+       </thead>
+       <tbody>
+<?php
+       $sQuery = "
+               SELECT *
+               FROM   testData
+               LIMIT  2000
+       ";
+       $rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
+       while ( $aRow = mysql_fetch_array( $rResult ) )
+       {
+               echo '<tr>';
+               echo '<td><a href="1">'.$aRow['id'].'</a></td>';
+               echo '<td>'.$aRow['name'].'</td>';
+               echo '<td>'.$aRow['phone'].'</td>';
+               echo '<td>'.$aRow['email'].'</td>';
+               echo '<td>'.$aRow['city'].'</td>';
+               echo '<td>'.$aRow['zip'].'</td>';
+               echo '<td>'.$aRow['state'].'</td>';
+               echo '<td>'.$aRow['country'].'</td>';
+               echo '<td>'.$aRow['zip2'].'</td>';
+               echo '</tr>';
+       }
+?>
+       </tbody>
+</table>
+                       </div>
+                       <div class="spacer"></div>
+                       
+                       <div id="footer" style="text-align:center;">
+                               <span style="font-size:10px;">
+                                       DataTables &copy; Allan Jardine 2008-2009.
+                               </span>
+                       </div>
+               </div>
+       </body>
+</html>
\ No newline at end of file