var p = getUrlParameter( "p" );
var u = getUrlParameter( "u" );

$( document ).ready( function() {
	var columnDefs = [];
	if ( u != 3 && p === "es" ) {
		columnDefs = [
			{ targets: [1], className: "hidden" }
		];
	}
	
	searching = false;
	if ( p !== "es" ) {
		searching = true;
	} 

    var myTable = $( "#MyTable_controller" ).DataTable( {
		"dom": "frtip",
        "paging": false,
        "searching": searching,
        "ordering": false, 
		"info": false,
		"autoWidth": false,
		"fixedHeader": {
			header: true,
			footer: false
		},
        "columnDefs": columnDefs,
		"language": {
			"searchPlaceholder": "Search...",
			"emptyTable": "No data"
		}
    } );
	
	if ( p !== "es" ) {
		$( ".dt-search input" ).removeClass( "ui input" ).addClass( "form-control shadow-sm" );
		$( ".dt-search" ).appendTo( ".dt-search-placeholder" );
		$( ".dt-search" ).not( "input" ).remove();
	}
} );