<?php
  include VIEWPATH.'includes/new_header.php';
  ?>
  <!-- fullCalendar -->
  <!-- <link rel="stylesheet" href="<?php echo $nouveau_url ?>plugins/fullcalendar/main.css"> -->

  
<body class="hold-transition sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
  <?php
  include VIEWPATH.'includes/new_top_menu.php';
  include VIEWPATH.'includes/new_menu_principal.php';
  ?>

  

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>Dashboard employé</h1>
          </div>
          <div class="col-sm-6">
           
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">

      <!-- Default box -->
      <div class="card">

        <div class="card-body">

      <form method="POST" action="<?=base_url('dashboard/Dashboard_Conge')?>" id="myform">
            

              <div class="form-row">

                 <div class="col-md-4">
                <label>Du</label>
               
                  <input type="date"  name="DATE1" id="DATE1" class="form-control" onchange="get_info()" value="<?=set_value('DATE1')?>">
              </div>


               <div class="col-md-4">
                <label>Au</label>

                  <input type="date" name="DATE2" id="DATE2" class="form-control" onchange="get_info()" value="<?=set_value('DATE2')?>">
                </div>
              </div>

</form>




          <div class="row col-md-12">
      <div class="col-md-6" id="container1"></div>
       <div class="col-md-6" id="container2"></div>

        </div>

      <div class="row col-md-12">
      <div class="col-md-6" id="container3"></div>
       <div class="col-md-6" id="container4"></div>

        </div>


        </div>

      </div>
      <!-- /.card -->

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <?php
 include VIEWPATH.'includes/new_copy_footer.php';  
  ?>
  <!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<?php
  include VIEWPATH.'includes/new_script.php';
  ?>

<script src="<?php echo $nouveau_url ?>higthchart/code/highcharts.js"></script>
<script src="<?php echo $nouveau_url ?>higthchart/code/modules/sankey.js"></script>
<script src="<?php echo $nouveau_url ?>higthchart/code/modules/organization.js"></script>
<script src="<?php echo $nouveau_url ?>higthchart/code/modules/exporting.js"></script>
<script src="<?php echo $nouveau_url ?>higthchart/code/modules/accessibility.js"></script>

</body>
</html>
<script>


         function get_info() {
       
       myform.action= myform.action;
        myform.submit();
      } 
  

</script>

<!---rapport 1-->

    <script type="text/javascript">

Highcharts.chart('container1', {

  chart: {
                type: 'column'
            },
            title: {
        text: '<b><?=$titre?></b>'
    },
            subtitle: {
        text: '<b><?=$title?> :  <?=$TOTALEMPLOYEDIRECTION?> </b> '
    },
            credits:{
              enabled: false
            },

            yAxis: {
        title: {
            text: ''
        }
    },

           credits: {
        enabled: true,
        href: "#",
        text: "Prime"
    },

            exporting: {
              enabled: true
            },
            legend: {
              enabled: true
            },
            xAxis: {
                type: 'category'
            },
            tooltip: {
                pointFormat: '{series.name}: {point.y}<br>',
                // valueSuffix: ' BIF',
                shared: true
            },

           plotOptions: {
        series: {
            borderWidth: 0,
            dataLabels: {
                enabled: true,
                format: '{point.y:1f}'
            }
        }
    },
    series: [{
            name: 'Nbre employés',
            data:

             [<?php echo $report; ?>]
           }
           
           
           
           ],
           
    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    layout: 'horizontal',
                    align: 'center',
                    verticalAlign: 'bottom'
                }
            }
        }]
    }

});
</script>


<script type="text/javascript">

Highcharts.chart('container2', {

  chart: {
                type: 'bar'
            },
            title: {
        text: '<b><?=$titre?></b>'
    },
            subtitle: {
        text: '<b><?=$titledepart?> :  <?=$TOTALEMPLDEPART?> </b> '
    },
            credits:{
              enabled: false
            },

            yAxis: {
        title: {
            text: ''
        }
    },

           credits: {
        enabled: true,
        href: "#",
        text: "Prime"
    },

            exporting: {
              enabled: true
            },
            legend: {
              enabled: true
            },
            xAxis: {
                type: 'category'
            },
            tooltip: {
                pointFormat: '{series.name}: {point.y}<br>',
                // valueSuffix: ' BIF',
                shared: true
            },

           plotOptions: {
        series: {
            borderWidth: 0,
            dataLabels: {
                enabled: true,
                format: '{point.y:1f}'
            }
        }
    },
    series: [{
            name: 'Nbre employés',
            data:

             [<?php echo $report_dep; ?>]
           }
           
           
           
           ],
           
    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    layout: 'horizontal',
                    align: 'center',
                    verticalAlign: 'bottom'
                }
            }
        }]
    }

});
</script>



<script type="text/javascript">

Highcharts.chart('container3', {

  chart: {
                type: 'bar'
            },
            title: {
        text: '<b><?=$titre?></b>'
    },
            subtitle: {
        text: '<b><?=$titleservice?> :  <?=$TOTALSERV?> </b> '
    },
            credits:{
              enabled: false
            },

            yAxis: {
        title: {
            text: ''
        }
    },

           credits: {
        enabled: true,
        href: "#",
        text: "Prime"
    },

            exporting: {
              enabled: true
            },
            legend: {
              enabled: true
            },
            xAxis: {
                type: 'category'
            },
            tooltip: {
                pointFormat: '{series.name}: {point.y}<br>',
                // valueSuffix: ' BIF',
                shared: true
            },

           plotOptions: {
        series: {
            borderWidth: 0,
            dataLabels: {
                enabled: true,
                format: '{point.y:1f}'
            }
        }
    },
    series: [{
            name: 'Nbre employés',
            data:

             [<?php echo $raport_serv; ?>]
           }
           
           
           
           ],
           
    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    layout: 'horizontal',
                    align: 'center',
                    verticalAlign: 'bottom'
                }
            }
        }]
    }

});
</script>



<script type="text/javascript">

Highcharts.chart('container4', {
    chart: {
        plotBackgroundColor: null,
        plotBorderWidth: null,
        plotShadow: false,
        type: 'pie'
    },
    title: {
        text: '<b><?=$titleempsex?> <br> <br> Total : <?=$TOTALEMPL_SEX?></b>'
    },
    tooltip: {
        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
    },
    accessibility: {
        point: {
            valueSuffix: '%'
        }
    },
    plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
                enabled: true
            },
            showInLegend: true
        }
    },

               credits: {
        enabled: true,
        href: "#",
        text: "Prime"
    },





    series: [{
        name: 'Nbre employés',
        colorByPoint: true,
        data: 
          [<?php echo $raport_sex; ?>]
       
    }]
});
</script>

