310 lines
10 KiB
PHP
310 lines
10 KiB
PHP
<?php ?>
|
|
<style>
|
|
|
|
</style>
|
|
|
|
<div id="content">
|
|
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-7 col-md-7 col-lg-4">
|
|
<h1 class="page-title txt-color-blueDark">
|
|
<i class="fa fa-table fa-fw "></i>
|
|
Infos
|
|
<span>>
|
|
Clients
|
|
</span>
|
|
</h1>
|
|
</div>
|
|
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-8">
|
|
<ul id="sparks" class="">
|
|
<li class="sparks-info">
|
|
<h5> Clients actif <span class="txt-color-blue" id="Clients_actif"> </span></h5>
|
|
|
|
</li>
|
|
<li class="sparks-info">
|
|
|
|
</li>
|
|
<li class="sparks-info">
|
|
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!-- widget grid -->
|
|
<section id="widget-grid" class="">
|
|
|
|
<!-- row -->
|
|
<div class="row">
|
|
|
|
<!-- NEW WIDGET START -->
|
|
<article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
|
|
|
<!-- Widget ID (each widget will need unique ID)-->
|
|
<div class="jarviswidget jarviswidget-color-orange" id="wid-id-0" data-widget-editbutton="false" data-widget-colorbutton="true" data-widget-deletebutton="false" >
|
|
<!-- widget options:
|
|
usage: <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">
|
|
|
|
data-widget-colorbutton="false"
|
|
data-widget-editbutton="false"
|
|
data-widget-togglebutton="false"
|
|
data-widget-deletebutton="false"
|
|
data-widget-fullscreenbutton="false"
|
|
data-widget-custombutton="false"
|
|
data-widget-collapsed="true"
|
|
data-widget-sortable="false"
|
|
|
|
-->
|
|
|
|
<header>
|
|
<span class="widget-icon"> <i class="fa fa-table"></i></span>
|
|
<h2> Clients</h2>
|
|
<h2>
|
|
<div class="onoffswitch-align-right">
|
|
<span class="onoffswitch-title"> Non actif</span>
|
|
<?php
|
|
$mem_check="";
|
|
if ($this->Config_model->conf_getFiltreData($this->session->id,'list_client','mem_listactive',1,0,1)==0)
|
|
$mem_check="checked";
|
|
?>
|
|
|
|
<span class="onoffswitch">
|
|
<input type="checkbox" class="onoffswitch-checkbox" id="inline" <?php echo($mem_check)?>>
|
|
<label class="onoffswitch-label" for="inline">
|
|
<span class="onoffswitch-inner" data-swchon-text="ON" data-swchoff-text="OFF"></span>
|
|
<span class="onoffswitch-switch"></span>
|
|
</label>
|
|
</span>
|
|
<span class="onoffswitch-title">terminé/payé/annulé</span>
|
|
<?php
|
|
$mem_check="";
|
|
if ($this->Config_model->conf_getFiltreData($this->session->id,'list_client','mem_projetsactive',1,0,1)==0)
|
|
$mem_check="checked";
|
|
?>
|
|
<span class="onoffswitch">
|
|
<input type="checkbox" class="onoffswitch-checkbox" id="inlineprojets" <?php echo($mem_check)?>>
|
|
<label class="onoffswitch-label" for="inlineprojets">
|
|
<span class="onoffswitch-inner" data-swchon-text="ON" data-swchoff-text="OFF"></span>
|
|
<span class="onoffswitch-switch"></span>
|
|
</label>
|
|
</span>
|
|
|
|
|
|
</div>
|
|
</h2>
|
|
|
|
</header>
|
|
|
|
<!-- widget div-->
|
|
<div>
|
|
|
|
<!-- widget edit box -->
|
|
<div class="jarviswidget-editbox">
|
|
<!-- This area used as dropdown edit box -->
|
|
|
|
</div>
|
|
<!-- end widget edit box -->
|
|
|
|
<!-- widget content -->
|
|
<div class="widget-body no-padding">
|
|
|
|
<div class="emp" id='employeeList'>
|
|
</div>
|
|
<div id='pagination' >
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<!-- end widget content -->
|
|
|
|
</div>
|
|
<!-- end widget div -->
|
|
|
|
</div>
|
|
|
|
</article>
|
|
<!-- WIDGET END -->
|
|
|
|
</div>
|
|
|
|
<!-- end row -->
|
|
|
|
<!-- end row -->
|
|
|
|
</section>
|
|
<!-- end widget grid -->
|
|
|
|
</div>
|
|
|
|
<!-- END MAIN PANEL -->
|
|
|
|
<!-- ==========================CONTENT ENDS HERE ========================== -->
|
|
|
|
<script type='text/javascript'>
|
|
mem_select=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_client','mem_select_4',0,0);?>;
|
|
|
|
var mem_listactive=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_client','mem_listactive',1,0);?>;
|
|
var mem_projetsactive=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_client','mem_projetsactive',1,0);?>;
|
|
mem_excel=0;
|
|
$(document).ready(function() {
|
|
|
|
$("body").on("click", ".emp a", function(){
|
|
|
|
memid=$(this).attr("id") ;
|
|
if (event.target.id=='excel'){
|
|
var x = $(this).attr("data-id");
|
|
var z = $(this).attr("data-filtre1");
|
|
//alert(z);
|
|
createPagination(0,1,x,z);
|
|
|
|
|
|
}
|
|
});
|
|
$("#inline").change( function(){
|
|
if(this.checked) {
|
|
mem_listactive=0
|
|
}else{
|
|
mem_listactive=1
|
|
}
|
|
|
|
createPagination(0);
|
|
});
|
|
$("#inlineprojets").change( function(){
|
|
if(this.checked) {
|
|
mem_projetsactive=0
|
|
}else{
|
|
mem_projetsactive=1
|
|
}
|
|
|
|
createPagination(0);
|
|
});
|
|
|
|
|
|
createPagination(0);
|
|
$('#pagination').on('click','a',function(e){
|
|
e.preventDefault();
|
|
var pageNum = $(this).attr('data-ci-pagination-page');
|
|
createPagination(pageNum);
|
|
});
|
|
|
|
|
|
$("body").on("keypress", "input.filtre_1", function(e){
|
|
if(e.which == 13) {
|
|
createPagination(0,1)
|
|
}
|
|
});
|
|
$("body").on("keypress", "input.filtre_2", function(e){
|
|
if(e.which == 13) {
|
|
createPagination(0,2)
|
|
}
|
|
|
|
});
|
|
$("body").on("keyup", "input.filtre_3", function(e){
|
|
if(e.which == 13) {
|
|
createPagination(0,3)
|
|
}
|
|
});
|
|
$("body").on("change", ".filtre_4", function(){
|
|
var optionSelected = $("option:selected", this);
|
|
mem_select = this.value;
|
|
|
|
createPagination(0,4);
|
|
|
|
});
|
|
|
|
(function($){
|
|
$.fn.focusTextToEnd = function(){
|
|
this.focus();
|
|
var $thisVal = this.val();
|
|
this.val('').val($thisVal);
|
|
return this;
|
|
}
|
|
}(jQuery));
|
|
|
|
|
|
|
|
function createPagination(pageNum,nofiltre=1,excel=0,filtre1=0){
|
|
|
|
//alert(excel);
|
|
if (typeof $('input.filtre_1').val()!=='undefined' )
|
|
mem_filtre_1=$('input.filtre_1').val().trim();
|
|
else
|
|
mem_filtre_1=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_client','mem_select_1','null',0,0);?>;
|
|
|
|
|
|
if (typeof $('input.filtre_2').val()!=='undefined' ){
|
|
|
|
mem_filtre_2=$('input.filtre_2').val().trim();}
|
|
else
|
|
mem_filtre_2=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_client','mem_select_2','null',0,0);?>;
|
|
|
|
if (typeof $('input.filtre_3').val()!=='undefined' ){
|
|
|
|
mem_filtre_3=$('input.filtre_3').val().trim();}
|
|
else
|
|
mem_filtre_3=<?php echo $this->Config_model->conf_getFiltreData($this->session->id,'list_client','mem_select_3','null',0,0);?>;
|
|
|
|
if(mem_filtre_1=="")
|
|
mem_filtre_1="null";
|
|
if(mem_filtre_2=="")
|
|
mem_filtre_2="null";
|
|
if(mem_filtre_3=="")
|
|
mem_filtre_3="null";
|
|
|
|
if (mem_select==0)
|
|
mem_filtre_4='null';
|
|
else
|
|
mem_filtre_4=mem_select;
|
|
|
|
if (filtre1!=0){
|
|
|
|
mem_filtre_1=filtre1;
|
|
|
|
}
|
|
|
|
//test='<?=base_url()?>index.php/Clients/loadData_list/'+pageNum+'/'+mem_filtre_1+'/'+mem_filtre_2+'/'+mem_filtre_3+'/'+mem_filtre_4+'/'+mem_listactive+'/'+mem_projetsactive+'/'+excel;
|
|
//alert(test);
|
|
$.ajax({
|
|
url: '<?=base_url()?>index.php/Clients/loadData_list/'+pageNum+'/'+mem_filtre_1+'/'+mem_filtre_2+'/'+mem_filtre_3+'/'+mem_filtre_4+'/'+mem_listactive+'/'+mem_projetsactive+'/'+excel,
|
|
type: 'get',
|
|
dataType: 'json',
|
|
success: function(responseData){
|
|
|
|
$('#pagination').html(responseData.pagination);
|
|
$('#employeeList').empty();
|
|
$('#employeeList').html(responseData.empData);
|
|
$('#Clients_actif').empty();
|
|
$('#Clients_actif').html(responseData.recordCount);
|
|
|
|
$('input.filtre_'+nofiltre).focusTextToEnd();
|
|
if(excel!=0)
|
|
{
|
|
|
|
location.replace('/data/clients.xls' );
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
});
|
|
(function () {
|
|
|
|
window.ms1SubmitEtapeUnique = function (el, url) {
|
|
|
|
var f = document.createElement('form');
|
|
f.method = 'POST';
|
|
f.action = url;
|
|
f.style.display = 'none';
|
|
|
|
var i = document.createElement('input');
|
|
i.type = 'hidden';
|
|
i.name = el.name;
|
|
i.value = el.value;
|
|
|
|
f.appendChild(i);
|
|
document.body.appendChild(f);
|
|
f.submit();
|
|
};
|
|
|
|
})();
|
|
|
|
</script>
|