js.php 2.27 KB
Newer Older
Hamza Arfaoui's avatar
Hamza Arfaoui committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="gstatic/loader.js"></script>

<script type="text/javascript" src="plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="plugins/bootstrap-datepicker/locales/bootstrap-datepicker.fr.min.js" charset="UTF-8"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $('.date_picker').datepicker({
            format: 'dd/mm/yyyy',
            autoclose: true,
            language: 'fr'
        });
        $('.date_picker_year').datepicker({
            format: 'yyyy',
            autoclose: true,
            viewMode: "years", 
            minViewMode: "years",
            language: 'fr'
        });
        $('.date_picker_month').datepicker({
            format: 'MM',
            autoclose: true,
            minViewMode: 'months',
            maxViewMode: 'months',
            startView: 'months',
            language: 'fr'
        });
    });
    $(window).on("load",function(){
        same_size();
    });
    $(window).on("resize",function(){
        same_size();
        
        visits_per_year_box();
        
    });
    function same_size(){        
        $('.card-body .wrap').height($('.card-body .wrap h5').innerWidth());
    }
    function visits_per_year_box() {
        var newWindowWidth = $(window).width();
        var getYearSummaryHeight = $('#previousYearSummary').height();
        var getcardValueHeight = $('#cardValue').height();
        

        if(getcardValueHeight + 50 < 200) {
            getcardValueHeight = getcardValueHeight + 50;
        }
        if(getYearSummaryHeight + 50 < 200) {
            getYearSummaryHeight = getYearSummaryHeight + 50;
        }
        
        if(getcardValueHeight > getYearSummaryHeight) {
            $('#previousYearSummary').height(getcardValueHeight);
            $('#cardValue').height(getcardValueHeight);
        } else {
            $('#previousYearSummary').height(getYearSummaryHeight);
            $('#cardValue').height(getYearSummaryHeight);
        }
        /* if (newWindowWidth > 481) {
            $('#cardValue').height(getHeight);
        } */
    }
</script>