<?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 congé</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>Statut du congé</label> 
                    <select class="custom-select" name="STATUS_CONGE" id="STATUS_CONGE" onchange="get_info()">
                          <option>-- Select --</option>
                          <?php
                          foreach ($typeconge as $typeconge) { ?>

                           <option value="<?php echo $typeconge['STATUS_CONGE'] ?>" <?php echo  set_select('STATUS_CONGE', $typeconge['STATUS_CONGE']); ?> <?= ($STATUS_CONGE == $typeconge['STATUS_CONGE'])?"selected":"" ?> ><?php echo $typeconge['DESCRIPTION']?></option>


                           


                         <?php }
                          ?>
                        </select>
              </div>




                 <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="container"></div>
       <div class="col-md-6" id="container1"></div>

        </div>

      <div class="row col-md-12">
      <div class="col-md-6" id="container2"></div>
       <div class="col-md-6" id="container3"></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('container', {
        chart: {
            type: 'column'
        },
        title: {
            text: "<b> <?=$title?><br> <br>Total: <?= number_format($tot_rec_direct + $tot_rec_depart + $tot_rec_servic, 0,',',' ') ?></b>"
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: <?=$categories?>,
        },
        yAxis: {
            title: {
                text: 'Nombre'
            }
        },
        plotOptions: {
            column: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false,
                cursor: "Pointer",
            }
        },

        credits: {
          enabled: true,
          href: "",
          text: "Prime"
      },
      series: [{
        name: "Service (<?= number_format($tot_rec_servic, 0,',',' ') ?>)",
        data: <?=$data_service?>,
        color: "green"
    },
     {
        name: 'Département (<?= number_format($tot_rec_depart, 0,',',' ') ?>)',
        data: <?=$data_depart?>,
        color: "orange",
    }, 
    {
        name: 'Direction (<?= number_format($tot_rec_direct, 0,',',' ') ?>)',
        data: <?=$data_direction?>,
        color: "blue",
    }]
});
</script>



<script type="text/javascript">

    Highcharts.chart('container1', {
        chart: {
            type: 'column'
        },
        title: {
            text: '<b>Congé demandés par direction <br>   <br> Total=<?=number_format($totcat,0,',',' ') ?></b>'
        },
        xAxis: {
            categories: [<?=$categoconge?>]
        },
        yAxis: {
            title: {
                text: 'congés'
            }
        },
        plotOptions: {
            column: {
             cursor:'pointer',
             point:{
                 events: {
          
            }
        },
        dataLabels: {
         enabled: true
     },
     showInLegend: true
 }
}
,

credits: {
  enabled: true,
  href: "",
  text: "Prime"
},
series: [<?=$nbr_categories?>]
});


</script>


<script type="text/javascript">

    Highcharts.chart('container2', {
        chart: {
            type: 'bar'
        },
        title: {
            text: '<b>Congé demandés par service <br>   <br> Total=<?=number_format($TOTALDEPART,0,',',' ') ?></b>'
        },
        xAxis: {
            categories: [<?=$congedepartement?>]
        },
        yAxis: {
            title: {
                text: 'congés'
            }
        },
        plotOptions: {
            bar: {
             cursor:'pointer',
             point:{
                 events: {
          
            }
        },
        dataLabels: {
         enabled: true
     },
     showInLegend: true
 }
}
,

credits: {
  enabled: true,
  href: "",
  text: "Prime"
},
series: [<?=$nbr_departem?>]
});


</script>


<script type="text/javascript">

    Highcharts.chart('container3', {
        chart: {
            type: 'column'
        },
        title: {
            text: '<b>Congé demandés par section <br>   <br> Total=<?=number_format($totalserv,0,',',' ') ?></b>'
        },
        xAxis: {
            categories: [<?=$conge_service?>]
        },
        yAxis: {
            title: {
                text: 'congés'
            }
        },
        plotOptions: {
            column: {
             cursor:'pointer',
             point:{
                 events: {
          
            }
        },
        dataLabels: {
         enabled: true
     },
     showInLegend: true
 }
}
,

credits: {
  enabled: true,
  href: "",
  text: "Prime"
},
series: [<?=$nbr_service?>]
});


</script>