mirror of
https://github.com/DataTables/DataTables.git
synced 2026-01-12 07:48:20 -05:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bd6b29fe4 | ||
|
|
6a61818e52 | ||
|
|
1055d27887 | ||
|
|
dc3f9b148e | ||
|
|
284658e3c9 | ||
|
|
29e0d112cb | ||
|
|
3d802a685b | ||
|
|
391cd6a7a6 | ||
|
|
90edd0bd94 | ||
|
|
b64dda47c3 | ||
|
|
49fe9f2e0e | ||
|
|
d512e8cce7 | ||
|
|
fee3ba754f | ||
|
|
c2a2b4f531 | ||
|
|
2884ee23d2 | ||
|
|
09a9755540 | ||
|
|
1fa1ef94a8 | ||
|
|
43f7878fab | ||
|
|
904f5dd672 | ||
|
|
05b9ad3d0c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ docs
|
||||
cdn
|
||||
media/js/jquery.dataTables.min.js
|
||||
.DS_Store
|
||||
Plugins
|
||||
|
||||
@@ -15,13 +15,14 @@
|
||||
$(document).ready(function() {
|
||||
$('#example').dataTable( {
|
||||
"fnDrawCallback": function ( oSettings ) {
|
||||
var that = this;
|
||||
|
||||
/* Need to redo the counters if filtered or sorted */
|
||||
if ( oSettings.bSorted || oSettings.bFiltered )
|
||||
{
|
||||
for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
|
||||
{
|
||||
$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 );
|
||||
}
|
||||
this.$('td:first-child', {"filter":"applied"}).each( function (i) {
|
||||
that.fnUpdate( i+1, this.parentNode, 0, false, false );
|
||||
} );
|
||||
}
|
||||
},
|
||||
"aoColumnDefs": [
|
||||
@@ -539,10 +540,9 @@
|
||||
/* Need to redo the counters if filtered or sorted */
|
||||
if ( oSettings.bSorted || oSettings.bFiltered )
|
||||
{
|
||||
for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
|
||||
{
|
||||
$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 );
|
||||
}
|
||||
this.$('td:first-child', {"filter":"applied"}).each( function (i) {
|
||||
that.fnUpdate( i+1, this.parentNode, 0, false, false );
|
||||
} );
|
||||
}
|
||||
},
|
||||
"aoColumnDefs": [
|
||||
|
||||
@@ -16,11 +16,7 @@
|
||||
$('#example').dataTable( {
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": "../server_side/scripts/server_processing.php",
|
||||
"sScrollY": "300",
|
||||
bPaginate: false,
|
||||
sScrollX: "100%",
|
||||
sScrollXInner: "120%"
|
||||
"sAjaxSource": "../server_side/scripts/server_processing.php"
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
||||
172
examples/examples_support/syntax/js/shCore.js
vendored
172
examples/examples_support/syntax/js/shCore.js
vendored
@@ -1,21 +1,5 @@
|
||||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
||||
*
|
||||
* @version
|
||||
* 3.0.83 (July 02 2010)
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
||||
*
|
||||
* @license
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
// XRegExp 1.5.0
|
||||
// (c) 2007-2010 Steven Levithan
|
||||
// XRegExp 1.5.1
|
||||
// (c) 2007-2012 Steven Levithan
|
||||
// MIT License
|
||||
// <http://xregexp.com>
|
||||
// Provides an augmented, extensible, cross-browser implementation of regular expressions,
|
||||
@@ -29,7 +13,7 @@ if (XRegExp) {
|
||||
}
|
||||
|
||||
// Run within an anonymous function to protect variables and avoid new globals
|
||||
(function () {
|
||||
(function (undefined) {
|
||||
|
||||
//---------------------------------
|
||||
// Constructor
|
||||
@@ -73,7 +57,7 @@ if (XRegExp) {
|
||||
} else {
|
||||
// Check for native multicharacter metasequences (excluding character classes) at
|
||||
// the current position
|
||||
if (match = real.exec.call(nativeTokens[currScope], pattern.slice(pos))) {
|
||||
if (match = nativ.exec.call(nativeTokens[currScope], pattern.slice(pos))) {
|
||||
output.push(match[0]);
|
||||
pos += match[0].length;
|
||||
} else {
|
||||
@@ -89,7 +73,7 @@ if (XRegExp) {
|
||||
}
|
||||
}
|
||||
|
||||
regex = RegExp(output.join(""), real.replace.call(flags, flagClip, ""));
|
||||
regex = RegExp(output.join(""), nativ.replace.call(flags, flagClip, ""));
|
||||
regex._xregexp = {
|
||||
source: pattern,
|
||||
captureNames: context.hasNamedCapture ? context.captureNames : null
|
||||
@@ -102,7 +86,7 @@ if (XRegExp) {
|
||||
// Public properties
|
||||
//---------------------------------
|
||||
|
||||
XRegExp.version = "1.5.0";
|
||||
XRegExp.version = "1.5.1";
|
||||
|
||||
// Token scope bitflags
|
||||
XRegExp.INSIDE_CLASS = 1;
|
||||
@@ -119,22 +103,17 @@ if (XRegExp) {
|
||||
isInsideConstructor = false,
|
||||
tokens = [],
|
||||
// Copy native globals for reference ("native" is an ES3 reserved keyword)
|
||||
real = {
|
||||
nativ = {
|
||||
exec: RegExp.prototype.exec,
|
||||
test: RegExp.prototype.test,
|
||||
match: String.prototype.match,
|
||||
replace: String.prototype.replace,
|
||||
split: String.prototype.split
|
||||
},
|
||||
compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups
|
||||
compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups
|
||||
compliantLastIndexIncrement = function () {
|
||||
var x = /^/g;
|
||||
real.test.call(x, "");
|
||||
return !x.lastIndex;
|
||||
}(),
|
||||
compliantLastIndexReset = function () {
|
||||
var x = /x/g;
|
||||
real.replace.call("x", x, "");
|
||||
nativ.test.call(x, "");
|
||||
return !x.lastIndex;
|
||||
}(),
|
||||
hasNativeY = RegExp.prototype.sticky !== undefined,
|
||||
@@ -189,15 +168,17 @@ if (XRegExp) {
|
||||
// Accepts a string to search, regex to search with, position to start the search within the
|
||||
// string (default: 0), and an optional Boolean indicating whether matches must start at-or-
|
||||
// after the position or at the specified position only. This function ignores the `lastIndex`
|
||||
// property of the provided regex
|
||||
// of the provided regex in its own handling, but updates the property for compatibility
|
||||
XRegExp.execAt = function (str, regex, pos, anchored) {
|
||||
regex = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : ""));
|
||||
regex.lastIndex = pos = pos || 0;
|
||||
var match = regex.exec(str);
|
||||
if (anchored)
|
||||
return (match && match.index === pos) ? match : null;
|
||||
else
|
||||
return match;
|
||||
var r2 = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : "")),
|
||||
match;
|
||||
r2.lastIndex = pos = pos || 0;
|
||||
match = r2.exec(str); // Run the altered `exec` (required for `lastIndex` fix, etc.)
|
||||
if (anchored && match && match.index !== pos)
|
||||
match = null;
|
||||
if (regex.global)
|
||||
regex.lastIndex = match ? r2.lastIndex : 0;
|
||||
return match;
|
||||
};
|
||||
|
||||
// Breaks the unrestorable link to XRegExp's private list of tokens, thereby preventing
|
||||
@@ -219,16 +200,18 @@ if (XRegExp) {
|
||||
// Executes `callback` once per match within `str`. Provides a simpler and cleaner way to
|
||||
// iterate over regex matches compared to the traditional approaches of subverting
|
||||
// `String.prototype.replace` or repeatedly calling `exec` within a `while` loop
|
||||
XRegExp.iterate = function (str, origRegex, callback, context) {
|
||||
var regex = clone(origRegex, "g"),
|
||||
XRegExp.iterate = function (str, regex, callback, context) {
|
||||
var r2 = clone(regex, "g"),
|
||||
i = -1, match;
|
||||
while (match = regex.exec(str)) {
|
||||
while (match = r2.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.)
|
||||
if (regex.global)
|
||||
regex.lastIndex = r2.lastIndex; // Doing this to follow expectations if `lastIndex` is checked within `callback`
|
||||
callback.call(context, match, ++i, str, regex);
|
||||
if (regex.lastIndex === match.index)
|
||||
regex.lastIndex++;
|
||||
if (r2.lastIndex === match.index)
|
||||
r2.lastIndex++;
|
||||
}
|
||||
if (origRegex.global)
|
||||
origRegex.lastIndex = 0;
|
||||
if (regex.global)
|
||||
regex.lastIndex = 0;
|
||||
};
|
||||
|
||||
// Accepts a string and an array of regexes; returns the result of using each successive regex
|
||||
@@ -285,16 +268,18 @@ if (XRegExp) {
|
||||
// rather than the empty string.
|
||||
// - `lastIndex` should not be incremented after zero-length matches.
|
||||
RegExp.prototype.exec = function (str) {
|
||||
var match = real.exec.apply(this, arguments),
|
||||
name, r2;
|
||||
if (match && str) {
|
||||
var match, name, r2, origLastIndex;
|
||||
if (!this.global)
|
||||
origLastIndex = this.lastIndex;
|
||||
match = nativ.exec.apply(this, arguments);
|
||||
if (match) {
|
||||
// Fix browsers whose `exec` methods don't consistently return `undefined` for
|
||||
// nonparticipating capturing groups
|
||||
if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
|
||||
r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
|
||||
r2 = RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", ""));
|
||||
// Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
|
||||
// matching due to characters outside the match
|
||||
real.replace.call(str.slice(match.index), r2, function () {
|
||||
nativ.replace.call((str + "").slice(match.index), r2, function () {
|
||||
for (var i = 1; i < arguments.length - 2; i++) {
|
||||
if (arguments[i] === undefined)
|
||||
match[i] = undefined;
|
||||
@@ -313,29 +298,33 @@ if (XRegExp) {
|
||||
if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
|
||||
this.lastIndex--;
|
||||
}
|
||||
if (!this.global)
|
||||
this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows)
|
||||
return match;
|
||||
};
|
||||
|
||||
// Don't override `test` if it won't change anything
|
||||
if (!compliantLastIndexIncrement) {
|
||||
// Fix browser bug in native method
|
||||
RegExp.prototype.test = function (str) {
|
||||
// Use the native `exec` to skip some processing overhead, even though the overriden
|
||||
// `exec` would take care of the `lastIndex` fix
|
||||
var match = real.exec.call(this, str);
|
||||
// Fix browsers that increment `lastIndex` after zero-length matches
|
||||
if (match && this.global && !match[0].length && (this.lastIndex > match.index))
|
||||
this.lastIndex--;
|
||||
return !!match;
|
||||
};
|
||||
}
|
||||
// Fix browser bugs in native method
|
||||
RegExp.prototype.test = function (str) {
|
||||
// Use the native `exec` to skip some processing overhead, even though the altered
|
||||
// `exec` would take care of the `lastIndex` fixes
|
||||
var match, origLastIndex;
|
||||
if (!this.global)
|
||||
origLastIndex = this.lastIndex;
|
||||
match = nativ.exec.call(this, str);
|
||||
// Fix browsers that increment `lastIndex` after zero-length matches
|
||||
if (match && !compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
|
||||
this.lastIndex--;
|
||||
if (!this.global)
|
||||
this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows)
|
||||
return !!match;
|
||||
};
|
||||
|
||||
// Adds named capture support and fixes browser bugs in native method
|
||||
String.prototype.match = function (regex) {
|
||||
if (!XRegExp.isRegExp(regex))
|
||||
regex = RegExp(regex); // Native `RegExp`
|
||||
if (regex.global) {
|
||||
var result = real.match.apply(this, arguments);
|
||||
var result = nativ.match.apply(this, arguments);
|
||||
regex.lastIndex = 0; // Fix IE bug
|
||||
return result;
|
||||
}
|
||||
@@ -350,20 +339,24 @@ if (XRegExp) {
|
||||
// third (`flags`) parameter
|
||||
String.prototype.replace = function (search, replacement) {
|
||||
var isRegex = XRegExp.isRegExp(search),
|
||||
captureNames, result, str;
|
||||
captureNames, result, str, origLastIndex;
|
||||
|
||||
// There are many combinations of search/replacement types/values and browser bugs that
|
||||
// preclude passing to native `replace`, so just keep this check relatively simple
|
||||
if (isRegex && typeof replacement.valueOf() === "string" && replacement.indexOf("${") === -1 && compliantLastIndexReset)
|
||||
return real.replace.apply(this, arguments);
|
||||
// There are too many combinations of search/replacement types/values and browser bugs that
|
||||
// preclude passing to native `replace`, so don't try
|
||||
//if (...)
|
||||
// return nativ.replace.apply(this, arguments);
|
||||
|
||||
if (!isRegex)
|
||||
if (isRegex) {
|
||||
if (search._xregexp)
|
||||
captureNames = search._xregexp.captureNames; // Array or `null`
|
||||
if (!search.global)
|
||||
origLastIndex = search.lastIndex;
|
||||
} else {
|
||||
search = search + ""; // Type conversion
|
||||
else if (search._xregexp)
|
||||
captureNames = search._xregexp.captureNames; // Array or `null`
|
||||
}
|
||||
|
||||
if (typeof replacement === "function") {
|
||||
result = real.replace.call(this, search, function () {
|
||||
if (Object.prototype.toString.call(replacement) === "[object Function]") {
|
||||
result = nativ.replace.call(this + "", search, function () {
|
||||
if (captureNames) {
|
||||
// Change the `arguments[0]` string primitive to a String object which can store properties
|
||||
arguments[0] = new String(arguments[0]);
|
||||
@@ -373,16 +366,16 @@ if (XRegExp) {
|
||||
arguments[0][captureNames[i]] = arguments[i + 1];
|
||||
}
|
||||
}
|
||||
// Update `lastIndex` before calling `replacement`
|
||||
// Update `lastIndex` before calling `replacement` (fix browsers)
|
||||
if (isRegex && search.global)
|
||||
search.lastIndex = arguments[arguments.length - 2] + arguments[0].length;
|
||||
return replacement.apply(null, arguments);
|
||||
});
|
||||
} else {
|
||||
str = this + ""; // Type conversion, so `args[args.length - 1]` will be a string (given nonstring `this`)
|
||||
result = real.replace.call(str, search, function () {
|
||||
result = nativ.replace.call(str, search, function () {
|
||||
var args = arguments; // Keep this function's `arguments` available through closure
|
||||
return real.replace.call(replacement, replacementToken, function ($0, $1, $2) {
|
||||
return nativ.replace.call(replacement + "", replacementToken, function ($0, $1, $2) {
|
||||
// Numbered backreference (without delimiters) or special variable
|
||||
if ($1) {
|
||||
switch ($1) {
|
||||
@@ -428,8 +421,12 @@ if (XRegExp) {
|
||||
});
|
||||
}
|
||||
|
||||
if (isRegex && search.global)
|
||||
search.lastIndex = 0; // Fix IE bug
|
||||
if (isRegex) {
|
||||
if (search.global)
|
||||
search.lastIndex = 0; // Fix IE, Safari bug (last tested IE 9.0.5, Safari 5.1.2 on Windows)
|
||||
else
|
||||
search.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows)
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
@@ -438,7 +435,7 @@ if (XRegExp) {
|
||||
String.prototype.split = function (s /* separator */, limit) {
|
||||
// If separator `s` is not a regex, use the native `split`
|
||||
if (!XRegExp.isRegExp(s))
|
||||
return real.split.apply(this, arguments);
|
||||
return nativ.split.apply(this, arguments);
|
||||
|
||||
var str = this + "", // Type conversion
|
||||
output = [],
|
||||
@@ -482,7 +479,7 @@ if (XRegExp) {
|
||||
}
|
||||
|
||||
if (lastLastIndex === str.length) {
|
||||
if (!real.test.call(s, "") || lastLength)
|
||||
if (!nativ.test.call(s, "") || lastLength)
|
||||
output.push("");
|
||||
} else {
|
||||
output.push(str.slice(lastLastIndex));
|
||||
@@ -511,7 +508,7 @@ if (XRegExp) {
|
||||
};
|
||||
}
|
||||
return regex;
|
||||
};
|
||||
}
|
||||
|
||||
function getNativeFlags (regex) {
|
||||
return (regex.global ? "g" : "") +
|
||||
@@ -519,7 +516,7 @@ if (XRegExp) {
|
||||
(regex.multiline ? "m" : "") +
|
||||
(regex.extended ? "x" : "") + // Proposed for ES4; included in AS3
|
||||
(regex.sticky ? "y" : "");
|
||||
};
|
||||
}
|
||||
|
||||
function runTokens (pattern, index, scope, context) {
|
||||
var i = tokens.length,
|
||||
@@ -548,7 +545,7 @@ if (XRegExp) {
|
||||
isInsideConstructor = false;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
function indexOf (array, item, from) {
|
||||
if (Array.prototype.indexOf) // Use the native array method if available
|
||||
@@ -558,7 +555,7 @@ if (XRegExp) {
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------
|
||||
@@ -573,7 +570,7 @@ if (XRegExp) {
|
||||
/\(\?#[^)]*\)/,
|
||||
function (match) {
|
||||
// Keep tokens separated unless the following token is a quantifier
|
||||
return real.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)";
|
||||
return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)";
|
||||
}
|
||||
);
|
||||
|
||||
@@ -635,7 +632,7 @@ if (XRegExp) {
|
||||
/(?:\s+|#.*)+/,
|
||||
function (match) {
|
||||
// Keep tokens separated unless the following token is a quantifier
|
||||
return real.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)";
|
||||
return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)";
|
||||
},
|
||||
XRegExp.OUTSIDE_CLASS,
|
||||
function () {return this.hasFlag("x");}
|
||||
@@ -664,6 +661,7 @@ if (XRegExp) {
|
||||
*/
|
||||
|
||||
})();
|
||||
|
||||
//
|
||||
// Begin anonymous function. This is used to contain local scope variables without polutting global scope.
|
||||
//
|
||||
|
||||
@@ -29,14 +29,28 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,7 +100,10 @@
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
@@ -121,13 +138,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -136,7 +153,7 @@
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -29,14 +29,28 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,7 +100,10 @@
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
@@ -121,13 +138,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -136,7 +153,7 @@
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -2,11 +2,30 @@
|
||||
/* 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' );
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
mysql_select_db( $gaSql['db'], $gaSql['link'] ) or
|
||||
die( 'Could not select database '. $gaSql['db'] );
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Paging */
|
||||
$sLimit = "";
|
||||
@@ -65,12 +84,12 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -78,7 +97,7 @@
|
||||
SELECT COUNT(id)
|
||||
FROM ajax
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -29,14 +29,28 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,7 +100,10 @@
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
@@ -121,13 +138,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -136,7 +153,7 @@
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -29,14 +29,28 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,7 +100,10 @@
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
@@ -121,13 +138,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -136,7 +153,7 @@
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -29,14 +29,28 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,7 +100,10 @@
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
@@ -121,13 +138,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -136,7 +153,7 @@
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -29,14 +29,28 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -87,7 +101,10 @@
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
@@ -123,13 +140,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -138,7 +155,7 @@
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -29,14 +29,28 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -87,7 +101,10 @@
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
@@ -123,13 +140,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -138,7 +155,7 @@
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -29,14 +29,28 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -85,7 +99,10 @@
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_POST['sSearch'] )."%' OR ";
|
||||
if ( isset($_POST['bSearchable_'.$i]) && $_POST['bSearchable_'.$i] == "true" )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_POST['sSearch'] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
@@ -120,13 +137,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -135,7 +152,7 @@
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -29,24 +29,37 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
|
||||
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
/*
|
||||
* Paging
|
||||
*/
|
||||
$sLimit = "";
|
||||
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
|
||||
{
|
||||
$sLimit = "LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ".
|
||||
mysql_real_escape_string( $_GET['iDisplayLength'] );
|
||||
$sLimit = "LIMIT ".intval( $_GET['iDisplayStart'] ).", ".
|
||||
intval( $_GET['iDisplayLength'] );
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +99,10 @@
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= "`".$aColumns[$i]."` LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" )
|
||||
{
|
||||
$sWhere .= "`".$aColumns[$i]."` LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
@@ -121,13 +137,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -136,7 +152,7 @@
|
||||
SELECT COUNT(`".$sIndexColumn."`)
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
@@ -111,14 +111,28 @@
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
function fatal_error ( $sErrorMessage = '' )
|
||||
{
|
||||
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
|
||||
die( $sErrorMessage );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$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'] );
|
||||
if ( ! $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) )
|
||||
{
|
||||
fatal_error( 'Could not open connection to server' );
|
||||
}
|
||||
|
||||
if ( ! mysql_select_db( $gaSql['db'], $gaSql['link'] ) )
|
||||
{
|
||||
fatal_error( 'Could not select database ' );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -203,13 +217,13 @@
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
@@ -218,7 +232,7 @@
|
||||
SELECT COUNT(`".$sIndexColumn."`)
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() );
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
101
media/js/jquery.dataTables.js
vendored
101
media/js/jquery.dataTables.js
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @summary DataTables
|
||||
* @description Paginate, search and sort HTML tables
|
||||
* @version 1.9.1
|
||||
* @version 1.9.2
|
||||
* @file jquery.dataTables.js
|
||||
* @author Allan Jardine (www.sprymedia.co.uk)
|
||||
* @contact www.sprymedia.co.uk/contact
|
||||
@@ -865,11 +865,13 @@
|
||||
return function (data, val) {
|
||||
for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
|
||||
{
|
||||
data = data[ a[i] ];
|
||||
if ( data === undefined )
|
||||
// If the nested object doesn't currently exist - since we are
|
||||
// trying to set the value - create it
|
||||
if ( data[ a[i] ] === undefined )
|
||||
{
|
||||
return;
|
||||
data[ a[i] ] = {};
|
||||
}
|
||||
data = data[ a[i] ];
|
||||
}
|
||||
data[ a[a.length-1] ] = val;
|
||||
};
|
||||
@@ -968,7 +970,6 @@
|
||||
}, _fnGetCellData(oSettings, iRow, iCol, 'display') );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new TR element (and it's TD children) for a row
|
||||
* @param {object} oSettings dataTables settings object
|
||||
@@ -1270,12 +1271,6 @@
|
||||
*/
|
||||
function _fnDraw( oSettings )
|
||||
{
|
||||
var i, iLen, n;
|
||||
var anRows = [];
|
||||
var iRowCount = 0;
|
||||
var iStripes = oSettings.asStripeClasses.length;
|
||||
var iOpenRows = oSettings.aoOpenRows.length;
|
||||
|
||||
/* Provide a pre-callback function which can be used to cancel the draw is false is returned */
|
||||
var aPreDraw = _fnCallbackFire( oSettings, 'aoPreDrawCallback', 'preDraw', [oSettings] );
|
||||
if ( $.inArray( false, aPreDraw ) !== -1 )
|
||||
@@ -1284,6 +1279,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var i, iLen, n;
|
||||
var anRows = [];
|
||||
var iRowCount = 0;
|
||||
var iStripes = oSettings.asStripeClasses.length;
|
||||
var iOpenRows = oSettings.aoOpenRows.length;
|
||||
|
||||
oSettings.bDrawing = true;
|
||||
|
||||
/* Check and see if we have an initial draw position from state saving */
|
||||
@@ -1542,11 +1543,11 @@
|
||||
/* Replace jQuery UI constants */
|
||||
if ( sAttr == "H" )
|
||||
{
|
||||
sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix";
|
||||
sAttr = oSettings.oClasses.sJUIHeader;
|
||||
}
|
||||
else if ( sAttr == "F" )
|
||||
{
|
||||
sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix";
|
||||
sAttr = oSettings.oClasses.sJUIFooter;
|
||||
}
|
||||
|
||||
/* The attribute can be in the format of "#id.class", "#id" or "class" This logic
|
||||
@@ -2341,7 +2342,7 @@
|
||||
*/
|
||||
function _fnEscapeRegex ( sVal )
|
||||
{
|
||||
var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
|
||||
var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ];
|
||||
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
|
||||
return sVal.replace(reReplace, '\\$1');
|
||||
}
|
||||
@@ -4655,7 +4656,7 @@
|
||||
* same effect as a click, if the element has focus.
|
||||
* @param {element} n Element to bind the action to
|
||||
* @param {object} oData Data object to pass to the triggered function
|
||||
* @param {function) fn Callback function for when the event is triggered
|
||||
* @param {function} fn Callback function for when the event is triggered
|
||||
* @memberof DataTable#oApi
|
||||
*/
|
||||
function _fnBindAction( n, oData, fn )
|
||||
@@ -4682,7 +4683,7 @@
|
||||
* @param {object} oSettings dataTables settings object
|
||||
* @param {string} sStore Name of the array storeage for the callbacks in oSettings
|
||||
* @param {function} fn Function to be called back
|
||||
* @param {string) sName Identifying name for the callback (i.e. a label)
|
||||
* @param {string} sName Identifying name for the callback (i.e. a label)
|
||||
* @memberof DataTable#oApi
|
||||
*/
|
||||
function _fnCallbackReg( oSettings, sStore, fn, sName )
|
||||
@@ -4705,7 +4706,7 @@
|
||||
* @param {string} sStore Name of the array storeage for the callbacks in oSettings
|
||||
* @param {string} sTrigger Name of the jQuery custom event to trigger. If null no trigger
|
||||
* is fired
|
||||
* @param {array) aArgs Array of arguments to pass to the callback function / trigger
|
||||
* @param {array} aArgs Array of arguments to pass to the callback function / trigger
|
||||
* @memberof DataTable#oApi
|
||||
*/
|
||||
function _fnCallbackFire( oSettings, sStore, sTrigger, aArgs )
|
||||
@@ -4818,8 +4819,11 @@
|
||||
*/
|
||||
this.$ = function ( sSelector, oOpts )
|
||||
{
|
||||
var i, iLen, a = [];
|
||||
var i, iLen, a = [], tr;
|
||||
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
|
||||
var aoData = oSettings.aoData;
|
||||
var aiDisplay = oSettings.aiDisplay;
|
||||
var aiDisplayMaster = oSettings.aiDisplayMaster;
|
||||
|
||||
if ( !oOpts )
|
||||
{
|
||||
@@ -4838,37 +4842,54 @@
|
||||
{
|
||||
for ( i=oSettings._iDisplayStart, iLen=oSettings.fnDisplayEnd() ; i<iLen ; i++ )
|
||||
{
|
||||
a.push( oSettings.aoData[ oSettings.aiDisplay[i] ].nTr );
|
||||
tr = aoData[ aiDisplay[i] ].nTr;
|
||||
if ( tr )
|
||||
{
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( oOpts.order == "current" && oOpts.filter == "none" )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aiDisplayMaster.length ; i<iLen ; i++ )
|
||||
for ( i=0, iLen=aiDisplayMaster.length ; i<iLen ; i++ )
|
||||
{
|
||||
a.push( oSettings.aoData[ oSettings.aiDisplayMaster[i] ].nTr );
|
||||
tr = aoData[ aiDisplayMaster[i] ].nTr;
|
||||
if ( tr )
|
||||
{
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( oOpts.order == "current" && oOpts.filter == "applied" )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
|
||||
for ( i=0, iLen=aiDisplay.length ; i<iLen ; i++ )
|
||||
{
|
||||
a.push( oSettings.aoData[ oSettings.aiDisplay[i] ].nTr );
|
||||
tr = aoData[ aiDisplay[i] ].nTr;
|
||||
if ( tr )
|
||||
{
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( oOpts.order == "original" && oOpts.filter == "none" )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
|
||||
for ( i=0, iLen=aoData.length ; i<iLen ; i++ )
|
||||
{
|
||||
a.push( oSettings.aoData[ i ].nTr );
|
||||
tr = aoData[ i ].nTr ;
|
||||
if ( tr )
|
||||
{
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( oOpts.order == "original" && oOpts.filter == "applied" )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
|
||||
for ( i=0, iLen=aoData.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( $.inArray( i, oSettings.aiDisplay ) !== -1 )
|
||||
tr = aoData[ i ].nTr;
|
||||
if ( $.inArray( i, aiDisplay ) !== -1 && tr )
|
||||
{
|
||||
a.push( oSettings.aoData[ i ].nTr );
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5195,8 +5216,8 @@
|
||||
fnCallBack.call( this, oSettings, oData );
|
||||
}
|
||||
|
||||
/* Check for an 'overflow' they case for dislaying the table */
|
||||
if ( oSettings._iDisplayStart >= oSettings.aiDisplay.length )
|
||||
/* Check for an 'overflow' they case for displaying the table */
|
||||
if ( oSettings._iDisplayStart >= oSettings.fnRecordsDisplay() )
|
||||
{
|
||||
oSettings._iDisplayStart -= oSettings._iDisplayLength;
|
||||
if ( oSettings._iDisplayStart < 0 )
|
||||
@@ -6715,7 +6736,7 @@
|
||||
* @type string
|
||||
* @default Version number
|
||||
*/
|
||||
DataTable.version = "1.9.1";
|
||||
DataTable.version = "1.9.2";
|
||||
|
||||
/**
|
||||
* Private data store, containing all of the settings objects that are created for the
|
||||
@@ -7484,7 +7505,7 @@
|
||||
* @param {object} o Object with the following parameters:
|
||||
* @param {int} o.iDataRow The row in aoData
|
||||
* @param {int} o.iDataColumn The column in question
|
||||
* @param {array o.aData The data for the row in question
|
||||
* @param {array} o.aData The data for the row in question
|
||||
* @param {object} o.oSettings The settings object for this DataTables instance
|
||||
* @returns {string} The string you which to use in the display
|
||||
* @default null
|
||||
@@ -8520,8 +8541,8 @@
|
||||
* "bProcessing": true,
|
||||
* "bServerSide": true,
|
||||
* "sAjaxSource": "xhr.php",
|
||||
* "fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
* $.ajax( {
|
||||
* "fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
|
||||
* oSettings.jqXHR = $.ajax( {
|
||||
* "dataType": 'json',
|
||||
* "type": "POST",
|
||||
* "url": sSource,
|
||||
@@ -8599,7 +8620,7 @@
|
||||
* $(document).ready(function() {
|
||||
* $('#example').dataTable( {
|
||||
* "bStateSave": true,
|
||||
* "fnStateLoad": function (oSettings, oData) {
|
||||
* "fnStateLoad": function (oSettings) {
|
||||
* var o;
|
||||
*
|
||||
* // Send an Ajax request to the server to get the data. Note that
|
||||
@@ -9451,7 +9472,7 @@
|
||||
* @example
|
||||
* $(document).ready(function() {
|
||||
* $('#example').dataTable( {
|
||||
* "sDom": '<"top"i>rt<"bottom"flp><"clear"&lgt;'
|
||||
* "sDom": '<"top"i>rt<"bottom"flp><"clear">'
|
||||
* } );
|
||||
* } );
|
||||
*/
|
||||
@@ -11238,7 +11259,9 @@
|
||||
"sScrollFootInner": "dataTables_scrollFootInner",
|
||||
|
||||
/* Misc */
|
||||
"sFooterTH": ""
|
||||
"sFooterTH": "",
|
||||
"sJUIHeader": "",
|
||||
"sJUIFooter": ""
|
||||
} );
|
||||
|
||||
|
||||
@@ -11282,7 +11305,9 @@
|
||||
"sScrollFoot": "dataTables_scrollFoot ui-state-default",
|
||||
|
||||
/* Misc */
|
||||
"sFooterTH": "ui-state-default"
|
||||
"sFooterTH": "ui-state-default",
|
||||
"sJUIHeader": "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",
|
||||
"sJUIFooter": "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"
|
||||
} );
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @summary DataTables
|
||||
* @description Paginate, search and sort HTML tables
|
||||
* @version 1.9.1
|
||||
* @version 1.9.2
|
||||
* @file jquery.dataTables.js
|
||||
* @author Allan Jardine (www.sprymedia.co.uk)
|
||||
* @contact www.sprymedia.co.uk/contact
|
||||
@@ -93,7 +93,7 @@
|
||||
* @type string
|
||||
* @default Version number
|
||||
*/
|
||||
DataTable.version = "1.9.1";
|
||||
DataTable.version = "1.9.2";
|
||||
|
||||
/**
|
||||
* Private data store, containing all of the settings objects that are created for the
|
||||
|
||||
@@ -37,8 +37,11 @@
|
||||
*/
|
||||
this.$ = function ( sSelector, oOpts )
|
||||
{
|
||||
var i, iLen, a = [];
|
||||
var i, iLen, a = [], tr;
|
||||
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
|
||||
var aoData = oSettings.aoData;
|
||||
var aiDisplay = oSettings.aiDisplay;
|
||||
var aiDisplayMaster = oSettings.aiDisplayMaster;
|
||||
|
||||
if ( !oOpts )
|
||||
{
|
||||
@@ -57,37 +60,54 @@ this.$ = function ( sSelector, oOpts )
|
||||
{
|
||||
for ( i=oSettings._iDisplayStart, iLen=oSettings.fnDisplayEnd() ; i<iLen ; i++ )
|
||||
{
|
||||
a.push( oSettings.aoData[ oSettings.aiDisplay[i] ].nTr );
|
||||
tr = aoData[ aiDisplay[i] ].nTr;
|
||||
if ( tr )
|
||||
{
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( oOpts.order == "current" && oOpts.filter == "none" )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aiDisplayMaster.length ; i<iLen ; i++ )
|
||||
for ( i=0, iLen=aiDisplayMaster.length ; i<iLen ; i++ )
|
||||
{
|
||||
a.push( oSettings.aoData[ oSettings.aiDisplayMaster[i] ].nTr );
|
||||
tr = aoData[ aiDisplayMaster[i] ].nTr;
|
||||
if ( tr )
|
||||
{
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( oOpts.order == "current" && oOpts.filter == "applied" )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
|
||||
for ( i=0, iLen=aiDisplay.length ; i<iLen ; i++ )
|
||||
{
|
||||
a.push( oSettings.aoData[ oSettings.aiDisplay[i] ].nTr );
|
||||
tr = aoData[ aiDisplay[i] ].nTr;
|
||||
if ( tr )
|
||||
{
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( oOpts.order == "original" && oOpts.filter == "none" )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
|
||||
for ( i=0, iLen=aoData.length ; i<iLen ; i++ )
|
||||
{
|
||||
a.push( oSettings.aoData[ i ].nTr );
|
||||
tr = aoData[ i ].nTr ;
|
||||
if ( tr )
|
||||
{
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( oOpts.order == "original" && oOpts.filter == "applied" )
|
||||
{
|
||||
for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
|
||||
for ( i=0, iLen=aoData.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( $.inArray( i, oSettings.aiDisplay ) !== -1 )
|
||||
tr = aoData[ i ].nTr;
|
||||
if ( $.inArray( i, aiDisplay ) !== -1 && tr )
|
||||
{
|
||||
a.push( oSettings.aoData[ i ].nTr );
|
||||
a.push( tr );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -414,8 +434,8 @@ this.fnDeleteRow = function( mTarget, fnCallBack, bRedraw )
|
||||
fnCallBack.call( this, oSettings, oData );
|
||||
}
|
||||
|
||||
/* Check for an 'overflow' they case for dislaying the table */
|
||||
if ( oSettings._iDisplayStart >= oSettings.aiDisplay.length )
|
||||
/* Check for an 'overflow' they case for displaying the table */
|
||||
if ( oSettings._iDisplayStart >= oSettings.fnRecordsDisplay() )
|
||||
{
|
||||
oSettings._iDisplayStart -= oSettings._iDisplayLength;
|
||||
if ( oSettings._iDisplayStart < 0 )
|
||||
|
||||
@@ -440,11 +440,13 @@ function _fnSetObjectDataFn( mSource )
|
||||
return function (data, val) {
|
||||
for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
|
||||
{
|
||||
data = data[ a[i] ];
|
||||
if ( data === undefined )
|
||||
// If the nested object doesn't currently exist - since we are
|
||||
// trying to set the value - create it
|
||||
if ( data[ a[i] ] === undefined )
|
||||
{
|
||||
return;
|
||||
data[ a[i] ] = {};
|
||||
}
|
||||
data = data[ a[i] ];
|
||||
}
|
||||
data[ a[a.length-1] ] = val;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
/**
|
||||
* Create a new TR element (and it's TD children) for a row
|
||||
* @param {object} oSettings dataTables settings object
|
||||
@@ -301,12 +300,6 @@ function _fnDrawHead( oSettings, aoSource, bIncludeHidden )
|
||||
*/
|
||||
function _fnDraw( oSettings )
|
||||
{
|
||||
var i, iLen, n;
|
||||
var anRows = [];
|
||||
var iRowCount = 0;
|
||||
var iStripes = oSettings.asStripeClasses.length;
|
||||
var iOpenRows = oSettings.aoOpenRows.length;
|
||||
|
||||
/* Provide a pre-callback function which can be used to cancel the draw is false is returned */
|
||||
var aPreDraw = _fnCallbackFire( oSettings, 'aoPreDrawCallback', 'preDraw', [oSettings] );
|
||||
if ( $.inArray( false, aPreDraw ) !== -1 )
|
||||
@@ -315,6 +308,12 @@ function _fnDraw( oSettings )
|
||||
return;
|
||||
}
|
||||
|
||||
var i, iLen, n;
|
||||
var anRows = [];
|
||||
var iRowCount = 0;
|
||||
var iStripes = oSettings.asStripeClasses.length;
|
||||
var iOpenRows = oSettings.aoOpenRows.length;
|
||||
|
||||
oSettings.bDrawing = true;
|
||||
|
||||
/* Check and see if we have an initial draw position from state saving */
|
||||
@@ -573,11 +572,11 @@ function _fnAddOptionsHtml ( oSettings )
|
||||
/* Replace jQuery UI constants */
|
||||
if ( sAttr == "H" )
|
||||
{
|
||||
sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix";
|
||||
sAttr = oSettings.oClasses.sJUIHeader;
|
||||
}
|
||||
else if ( sAttr == "F" )
|
||||
{
|
||||
sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix";
|
||||
sAttr = oSettings.oClasses.sJUIFooter;
|
||||
}
|
||||
|
||||
/* The attribute can be in the format of "#id.class", "#id" or "class" This logic
|
||||
|
||||
@@ -398,7 +398,7 @@ function _fnDataToSearch ( sData, sType )
|
||||
*/
|
||||
function _fnEscapeRegex ( sVal )
|
||||
{
|
||||
var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
|
||||
var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ];
|
||||
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
|
||||
return sVal.replace(reReplace, '\\$1');
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ function _fnExtend( oOut, oExtender )
|
||||
* same effect as a click, if the element has focus.
|
||||
* @param {element} n Element to bind the action to
|
||||
* @param {object} oData Data object to pass to the triggered function
|
||||
* @param {function) fn Callback function for when the event is triggered
|
||||
* @param {function} fn Callback function for when the event is triggered
|
||||
* @memberof DataTable#oApi
|
||||
*/
|
||||
function _fnBindAction( n, oData, fn )
|
||||
@@ -218,7 +218,7 @@ function _fnBindAction( n, oData, fn )
|
||||
* @param {object} oSettings dataTables settings object
|
||||
* @param {string} sStore Name of the array storeage for the callbacks in oSettings
|
||||
* @param {function} fn Function to be called back
|
||||
* @param {string) sName Identifying name for the callback (i.e. a label)
|
||||
* @param {string} sName Identifying name for the callback (i.e. a label)
|
||||
* @memberof DataTable#oApi
|
||||
*/
|
||||
function _fnCallbackReg( oSettings, sStore, fn, sName )
|
||||
@@ -241,7 +241,7 @@ function _fnCallbackReg( oSettings, sStore, fn, sName )
|
||||
* @param {string} sStore Name of the array storeage for the callbacks in oSettings
|
||||
* @param {string} sTrigger Name of the jQuery custom event to trigger. If null no trigger
|
||||
* is fired
|
||||
* @param {array) aArgs Array of arguments to pass to the callback function / trigger
|
||||
* @param {array} aArgs Array of arguments to pass to the callback function / trigger
|
||||
* @memberof DataTable#oApi
|
||||
*/
|
||||
function _fnCallbackFire( oSettings, sStore, sTrigger, aArgs )
|
||||
|
||||
@@ -59,7 +59,9 @@ $.extend( DataTable.ext.oStdClasses, {
|
||||
"sScrollFootInner": "dataTables_scrollFootInner",
|
||||
|
||||
/* Misc */
|
||||
"sFooterTH": ""
|
||||
"sFooterTH": "",
|
||||
"sJUIHeader": "",
|
||||
"sJUIFooter": ""
|
||||
} );
|
||||
|
||||
|
||||
@@ -103,6 +105,8 @@ $.extend( DataTable.ext.oJUIClasses, DataTable.ext.oStdClasses, {
|
||||
"sScrollFoot": "dataTables_scrollFoot ui-state-default",
|
||||
|
||||
/* Misc */
|
||||
"sFooterTH": "ui-state-default"
|
||||
"sFooterTH": "ui-state-default",
|
||||
"sJUIHeader": "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",
|
||||
"sJUIFooter": "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"
|
||||
} );
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ DataTable.models.oColumn = {
|
||||
* @param {object} o Object with the following parameters:
|
||||
* @param {int} o.iDataRow The row in aoData
|
||||
* @param {int} o.iDataColumn The column in question
|
||||
* @param {array o.aData The data for the row in question
|
||||
* @param {array} o.aData The data for the row in question
|
||||
* @param {object} o.oSettings The settings object for this DataTables instance
|
||||
* @returns {string} The string you which to use in the display
|
||||
* @default null
|
||||
|
||||
@@ -901,8 +901,8 @@ DataTable.defaults = {
|
||||
* "bProcessing": true,
|
||||
* "bServerSide": true,
|
||||
* "sAjaxSource": "xhr.php",
|
||||
* "fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
* $.ajax( {
|
||||
* "fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
|
||||
* oSettings.jqXHR = $.ajax( {
|
||||
* "dataType": 'json',
|
||||
* "type": "POST",
|
||||
* "url": sSource,
|
||||
@@ -980,7 +980,7 @@ DataTable.defaults = {
|
||||
* $(document).ready(function() {
|
||||
* $('#example').dataTable( {
|
||||
* "bStateSave": true,
|
||||
* "fnStateLoad": function (oSettings, oData) {
|
||||
* "fnStateLoad": function (oSettings) {
|
||||
* var o;
|
||||
*
|
||||
* // Send an Ajax request to the server to get the data. Note that
|
||||
@@ -1832,7 +1832,7 @@ DataTable.defaults = {
|
||||
* @example
|
||||
* $(document).ready(function() {
|
||||
* $('#example').dataTable( {
|
||||
* "sDom": '<"top"i>rt<"bottom"flp><"clear"&lgt;'
|
||||
* "sDom": '<"top"i>rt<"bottom"flp><"clear">'
|
||||
* } );
|
||||
* } );
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "DataTables",
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.2",
|
||||
"title": "DataTables",
|
||||
"author": {
|
||||
"name": "Allan Jardine",
|
||||
|
||||
Reference in New Issue
Block a user