126 lines
4.1 KiB
PHP
126 lines
4.1 KiB
PHP
|
|
|
|
mem_select=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_utilisateur','mem_select_3',0,0);?>;
|
|
var mem_listactive=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_utilisateur','mem_listactive',1,0);?>;
|
|
|
|
if ('<?php echo($new);?>'=='new'){
|
|
createpagination_utilisateur(0,1,0);
|
|
|
|
}else{
|
|
createpagination_utilisateur(0);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$("#inline").change( function(){
|
|
if(this.checked) {
|
|
mem_listactive=0
|
|
}else{
|
|
mem_listactive=1
|
|
}
|
|
//alert(mem_listactive);
|
|
createpagination_utilisateur(0);
|
|
});
|
|
|
|
$("body").on("click", ".emp a", function(){
|
|
|
|
$.ajax({
|
|
url: '<?=base_url()?>index.php/user/form/'+$(this).attr("data-id"),
|
|
type: 'get',
|
|
dataType: 'json',
|
|
success: function(responseData){
|
|
|
|
|
|
|
|
$('#modal_info').html(responseData);
|
|
|
|
|
|
|
|
}
|
|
});
|
|
$('#myModal').modal('show');
|
|
});
|
|
|
|
$('#pagination_utilisateur').on('click','a',function(e){
|
|
e.preventDefault();
|
|
var pageNum = $(this).attr('data-ci-pagination-page');
|
|
createpagination_utilisateur(pageNum);
|
|
});
|
|
|
|
|
|
|
|
|
|
$("body").on("keyup", "input.filtre_utilisateur_1", function(e){
|
|
if(e.which == 13) {
|
|
createpagination_utilisateur(0,1)
|
|
}
|
|
});
|
|
$("body").on("keyup", "input.filtre_utilisateur_2", function(e){
|
|
if(e.which == 13) {
|
|
createpagination_utilisateur(0,2)
|
|
}
|
|
});
|
|
mem_select=0;
|
|
$("body").on("change", ".filtre_utilisateur_3", function(){
|
|
var optionSelected = $("option:selected", this);
|
|
mem_select = this.value;
|
|
|
|
createpagination_utilisateur(0,3)
|
|
|
|
});
|
|
|
|
(function($){
|
|
$.fn.focusTextToEnd = function(){
|
|
this.focus();
|
|
var $thisVal = this.val();
|
|
this.val('').val($thisVal);
|
|
return this;
|
|
}
|
|
}(jQuery));
|
|
|
|
function createpagination_utilisateur(pageNum,nofiltre=1,focus=1){
|
|
|
|
if (typeof $('input.filtre_produits_1').val()!=='undefined')
|
|
mem_filtre_utilisateur_1=$('input.filtre_produits_1').val().trim();
|
|
else
|
|
mem_filtre_utilisateur_1=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_utilisateur','mem_select_1','null',0,0);?>;
|
|
;
|
|
|
|
if (typeof $('input.filtre_utilisateur_2').val()!=='undefined') {
|
|
|
|
mem_filtre_utilisateur_2=$('input.filtre_produits_2').val().trim();}
|
|
else
|
|
mem_filtre_utilisateur_2=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_utilisateur','mem_select_2','null',0,0);?>;
|
|
if (mem_filtre_utilisateur_2=="")
|
|
mem_filtre_utilisateur_2="null";
|
|
if (mem_filtre_utilisateur_1=="")
|
|
mem_filtre_utilisateur_1="null";
|
|
if (mem_select!=0)
|
|
|
|
mem_filtre_utilisateur_3=mem_select;
|
|
else
|
|
mem_filtre_utilisateur_3='null';
|
|
$.ajax({
|
|
url: '<?=base_url()?>index.php/user/loadData_list/'+pageNum+'/'+mem_filtre_utilisateur_1+'/'+mem_filtre_utilisateur_2+'/'+mem_filtre_utilisateur_3+'/'+mem_listactive+'/<?php echo($model_de_produits);?>' ,
|
|
type: 'get',
|
|
dataType: 'json',
|
|
success: function(responseData){
|
|
console.log(responseData);
|
|
$('#pagination_utilisateur').empty();
|
|
$('#pagination_utilisateur').html(responseData.pagination);
|
|
$('#utilisateur_list').empty();
|
|
$('#utilisateur_list').html(responseData.list);
|
|
$('#utilisateur_actif').empty();
|
|
$('#utilisateur_actif').html(responseData.recordCount);
|
|
if (focus==1)
|
|
$('input.filtre_utilisateur_'+nofiltre).focusTextToEnd();
|
|
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|