296 lines
8.8 KiB
PHP
296 lines
8.8 KiB
PHP
<?php
|
|
if (!isset($listactivechange))
|
|
$listactivechange=1;
|
|
|
|
|
|
?>
|
|
<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>
|
|
Lots
|
|
<span>>
|
|
|
|
</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> Lots actif <span class="txt-color-blue" id="Produits_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>Lots</h2>
|
|
<h2>
|
|
|
|
<div class="onoffswitch-align-right">
|
|
|
|
<?php
|
|
$mem_check="";
|
|
if ($listactivechange==1)
|
|
$mem_check="checked";
|
|
?>
|
|
|
|
<span class="onoffswitch-title"> Lot a faire</span>
|
|
<span class="onoffswitch">
|
|
<input <?php echo $mem_check;?> type="checkbox" class="onoffswitch-checkbox " id="inline">
|
|
<label class="onoffswitch-label" for="inline">
|
|
<span class="onoffswitch-inner" data-swchon-text="OUI" data-swchoff-text="NON"></span>
|
|
<span class="onoffswitch-switch"></span>
|
|
</label>
|
|
</span>
|
|
</div>
|
|
</h2>
|
|
<button id="reset" type="button" class="btn btn-danger btn-circle glyphicon glyphicon-check"> </button>'
|
|
|
|
</header>
|
|
|
|
<!-- widget div-->
|
|
<div>
|
|
|
|
<!-- widget edit box -->
|
|
<div class="jarviswidget-editbox">
|
|
<!-- This area used as dropdown edit box -->
|
|
|
|
</div>
|
|
<!-- end widget edit box -->
|
|
<?php echo form_open('lots/prepare_lot/', 'class="smart-form" id="saveRecord"');
|
|
?>
|
|
<!-- widget content -->
|
|
<div class="widget-body no-padding">
|
|
|
|
<div class="emp" id='produits_list'>
|
|
</div>
|
|
<div id='pagination_produits' >
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<!-- end widget content -->
|
|
<?php
|
|
echo form_close();
|
|
?>
|
|
</div>
|
|
<!-- end widget div -->
|
|
|
|
</div>
|
|
|
|
</article>
|
|
<!-- WIDGET END -->
|
|
|
|
</div>
|
|
|
|
<!-- end row -->
|
|
|
|
<!-- end row -->
|
|
|
|
</section>
|
|
<!-- end widget grid -->
|
|
<!-- Modal -->
|
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
|
×
|
|
</button>
|
|
<h4 class="modal-title">
|
|
<img src="<?php echo ASSETS_URL; ?>/img/logo.png" width="150" alt="SmartAdmin">
|
|
</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div id="modal_info">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div><!-- /.modal-content -->
|
|
</div><!-- /.modal-dialog -->
|
|
|
|
</div><!-- /.modal -->
|
|
|
|
</div>
|
|
|
|
<!-- END MAIN PANEL -->
|
|
|
|
<!-- ==========================CONTENT ENDS HERE ========================== -->
|
|
<script>
|
|
$(document).ready(function() {
|
|
mem_reset=false;
|
|
|
|
mem_filtre_produits_3='null';
|
|
mem_filtre_produits_1='null';
|
|
$("body").on("change", ".filtre_produits_3", function(){
|
|
var optionSelected = $("option:selected", this);
|
|
mem_select = this.value;
|
|
|
|
if (mem_select==0)
|
|
mem_filtre_produits_3='null';
|
|
else
|
|
mem_filtre_produits_3=mem_select;
|
|
createpagination_produits(0,3);
|
|
// createpagination_fournisseurs(0,3)
|
|
|
|
});
|
|
|
|
$("body").on("keyup", ".filtre_produits_1", function(e){
|
|
|
|
if(e.which == 13) {
|
|
mem_filtre_produits_1=$('input.filtre_produits_1').val();
|
|
|
|
createpagination_produits(0,1);
|
|
// createpagination_fournisseurs(0,3)
|
|
}
|
|
});
|
|
|
|
function reset_selection(){
|
|
var checkboxes = document.getElementsByName('go[]');
|
|
for (var i=0, len=checkboxes.length; i<len; i++) {
|
|
// alert(checkboxes[i].value);
|
|
checkboxes[i].checked=mem_reset;
|
|
};
|
|
if ( mem_reset==true)
|
|
mem_reset=false;
|
|
else
|
|
mem_reset=true;
|
|
}
|
|
|
|
$("#reset").click( function(){
|
|
reset_selection();
|
|
|
|
});
|
|
|
|
|
|
var mem_select=0;
|
|
var mem_listactive=<?php echo $listactivechange;?>;
|
|
|
|
|
|
createpagination_produits(0);
|
|
|
|
|
|
|
|
|
|
$("#inline").change( function(){
|
|
if(this.checked) {
|
|
mem_listactive=1;
|
|
|
|
}else{
|
|
mem_listactive=0;
|
|
|
|
}
|
|
|
|
createpagination_produits(0);
|
|
});
|
|
|
|
$("body").on("click", ".emp a", function(){
|
|
|
|
$.ajax({
|
|
url: '<?=base_url()?>index.php/Lots/removelot/'+$(this).attr("data-id")+'/'+mem_listactive,
|
|
type: 'get',
|
|
dataType: 'json',
|
|
success: function(responseData){
|
|
lien=window.location.hostname;
|
|
window.location.href='/index.php/Lots/reload/'+mem_listactive;
|
|
|
|
|
|
// $('#modal_info').html(responseData);
|
|
|
|
|
|
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(function($){
|
|
$.fn.focusTextToEnd = function(){
|
|
this.focus();
|
|
var $thisVal = this.val();
|
|
this.val('').val($thisVal);
|
|
return this;
|
|
}
|
|
}(jQuery));
|
|
$('#pagination_produits').on('click','a',function(e){
|
|
e.preventDefault();
|
|
var pageNum = $(this).attr('data-ci-pagination-page');
|
|
createpagination_produits(pageNum);
|
|
});
|
|
function createpagination_produits(pageNum,nofiltre=1,focus=1){
|
|
|
|
|
|
|
|
|
|
mem_filtre_produits_2='null';
|
|
|
|
|
|
|
|
$.ajax({
|
|
url: '<?=base_url()?>index.php/Lots/loadData_list/'+pageNum+'/'+mem_filtre_produits_1+'/'+mem_filtre_produits_2+'/'+mem_filtre_produits_3+'/'+mem_listactive ,
|
|
type: 'get',
|
|
dataType: 'json',
|
|
success: function(responseData){
|
|
|
|
$('#pagination_produits').empty();
|
|
$('#pagination_produits').html(responseData.pagination);
|
|
$('#produits_list').empty();
|
|
$('#produits_list').html(responseData.list);
|
|
$('#Produits_actif').empty();
|
|
$('#Produits_actif').html(responseData.recordCount);
|
|
$('input.filtre_produits_'+nofiltre).focusTextToEnd();
|
|
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
</script>
|