203 lines
5.2 KiB
PHP
203 lines
5.2 KiB
PHP
|
|
mem_select=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_projetstaches','mem_select_3',0,0);?>;
|
|
|
|
|
|
// START AND FINISH DATE
|
|
$('#date_debut').datepicker({
|
|
dateFormat: 'yy-mm-dd',
|
|
prevText: '<i class="fa fa-chevron-left"></i>',
|
|
nextText: '<i class="fa fa-chevron-right"></i>',
|
|
onSelect: function (selectedDate) {
|
|
$('#date_fin').datepicker('option', 'minDate', selectedDate);
|
|
createpagination_fournisseurs(0);
|
|
|
|
}
|
|
});
|
|
$('#date_fin').datepicker({
|
|
dateFormat: 'yy-mm-dd',
|
|
prevText: '<i class="fa fa-chevron-left"></i>',
|
|
nextText: '<i class="fa fa-chevron-right"></i>',
|
|
onSelect: function (selectedDate) {
|
|
$('#date_debut').datepicker('option', 'maxDate', selectedDate);
|
|
createpagination_fournisseurs(0);
|
|
}
|
|
});
|
|
$('#aqui').on('change', function() {
|
|
createpagination_fournisseurs(0);
|
|
});
|
|
$('#proj_etape').on('change', function() {
|
|
createpagination_fournisseurs(0);
|
|
});
|
|
$('#proj_type').on('change', function() {
|
|
createpagination_fournisseurs(0);
|
|
});
|
|
$('#proj_dest').on('change', function() {
|
|
createpagination_fournisseurs(0);
|
|
});
|
|
$('#proj_num').on('change', function() {
|
|
createpagination_fournisseurs(0);
|
|
});
|
|
$('#proj_compagnie').on('change', function() {
|
|
createpagination_fournisseurs(0);
|
|
});
|
|
<?php
|
|
if ($model_de_fournisseur=="liste"){
|
|
?>
|
|
|
|
createpagination_fournisseurs(0);
|
|
<?php
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
$('#pagination_fournisseurs').on('click','a',function(e){
|
|
e.preventDefault();
|
|
var pageNum = $(this).attr('data-ci-pagination-page');
|
|
createpagination_fournisseurs(pageNum);
|
|
});
|
|
|
|
$("body").on("keyup", "input.filtre_fournisseurs_1", function(e){
|
|
if(e.which == 13) {
|
|
createpagination_fournisseurs(0,1)
|
|
}
|
|
});
|
|
$("body").on("keyup", "input.filtre_fournisseurs_2", function(e){
|
|
if(e.which == 13) {
|
|
createpagination_fournisseurs(0,2)
|
|
}
|
|
});
|
|
|
|
$("body").on("change", ".filtre_fournisseurs_3", function(){
|
|
|
|
|
|
createpagination_fournisseurs(0,3)
|
|
|
|
});
|
|
(function($){
|
|
$.fn.focusTextToEnd = function(){
|
|
this.focus();
|
|
var $thisVal = this.val();
|
|
this.val('').val($thisVal);
|
|
return this;
|
|
}
|
|
}(jQuery));
|
|
function createpagination_fournisseurs(pageNum,nofiltre=1,excel=0){
|
|
|
|
mem_debut=$('#date_debut').val();
|
|
|
|
mem_fin=$('#date_fin').val();
|
|
mem_aqui=$('#aqui').val();
|
|
mem_proj_etape=$('#proj_etape').val();
|
|
mem_proj_type=$('#proj_type').val();
|
|
mem_proj_dest=$('#proj_dest').val();
|
|
mem_proj_num=$('#proj_num').val();
|
|
mem_proj_compagnie=$('#proj_compagnie').val();
|
|
|
|
if(mem_proj_num.trim()==''){
|
|
mem_proj_num='null';
|
|
}
|
|
if(mem_proj_compagnie.trim()==''){
|
|
mem_proj_compagnie='null';
|
|
}
|
|
//alert('index.php/TachesProjets/loadData_list/'+pageNum+'/'+mem_aqui +'/'+mem_proj_etape +'/'+mem_proj_type +'/'+mem_proj_dest +'/'+mem_debut+'/'+mem_fin+'/'+mem_proj_num+'/'+mem_proj_compagnie+'/1/<?php echo($model_de_fournisseur);?>/'+excel);
|
|
$.ajax({
|
|
url: '<?=base_url()?>index.php/TachesProjets/loadData_list/'+pageNum+'/'+mem_aqui +'/'+mem_proj_etape +'/'+mem_proj_type +'/'+mem_proj_dest +'/'+mem_debut+'/'+mem_fin+'/'+mem_proj_num+'/'+mem_proj_compagnie+'/1/<?php echo($model_de_fournisseur);?>/'+excel,
|
|
type: 'get',
|
|
dataType: 'json',
|
|
success: function(responseData){
|
|
$('#pagination_fournisseurs').empty();
|
|
$('#pagination_fournisseurs').html(responseData.pagination);
|
|
$('#fournisseurs_List').empty();
|
|
$('#fournisseurs_List').html(responseData.list);
|
|
|
|
$('#Fournisseurs_actif').empty();
|
|
$('#Fournisseurs_actif').html(responseData.recordCount);
|
|
|
|
$('input.filtre_fournisseurs_'+nofiltre).focusTextToEnd();
|
|
|
|
//alert('TachesProjets/loadData_list/'+pageNum+'/'+mem_filtre_fournisseurs_1+'/'+mem_filtre_fournisseurs_2+'/'+mem_filtre_fournisseurs_3+'/'+mem_debut+'/'+mem_fin+'/1/<?php echo($model_de_fournisseur);?>/'+excel);
|
|
|
|
if(excel!=0)
|
|
{
|
|
|
|
location.replace('/data/projetstaches.xls' );
|
|
}
|
|
|
|
}
|
|
});
|
|
}
|
|
mem_excel=0;
|
|
memid='';
|
|
$("body").on("click", ".emp a", function(){
|
|
|
|
memid=$(this).attr("id") ;
|
|
|
|
|
|
if (typeof $(this).data('section') != 'undefined'){
|
|
var section = $(this).data('section');
|
|
|
|
var section_id = $(this).data('section_id')
|
|
var section = $(this).data('section')
|
|
var id = $(this).data('id')
|
|
//alert('index.php/projets/form_tache/'+id+'/'+section+'/'+section_id+'/list')
|
|
$.ajax({
|
|
|
|
url: '<?=base_url()?>index.php/projets/form_tache/'+id+'/'+section+'/'+section_id+'/listprojets' ,
|
|
type: 'get',
|
|
dataType: 'json',
|
|
success: function(responseData){
|
|
|
|
$('#modal_info').html(responseData) ;
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$('#myModal').modal('show');
|
|
var section = $(this).data('section');
|
|
var id = $(this).data('id');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (event.target.id=='excel'){
|
|
var x = $(this).attr("data-id");
|
|
|
|
createpagination_fournisseurs(0,3,x);
|
|
|
|
}else{
|
|
|
|
if (typeof memid != 'undefined'){
|
|
if (memid.substring(0, 2)=='bt'){
|
|
var x = document.getElementById($(this).attr("data-id"));
|
|
|
|
if (x.style.display === "none") {
|
|
x.style.display = "block";
|
|
} else {
|
|
x.style.display = "none";
|
|
}
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
};
|
|
}
|
|
});
|
|
|
|
|