AnonSec Team
Server IP : 10.128.40.6  /  Your IP : 216.73.217.20
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/python/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/mcg/pages/python/../Pres.php
<?php

include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;

// phpinfo();





?><html>

			<head>

			<?php include('header.php'); ?>


			</head> 
			
<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'); ?>


  



 <!-- 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 -->


   
   
   	
				<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-clock"></i> T&#233;l&#233;pointage  Prestation   </h3>
																	</div>
																</div> 
															</div>
									<div class="card-body">
									
									
											<?php		

// if(!empty($_POST))
// {
// echo "<pre>" ; 
// print_r($_POST) ; 
// echo "<pre>" ; 
// }

if(!empty($_POST))
{

	$an= $_POST['ans'] ; 
	$mois =  $_POST['mois'] ; 
// $ismai = $_POST['ans']."".$_POST['mois']  ; 
$ismai =  $an."".$mois ; 
$salarie_id=$_POST['salarie_id'] ;
// $qa = dbi_query(" SELECT * FROM `telepointage` where matricule = $salarie_id and `jour` LIKE '$ismai%' ORDER BY `telepointage`.`jour` DESC ,heure DESC ") ;  


}





// echo "ppp=> $an <br/>" ; 

// $a = dbi_query("SELEC * FROM `etablissement` $where1")

function dateDifference($date1, $date2)
{
    $first = DateTime::createFromFormat('m/d/Y', $date1);
    $second = DateTime::createFromFormat('m/d/Y', $date2);
    if($date1 > $date2) return week_between_two_dates($date2, $date1);
    return floor($first->diff($second)->days/7);
}
 ?>



															
															
															

	  				

  
  
  
  											
							<form id="bureau_mois" name="mois_form" method="POST" action="">							
							  <div class="form-row"> 
							  
							  	<div class="form-group col-md-4">
									 <div class="input-group">
									<?php $qm = dbi_query("SELECT *  FROM `salarie` WHERE `salarie_statut` = '1' ORDER BY `salarie`.`salarie_nom` ASC") ; ?>
										  <select class="form-control select2" style="width: 100%;" name="salarie_id" >
											<option selected="selected">selectionner un salari&#233; </option>
											<?php while($sala = dbi_fetch_row($qm)) { ?>
											<option  value='<?php echo $sala['salarie_id'] ;  ?>'><?php echo $sala['salarie_nom']." ".$sala['salarie_prenom']?></option>
											<?php }?>
										  </select>
								   </div>
							   </div> 
							  
							  
								<div class="form-group col-md-3">
								  <div class="input-group">
									  <?php $qm = dbi_query("SELECT *  FROM `client` WHERE `client_statut` = '1'") ; ?>							 
											  <select class="form-control select" style="width: 100%;"  name="mois" onchange="GetIdmois()";>
												<option selected="selected">selectionner un mois  </option>
												<option  value='01' <?php if($mois=="01"){echo "selected" ; }?>> Janvier   </option>
												<option  value='02' <?php if($mois=="02"){echo "selected" ; }?> > F&#233;vrier   </option>
												<option  value='03' <?php if($mois=="03"){echo "selected" ; }?>> Mars   </option>
												<option  value='04' <?php if($mois=="04"){echo "selected" ; }?> > Avril   </option>
												<option  value='05' <?php if($mois=="05"){echo "selected" ; }?>> Mai   </option>
												<option  value='06' <?php if($mois=="06"){echo "selected" ; }?>> Juin   </option>
												<option  value='07' <?php if($mois=="07"){echo "selected" ; }?> > Juillet   </option>
												<option  value='08' <?php if($mois=="08"){echo "selected" ; }?>> Aout   </option>
												<option  value='09' <?php if($mois=="09"){echo "selected" ; }?> > Septembre   </option>
												<option  value='10' <?php if($mois=="10"){echo "selected" ; }?> > Octobre   </option>
												<option  value='11' <?php if($mois=="11"){echo "selected" ; }?>> Novembre   </option>
												<option  value='12' <?php if($mois=="12"){echo "selected" ; }?>> DF&#233;cembre   </option>
											  </select>
									</div> 
								</div>
   
   
     
								<div class="form-group col-md-3">
									 <div class="input-group"> 
											  <select class="form-control select" style="width: 100%;"  name="ans" onchange="GetIdans()";>
												<option selected="selected">selectionner un ann&#233;e  </option>
													
													<option  value='2020' <?php if($an=="2020"){echo "selected" ; }?> > 2020   </option>
													<option  value='2021' <?php if($an=="2021"){echo "selected" ; }?>> 2021   </option>
													<option  value='2022' <?php if($an=="2022"){echo "selected" ; }?>> 2022   </option>
													<option  value='2023' <?php if($an=="2023"){echo "selected" ; }?>> 2023   </option>
													<option  value='2024' <?php if($an=="2024"){echo "selected" ; }?> > 2024   </option>
													<option  value='2025' <?php if($an=="2025"){echo "selected" ; }?> > 2025   </option>
													<option  value='2026' <?php if($an=="2026"){echo "selected" ; }?>> 2026   </option>											 
											  </select>											  
				                   </div>
	                            </div>
	 
   
								<div class="form-group col-md-2">
									 <div class="input-group">
											<button type="submit" name="Afficher" class="btn btn-primary">Afficher </button>
								   </div>
							   </div> 
						</div> 
						</form>
  
  
  
  		
		
										<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">Jour</th>
																  <th align="center">Salari&#233;</th>	
																  <th align="center">Prestation </th>
																  <th align="center">Télépointage </th>
																  <th align="center">SMS </th>
																  
																</TR>
															</thead>
                                                            <tbody>
															
                                                            <?php 
															
															if(empty($_POST['salarie_id'])){$_POST['salarie_id']=0 ;}
															for($i=1; $i<=31; $i++)
																{
																	if($i<10)
																	  $date_jour=  $ismai."0".$i ;  
																	else
																	$date_jour=  $ismai."".$i ; 

															$sqlah = " SELECT *  FROM telepointage WHERE jour LIKE '".$date_jour."' and matricule = '".$_POST['salarie_id']."' ";
															 $ah = dbi_query($sqlah) ; 
															 
															 
															 
															 
															 
															 
																$salarie_id = $_POST['salarie_id'];
																$date = $date_jour;
																$q = dbi_query("
																	SELECT * FROM PRESTATIONS p where presta_date_debut <= $date AND (p.presta_date_fin >= $date OR p.presta_date_fin IS NULL)
																	AND ( p.presta_id IN (select presta_id FROM PRESTATIONS WHERE salarie_id = $salarie_id   ) OR p.presta_id IN ( select presta_id FROM PRESTATIONS_MODIF WHERE salarie_id = $salarie_id ) )
																");
																$chaine ="" ; 
																	while($prest = dbi_fetch_row($q))
																{		
																		$date_presta_sem = $prest['presta_date_debut'] ;
																		$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'])
																		{
																			if( $m['presta_sem'] != NULL ) $date_presta_sem = $m['start'];
																			$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['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['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( $prest['salarie_id'] == $salarie_id ) {
																					$day = date("w", strtotime( int2date_autre_format($date)));
																					if( $day == $prest['presta_jour']){		
																					
																						$EXP = dbi_fetch_row(dbi_query("SELECT date_presta FROM EXCEPTIONS WHERE presta_id = ".$prest['presta_id']." AND date_presta = ".$date." " )) ;	   ;
																						if($EXP ){}   else {
																							if( $prest['presta_sem'] == 1 )
																							{
																								   $Clt = dbi_fetch_row(dbi_query("SELECT * FROM client WHERE client_id = ".$prest['client_id'] ." " )) ;	    
																									$chaine .=  $Clt["client_nom"]." ** ".int2heure($prest['presta_Hdeb'])." ==>  ".int2heure(addDuree($prest['presta_Hdeb'], $prest['presta_Hduree']))."<br/>";
																		
																							}
																							
																						}

																					}																			
																				}	
																}		
															
															// echo $client_nom."  --- ".$tel['heure']." --- ".$tel['action']; 
															
															
															
															
															
															 
															 
															 list($som)= dbi_fetch_row(dbi_query("SELECT count(id_p)  FROM telepointage WHERE jour LIKE '".$date_jour."' and matricule = '".$_POST['salarie_id']."' ")) ; 
															 if($som != 0)
															 {
															 // echo "==> $som <br/>" ; 
															 list($inter_nom ,	$inter_pnom) = dbi_fetch_row(dbi_query(" SELECT salarie_nom	, salarie_prenom  FROM salarie WHERE salarie_id = ".$_POST['salarie_id'])) ;
															 ?>
															 <tr>
															   <td rowspan="<?php echo "$som" ; ?>"> <?php echo int2date($date_jour) ; ?> </td> 
															    
															   <td rowspan="<?php echo "$som" ; ?>"> <?php echo $inter_nom." ".$inter_pnom; ?> </td> 
															   
															   <td rowspan="<?php echo "$som" ; ?>"> <?php echo $chaine ; ?> </td> 
															   <?
																	while($tel = dbi_fetch_row($ah)) { ?>
													
															<?php $tele =$tel['telephone'] ; 
															list($client_nom ) = dbi_fetch_row(dbi_query("SELECT client_nom  FROM `client` WHERE `tele1` LIKE '$tele' OR `tele2` LIKE '$tele' OR `tele3` LIKE '$tele' OR `tele4` LIKE '$tele'")) ; 
															?>
															
															
															
															<td> <?php echo $client_nom."  --- ".$tel['heure']." --- ".$tel['action']; ?> </td> 

													

															
																	<td colspan="">  </td> 
															 </tr>	
															
															 <?php } ?>
															 
															 
															
															<?php
															 }
																
															
																
																}
															?>

															
																
															 
															
 
															</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').on('show.bs.modal', function (e) {
        var rowid = $(e.relatedTarget).data('id');
        $.ajax({
            type : 'post',
            url : 'ajaxAjoutMat.php', //Here you will fetch records 
            data :  'rowid='+ rowid, //Pass $id
            success : function(data){
            $('#fetch').html(data);//Show fetched data from database
            }
        });
     });
});

    
</script>



		
</body>
</html>

AnonSec - 2021