|
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
if($_POST['idp']) {
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
$TMCPROCLIENTID = 10824;
$presta_id = $_POST['idp'];
$date = $_POST['date'];
$client_id = $_SESSION["client_id"] ;
if (!empty($presta_id) && $presta_id > 0)
{
$q = dbi_query("SELECT * FROM PRESTATIONS WHERE presta_id = ".$presta_id) ;
if(!$prest = dbi_fetch_row($q))
die('Numéro de prestation invalide</body></html>') ;
}
$TMCPROCLIENTID = 10824;
$TMCPROCHANTIER_ID = 4360;
$client_id = $prest["client_id"] ;
// $date = date('Ymd'); ;
$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'])
{
$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_Hdeb'] = $m['presta_Hdeb'] === NULL ? $prest['presta_Hdeb'] : $m['presta_Hdeb'] ;
$prest['presta_Hduree'] = $m['presta_Hduree'] === NULL ? $prest['presta_Hduree'] : $m['presta_Hduree'] ;
$prest['salarie_id'] = $m['salarie_id'] === NULL ? $prest['salarie_id'] : $m['salarie_id'] ;
$prest['chantier_id'] = $m['chantier_id'] === NULL ? $prest['chantier_id'] : $m['chantier_id'] ;
$prest['presta_forfait'] = $m['presta_forfait'] === NULL ? $prest['presta_forfait'] : $m['presta_forfait'] ;
}
$prestation_motif = $m['prestation_motif'];
// fif(!empty($prest['presta_date_fin']))
// $presta_date_fin = int2date_autre_format($prest['presta_date_fin']) ;
// else
// $presta_date_fin = NULL ;
// if(!empty($prest['presta_date_debut']))
// $presta_date_debut = int2date_autre_format($prest['presta_date_debut']) ;
// else
// $presta_date_debut = NULL ;
$presta_Hfin =addDuree($prest['presta_Hdeb'], $prest['presta_Hduree']) ;
?>
<?php
}
if($client_id == $TMCPROCLIENTID )
{
?>
<div class="modal-header task-single-header" data-task-single-id="5" data-status="4">
<h4 class="modal-title"><?php echo $prest['presta_id']; ?>Modifier ou Supprimer Une Prestation <?php echo int2date_autre_format($date) ;?></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form action="" method="POST">
<div class="modal-body">
<div class="card-body">
<?php if($prest['presta_date_debut'] == $prest['presta_date_fin']) echo '<input type="hidden" id="presta_id_ponct" name="presta_id_ponct" value="'.$presta_id.'">'; ?>
<input type="hidden" id="client_id" name="client_id" value="<?php echo $client_id ;?>">
<input type="hidden" id="presta_id" name="presta_id" value="<?php echo $presta_id ;?>">
<input type="hidden" id="presta_id_old" name="presta_id_old" value="<?php echo $prest['presta_id_old'] ;?>">
<input type="hidden" id="prestation_type" name="prestation_type" value="<?php echo $prest['prestation_type'] ;?>">
<input type="hidden" id="chantier_id" name="chantier_id" value="<?php echo $prest['chantier_id'] ;?>">
<input type="hidden" id="date_presta" name="date_presta" value="<?php echo int2date_autre_format($date) ;?>">
<input type="hidden" name="presta_Hduree_Old" id="presta_Hduree_Old" value="<?php echo $prest['presta_Hduree']; ?>" >
<input type="hidden" name="presta_Hdeb_Old" value="<?php echo $prest['presta_Hdeb']; ?>" >
<input type="hidden" name="presta_jour_Old" value="<?php echo $prest['presta_jour']; ?>" >
<input type="hidden" name="salarie_id_Old" value="<?php echo $prest['salarie_id']; ?>" >
<input type="hidden" name="salarie_id" value="<?php echo $prest['salarie_id']; ?>" >
<input type="hidden" name="presta_forfait" value="0" >
<div class="form-row">
<div class="form-group col-md-4">
<label>Date du prestation </label>
<div class="input-group">
<div class="input-group-prepend"> <span class="input-group-text"><i class="far fa-calendar-alt"></i></span></div>
<input type="date" class="form-control" id="presta_date_debut" name="presta_date_debut" value='<?php echo int2date_autre_format($date); ?>' placeholder="jj/mm/aaaa"/>
</div>
</div>
<div class="form-group col-md-4">
<label for="inputAddresse">Heure Début</label>
<input type="time" id="appt1" min="05:00" max="22:00" class="form-control" name="presta_Hdeb" value="<?php echo int2heure($prest['presta_Hdeb']); ?>" required>
</div>
<div class="form-group col-md-4">
<label for="inputsociete">Heure fin</label>
<input type="time" id="appt2" min="05:00" max="22:00" class="form-control" name="presta_Hfin" value="<?php echo int2heure($presta_Hfin); ?>" required>
</div>
<div class="form-group col-md-4">
<label for="inputsociete">Motif</label>
<input type="text" id="prestation_motif" class="form-control" name="prestation_motif" value= "<?php echo $prestation_motif ; ?>" required>
</div>
<div id="hidefact" class="form-group col-md-8">
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-primary" data-dismiss="modal">Fermer</button>
<button type="submit" name="UptPrDate" class="btn btn-primary">Modifier</button>
<button type="submit" name="DelPrDate" id="DelPrDate" class="btn btn-danger" onclick="myFunction()" >Supprimer</button>
</div>
</form>
<!-- Select2 -->
<script src="../plugins/select2/js/select2.full.min.js"></script>
<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>
<!-- InputMask -->
<!-- Page script -->
<script>
$(function () {
//Initialize Select2 Elements
$('.select2').select2()
//Initialize Select2 Elements
$('.select2bs4').select2({
theme: 'bootstrap4'
})
})
</script>
<?php
}
else
{
?>
<?php
// echo $prest['presta_id'];
$q= dbi_fetch_row(dbi_query("SELECT * FROM client where client_id = ".$client_id)) ;
?>
<div class="modal-header task-single-header" data-task-single-id="5" data-status="4">
<h4 class="modal-title">
Modifier ou Supprimer Une Prestation <?php echo int2date_autre_format($date) ;?>
<?php echo " <br/> ".$q['client_nom']." ".$q['client_adr1']." ".$q['client_adr2']." ".$q['client_adr3']." ".$q['client_cp']." ".$q['client_ville'] ;?>
</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
// echo "==> $client_id <br/>" ;
$qm = dbi_query("SELECT * FROM contact where client_id = '$client_id'") ;
?>
<div class="card-body">
<table id="example1" class="table table-hover">
<tbody>
<?php while($q=dbi_fetch_row($qm)){ ?>
<?php
$chaine = $q['contact_nom']." ". $q['contact_pnom'] ;
?>
<tr>
<td><?php echo $chaine ?></td>
<td><?php echo $q['contact_fonction'] ; ?></td>
<td><?php echo $q['contact_tele1'] ; ?></td>
<td><?php echo $q['contact_tele2'] ; ?></td>
<td><?php echo $q['contact_email'] ; ?></td>
</tr>
<?php }?>
</tbody>
</table>
</div>
<form action="" method="POST">
<div class="modal-body">
<div class="card-body">
<?php if($prest['presta_date_debut'] == $prest['presta_date_fin']) echo '<input type="hidden" id="presta_id_ponct" name="presta_id_ponct" value="'.$presta_id.'">'; ?>
<input type="hidden" id="client_id" name="client_id" value="<?php echo $client_id ;?>">
<input type="hidden" id="presta_id" name="presta_id" value="<?php echo $presta_id ;?>">
<input type="hidden" id="presta_id_old" name="presta_id_old" value="<?php echo $prest['presta_id_old'] ;?>">
<input type="hidden" id="prestation_type" name="prestation_type" value="<?php echo $prest['prestation_type'] ;?>">
<input type="hidden" id="chantier_id" name="chantier_id" value="<?php echo $prest['chantier_id'] ;?>">
<input type="hidden" id="date_presta" name="date_presta" value="<?php echo int2date_autre_format($date) ;?>">
<input type="hidden" name="presta_Hduree_Old" id="presta_Hduree_Old" value="<?php echo $prest['presta_Hduree']; ?>" >
<input type="hidden" name="presta_Hdeb_Old" value="<?php echo $prest['presta_Hdeb']; ?>" >
<input type="hidden" name="presta_jour_Old" value="<?php echo $prest['presta_jour']; ?>" >
<input type="hidden" name="salarie_id_Old" value="<?php echo $prest['salarie_id']; ?>" >
<input type="hidden" name="presta_forfait" id="presta_forfait" value="<?php echo $prest['presta_forfait'] ;?>" >
<div class="form-row">
<div class="form-group col-md-4" id="hidden1">
<label>Date du prestation </label>
<div class="input-group">
<div class="input-group-prepend"> <span class="input-group-text"><i class="far fa-calendar-alt"></i></span></div>
<input type="date" class="form-control" id="presta_date_debut" name="presta_date_debut" value='<?php echo int2date_autre_format($date); ?>' placeholder="jj/mm/aaaa"/>
</div>
</div>
<div class="form-group col-md-2" id="hidden2">
<label for="inputAddresse">Heure Début</label>
<input type="time" id="appt1" min="05:00" max="22:00" class="form-control" name="presta_Hdeb" value="<?php echo int2heure($prest['presta_Hdeb']); ?>" required>
</div>
<div class="form-group col-md-2" id="hidden3">
<label for="inputsociete">Heure fin</label>
<input type="time" id="appt2" min="05:00" max="22:00" class="form-control" name="presta_Hfin" value="<?php echo int2heure($presta_Hfin); ?>" required>
</div>
<div class="form-group col-md-4" id="hidden4"><!-- Liste déroulante jour -->
<label>Salarier </label>
<select class="form-control select2" style="width: 100%;" name="salarie_id" id="salarie_idupd">
<?php $req =dbi_query("SELECT * FROM salarie WHERE `salarie_statut` = '1'") ;
while( $sal=dbi_fetch_row($req)) { ?>
<option value="<?php echo $sal['salarie_id'] ; ?>" <?php if( $sal['salarie_id']== $prest['salarie_id']) echo "SELECTED" ; ?> ><?php echo $sal['salarie_nom']." ".$sal['salarie_prenom']; ?></option>
<?php } ?>
</select>
</div>
<div id="hidefact" class="form-group col-md-8">
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<div id="hidden7"><button type="submit" name="UptPrDate" class="btn btn-primary">Modifier</button></div>
<div id="hidden11"><button type="submit" name="DelPrDate" id="DelPrDate" class="btn btn-danger" onclick="myFunction()" >Supprimer</button></div>
</div>
</form>
<!-- Select2 -->
<script src="../plugins/select2/js/select2.full.min.js"></script>
<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>
<!-- InputMask -->
<!-- Page script -->
<script>
$(function () {
//Initialize Select2 Elements
$('.select2').select2()
//Initialize Select2 Elements
$('.select2bs4').select2({
theme: 'bootstrap4'
})
})
</script>
<script>
function myFunction() {
// $facture = $this->input->post('facture');
// var facture = $(this).parent().parent().find("#facture");
document.getElementById("hidden1").style.display = "none";
document.getElementById("hidden2").style.display = "none";
document.getElementById("hidden3").style.display = "none";
document.getElementById("hidden4").style.display = "none";
document.getElementById("hidden5").style.display = "none";
document.getElementById("hidden6").style.display = "none";
document.getElementById("hidden7").style.display = "none";
if ($('#facture').length <= 0 )
$('#hidefact').html('<label for="inputsociete">Souhaitez vous déduire la prestation de la facture ?</label><select required class="form-control" name="facture" id="facture"><option value="" selected> -------------------- </option><option value="0" > OUI </option><option value="1" > NON</option></select>');
// alert(' $$$$$$$$$$$$$$ ');
// if ($facture == '' )
// $('#hidefact').html('<label for="inputsociete">Facture</label><select required class="form-control" name="facture" id="facture"><option value="" selected> -------------------- </option><option value="1" > Facturer </option><option value="0" > Ne pas facturer</option></select>');
}
$(function () {
// $('#hidefact').css('display', 'none');
// $('#facture').html('<input name="facture" id="facture" value="0" >');
var presta_Hduree_Old = $('#presta_Hduree_Old').val();
// $('#DelPrDate').blur(function(){
// $.ajax({
// type:'POST',
// url: 'prstajax.php',
// data:'del=1',
// success:function(html){
// $('#hidefact').html(html);
// }
// });
// alert('tttttttttt');
// });
// $('.select2').select2();
// $('.select2bs4').select2({
// theme: 'bootstrap4'
// });
$('#appt1').blur(function(){
// alert('tttttttttt');
document.getElementById("hidden11").style.display = "none";
var presta_Hdeb = $(this).val();
var presta_Hfin = $('#appt2').val();
// alert(presta_Hfin);
$.ajax({
type:'POST',
url: 'prstajax.php',
data:'presta_Hduree_Old='+presta_Hduree_Old+'&presta_Hdeb='+presta_Hdeb+'&presta_Hfin='+presta_Hfin,
success:function(html){
$('#hidefact').html(html);
}
});
});
$('#appt2').blur(function(){
document.getElementById("hidden11").style.display = "none";
var presta_Hdeb = $('#appt1').val();
var presta_Hfin = $(this).val();
// alert(presta_Hduree_Old);
$.ajax({
type:'POST',
url: 'prstajax.php',
data:'presta_Hduree_Old='+presta_Hduree_Old+'&presta_Hdeb='+presta_Hdeb+'&presta_Hfin='+presta_Hfin,
success:function(html){
$('#hidefact').html(html);
}
});
});
$('#presta_date_debut').blur(function(){
document.getElementById("hidden11").style.display = "none";
var presta_Hdeb = $('#appt1').val();
var presta_Hfin = $('#appt2').val();
// alert(presta_Hduree_Old);
$.ajax({
type:'POST',
url: 'prstajax.php',
data:'presta_Hduree_Old='+presta_Hduree_Old+'&presta_Hdeb='+presta_Hdeb+'&presta_Hfin='+presta_Hfin,
success:function(html){
$('#hidefact').html(html);
}
});
});
$('#salarie_idupd').blur(function(){
document.getElementById("hidden11").style.display = "none";
var presta_Hdeb = $('#appt1').val();
var presta_Hfin = $('#appt2').val();
// alert(presta_Hduree_Old);
$.ajax({
type:'POST',
url: 'prstajax.php',
data:'presta_Hduree_Old='+presta_Hduree_Old+'&presta_Hdeb='+presta_Hdeb+'&presta_Hfin='+presta_Hfin,
success:function(html){
$('#hidefact').html(html);
}
});
});
$('#presta_forfait').blur(function(){
document.getElementById("hidden11").style.display = "none";
var presta_Hdeb = $('#appt1').val();
var presta_Hfin = $('#appt2').val();
// alert(presta_Hduree_Old);
$.ajax({
type:'POST',
url: 'prstajax.php',
data:'presta_Hduree_Old='+presta_Hduree_Old+'&presta_Hdeb='+presta_Hdeb+'&presta_Hfin='+presta_Hfin,
success:function(html){
$('#hidefact').html(html);
}
});
});
$('#salarie_idupd').on('change',function(){
document.getElementById("hidden11").style.display = "none";
});
});
</script>
<?php
}
?>