|
Server IP : 10.128.40.6 / Your IP : 216.73.216.233 Web Server : Apache System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : logmcpe ( 111175) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/logmcpe/www/TMCPRO/pages/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
use App\Configuration;
use App\DatabaseWrapper;
use App\Repository;
// error_reporting(E_ALL);
// ini_set('display_errors', 1);
require __DIR__ . '/vendor_dispo/autoload.php';
// if(!empty($_GET)){
// echo "<pre>" ;
// print_r($_GET) ;
// echo "</pre>" ;
// }
function count_week_days($__date_from, $__date_to, $__holidays_between=array(), $__weekend_days=array()) {
$total_days_count = $__date_to > $__date_from ? round(($__date_to - $__date_from)/(24*3600)) : 0;
$full_weeks_count = floor($total_days_count/7);
$weekend_days_count = $full_weeks_count*count($__weekend_days);
$days_left_uncovered = $total_days_count - $full_weeks_count*7;
for($i = 0; $i < $days_left_uncovered; $i++) {
$date_to_check = $i ? strtotime("+{$i} day", $__date_from) : $__date_from;
if(in_array(date('N', $date_to_check), $__weekend_days)) {
$weekend_days_count++;
}
}
$week_days_count = $total_days_count - $weekend_days_count - count($__holidays_between);
return $week_days_count;
}
$databaseWrapper = new DatabaseWrapper(Configuration::DB_NAME, Configuration::DB_USER, Configuration::DB_PASS, Configuration::DB_HOST, Configuration::DB_PORT);
$repository = new Repository($databaseWrapper);
$startDate = $_GET['start_date'] ?? date('Y-m-01');
$firstDayOfNextMonth = date('Y-m-01', strtotime('first day of next month'));
$endDate = $_GET['end_date'] ?? $firstDayOfNextMonth;
// $hideBlankWorkingDays = $_GET['hide_blank_working_days'] ?? false;
$hideBlankWorkingDays = $_GET['hide_blank_working_days'] ?? false;
$hideBlankBookedDays = $_GET['hide_blank_booked_days'] ?? false;
$hideBlankAvailableRanges = $_GET['hide_blank_available_ranges'] ?? false;
$hideAbsentDays = $_GET['hide_absent_ranges'] ?? false;
$dayAvailable = $repository->getDayAvailable();
$etablisements = $repository->getEtablissements();
if (get('etablissement_id')) {
$dataBooked = $repository->getDataByDateAndEtablis($startDate, $endDate, intval(get('etablissement_id')));
list($dataAbsence, $dataSkip) = $repository->getAbsenceByDate($startDate, $endDate, array_keys($dataBooked));
// echo "<pre>" ;
// print_r($dataBooked) ;
// echo "</pre>" ;
} else {
$dataBooked = $repository->getDataByDate($startDate, $endDate);
list($dataAbsence, $dataSkip) = $repository->getAbsenceByDate($startDate, $endDate);
}
function getAvailableTimeRangesMultiple(array $workingHours, array $prestation_jour, array $absence): ?array
{
$available = [];
if ($absence) {
$prestation_jour[] = ['heure_debut' => $absence[0][0], 'heure_fin' => $absence[0][1]];
usort($prestation_jour, function ($a, $b) {
return strcmp($a["heure_debut"], $b["heure_debut"]);
});
}
if (!$prestation_jour) {
foreach ($workingHours as $workingHoursItem) {
$available[] = [$workingHoursItem['heure_deb'], $workingHoursItem['heure_fin']];
}
return $available;
}
foreach ($workingHours as $workingHoursItem) {
$new = getAvailableTimeRanges($workingHoursItem['heure_deb'], $workingHoursItem['heure_fin'], $prestation_jour);
foreach ($new as $newItem) {
$available[] = $newItem;
}
}
return $available;
}
function getAvailableTimeRanges(string $heure_deb, string $heure_fin, array $prestation_jour): ?array
{
$availableTimeRanges = [];
if (!$prestation_jour) {
return [$heure_deb, $heure_fin];
}
$start = $heure_deb;
$end = $heure_fin;
foreach ($prestation_jour as $i => $item) {
if ($item['heure_debut'] <= $start && $item['heure_fin'] >= $end) {
return [];
}
if ($item['heure_debut'] >= $end || $item['heure_fin'] <= $start) {
continue;
}
$nextItemStart = min($prestation_jour[$i + 1]['heure_debut'] ?? $end, $end);
if ($start < $item['heure_debut']) {
if ($end > $item['heure_debut']) {
$availableTimeRanges[] = [$start, $item['heure_debut']];
if ($end > $item['heure_fin']) {
$availableTimeRanges[] = [$item['heure_fin'], $end];
}
$start = $item['heure_fin'];
continue;
} else {
$availableTimeRanges[] = [$start, $end];
break;
}
} elseif ($start >= $item['heure_debut']) {
$item['heure_fin'] = min($item['heure_fin'], $end);
if ($start >= $item['heure_fin']) {
continue;
} else {
if ($item['heure_fin'] != ($nextItemStart)) {
$availableTimeRanges[] = [$item['heure_fin'], $nextItemStart];
}
$start = $nextItemStart;
}
}
}
if (!$availableTimeRanges) {
$availableTimeRanges[] = [$start, $end];
}
return $availableTimeRanges;
}
?>
<!doctype html>
<html lang="en">
<head>
<?php include('header.php'); ?>
<link href="assets/bootstrap.min.css" rel="stylesheet">
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<!-- TOP MENU -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
</li>
<li>
<h3><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-nouvelle"><i class="fas fa-plus"></i> RENDEZ-VOUS</button></h3>
</li>
</ul>
<ul class="navbar-nav ml-auto">
</ul>
</nav>
<?php include('menu.php'); ?>
<div class="content-wrapper">
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
</ol>
</div>
</div>
</div>
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card card-primary">
<div class="card-body p-20">
<form action="">
<div class="row mb-4">
<div class="col-md-3">
<label for="start_date">Début</label>
<input type="date" name="start_date" id="start_date" class="form-control" value="<?=$startDate?>">
</div>
<div class="col-md-3">
<label for="end_date">Fin</label>
<input type="date" name="end_date" id="end_date" class="form-control" value="<?=$endDate?>">
</div>
<div class="col-md-3">
<button class="btn btn-primary mt-4 px-4">Valider</button>
</div>
<div class="col-md-3"></div>
<div class="col-md-3 mt-2">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="1" id="hide_blank_working_days" name="hide_blank_working_days" <?=$hideBlankWorkingDays ? 'checked' : ''?>>
<label class="form-check-label" for="hide_blank_working_days">
Masquer les jours des disponibilité vides
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="1" id="hide_blank_booked_days" name="hide_blank_booked_days" <?=$hideBlankBookedDays ? 'checked' : ''?>>
<label class="form-check-label" for="hide_blank_booked_days">
Masquer les jours des prestation vides
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="1" id="hide_blank_available_ranges" name="hide_blank_available_ranges" <?=$hideBlankAvailableRanges ? 'checked' : ''?>>
<label class="form-check-label" for="hide_blank_available_ranges">
Masquer les plages disponibles réel vides
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="1" id="hide_absent_ranges" name="hide_absent_ranges" <?=$hideAbsentDays ? 'checked' : ''?>>
<label class="form-check-label" for="hide_absent_ranges">
Masquer les jours absentes
</label>
</div>
</div>
<div class="col-md-3">
<label for="etablissement_id"></label>
<select class="form-select" aria-label="Default select example" name="etablissement_id" id="etablissement_id">
<option value="" <?=!get('etablissement_id') ? 'selected':''?>>Tous les établissements</option>
<?php foreach ($etablisements as $etablisement):?>
<option <?=get('etablissement_id') == $etablisement['etablissement_id'] ? 'selected':''?> value="<?=$etablisement['etablissement_id']?>"><?=$etablisement['etablissement_nom']?></option>
<?php endforeach;?>
</select>
</div>
</div>
</form>
<?php
// echo "uuuuuuuuu<br/>" ;
// echo "<pre>" ;
// print_r($dayAvailable) ;
// echo "</pre>" ;
if(!empty($_GET['etablissement_id']))
{
$whero = " AND `etablissement_id` = ".$_GET['etablissement_id'] ;
}
foreach ($dayAvailable as $salaryId => $dayAvailableItem):?>
<?php if ((!$hideBlankWorkingDays || $dayAvailableItem) && (!$hideBlankBookedDays || isset($dataBooked[$salaryId]))):
list($salarie_nom , $salarie_prenom , $nbr_sal) = dbi_fetch_row ( dbi_query("SELECT salarie_nom , salarie_prenom , count(salarie_id) as nbr_sal FROM `salarie` WHERE `salarie_id` = ".$salaryId." $whero ")) ;
// echo "==> $nbr_sal <br/>" ;
// dbi_fetch_row
// SELECT * FROM `salarie` WHERE `salarie_id` = 710 AND `etablissement_id` = 0
if($nbr_sal == 1){
// echo "test <br/>" ;
?>
<h3><?=$salarie_nom." ".$salarie_prenom."(".$salaryId.")"?></h3>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th scope="col">date</th>
<th scope="col">jour</th>
<th scope="col">disponibilité</th>
<th>prestation</th>
<th scope="col">disponibilité reel</th>
</tr>
</thead>
<tbody>
<?php
$start_timestamp = strtotime($startDate);
$end_timestamp = strtotime($endDate);
$totalBookedMinutes = 0;
for ($timestamp = $start_timestamp; $timestamp <= $end_timestamp; $timestamp += 86400):?>
<?php
switch (date('l', $timestamp)) {
case 'Monday':
$day_availability = 'Lundi' ;
break;
case 'Tuesday':
$day_availability = 'Mardi' ;
break;
case 'Wednesday':
$day_availability = 'Mercredi' ;
break;
case 'Thursday':
$day_availability = 'Jeudi' ;
break;
case 'Friday':
$day_availability = 'Vendredi' ;
break;
case 'Saturday':
$day_availability = 'Samedi' ;
break;
case 'Sunday':
$day_availability = 'Dimanche' ;
break;
}
$currentDate = date('Y-m-d', $timestamp);
if (isset($dataSkip[$salaryId]) && in_array($currentDate, $dataSkip[$salaryId])) {
if (!$hideAbsentDays) echo "<tr><td>$currentDate</td><td>".$day_availability."</td><td colspan='3'>Absente</td>";
continue;
}
$currentDateOfWeekNumber = date('N', $timestamp);
if ($hideBlankWorkingDays && !isset($dayAvailableItem[$currentDateOfWeekNumber])) {
continue;
}
if ($hideBlankBookedDays && !isset($dataBooked[$salaryId][$currentDate])) {
continue;
}
$availableForThisDay = [];
if (isset($dayAvailableItem[$currentDateOfWeekNumber])) {
$availableForThisDay = getAvailableTimeRangesMultiple($dayAvailableItem[$currentDateOfWeekNumber], $dataBooked[$salaryId][$currentDate] ?? [], $dataAbsence[$salaryId][$currentDate] ?? []);
}
if ($hideBlankAvailableRanges && !$availableForThisDay) {
continue;
}
if (isset($dataBooked[$salaryId][$currentDate])) {
foreach ($dataBooked[$salaryId][$currentDate] as $item) {
$totalBookedMinutes += getDurationInMinutes($item['heure_fin'], $item['heure_debut']);
}
}
?>
<tr>
<td>
<?=date('Y-m-d', $timestamp)?>
</td>
<td>
<?=$day_availability?>
</td>
<td>
<?php if (isset($dayAvailableItem[$currentDateOfWeekNumber])):?>
<?php foreach ($dayAvailableItem[$currentDateOfWeekNumber] as $dayAvailableItemSubItem):?>
<?=$dayAvailableItemSubItem['heure_deb']?>-<?=$dayAvailableItemSubItem['heure_fin']?><br>
<?php endforeach;?>
<?php endif;?>
</td>
<td>
<?php if (isset($dataBooked[$salaryId][$currentDate])):?>
<?php foreach ($dataBooked[$salaryId][$currentDate] as $dataBookedItem):?>
<?=$dataBookedItem['heure_debut']?>-<?=$dataBookedItem['heure_fin']?><br>
<?php endforeach;?>
<?php endif;?>
<?php if (isset($dataAbsence[$salaryId][$currentDate])):?>
<?php endif;?>
</td>
<td>
<?php foreach ($availableForThisDay as $item):?>
<?=$item[0]?>-<?=$item[1]?><br>
<?php endforeach;?>
</td>
</tr>
<?php endfor;?>
<tr>
<td colspan="3"></td>
<td><?=minutes_to_time_string($totalBookedMinutes)?></td>
<td></td>
</tr>
</tbody>
</table>
<div class="table-responsive">
<table class="table m-0">
<thead>
<tr>
<th>Période</th>
<th>Contrat</th>
<th>ACH</th>
<th>Absences</th>
<th>Travaillées</th>
<th>Ecart</th>
</tr>
</thead>
<tbody>
<?php
// echo "===>".$crdebut."<====>".$ctend."<br/>" ;
$crdebut = $_GET['start_date'] ;
$ctend = $_GET['end_date'] ;
while ($crdebut <= $ctend )
{
$salarie_id = $salaryId ;
$week_start = date("Ymd", strtotime('monday this week', strtotime($crdebut)));
$week_end = date("Ymd", strtotime('sunday this week', strtotime($crdebut)));
// echo $week_start .' **** '.$week_end .'<br>' ;
$crdebut = date('Y-m-d', strtotime('+1 week', strtotime($crdebut)));
// $sql2="SELECT contrat_heure FROM ".TABLE_CONTRAT." WHERE inter_id = ".$salarie_id." AND contrat_debut<=".dateformaint($crdebut)." AND ( contrat_fin IS NULL OR contrat_fin >".dateformaint($crdebut)." ) AND Contrat_type_ID = 12 ORDER BY contrat_id DESC";
// $sql2 = "SELECT contrat_heure FROM ".TABLE_CONTRAT." WHERE contrat_debut <= $week_start AND (contrat_fin IS NULL OR contrat_fin > $week_start OR contrat_fin=0) AND inter_id = $salarie_id ORDER BY contrat_debut DESC LIMIT 1" ;
$sql2 = " SELECT salarie_contrat_duree_mensuelle FROM `salarie_contrat` WHERE salarie_contrat_date_debut <= $week_start AND (salarie_contrat_date_fin IS NULL OR salarie_contrat_date_fin > $week_start OR salarie_contrat_date_fin=0) AND salarie_id = $salarie_id AND contrat_type_id NOT IN(10, 11) ORDER BY salarie_contrat_date_debut DESC LIMIT 1 " ;
$sql22 = " SELECT hebdo_moyen_complement FROM `salarie_contrat`
WHERE
salarie_id = $salarie_id AND contrat_type_id IN(10, 11)
AND
(
( salarie_contrat_date_debut between $week_start AND $week_end )
OR
( salarie_contrat_date_fin between $week_start AND $week_end )
OR
( salarie_contrat_date_fin >= $week_end AND salarie_contrat_date_debut <= $week_start )
)
ORDER BY salarie_contrat_date_debut DESC LIMIT 1 " ;
// echo $sql22.'<br>';
// echo $sql2 ;
list($heures_contrat_ACH)=dbi_fetch_row(dbi_query($sql2));
$heures_contrat_ACH= round($heures_contrat_ACH/4.333 , 2);
list($hebdo_moyen_complement)=dbi_fetch_row(dbi_query($sql22));
// echo"==> ".$heures_contrat_ACH."<br/>" ;
// $contrat = dbi_fetch_row(dbi_query("SELECT contrat_heure FROM ".TABLE_CONTRAT." WHERE contrat_debut <= $week_end AND agence_id=$agence AND (contrat_fin IS NULL OR contrat_fin > $week_start OR contrat_fin=0) AND inter_id = $salarie_id AND Contrat_type_ID != 12 ORDER BY contrat_debut DESC LIMIT 1")) ;
// echo ;
// echo ;
$date = $week_start ;
$presta_Hduree = 0;
while ($date <= $week_end )
{
// echo "
// SELECT * FROM PRESTATIONS p where presta_date_debut <= $date AND (p.presta_date_fin >= $date OR p.presta_date_fin IS NULL)
// AND ( p.presta_id IN (select presta_id FROM PRESTATIONS WHERE salarie_id = $salarie_id ) OR p.presta_id IN ( select presta_id FROM PRESTATIONS_MODIF WHERE salarie_id = $salarie_id ) )
// ";
$q = dbi_query("
SELECT * FROM PRESTATIONS p where presta_date_debut <= $date AND (p.presta_date_fin >= $date OR p.presta_date_fin IS NULL)
AND ( p.presta_id IN (select presta_id FROM PRESTATIONS WHERE salarie_id = $salarie_id ) OR p.presta_id IN ( select presta_id FROM PRESTATIONS_MODIF WHERE salarie_id = $salarie_id ) )
AND ( p.presta_recur IS NULL OR p.presta_recur NOT IN ( SELECT presta_id FROM PRESTATIONS where presta_date_fin < $date ))
");
while($prest = dbi_fetch_row($q))
{
$date_presta_sem = $prest['presta_date_debut'] ;
$q1 = dbi_query("SELECT * FROM PRESTATIONS_MODIF WHERE presta_id = ".$prest['presta_id']." order by start, modif_id ") ;
while (($m = dbi_fetch_row($q1)) && $date >= $m['start'])
{
if( $m['presta_sem'] != NULL ) $date_presta_sem = $m['start'];
$prest['salarie_id'] = $m['salarie_id'] === NULL ? $prest['salarie_id'] : $m['salarie_id'] ;
$prest['presta_sem'] = $m['presta_sem'] === NULL ? $prest['presta_sem'] : $m['presta_sem'] ;
$prest['presta_jour'] = $m['presta_jour'] === NULL ? $prest['presta_jour'] : $m['presta_jour'] ;
$prest['presta_Hduree'] = $m['presta_Hduree'] === NULL ? $prest['presta_Hduree'] : $m['presta_Hduree'] ;
}
if( $prest['salarie_id'] == $salarie_id ) {
// $nbre =count_week_days(strtotime(int2date_autre_format($date_presta_sem,'d.m.Y')), strtotime(int2date_autre_format($date,'d.m.Y')));
// echo ' +++++++++++++++ ';
$day = date("w", strtotime( int2date_autre_format($date)));
if( $day == $prest['presta_jour'] OR ( $date == $prest['presta_date_debut'] && $prest['presta_date_debut'] == $prest['presta_date_fin'] ) ){
$EXP = dbi_fetch_row(dbi_query("SELECT date_presta FROM EXCEPTIONS WHERE presta_id = ".$prest['presta_id']." AND date_presta = ".$date." " )) ; ;
if($EXP ){} else {
if( $prest['presta_sem'] == 1 )
$presta_Hduree = $presta_Hduree + $prest['presta_Hduree'] ;
else{
$nbre =count_week_days(strtotime(int2date_autre_format($date_presta_sem,'d.m.Y')), strtotime(int2date_autre_format($date,'d.m.Y')));
$modolo = $nbre % $prest['presta_sem'] ;
if( $modolo == 0)
$presta_Hduree = $presta_Hduree + $prest['presta_Hduree'] ;
}
}
}
}
}
$date = date("Ymd", strtotime("+1 day", strtotime($date)));
}
// echo " $$$$$$$$$$$ ";
// $presta_Hduree/= 60;
$presta_Hduree /= 60 ;
// $pour $p
$badge = 'badge-success';
if($presta_Hduree < ($heures_contrat_ACH + $hebdo_moyen_complement ))
$badge = 'badge-danger';
else
$badge = 'badge-warning';
// else($presta_Hduree > $heures_contrat_ACH)
// $badge = 'badge-warning';
echo
"<tr>
<td><b> ".int2date_autre_format($week_start,'d/m/Y')." </b> au <b> ".int2date_autre_format($week_end,'d/m/Y')." </b> </td>
<td> <b> ".number_format( $heures_contrat_ACH, 2, ',', ' ')."</b> </td>
<td> <b> ".number_format( $hebdo_moyen_complement, 2, ',', ' ')."</b> </td>
";
$q= dbi_query("SELECT * FROM salarie_absence where salarie_id = '".$salarie_id."' AND ( salarie_absence_date_debut BETWEEN $week_start AND $week_end OR salarie_absence_date_fin BETWEEN $week_start AND $week_end
OR ( salarie_absence_date_debut <= $week_start && salarie_absence_date_fin >= $week_end )
) " ) ;
echo "<td>";
while($cl=dbi_fetch_row($q))
{
list($motif)= dbi_fetch_row(dbi_query("SELECT descr FROM cause_absence where cause_id =".$cl['absence_type_id'])) ;
$fin = int2date($cl['salarie_absence_date_fin']);
if( empty($cl["salarie_absence_date_fin"]) OR $cl["salarie_absence_date_fin"] ==0)
$fin = ' Pas de Date Fin ';
echo " $motif du <b> ".int2date($cl['salarie_absence_date_debut'])." </b> au <b> ".$fin." </b> ( de ".$cl['salarie_absence_heure_debut']." á ".$cl['salarie_absence_heure_fin']." ) <br>";
}
echo "</td>";
echo "<td><span class='badge ".$badge."'> ".number_format( $presta_Hduree, 2, ',', ' ')." </span></td>";
$delta = ($presta_Hduree - $heures_contrat_ACH - $hebdo_moyen_complement );
echo "<td><b> ".number_format( $delta, 2, ',', ' ')." </b></td>";
echo "</tr>" ;
// if($presta_Hduree<$heures_contrat_ACH )
// {
// echo "<td><div class='sparkbar' data-color='#FF3355' data-height='20'></div></td>" ;
// }else
// {
// echo "<td><div class='sparkbar' data-color='#00a65a' data-height='20'></div></td>" ;
// }
// echo "";
}
?>
</tbody>
</table>
</div>
<!-- /.table-responsive -->
<?}?>
<?php endif;?>
<?php endforeach;?>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
</div>
<footer class="main-footer">
<div class="float-right d-none d-sm-block">
<b>Version</b> 3.0.1
</div>
<strong>Copyright © 2019 MCPRO</strong>
</footer>
<!-- FIN DU PIED DE PAGE -->
<!-- NE PAS TOUCHER CI-DESSOUS -->
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
<!-- ./wrapper -->
<!-- jQuery -->
<script src="../../plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<script src="../../plugins/datatables/jquery.dataTables.js"></script>
<script src="../../plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
<script src="assets/bootstrap.bundle.min.js"></script>
<script src="../../plugins/datatables/jquery.dataTables.min.js"></script>
<script src="../../plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="../../plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="../../plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script src="../../plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="../../plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
<script src="../../plugins/jszip/jszip.min.js"></script>
<script src="../../plugins/pdfmake/pdfmake.min.js"></script>
<script src="../../plugins/pdfmake/vfs_fonts.js"></script>
<script src="../../plugins/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="../../plugins/datatables-buttons/js/buttons.print.min.js"></script>
<script src="../../plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<script>
$(function () {
$("#example1").DataTable({
"responsive": true, "lengthChange": false, "autoWidth": false, "paging": false,
"buttons": ["copy", "csv", "excel", "pdf", "print"]
}).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
$('#example2').DataTable({
"paging": false,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false,
"responsive": true,
});
});
</script>
<script>
$(function () {
$("#allcheck").click(function(){
$('input:checkbox').not(this).prop('checked', this.checked);
});
var TOTALCA ="<?php echo number_format( $CATTC, 2, ',', ' ').'<sup> € </sup>';?>";
$('#TOTALCA').html(TOTALCA);
var TOTALCAHT ="<?php echo number_format( $CAHT, 2, ',', ' ').'<sup> € </sup>';?>";
$('#TOTALCAHT').html(TOTALCAHT);
//Initialize Select2 Elements
$('.select2').select2()
//Initialize Select2 Elements
$('.select2bs4').select2({
theme: 'bootstrap4'
})
//Datemask dd/mm/yyyy
$('#datemask').inputmask('dd/mm/yyyy', { 'placeholder': 'dd/mm/yyyy' })
//Datemask2 mm/dd/yyyy
$('#datemask2').inputmask('mm/dd/yyyy', { 'placeholder': 'mm/dd/yyyy' })
//Money Euro
$('[data-mask]').inputmask()
//Date range picker
$('#reservation').daterangepicker()
//Date range picker with time picker
$('#reservationtime').daterangepicker({
timePicker: true,
timePickerIncrement: 30,
locale: {
format: 'MM/DD/YYYY hh:mm A'
}
})
//Date range as a button
$('#daterange-btn').daterangepicker(
{
ranges : {
'Today' : [moment(), moment()],
'Yesterday' : [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days' : [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month' : [moment().startOf('month'), moment().endOf('month')],
'Last Month' : [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
startDate: moment().subtract(29, 'days'),
endDate : moment()
},
function (start, end) {
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'))
}
)
//Timepicker
$('#timepicker').datetimepicker({
format: 'LT'
})
//Bootstrap Duallistbox
$('.duallistbox').bootstrapDualListbox()
//Colorpicker
$('.my-colorpicker1').colorpicker()
//color picker with addon
$('.my-colorpicker2').colorpicker()
$('.my-colorpicker2').on('colorpickerChange', function(event) {
$('.my-colorpicker2 .fa-square').css('color', event.color.toString());
});
$("input[data-bootstrap-switch]").each(function(){
$(this).bootstrapSwitch('state', $(this).prop('checked'));
});
})
</script>
<script src="../../plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
bsCustomFileInput.init();
});
</script>
</body>
</html>
