AnonSec Team
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  ]

Current File : /home/logmcpe/www/TMCPRO/pages/Prestation_Upt_Date_bien_ancien.php
<?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 f= 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">&times;</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&#233;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
{	
?>


	
        <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">&times;</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']; ?>" >								
								<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-2">
										<label for="inputAddresse">Heure D&#233;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">
									  <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"><!-- 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 class="form-group col-md-8"><!-- Liste déroulante jour -->  
										<label>Chantier </label>
										<select required class="form-control" name="chantier_id" id="chantier_id">
											<?php $req1 =dbi_query("SELECT *  FROM chantier WHERE client_id = $client_id and chantier_type_id = 1") ; 
											while(  $chant=dbi_fetch_row($req1)) { ?>
												<option value="<?php echo $chant['chantier_ID'] ; ?>"  <?php if( $chant['chantier_ID']== $prest['chantier_id']) echo 'SELECTED'  ; ?> ><?php echo $chant['chantier_designation']; ?></option>
												<?php   }	?>
										</select>
									</div>
   
									<div class="form-group col-md-4">
										<label for="inputsociete">Taux</label>
										<input type="text"	 class="form-control" name="presta_forfait" id="presta_forfait"  value="<?php echo $prest['presta_forfait'] ;?>"  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>


			
			
			
<script>


function myFunction() {
	// $facture = $this->input->post('facture');
	// var facture = $(this).parent().parent().find("#facture");
	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');
		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(){
		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(){
		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(){
		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(){
		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);
			}
		}); 
	});		
	
  });
</script>
<?php	
}
	
?>

AnonSec - 2021