|
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
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
if(!empty($_POST['presta_id']))
{
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
// exit() ;
dbi_query("UPDATE `PRESTATIONS` SET `annexe_salarie_id` = '".$_POST['salarie_id']."' WHERE `PRESTATIONS`.`presta_id` = ".$_POST['presta_id']) ;
header('Location:Prestation_par_etablisement.php?msg=salarié bien affecté&color=success');
}
?>
<!DOCTYPE html>
<html>
<head>
<?php include('header.php'); ?>
</head>
<script language="Javascript">
function GetIdBureauB()
{
var id_etab="";
id_etab = document.client_statu_form.client_etab.value ;
if( id_etab > 0 || id_etab=="INDEFINI" )
window.location = "Prestation_par_etablisement.php?id_etab="+id_etab;
else
window.location = "Prestation_par_etablisement.php";
}
</script>
<?php
$_SESSION["id_etab"]= 111 ;
$_SESSION["id_statu"]=2 ;
// echo "==>".$_SESSION["id_etab"]."<br/>" ;
// echo "==>".$_SESSION["id_statu"]."<br/>" ;
if(!empty( $_GET["id_statu"]))
{
$_SESSION["id_statu"] = $_GET["id_statu"];
}
if(!empty( $_GET["id_etab"]))
{
$_SESSION["id_etab"] = $_GET["id_etab"];
}
if($_SESSION["id_etab"]== 111){
$where_etablissement_id="" ;
}
else{
$where_etablissement_id = " AND c.etablissement_id = ".$_SESSION["id_etab"] ;
}
?>
<body class="hold-transition sidebar-mini">
<!-- Site wrapper -->
<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>
</ul>
</nav>
<!-- BARRE DE NAVIGATION -->
<?php include('menu.php'); ?>
<div class="modal fade" id="myModal_tache_all" 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="fetch_tache_all" ></div>
</div>
</div>
</div>
<!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="modal fade" id="myModal" 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="fetch" >
</div>
</div>
</div>
</div>
</div><!-- /.row -->
</div>
</div>
<!-- /.content-header -->
<!-- PAGE PRINCIPALE -->
<section class="content">
<div class="row">
<div class="col-12">
<div class="card card-primary card-outline">
<div class="card-header">
<div class="row">
<div class="col-sm-11">
<h3 class="card-title"> <i class="nav-icon fas fa-id-card"></i> Prestation </h3>
</div>
</div>
</div>
<div class="card-body">
<?php $data = array(); $date = date("Ymd"); $i = 1; $were_type = "" ;
if(!empty($_POST))
{
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
$type=$_POST['type'] ;
$were_type= " AND prestation_type = $type " ;
}
$q = dbi_query("SELECT * FROM PRESTATIONS p, client c WHERE p.client_id = c.client_id and ((presta_date_debut != presta_date_fin && presta_date_fin >= '".$date."') OR presta_date_fin IS NULL and annexe_salarie_id = 0 $where_etablissement_id)");
?>
<form id="client_statu_form" name="client_statu_form" method="POST" action="">
<div class="form-row">
<!-- 6 ya3ni tous les clients / 4 ya3ni Clients inactifs / 2 Client actifs -->
<div class="form-group col-md-6">
<div class="input-group">
<?php $qa = dbi_query("SELECT * FROM `etablissement`") ; ?>
<select class="form-control select" style="width: 100%;" id="client_etab" name="client_etab" onchange="GetIdBureauB()"; >
<?php while($etab=dbi_fetch_row($qa)) {?>
<option value="<?php echo $etab['etablissement_id'] ;?> " <?php if($etab['etablissement_id']==$_SESSION["id_etab"]){echo "selected" ;} ?> ><?php echo $etab['etablissement_nom'] ;?></option>
<?php } ?>
<option value="111" <?php if($_SESSION["id_etab"]== 111 ){echo "selected" ;} ?> >Tous les Etablissements</option>
</select>
</div>
</div>
</div>
</form>
<?php
if(isset($_GET["msg"])){
?>
<div class="alert alert-<?php echo $_GET["color"]; ?> alert-dismissible col-12" role="alert">
<strong><?php echo $_GET["color"].': '; ?></strong><?php echo $_GET["msg"]; ?>.
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
?>
<div class="onglet_dotted">
<div style="width:100%; float:left; vertical-align:top" class="header_ray">
<div id="tab">
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<TR>
<th align="center">id</th>
<th align="center">Client</th>
<th align="center">Salarié</th>
<th align="center">Jour </th>
<th align="center">Jour </th>
<th align="center">Heure de début</th>
<th align="center">Heure de fin</th>
<th align="center">Fréquence</th>
<th align="center">Type de prestation</th>
<th align="center">Affecter</th>
</TR>
</thead>
<tbody>
<?php
while($prest = dbi_fetch_row($q))
{
$q1 = dbi_query("SELECT * FROM PRESTATIONS_MODIF WHERE presta_id = ".$prest['presta_id']." AND start <= '".$date."' order by start, modif_id ") ;
while ($m = dbi_fetch_row($q1))
{
$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['presta_sem'] = $m['presta_sem'] === NULL ? $prest['presta_sem'] : $m['presta_sem'] ;
$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'] ;
}
// echo $i.' $$ '.$prest['presta_id'].' ** '.$prest['client_id'].' ** '.$prest['presta_jour'].' ** '.$prest['salarie_id'].'<br>';
list($client_nom)= dbi_fetch_row(dbi_query("SELECT `client_nom` FROM `client` WHERE `client_id` = ".$prest['client_id']));
if($client_nom == ""){
$chain_clien = $prest['client_id'] ;
}else{
$chain_clien = $client_nom ;
}
if($prest['presta_jour']==1){$presta_jour= "Lundi" ; } if($prest['presta_jour']==2){$presta_jour= "Mardi" ; } if($prest['presta_jour']==3){$presta_jour= "Mercredi" ; }
if($prest['presta_jour']==4){$presta_jour= "Jeudi" ; } if($prest['presta_jour']==5){$presta_jour= "Vendredi" ; } if($prest['presta_jour']==6){$presta_jour= "Samedi" ; }
list($salarie_nom ,$salarie_prenom)= dbi_fetch_row(dbi_query("SELECT salarie_nom , salarie_prenom FROM `salarie` WHERE `salarie_id` = ".$prest['salarie_id']));
list($prestation_type_intitul)=dbi_fetch_row(dbi_query("SELECT `prestation_type_intitul` FROM `prestation_type` WHERE `prestation_type_id` = ".$prest['prestation_type'])) ;
?>
<tr>
<td><?php echo $prest['presta_id'] ; ?> </td>
<td><?php echo $chain_clien ; ?> </td>
<td><?php echo $salarie_nom." ".$salarie_prenom ; ?> </td>
<td><?php echo $prest['presta_jour'] ; ?> </td>
<td><?php echo $presta_jour ; ?> </td>
<td><?php echo int2heure($prest['presta_Hdeb']) ; ?> </td>
<td><?php echo int2heure(addDuree($prest['presta_Hdeb'],$prest['presta_Hduree'])) ; ?> </td>
<td><?php echo $prest['presta_sem'] ; ?> </td>
<td><?php echo $prestation_type_intitul ; ?> </td>
<th align="center"> <h3>
<?php echo '<a class="btn btn-info btn-sm" href="#myModal_tache_all" id="custId" data-toggle="modal" data-id="'.$prest['presta_id'].'">Affecter</a>';?>
</h3></th>
</tr>
<?php
++$i;
}
?>
</tbody>
</table><!-- /.table -->
</div><!-- /.box-body -->
</div><!-- /.tab -->
</div><!-- /.header_ray -->
</div><!-- /.onglet_dotted -->
</div><!-- /.card-body -->
</div><!-- /.card card-primary card-outline -->
</div> <!-- /.col-12 -->
</div> <!-- /.row -->
</section> <!-- /.section -->
</div>
<?php include('footerr.php'); ?>
<script type="text/javascript">
$(document).ready(function(){
$('#myModal_tache_all').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$.ajax({
type : 'post',
url : 'prestation_ajax_affect_salar.php', //Here you will fetch records
data : 'rowid='+ rowid, //Pass $id
success : function(data){
$('#fetch_tache_all').html(data);//Show fetched data from database
}
});
});
});
</script>
</body>
</html>
