forked from kevinowino869/mitrobill
PHPMixBill v5.0 - First Upload
This commit is contained in:
.DS_Store.gitignoreLICENSEREADME.md
admin
index.phpsystem
.DS_Store
autoload
Admin.phpApp.php
boot.phpconfig.sample.phpPEAR2
Autoload.php
Paginator.phpPassword.phpRouter.phpTimezone.phpUser.phpValidator.phpindex.htmlCache
Console
Color.php
Color
CommandLine.phpCommandLine
Action.php
Action
Callback.phpCounter.phpHelp.phpList.phpPassword.phpStoreArray.phpStoreFalse.phpStoreFloat.phpStoreInt.phpStoreString.phpStoreTrue.phpVersion.php
Argument.phpCommand.phpCustomMessageProvider.phpElement.phpException.phpMessageProvider.phpMessageProvider
Option.phpOutputter.phpOutputter
Renderer.phpRenderer
Result.phpXmlParser.phpNet
controllers
accounts.phpadmin.phpautoload.phpbandwidth.phpcustomers.phpdashboard.phpdefault.phpexport.phphome.phpindex.htmllogin.phplogout.phpmessage.phporder.phppm.phppool.phpprepaid.phpreports.phprouters.phpservices.phpsettings.phpvoucher.php
cron.phpindex.htmlinstall
lan
orm.phpuploads
vendors
.DS_Storeindex.html
mpdf
CHANGELOG.txtCREDITS.txtLICENSE.txtREADME.txt
classes
barcode.phpbmp.phpcssmgr.phpdesktop.inidirectw.phpgif.phpgrad.phpindic.phpmeter.phpmpdfform.phpmyanmar.phpotl.phpotl_dump.phpsea.phpsvg.phptocontents.phpttfontsuni.phpttfontsuni_analysis.phpucdn.phpwmf.php
collations
Afrikaans_South_Africa.phpAlbanian_Albania.phpAlsatian_France.phpArabic_Algeria.phpArabic_Bahrain.phpArabic_Egypt.phpArabic_Iraq.phpArabic_Jordan.phpArabic_Kuwait.phpArabic_Lebanon.phpArabic_Libya.phpArabic_Morocco.phpArabic_Oman.phpArabic_Pseudo_RTL.phpArabic_Qatar.phpArabic_Saudi_Arabia.phpArabic_Syria.phpArabic_Tunisia.phpArabic_Yemen.phpAzeri_(Cyrillic)_Azerbaijan.phpAzeri_(Latin)_Azerbaijan.phpBashkir_Russia.phpBasque_Spain.phpBelarusian_Belarus.phpBosnian_(Cyrillic)_Bosnia_and_Herzegovina.phpBosnian_(Latin)_Bosnia_and_Herzegovina.phpBreton_France.phpBulgarian_Bulgaria.phpCatalan_Spain.phpCorsican_France.phpCroatian_(Latin)_Bosnia_and_Herzegovina.phpCroatian_Croatia.phpCzech_Czech_Republic.phpDanish_Denmark.phpDari_Afghanistan.phpDutch_Belgium.phpDutch_Netherlands.phpEnglish_Australia.phpEnglish_Belize.phpEnglish_Canada.phpEnglish_Caribbean.phpEnglish_India.phpEnglish_Ireland.phpEnglish_Jamaica.phpEnglish_Malaysia.phpEnglish_New_Zealand.phpEnglish_Republic_of_the_Philippines.phpEnglish_Singapore.phpEnglish_South_Africa.phpEnglish_Trinidad_and_Tobago.phpEnglish_United_Kingdom.phpEnglish_United_States.phpEnglish_Zimbabwe.phpEstonian_Estonia.phpFaroese_Faroe_Islands.phpFilipino_Philippines.phpFinnish_Finland.phpFrench_Belgium.phpFrench_Canada.phpFrench_France.phpFrench_Luxembourg.phpFrench_Principality_of_Monaco.phpFrench_Switzerland.phpFrisian_Netherlands.phpGalician_Spain.phpGerman_Austria.phpGerman_Germany.phpGerman_Liechtenstein.phpGerman_Luxembourg.phpGerman_Switzerland.phpGreek_Greece.phpGreenlandic_Greenland.phpHausa_(Latin)_Nigeria.phpHebrew_Israel.phpHungarian_Hungary.phpIcelandic_Iceland.phpIgbo_Nigeria.phpIndonesian_Indonesia.phpInuktitut_(Latin)_Canada.phpInvariant_Language_Invariant_Country.phpIrish_Ireland.phpItalian_Italy.phpItalian_Switzerland.phpKinyarwanda_Rwanda.phpKiswahili_Kenya.phpKyrgyz_Kyrgyzstan.phpLatvian_Latvia.phpLithuanian_Lithuania.phpLower_Sorbian_Germany.phpLuxembourgish_Luxembourg.phpMacedonian_(FYROM)_Macedonia_(FYROM).phpMalay_Brunei_Darussalam.phpMalay_Malaysia.phpMapudungun_Chile.phpMohawk_Canada.phpMongolian_(Cyrillic)_Mongolia.phpNorwegian_(Nynorsk)_Norway.phpOccitan_France.phpPersian_Iran.phpPolish_Poland.phpPortuguese_Brazil.phpPortuguese_Portugal.phpQuechua_Bolivia.phpQuechua_Ecuador.phpQuechua_Peru.phpRomanian_Romania.phpRomansh_Switzerland.phpRussian_Russia.phpSami_(Inari)_Finland.phpSami_(Lule)_Norway.phpSami_(Lule)_Sweden.phpSami_(Northern)_Finland.phpSami_(Northern)_Norway.phpSami_(Northern)_Sweden.phpSami_(Skolt)_Finland.phpSami_(Southern)_Norway.phpSami_(Southern)_Sweden.phpSerbian_(Cyrillic)_Bosnia_and_Herzegovina.phpSerbian_(Cyrillic)_Serbia.phpSerbian_(Latin)_Bosnia_and_Herzegovina.phpSerbian_(Latin)_Serbia.phpSesotho_sa_Leboa_South_Africa.phpSetswana_South_Africa.phpSlovak_Slovakia.phpSlovenian_Slovenia.phpSpanish_Argentina.phpSpanish_Bolivia.phpSpanish_Chile.phpSpanish_Colombia.phpSpanish_Costa_Rica.phpSpanish_Dominican_Republic.phpSpanish_Ecuador.phpSpanish_El_Salvador.phpSpanish_Guatemala.phpSpanish_Honduras.phpSpanish_Mexico.phpSpanish_Nicaragua.phpSpanish_Panama.phpSpanish_Paraguay.phpSpanish_Peru.phpSpanish_Puerto_Rico.phpSpanish_Spain.phpSpanish_United_States.phpSpanish_Uruguay.phpSpanish_Venezuela.phpSwedish_Finland.phpSwedish_Sweden.phpTajik_(Cyrillic)_Tajikistan.phpTamazight_(Latin)_Algeria.phpTatar_Russia.phpTurkish_Turkey.phpTurkmen_Turkmenistan.phpUkrainian_Ukraine.phpUpper_Sorbian_Germany.phpUrdu_Islamic_Republic_of_Pakistan.phpUzbek_(Cyrillic)_Uzbekistan.phpUzbek_(Latin)_Uzbekistan.phpVietnamese_Vietnam.phpWelsh_United_Kingdom.phpWolof_Senegal.phpYakut_Russia.phpYoruba_Nigeria.phpisiXhosa_South_Africa.phpisiZulu_South_Africa.php
compress.phpconfig.phpconfig_fonts-distr-without-OTL.phpconfig_fonts.phpconfig_lang2fonts.phpconfig_script2lang.phpfont
ccourier.phpccourierb.phpccourierbi.phpccourieri.phpchelvetica.phpchelveticab.phpchelveticabi.phpchelveticai.phpcsymbol.phpctimes.phpctimesb.phpctimesbi.phpctimesi.phpczapfdingbats.php
graph.phpgraph_cache
includes
CJKdata.phpfunctions.phplinebrdictK.datlinebrdictL.datlinebrdictT.datno_image.jpgout.phpsubs_core.phpsubs_win-1252.phpupperCase.php
lang2fonts.cssmpdf.cssmpdf.phpmpdfi
patterns
progbar.csstmp
ttfontdata
dejavusans.GDEFdata.phpdejavusans.GPOSdata.phpdejavusans.GSUB.arab.DFLT.phpdejavusans.GSUB.arab.KUR .phpdejavusans.GSUB.arab.SND .phpdejavusans.GSUB.arab.URD .phpdejavusans.GSUB.nko .DFLT.phpdejavusans.GSUBGPOStables.datdejavusans.GSUBdata.phpdejavusans.cw.datdejavusans.cw127.phpdejavusans.gid.datdejavusans.mtx.phpdejavusanscondensed.GDEFdata.phpdejavusanscondensed.GPOSdata.phpdejavusanscondensed.GSUB.arab.DFLT.phpdejavusanscondensed.GSUB.arab.KUR .phpdejavusanscondensed.GSUB.arab.SND .phpdejavusanscondensed.GSUB.arab.URD .phpdejavusanscondensed.GSUB.nko .DFLT.phpdejavusanscondensed.GSUBGPOStables.datdejavusanscondensed.GSUBdata.phpdejavusanscondensed.cw.datdejavusanscondensed.cw127.phpdejavusanscondensed.gid.datdejavusanscondensed.mtx.phpdejavusanscondensedB.GDEFdata.phpdejavusanscondensedB.GPOSdata.phpdejavusanscondensedB.GSUB.arab.DFLT.phpdejavusanscondensedB.GSUB.arab.KUR .phpdejavusanscondensedB.GSUB.arab.SND .phpdejavusanscondensedB.GSUB.arab.URD .phpdejavusanscondensedB.GSUB.nko .DFLT.phpdejavusanscondensedB.GSUBGPOStables.datdejavusanscondensedB.GSUBdata.phpdejavusanscondensedB.cw.datdejavusanscondensedB.cw127.phpdejavusanscondensedB.gid.datdejavusanscondensedB.mtx.phpdejavusanscondensedI.GDEFdata.phpdejavusanscondensedI.GPOSdata.phpdejavusanscondensedI.GSUBGPOStables.datdejavusanscondensedI.GSUBdata.phpdejavusanscondensedI.cw.datdejavusanscondensedI.gid.datdejavusanscondensedI.mtx.phpdejavusansmono.GDEFdata.phpdejavusansmono.GPOSdata.phpdejavusansmono.GSUB.arab.DFLT.phpdejavusansmono.GSUBGPOStables.datdejavusansmono.GSUBdata.phpdejavusansmono.cw.datdejavusansmono.cw127.phpdejavusansmono.gid.datdejavusansmono.mtx.phpdejavusansmonoB.GDEFdata.phpdejavusansmonoB.GPOSdata.phpdejavusansmonoB.GSUB.arab.DFLT.phpdejavusansmonoB.GSUBGPOStables.datdejavusansmonoB.GSUBdata.phpdejavusansmonoB.cw.datdejavusansmonoB.gid.datdejavusansmonoB.mtx.phpdejavuserifcondensed.cw.datdejavuserifcondensed.cw127.phpdejavuserifcondensed.gid.datdejavuserifcondensed.mtx.phpdejavuserifcondensedB.cw.datdejavuserifcondensedB.gid.datdejavuserifcondensedB.mtx.php
ttfonts
DejaVuSans-Bold.ttfDejaVuSans-BoldOblique.ttfDejaVuSans-Oblique.ttfDejaVuSans.ttfDejaVuSansCondensed-Bold.ttfDejaVuSansCondensed-BoldOblique.ttfDejaVuSansCondensed-Oblique.ttfDejaVuSansCondensed.ttfDejaVuSansMono-Bold.ttfDejaVuSansMono-BoldOblique.ttfDejaVuSansMono-Oblique.ttfDejaVuSansMono.ttfDejaVuSerif-Bold.ttfDejaVuSerif-BoldItalic.ttfDejaVuSerif-Italic.ttfDejaVuSerif.ttfDejaVuSerifCondensed-Bold.ttfDejaVuSerifCondensed-BoldItalic.ttfDejaVuSerifCondensed-Italic.ttfDejaVuSerifCondensed.ttfDejaVuinfo.txt
utils
smarty
COPYING.libindex.html
libs
.DS_StoreSmarty.class.phpSmartyBC.class.phpdebug.tplindex.html
plugins
block.textformat.phpfunction.counter.phpfunction.cycle.phpfunction.fetch.phpfunction.html_checkboxes.phpfunction.html_image.phpfunction.html_options.phpfunction.html_radios.phpfunction.html_select_date.phpfunction.html_select_time.phpfunction.html_table.phpfunction.mailto.phpfunction.math.phpindex.htmlmodifier.capitalize.phpmodifier.date_format.phpmodifier.debug_print_var.phpmodifier.escape.phpmodifier.regex_replace.phpmodifier.replace.phpmodifier.spacify.phpmodifier.truncate.phpmodifiercompiler.cat.phpmodifiercompiler.count_characters.phpmodifiercompiler.count_paragraphs.phpmodifiercompiler.count_sentences.phpmodifiercompiler.count_words.phpmodifiercompiler.default.phpmodifiercompiler.escape.phpmodifiercompiler.from_charset.phpmodifiercompiler.indent.phpmodifiercompiler.lower.phpmodifiercompiler.noprint.phpmodifiercompiler.string_format.phpmodifiercompiler.strip.phpmodifiercompiler.strip_tags.phpmodifiercompiler.to_charset.phpmodifiercompiler.unescape.phpmodifiercompiler.upper.phpmodifiercompiler.wordwrap.phpoutputfilter.trimwhitespace.phpshared.escape_special_chars.phpshared.literal_compiler_param.phpshared.make_timestamp.phpshared.mb_str_replace.phpshared.mb_unicode.phpshared.mb_wordwrap.phpvariablefilter.htmlspecialchars.php
sysplugins
index.htmlsmarty_cacheresource.phpsmarty_cacheresource_custom.phpsmarty_cacheresource_keyvaluestore.phpsmarty_config_source.phpsmarty_internal_cacheresource_file.phpsmarty_internal_compile_append.phpsmarty_internal_compile_assign.phpsmarty_internal_compile_block.phpsmarty_internal_compile_break.phpsmarty_internal_compile_call.phpsmarty_internal_compile_capture.phpsmarty_internal_compile_config_load.phpsmarty_internal_compile_continue.phpsmarty_internal_compile_debug.phpsmarty_internal_compile_eval.phpsmarty_internal_compile_extends.phpsmarty_internal_compile_for.phpsmarty_internal_compile_foreach.phpsmarty_internal_compile_function.phpsmarty_internal_compile_if.phpsmarty_internal_compile_include.phpsmarty_internal_compile_include_php.phpsmarty_internal_compile_insert.phpsmarty_internal_compile_ldelim.phpsmarty_internal_compile_nocache.phpsmarty_internal_compile_private_block_plugin.phpsmarty_internal_compile_private_function_plugin.phpsmarty_internal_compile_private_modifier.phpsmarty_internal_compile_private_object_block_function.phpsmarty_internal_compile_private_object_function.phpsmarty_internal_compile_private_print_expression.phpsmarty_internal_compile_private_registered_block.phpsmarty_internal_compile_private_registered_function.phpsmarty_internal_compile_private_special_variable.phpsmarty_internal_compile_rdelim.phpsmarty_internal_compile_section.phpsmarty_internal_compile_setfilter.phpsmarty_internal_compile_while.phpsmarty_internal_compilebase.phpsmarty_internal_config.phpsmarty_internal_config_file_compiler.phpsmarty_internal_configfilelexer.phpsmarty_internal_configfileparser.phpsmarty_internal_data.phpsmarty_internal_debug.phpsmarty_internal_filter_handler.phpsmarty_internal_function_call_handler.phpsmarty_internal_get_include_path.phpsmarty_internal_nocache_insert.phpsmarty_internal_parsetree.phpsmarty_internal_resource_eval.phpsmarty_internal_resource_extends.phpsmarty_internal_resource_file.phpsmarty_internal_resource_php.phpsmarty_internal_resource_registered.phpsmarty_internal_resource_stream.phpsmarty_internal_resource_string.phpsmarty_internal_smartytemplatecompiler.phpsmarty_internal_template.phpsmarty_internal_templatebase.phpsmarty_internal_templatecompilerbase.phpsmarty_internal_templatelexer.phpsmarty_internal_templateparser.phpsmarty_internal_utility.phpsmarty_internal_write_file.phpsmarty_resource.phpsmarty_resource_custom.phpsmarty_resource_recompiled.phpsmarty_resource_uncompiled.phpsmarty_security.php
ui
.DS_Store
cache
compiled
conf
index.htmllib
c
css
dt
dataTables.bootstrap.jsdatatables.jsindex.htmljquery.dataTables.jsjquery.dataTables.min.cssjquery.dataTables.min.js
index.htmljs
theme
.DS_Store
default
404.tpla404.tpladmin.tplapp-localisation.tplapp-settings.tplautoload-pool.tplautoload-server.tplautoload.tplbandwidth-add.tplbandwidth-edit.tplbandwidth.tplchange-password.tplcustomers-add.tplcustomers-edit.tplcustomers.tpldashboard.tpldbstatus.tplindex.htmlhotspot-add.tplhotspot-edit.tplhotspot.tpl
index.htmlfonts
font-awesome
css
fonts
fontawesome-webfontd41d.eotfontawesome-webfonte0a5.eotfontawesome-webfonte0a5.svgfontawesome-webfonte0a5.ttffontawesome-webfonte0a5.wofffontawesome-webfonte0a5.woff2index.html
index.htmlionicons
images
index.htmlinvoice-print.tplinvoice.tpllanguage-add.tpllogin.tplpool-add.tplpool-edit.tplpool.tplpppoe-add.tplpppoe-edit.tplpppoe.tplprepaid-edit.tplprepaid.tplprint-by-date.tplprint-by-period.tplrecharge-user.tplrecharge.tplrefill.tplreports-daily.tplreports-period-view.tplreports-period.tplrouters-add.tplrouters-edit.tplrouters.tplscripts
app.jsbootstrap.jsbootstrap.min.jsc3.init.jscalendar.init.jscustom.jsform-elements.init.jsinbox.init.jsindex.htmlindex.init.jsjquery-1.10.2.jsmaps.init.js
plugins
bootstrap-datepicker.min.jsbootstrap-rating.min.jsbootstrap-slider.min.jsc3.min.jsd3.min.jsfullcalendar.min.jsindex.htmljquery.dataTables.min.jsjquery.easypiechart.min.jsjquery.sparkline.min.jsmoment.min.jsperfect-scrollbar.min.jsscreenfull.jsselect2.min.jssummernote.min.jswaves.min.js
sparklines.init.jstables.init.jsvendors.jssections
styles
user-activation-list.tpluser-activation.tpluser-change-password.tpluser-dashboard.tpluser-profile.tplusers-add.tplusers-edit.tplusers.tplvoucher-add.tplvoucher.tpltheme1
407
ui/lib/dt/datatables.js
Normal file
407
ui/lib/dt/datatables.js
Normal file
@ -0,0 +1,407 @@
|
||||
/**
|
||||
* Theme: Montran Admin Template
|
||||
* Author: Coderthemes
|
||||
* Component: Datatable
|
||||
*
|
||||
*/
|
||||
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery','datatables'], factory);
|
||||
}
|
||||
else {
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
/* Set the defaults for DataTables initialisation */
|
||||
$.extend( true, $.fn.dataTable.defaults, {
|
||||
"sDom": "<'row'<'col-sm-12'<'pull-right'f><'pull-left'l>r<'clearfix'>>>t<'row'<'col-sm-12'<'pull-left'i><'pull-right'p><'clearfix'>>>",
|
||||
"sPaginationType": "bs_normal",
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "Show _MENU_ Rows",
|
||||
"sSearch": ""
|
||||
}
|
||||
} );
|
||||
|
||||
/* Default class modification */
|
||||
$.extend( $.fn.dataTableExt.oStdClasses, {
|
||||
"sWrapper": "dataTables_wrapper"
|
||||
} );
|
||||
|
||||
/* API method to get paging information */
|
||||
$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
|
||||
{
|
||||
return {
|
||||
"iStart": oSettings._iDisplayStart,
|
||||
"iEnd": oSettings.fnDisplayEnd(),
|
||||
"iLength": oSettings._iDisplayLength,
|
||||
"iTotal": oSettings.fnRecordsTotal(),
|
||||
"iFilteredTotal": oSettings.fnRecordsDisplay(),
|
||||
"iPage": oSettings._iDisplayLength === -1 ?
|
||||
0 : Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),
|
||||
"iTotalPages": oSettings._iDisplayLength === -1 ?
|
||||
0 : Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )
|
||||
};
|
||||
};
|
||||
|
||||
/* Bootstrap style pagination control */
|
||||
$.extend( $.fn.dataTableExt.oPagination, {
|
||||
"bs_normal": {
|
||||
"fnInit": function( oSettings, nPaging, fnDraw ) {
|
||||
var oLang = oSettings.oLanguage.oPaginate;
|
||||
var fnClickHandler = function ( e ) {
|
||||
e.preventDefault();
|
||||
if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {
|
||||
fnDraw( oSettings );
|
||||
}
|
||||
};
|
||||
$(nPaging).append(
|
||||
'<ul class="pagination">'+
|
||||
'<li class="prev disabled"><a href="#"><span class="fa fa-chevron-left"></span></a></li>'+
|
||||
'<li class="next disabled"><a href="#"><span class="fa fa-chevron-right"></span></a></li>'+
|
||||
'</ul>'
|
||||
);
|
||||
var els = $('a', nPaging);
|
||||
$(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
|
||||
$(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler );
|
||||
},
|
||||
"fnUpdate": function ( oSettings, fnDraw ) {
|
||||
var iListLength = 5;
|
||||
var oPaging = oSettings.oInstance.fnPagingInfo();
|
||||
var an = oSettings.aanFeatures.p;
|
||||
var i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
|
||||
if ( oPaging.iTotalPages < iListLength) {
|
||||
iStart = 1;
|
||||
iEnd = oPaging.iTotalPages;
|
||||
}
|
||||
else if ( oPaging.iPage <= iHalf ) {
|
||||
iStart = 1;
|
||||
iEnd = iListLength;
|
||||
} else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {
|
||||
iStart = oPaging.iTotalPages - iListLength + 1;
|
||||
iEnd = oPaging.iTotalPages;
|
||||
} else {
|
||||
iStart = oPaging.iPage - iHalf + 1;
|
||||
iEnd = iStart + iListLength - 1;
|
||||
}
|
||||
for ( i=0, ien=an.length ; i<ien ; i++ ) {
|
||||
$('li:gt(0)', an[i]).filter(':not(:last)').remove();
|
||||
for ( j=iStart ; j<=iEnd ; j++ ) {
|
||||
sClass = (j==oPaging.iPage+1) ? 'class="active"' : '';
|
||||
$('<li '+sClass+'><a href="#">'+j+'</a></li>')
|
||||
.insertBefore( $('li:last', an[i])[0] )
|
||||
.bind('click', function (e) {
|
||||
e.preventDefault();
|
||||
if ( oSettings.oApi._fnPageChange(oSettings, parseInt($('a', this).text(),10)-1) ) {
|
||||
fnDraw( oSettings );
|
||||
}
|
||||
} );
|
||||
}
|
||||
if ( oPaging.iPage === 0 ) {
|
||||
$('li:first', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:first', an[i]).removeClass('disabled');
|
||||
}
|
||||
|
||||
if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
|
||||
$('li:last', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:last', an[i]).removeClass('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs_two_button": {
|
||||
"fnInit": function ( oSettings, nPaging, fnCallbackDraw )
|
||||
{
|
||||
var oLang = oSettings.oLanguage.oPaginate;
|
||||
var oClasses = oSettings.oClasses;
|
||||
var fnClickHandler = function ( e ) {
|
||||
if ( oSettings.oApi._fnPageChange( oSettings, e.data.action ) )
|
||||
{
|
||||
fnCallbackDraw( oSettings );
|
||||
}
|
||||
};
|
||||
var sAppend = '<ul class="pagination">'+
|
||||
'<li class="prev"><a class="'+oSettings.oClasses.sPagePrevDisabled+'" tabindex="'+oSettings.iTabIndex+'" role="button"><span class="fa fa-chevron-left"></span> '+oLang.sPrevious+'</a></li>'+
|
||||
'<li class="next"><a class="'+oSettings.oClasses.sPageNextDisabled+'" tabindex="'+oSettings.iTabIndex+'" role="button">'+oLang.sNext+' <span class="fa fa-chevron-right"></span></a></li>'+
|
||||
'</ul>';
|
||||
$(nPaging).append( sAppend );
|
||||
var els = $('a', nPaging);
|
||||
var nPrevious = els[0],
|
||||
nNext = els[1];
|
||||
oSettings.oApi._fnBindAction( nPrevious, {action: "previous"}, fnClickHandler );
|
||||
oSettings.oApi._fnBindAction( nNext, {action: "next"}, fnClickHandler );
|
||||
if ( !oSettings.aanFeatures.p )
|
||||
{
|
||||
nPaging.id = oSettings.sTableId+'_paginate';
|
||||
nPrevious.id = oSettings.sTableId+'_previous';
|
||||
nNext.id = oSettings.sTableId+'_next';
|
||||
nPrevious.setAttribute('aria-controls', oSettings.sTableId);
|
||||
nNext.setAttribute('aria-controls', oSettings.sTableId);
|
||||
}
|
||||
},
|
||||
"fnUpdate": function ( oSettings, fnCallbackDraw )
|
||||
{
|
||||
if ( !oSettings.aanFeatures.p )
|
||||
{
|
||||
return;
|
||||
}
|
||||
var oPaging = oSettings.oInstance.fnPagingInfo();
|
||||
var oClasses = oSettings.oClasses;
|
||||
var an = oSettings.aanFeatures.p;
|
||||
var nNode;
|
||||
for ( var i=0, iLen=an.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( oPaging.iPage === 0 ) {
|
||||
$('li:first', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:first', an[i]).removeClass('disabled');
|
||||
}
|
||||
|
||||
if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
|
||||
$('li:last', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:last', an[i]).removeClass('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs_four_button": {
|
||||
"fnInit": function ( oSettings, nPaging, fnCallbackDraw )
|
||||
{
|
||||
var oLang = oSettings.oLanguage.oPaginate;
|
||||
var oClasses = oSettings.oClasses;
|
||||
var fnClickHandler = function ( e ) {
|
||||
e.preventDefault()
|
||||
if ( oSettings.oApi._fnPageChange( oSettings, e.data.action ) )
|
||||
{
|
||||
fnCallbackDraw( oSettings );
|
||||
}
|
||||
};
|
||||
$(nPaging).append(
|
||||
'<ul class="pagination">'+
|
||||
'<li class="disabled"><a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageFirst+'"><span class="fa fa-backward"></span> '+oLang.sFirst+'</a></li>'+
|
||||
'<li class="disabled"><a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPagePrevious+'"><span class="fa fa-chevron-left"></span> '+oLang.sPrevious+'</a></li>'+
|
||||
'<li><a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageNext+'">'+oLang.sNext+' <span class="fa fa-chevron-right"></span></a></li>'+
|
||||
'<li><a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageLast+'">'+oLang.sLast+' <span class="fa fa-forward"></span></a></li>'+
|
||||
'</ul>'
|
||||
);
|
||||
var els = $('a', nPaging);
|
||||
var nFirst = els[0],
|
||||
nPrev = els[1],
|
||||
nNext = els[2],
|
||||
nLast = els[3];
|
||||
oSettings.oApi._fnBindAction( nFirst, {action: "first"}, fnClickHandler );
|
||||
oSettings.oApi._fnBindAction( nPrev, {action: "previous"}, fnClickHandler );
|
||||
oSettings.oApi._fnBindAction( nNext, {action: "next"}, fnClickHandler );
|
||||
oSettings.oApi._fnBindAction( nLast, {action: "last"}, fnClickHandler );
|
||||
if ( !oSettings.aanFeatures.p )
|
||||
{
|
||||
nPaging.id = oSettings.sTableId+'_paginate';
|
||||
nFirst.id =oSettings.sTableId+'_first';
|
||||
nPrev.id =oSettings.sTableId+'_previous';
|
||||
nNext.id =oSettings.sTableId+'_next';
|
||||
nLast.id =oSettings.sTableId+'_last';
|
||||
}
|
||||
},
|
||||
"fnUpdate": function ( oSettings, fnCallbackDraw )
|
||||
{
|
||||
if ( !oSettings.aanFeatures.p )
|
||||
{
|
||||
return;
|
||||
}
|
||||
var oPaging = oSettings.oInstance.fnPagingInfo();
|
||||
var oClasses = oSettings.oClasses;
|
||||
var an = oSettings.aanFeatures.p;
|
||||
var nNode;
|
||||
for ( var i=0, iLen=an.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( oPaging.iPage === 0 ) {
|
||||
$('li:eq(0)', an[i]).addClass('disabled');
|
||||
$('li:eq(1)', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:eq(0)', an[i]).removeClass('disabled');
|
||||
$('li:eq(1)', an[i]).removeClass('disabled');
|
||||
}
|
||||
|
||||
if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
|
||||
$('li:eq(2)', an[i]).addClass('disabled');
|
||||
$('li:eq(3)', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:eq(2)', an[i]).removeClass('disabled');
|
||||
$('li:eq(3)', an[i]).removeClass('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs_full": {
|
||||
"fnInit": function ( oSettings, nPaging, fnCallbackDraw )
|
||||
{
|
||||
var oLang = oSettings.oLanguage.oPaginate;
|
||||
var oClasses = oSettings.oClasses;
|
||||
var fnClickHandler = function ( e ) {
|
||||
if ( oSettings.oApi._fnPageChange( oSettings, e.data.action ) )
|
||||
{
|
||||
fnCallbackDraw( oSettings );
|
||||
}
|
||||
};
|
||||
$(nPaging).append(
|
||||
'<ul class="pagination">'+
|
||||
'<li class="disabled"><a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageFirst+'">'+oLang.sFirst+'</a></li>'+
|
||||
'<li class="disabled"><a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPagePrevious+'">'+oLang.sPrevious+'</a></li>'+
|
||||
'<li><a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageNext+'">'+oLang.sNext+'</a></li>'+
|
||||
'<li><a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageLast+'">'+oLang.sLast+'</a></li>'+
|
||||
'</ul>'
|
||||
);
|
||||
var els = $('a', nPaging);
|
||||
var nFirst = els[0],
|
||||
nPrev = els[1],
|
||||
nNext = els[2],
|
||||
nLast = els[3];
|
||||
oSettings.oApi._fnBindAction( nFirst, {action: "first"}, fnClickHandler );
|
||||
oSettings.oApi._fnBindAction( nPrev, {action: "previous"}, fnClickHandler );
|
||||
oSettings.oApi._fnBindAction( nNext, {action: "next"}, fnClickHandler );
|
||||
oSettings.oApi._fnBindAction( nLast, {action: "last"}, fnClickHandler );
|
||||
if ( !oSettings.aanFeatures.p )
|
||||
{
|
||||
nPaging.id = oSettings.sTableId+'_paginate';
|
||||
nFirst.id =oSettings.sTableId+'_first';
|
||||
nPrev.id =oSettings.sTableId+'_previous';
|
||||
nNext.id =oSettings.sTableId+'_next';
|
||||
nLast.id =oSettings.sTableId+'_last';
|
||||
}
|
||||
},
|
||||
"fnUpdate": function ( oSettings, fnCallbackDraw )
|
||||
{
|
||||
if ( !oSettings.aanFeatures.p )
|
||||
{
|
||||
return;
|
||||
}
|
||||
var oPaging = oSettings.oInstance.fnPagingInfo();
|
||||
var iPageCount = $.fn.dataTableExt.oPagination.iFullNumbersShowPages;
|
||||
var iPageCountHalf = Math.floor(iPageCount / 2);
|
||||
var iPages = Math.ceil((oSettings.fnRecordsDisplay()) / oSettings._iDisplayLength);
|
||||
var iCurrentPage = Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength) + 1;
|
||||
var sList = "";
|
||||
var iStartButton, iEndButton, i, iLen;
|
||||
var oClasses = oSettings.oClasses;
|
||||
var anButtons, anStatic, nPaginateList, nNode;
|
||||
var an = oSettings.aanFeatures.p;
|
||||
var fnBind = function (j) {
|
||||
oSettings.oApi._fnBindAction( this, {"page": j+iStartButton-1}, function(e) {
|
||||
if( oSettings.oApi._fnPageChange( oSettings, e.data.page ) ){
|
||||
fnCallbackDraw( oSettings );
|
||||
}
|
||||
e.preventDefault();
|
||||
} );
|
||||
};
|
||||
if ( oSettings._iDisplayLength === -1 )
|
||||
{
|
||||
iStartButton = 1;
|
||||
iEndButton = 1;
|
||||
iCurrentPage = 1;
|
||||
}
|
||||
else if (iPages < iPageCount)
|
||||
{
|
||||
iStartButton = 1;
|
||||
iEndButton = iPages;
|
||||
}
|
||||
else if (iCurrentPage <= iPageCountHalf)
|
||||
{
|
||||
iStartButton = 1;
|
||||
iEndButton = iPageCount;
|
||||
}
|
||||
else if (iCurrentPage >= (iPages - iPageCountHalf))
|
||||
{
|
||||
iStartButton = iPages - iPageCount + 1;
|
||||
iEndButton = iPages;
|
||||
}
|
||||
else
|
||||
{
|
||||
iStartButton = iCurrentPage - Math.ceil(iPageCount / 2) + 1;
|
||||
iEndButton = iStartButton + iPageCount - 1;
|
||||
}
|
||||
for ( i=iStartButton ; i<=iEndButton ; i++ )
|
||||
{
|
||||
sList += (iCurrentPage !== i) ?
|
||||
'<li><a tabindex="'+oSettings.iTabIndex+'">'+oSettings.fnFormatNumber(i)+'</a></li>' :
|
||||
'<li class="active"><a tabindex="'+oSettings.iTabIndex+'">'+oSettings.fnFormatNumber(i)+'</a></li>';
|
||||
}
|
||||
for ( i=0, iLen=an.length ; i<iLen ; i++ )
|
||||
{
|
||||
nNode = an[i];
|
||||
if ( !nNode.hasChildNodes() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$('li:gt(1)', an[i]).filter(':not(li:eq(-2))').filter(':not(li:eq(-1))').remove();
|
||||
if ( oPaging.iPage === 0 ) {
|
||||
$('li:eq(0)', an[i]).addClass('disabled');
|
||||
$('li:eq(1)', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:eq(0)', an[i]).removeClass('disabled');
|
||||
$('li:eq(1)', an[i]).removeClass('disabled');
|
||||
}
|
||||
if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
|
||||
$('li:eq(-1)', an[i]).addClass('disabled');
|
||||
$('li:eq(-2)', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:eq(-1)', an[i]).removeClass('disabled');
|
||||
$('li:eq(-2)', an[i]).removeClass('disabled');
|
||||
}
|
||||
$(sList)
|
||||
.insertBefore($('li:eq(-2)', an[i]))
|
||||
.bind('click', function (e) {
|
||||
e.preventDefault();
|
||||
if ( oSettings.oApi._fnPageChange(oSettings, parseInt($('a', this).text(),10)-1) ) {
|
||||
fnCallbackDraw( oSettings );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
/*
|
||||
* TableTools Bootstrap compatibility
|
||||
* Required TableTools 2.1+
|
||||
*/
|
||||
if ( $.fn.DataTable.TableTools ) {
|
||||
// Set the classes that TableTools uses to something suitable for Bootstrap
|
||||
$.extend( true, $.fn.DataTable.TableTools.classes, {
|
||||
"container": "DTTT btn-group",
|
||||
"buttons": {
|
||||
"normal": "btn btn-default",
|
||||
"disabled": "disabled"
|
||||
},
|
||||
"collection": {
|
||||
"container": "DTTT_dropdown dropdown-menu",
|
||||
"buttons": {
|
||||
"normal": "",
|
||||
"disabled": "disabled"
|
||||
}
|
||||
},
|
||||
"print": {
|
||||
"info": "DTTT_print_info"
|
||||
},
|
||||
"select": {
|
||||
"row": "active"
|
||||
}
|
||||
} );
|
||||
|
||||
// Have the collection use a bootstrap compatible dropdown
|
||||
$.extend( true, $.fn.DataTable.TableTools.DEFAULTS.oTags, {
|
||||
"collection": {
|
||||
"container": "ul",
|
||||
"button": "li",
|
||||
"liner": "a"
|
||||
}
|
||||
} );
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user