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/TEST/../TMCPRO/pages/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/TEST/../TMCPRO/pages/fourinc_12_01_2026.php
<?php
// exit() ; 
// echo "test <br/>" ;
 // la page qui me permet de selectionner l'etablisement avant d'ariver sur cette page est pon_fourinc.php

// require __DIR__ . '/vendor_sms_recu/autoload.php';
// include 'includes_sms_recu/ovh.php';
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;


$_SESSION['automatique'] = 1 ;


	$month = date('m') ;
	$year = date('Y') ;
	// echo "==$year===$month <qbr/>" ;

$d=cal_days_in_month(CAL_GREGORIAN,$month,$year);

$an_mo = $year."".$month ;
list($nbr_jour) = dbi_fetch_row(dbi_query(" SELECT count(*) FROM `verification_pointage` WHERE `date` LIKE '".$an_mo."%'"))  ;

// echo " SELECT count(*) FROM `verification_pointage` WHERE `date` LIKE '".$an_mo."%' <br/>" ;
// echo "$d   --- kkkk ==>$nbr_jour <br/>" ;
// exit() ;


if($nbr_jour < $d){

	dbi_query("DELETE FROM `verification_pointage` WHERE `date` LIKE '".$an_mo."%'") ;
for($i=1 ; $i<= $d ; $i++ )
{
	if($i<10){
		$chaine_date =  $year."".$month."0".$i ;
	}else{
		$chaine_date =  $year."".$month."".$i ;
	}


	dbi_query("INSERT INTO `verification_pointage` (`id_verification_pointage`, `date`, `valide`) VALUES (NULL, '".$chaine_date."', '0')") ;
}

}





										$_SESSION["id_etab"]= 111 ;



										if(!empty( $_GET["id_etab"]))
										{
										$_SESSION["id_etab"] = $_GET["id_etab"];
										}


										if($_SESSION["id_etab"]== 111){
											$where_etablissement_id="" ;
										}
										else{
										$where_etablissement_id = " AND etablissement_id = ".$_SESSION["id_etab"] ;
										}




// echo "<pre>" ;
// print_r($_GET) ;
// echo "</pre>" ;


if($_GET['action'] == "sup_message")
{
$idprod=$_GET['id'];
// echo "==> $idprod <br/>" ;
	dbi_query("DELETE FROM `message_pointage` WHERE `message_pointage`.`id_message_pointage` =  $idprod  ") ;
	header('Location:fourinc.php?msg=messsage bien supprimé&color=success');
}


if(!empty($_POST['message']))
{


	$date_message_pointage = dateformaint($_POST['date_message_pointage']) ;

	// echo "==>".$date_message_pointage."<br/>" ;

	  dbi_query(" INSERT INTO `message_pointage` (`id_message_pointage`, `client_id`, `salarie_id`, `date_message_pointage`, `message`)
          VALUES (NULL, '".$_POST['client_id']."', '".$_POST['salarie_id']."', '".$date_message_pointage."', '".addslashes($_POST['message'])."')") ;



	header('Location:fourinc.php?msg=messsage bien ajouté&color=success');
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;

	// echo "bonjour" ;

	// exit() ;
}


											// echo "<pre>" ;
											// print_r($_GET) ;
											// echo "</pre>" ;


// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<< anomalies fin >>>++++++++++++++++++++++++++++++++++++++++++++++++++++++

// le code pour remplir la table
    // function check_null($value)
    // {
        // if(empty($value))
        // {
            // return 0;
        // }
        // else{
            // return $value;
        // }
    // }


// $my_connection = ftp_connect("telegestion.appius.fr", 21) or exit('Erreur : connexion au serveur FTP impossible.');
// ftp_login($my_connection, "AD_636", "AC4BRT9F");
// ftp_pasv($my_connection, true);
// $liste_fichiers = ftp_nlist($my_connection, '/sortie');
// foreach($liste_fichiers as $fichier)
// {
		// $ret = ftp_nb_get($my_connection, "input.txt", $fichier, FTP_BINARY);
// while ($ret == FTP_MOREDATA) {
   // $ret = ftp_nb_continue($my_connection);
// }
// if ($ret != FTP_FINISHED) {
   // echo "Il y a eu un problème lors du téléchargement...";
   // exit(1);
// }
// ftp_delete($my_connection, $fichier) ;
    // $file = fopen("input.txt","r");
    // while(! feof($file))
    // {
        // $line = fgets($file);
        // $row = explode(";", $line);
        // $agence = check_null($row[0]);
        // $jour = check_null($row[1]);
        // $heure = check_null($row[2]);
        // $telephone = check_null($row[3]);
        // $matricule = check_null($row[5]);
        // $action = check_null($row[6]);
				
				// $in = 0 ;  // ce variable pour ne pas pointer deux fois soit  on teste ce variable dans la 2eme condition
		// if(strlen($row[3])> 6){
		// $in= 1 ;
		// if($heure != 0)
		// {
			// $jour = dateMCPROint($jour) ;
        // $query = "INSERT INTO `telepointage`(`agence`, `jour`, `heure`, `telephone`, `matricule`, `action`) VALUES ('$agence', '$jour', '$heure', '$telephone', '$matricule', '$action')";
		// dbi_query($query) ;
		// }}

			// if( ((strlen($row[4])== 6)  OR (strlen($row[4])== 5) ) AND $in ==0 ){
		// if($heure != 0)
		// {
			// $client_id = check_null($row[4]);
			// $jour = dateMCPROint($jour) ;
        // $query = "INSERT INTO `telepointage`(`agence`, `jour`, `heure`, `client_id`, `matricule`, `action`) VALUES ('$agence', '$jour', '$heure', '$client_id', '$matricule', '$action')";
		// dbi_query($query) ;
		// }}
		// $client_id  = "" ; 
    // }

    // fclose($file);
// }



$ismai = $_SESSION['ans']."".$_SESSION['mois']  ;
if(!empty($_POST['mois']))
{
$_SESSION['mois'] = $_POST['mois']  ;
$_SESSION['ans'] = $_POST['ans']  ;

$ismai = $_POST['ans']."".$_POST['mois']  ;
}


if(empty($_POST['mois']) AND empty($_SESSION['mois']) )
{
	$ismai =  date("Ym") ;
		$_SESSION['mois'] =    date("m") ;
	$_SESSION['ans'] =    date("Y") ;
}








													   //=======================================l========= la mise a jour des id_client dans la télépointage ========================================================//

													   $qIo =dbi_query("SELECT *  FROM `telepointage` WHERE jour >= 20210801 AND (`client_id` IS NULL OR client_id = 0 )") ;
														while($j= dbi_fetch_row($qIo))
														{

															$telephone= $j['telephone'] ;

															list($client_id) = dbi_fetch_row(dbi_query("SELECT client_id FROM `client` WHERE `tele1` LIKE '$telephone'  or `tele2` LIKE '$telephone' or `tele3` LIKE '$telephone' or `tele4` LIKE '$telephone' or `tele5` LIKE '$telephone' ")) ;

														// echo "$telephone ==> $client_id	<br/>" ;
														// echo "SELECT client_id FROM `client` WHERE `tele1` LIKE '$telephone'  or `tele2` LIKE '$telephone' or `tele3` LIKE '$telephone' or `tele4` LIKE '$telephone' or `tele5` LIKE '$telephone' <br/> " ; 

														 dbi_query("UPDATE `telepointage` SET `client_id` = '$client_id' WHERE `id_p` = ".$j['id_p'] );



														}
														//=============================================================================================================================================================//





															$qa = dbi_query(" SELECT DISTINCT a.* FROM telepointage a , telepointage b , client c  where   a.client_id != 0  AND a.jour = b.jour AND a.matricule = b.matricule AND a.client_id= b.client_id AND a.client_id = c.client_id AND a.id_p != b.id_p AND a.action = 'FIN' AND b.action = 'FIN' AND   a.pointage_valider = 0  AND b.pointage_valider = 0 AND a.jour LIKE '$ismai%' $where_etablissement_id  ORDER BY a.jour ASC") ;

														$nbr_anomalie_fin = 0 ;
															while($tel = dbi_fetch_row($qa)) { $nbr_anomalie_fin++ ;  }




						//++++++++++++++++++++++++++++++++++++++++++++++++++<< anomalies debut >>+++++++++++++++++++++++++++++++++++++++


															$nbr_anomalie_debut = 0  ;
																$qi = dbi_query("  SELECT DISTINCT a.* FROM telepointage a , telepointage b , client c  where   a.client_id != 0  AND a.jour = b.jour AND a.matricule = b.matricule AND a.client_id= b.client_id AND a.client_id = c.client_id AND a.id_p != b.id_p AND a.action = 'DEBUT' AND b.action = 'DEBUT'  AND   a.pointage_valider = 0 and b.pointage_valider = 0 AND a.jour LIKE '$ismai%'  $where_etablissement_id ORDER BY a.jour ASC") ;
														while($t = dbi_fetch_row($qi)) {$nbr_anomalie_debut ++ ;  }


						//++++++++++++++++++++++++++++++++++++++++++++++<< anomalies  salarie >>++++++++++++++++++++++++++++++++++++++++++++++++++++++


															$nbr_anomalie_salarie = 0  ;

							 $qui = dbi_query(" SELECT * FROM `telepointage` t , client c  where t.client_id = c.client_id AND  `jour` LIKE  '$ismai%'  $where_etablissement_id ORDER BY t.jour ASC ") ;


							   while($t = dbi_fetch_row($qui)) {
															 list($inter_nom ,	$inter_pnom) = dbi_fetch_row(dbi_query(" SELECT salarie_nom , salarie_prenom  FROM `salarie` WHERE `salarie_id` = ".$t['matricule'])) ;
															 $tele =$t['telephone'] ;
															list($client_nom,$client_id ) = dbi_fetch_row(dbi_query("SELECT client_nom,client_id  FROM `client` WHERE `tele1` LIKE '$tele' OR `tele2` LIKE '$tele' OR `tele3` LIKE '$tele' OR `tele4` LIKE '$tele'  OR `tele5` LIKE '$tele' ")) ;



															if($inter_nom == "" AND $inter_pnom=="" )
															{
																$nbr_anomalie_salarie++ ;
															}

															}



						// ++++++++++++++++++++++++++++++++++++++++++++++++++++<< anomales client >>+++++++++++++++++++++++++++++++++++++++++++++

						$nbr_anomalie_client = 0  ;

                   // $qaP = dbi_query(" SELECT * FROM `telepointage` where `jour` LIKE '$ismai%' ORDER BY `telepointage`.`jour` ASC ") ;
                       $qaP = dbi_query(" SELECT * FROM `telepointage` t , salarie c  where t.matricule = c.salarie_id AND  `jour` LIKE  '$ismai%' and client_id = 0  $where_etablissement_id ORDER BY t.jour ASC ") ;
                       // $qaP = dbi_query(" SELECT * FROM telepointage t , client c  where t.client_id = c.client_id AND `jour` LIKE '$ismai%' $where_etablissement_id ORDER BY t.jour ASC ") ;
// OR `tele5` LIKE '$tele'
					    while($tt = dbi_fetch_row($qaP)) {
															$tele =$tt['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' OR `tele5` LIKE '$tele'  $where_etablissement_id ")) ;

															// echo "SELECT client_nom  FROM `client` WHERE `tele1` LIKE '$tele' OR `tele2` LIKE '$tele' OR `tele3` LIKE '$tele' OR `tele4` LIKE '$tele' OR `tele5` LIKE '$tele'  $where_etablissement_id <br/>" ;

															if($client_nom=="")
															{
																$nbr_anomalie_client++ ;
															}
														}






// echo "==> $nbr_anomalie_fin <br/>" ;
// echo "==> $nbr_anomalie_debut <br/>" ;
// echo "===> $nbr_anomalie_salarie <br/>" ;
// echo "=====> $nbr_anomalie_client <br/>" ;

?>
<html>
			<head>

			<?php include('header.php'); ?>
			
			  <!-- 
	  <script type="text/javascript" src="plugins/selectize/selectize.js"></script>
	<link rel="stylesheet" type="text/css" href="plugins/selectize/selectize.css" />
	<script type="text/javascript" src="plugins/selectize/selectize.min.js"></script>
	<link rel="stylesheet" type="text/css" href="plugins/selectize/selectize.default.css" />
	<link rel="stylesheet" href="../../plugins/summernote/summernote-bs4.css">








<script src="plugins/jQuery/jquery-2.2.3.min.js"></script>

<script src="bootstrap/js/bootstrap.min.js"></script>

<script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables/dataTables.bootstrap.min.js"></script>

<script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
 -->
  <style type="text/css">
  .modal-backdrop {
    /* bug fix - no overlay */
    display: none;
}
</style>


<!-- SlimScroll -->



			</head>


<body class="hold-transition sidebar-mini">
<div class="wrapper">

  <!-- Navbar -->
  <nav class="main-header navbar navbar-expand navbar-white navbar-light">
    <!-- Left navbar links -->
    <ul class="navbar-nav">



      <li class="nav-item d-none d-sm-inline-block">
        <a href="index.html" class="nav-link"><!--Accueil --></a>
      </li>

      <li class="nav-item d-none d-sm-inline-block">
        <a href="#" class="nav-link"><!--Contact --></a>
      </li>


    </ul>

    <!-- SEARCH FORM
    <form class="form-inline ml-3">
      <div class="input-group input-group-sm">
        <input class="form-control form-control-navbar" type="search" placeholder="Search" aria-label="Search">
        <div class="input-group-append">
          <button class="btn btn-navbar" type="submit">
            <i class="fas fa-search"></i>
          </button>
        </div>
      </div>
    </form>
 -->


  </nav>
  <!-- /.navbar -->

  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">

    <!-- Brand Logo -->
    <a href="index3.html" class="brand-link">
      <img src="dist/img/logomcpro.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
           style="opacity: .8">
      <span class="brand-text font-weight-light">MC PRO</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user panel (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="image">
          <img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
        </div>
        <div class="info">
          <a href="#" class="d-block">Steeven ROBLOT</a>
        </div>
      </div>

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

      <!-- Sidebar Menu -->

    </div>
    <!-- /.sidebar -->
  </aside>

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

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">

		<section class="content-header">
		 <div class="container-fluid">
			 <div class="row mb-2">
				 <div class="col-sm-6">
					 <h1>Pointages</h1>
				 </div>
				 <div class="col-sm-6">
					 <ol class="breadcrumb float-sm-right">
						 <li class="breadcrumb-item"><a href="index.php">Accueil</a></li>

						 <li class="breadcrumb-item active">Pointages </li>
					 </ol>
				 </div>
			 </div>
		 </div><!-- /.container-fluid -->
		</section>

    <!-- Content Header (Page header) -->


    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">



        <!-- Small boxes (Stat box) -->
        <div class="row">



          <!-- ./col -->
          <div class="col-lg-3 col-6">
            <!-- small box -->
            <div class="small-box bg-info">
              <div class="inner">
                <h3><?php  echo $nbr_anomalie_debut ; ?> </h3>
								<p>Anomalies DEBUT</p>
							</div>
              <div class="icon">
                <i class="ion ion-arrow-left-a"></i>
              </div>
              <a href="http://www.tmcpro.logmcpro.fr/pages/anomalies_debut.php" class="small-box-footer">Corriger <i class="fas fa-arrow-circle-right"></i></a>
            </div>
          </div>
          <!-- ./col -->
					<div class="col-lg-3 col-6">
						<!-- small box -->
						<div class="small-box bg-info">
							<div class="inner">
								<h3>  <?php echo $nbr_anomalie_fin ; ?></h3>
								<p>Anomalies FIN</p>

							</div>
							<div class="icon">
								<i class="ion ion-arrow-right-a"></i>
							</div>
							<a href="http://www.tmcpro.logmcpro.fr/pages/anomalies_fin.php" class="small-box-footer">Corriger <i class="fas fa-arrow-circle-right"></i></a>
						</div>
					</div>


          <!-- ./col -->


          <div class="col-lg-3 col-6">
            <!-- small box -->
            <div class="small-box bg-info">
              <div class="inner">

                <h3> <?php echo $nbr_anomalie_salarie  ;  ?></h3>
								<p>Anomalies SALARIES</p>

              </div>
              <div class="icon">
                <i class="ion ion-android-person"></i>
              </div>
              <a  href="http://www.tmcpro.logmcpro.fr/pages/anomalies_salarie_2.php"  class="small-box-footer">Corriger <i class="fas fa-arrow-circle-right"></i></a>
            </div>
          </div>


		   <div class="col-lg-3 col-6">
            <!-- small box -->
            <div class="small-box bg-info">
              <div class="inner">
                <h3><?php  echo $nbr_anomalie_client  ; ?> </h3>
								<p>Anomalies CLIENTS</p>


              </div>
              <div class="icon">
                <i class="ion ion-home"></i>
              </div>
              <a href="http://www.tmcpro.logmcpro.fr/pages/anomalies_numero.php" class="small-box-footer">Corriger <i class="fas fa-arrow-circle-right"></i></a>
            </div>
          </div>
</div>

					<div class="row">

						<div class="col-lg-6 col-6">
							<!-- small box -->
							<div class="small-box bg-info">
								<div class="inner">
									<h3>CONTROLE QUOTIDIEN</h3>

									<p>Vérification des pointages par jour</p>
								</div>
								<div class="icon">
									<i class="ion ion-checkmark"></i>
								</div>
								<a href="Pres_jours2.php" class="small-box-footer">Contrôler <i class="fas fa-arrow-circle-right"></i></a>
							</div>
						</div>


					<div class="col-lg-6 col-6">
						<!-- small box -->
						<div class="small-box bg-secondary">
							<div class="inner">
								<h3>RAPPORT MENSUEL</h3>

								<p>Edition du rapport mensuel pour la paye</p>
							</div>
							<div class="icon">
								<i class="ion ion-android-list"></i>
							</div>
							<a href="paye182.php" class="small-box-footer">Voir <i class="fas fa-arrow-circle-right"></i></a>
						</div>
					</div>
				</div>

					<div class="row">


						<div class="col-lg-3 col-3">
							<!-- small box -->
							<div class="small-box bg-secondary">
								<div class="inner">
									<h3>LISTING MENSUEL</h3>

									<p>Affichage de tous les pointages par mois</p>
								</div>
								<div class="icon">
									<i class="ion ion-archive"></i>
								</div>
								<a href="testftp.php" class="small-box-footer">Voir <i class="fas fa-arrow-circle-right"></i></a>
							</div>
						</div>

						<div class="col-lg-3 col-3">
							<!-- small box -->
							<div class="small-box bg-secondary">
								<div class="inner">
									<h3>EXCES DE POINTAGES</h3>

									<p>Liste des pointages non validés</p>
								</div>
								<div class="icon">
									<i class="ion ion-plus"></i>
								</div>
								<a href="pointages_restant1.php" class="small-box-footer">Voir <i class="fas fa-arrow-circle-right"></i></a>
							</div>
						</div>

						<div class="col-lg-3 col-3">
							<!-- small box -->
							<div class="small-box bg-secondary">
								<div class="inner">
									<h3>PARAMETRAGE</h3>

									<p>Enregistrement des N° des clients</p>
								</div>
								<div class="icon">
									<i class="ion ion-gear-b"></i>
								</div>
								<a href="Parametrage.php" class="small-box-footer">Voir <i class="fas fa-arrow-circle-right"></i></a>
							</div>
						</div>

						<div class="col-lg-3 col-3">
							<!-- small box -->
							<div class="small-box bg-secondary">
								<div class="inner">
									<h3>NFC</h3>

									<p>Téléphones mis à disposition</p>
								</div>
								<div class="icon">
									<i class="ion ion-iphone"></i>
								</div>
								<a href="NFC.php" class="small-box-footer">Voir <i class="fas fa-arrow-circle-right"></i></a>
							</div>
						</div>
						<!-- ./col -->

						<!-- ./col -->

						<!-- ./col -->

						<!-- ./col -->
					</div>













				<section class="content">
					<div class="row">
						<div class="col-12">
							<div class="card">
								<div class="card-header">
									<h3 class="card-title">Messages reçus pour justifier l'absence de pointage</h3>
								</div>

									<div class="card-body">

																							<?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">&times;</span>
          </button>
        </div>
        <?php
        }
       ?>





<?php





 $qa = dbi_query(" SELECT * FROM message_pointage ") ;
 // echo "===>$an <br/>" ;
// echo "===>$ismai <br/>" ;
// echo "<pre>" ;
// print_r($_GET) ;
// echo "<pre>" ;

?>





		  <h3><a href="#myModal_tache_all"  id="custId" data-toggle="modal" >   <button type="button"  class="btn btn-primary" > <i class="fas fa-plus"></i> MESSAGE</button> </a></h3>


										<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">Date</th>
																  <th align="center">Salari&#233;</th>
																  <th align="center">Client</th>
                                  <th align="center">Message</th>



																  <th align="center"></th>

																</TR>
															</thead>
                                                            <tbody>
                                                            <?php while($tel = dbi_fetch_row($qa)) { ?>
															<?php list($inter_nom ,	$inter_pnom) = dbi_fetch_row(dbi_query(" SELECT salarie_nom , salarie_prenom  FROM `salarie` WHERE `salarie_id` = ".$tel['salarie_id'])) ;  ?>
															<?php $tele =$tel['telephone'] ;
															if($tel['client_id']>0){
																list($client_nom ) = dbi_fetch_row(dbi_query("SELECT client_nom  FROM `client` WHERE client_id = ".$tel['client_id'])) ;

															}else{
															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'  OR `tele5` LIKE '$tele' ")) ;
															}
															?>
															<tr>
															<td> <?php echo int2date($tel['date_message_pointage']) ; ?> </td>
															<td> <?php echo $inter_nom." ".$inter_pnom; ?> </td>
															<td> <?php echo $client_nom ; ?> </td>

															<td> <?php echo  $tel['message'] ; ?> </td>






															  <TD align="center" nowrap>


   <a class="btn btn-danger btn-sm" href="?action=sup_message&id=<?=$tel['id_message_pointage']?>"  onclick="return confirm('Voulez-vous vraiment supprimer ce message ?');">

				  <i class="fas fa-trash">
					</i> Supprimer
				   </a>

  </TD>

															</tr>


															<?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 class="content">
										<div class="row">
											<div class="col-12">
												<div class="card">
													<div class="card-header">
														<h3 class="card-title">Validation des pointages</h3>
													</div>

														<div class="card-body">







					<?php

					if(!empty($_POST['mois']))
					{

					$ismai = $_POST['ans']."".$_POST['mois']  ;
					}
					else
					{
						$ismai =  date("Ym") ;
						// echo "ppp=> $ismai <br/>" ;
					}



					// $_SESSION['favcolor'] = 'green';
					// if(!empty($_GET['idans']))
					// {
						// $_SESSION['idans'] = $_GET['idans'];
					// }
					// elseif(empty($_GET['id']))
					// {
					// $_SESSION['idans']  = date("Ym");
					// }
					// $ismai = date("m");

					// $an = $_SESSION['idans'] ;

					// if(!empty($_GET['id']))
					// {
						// $ismai=$an."".$_GET['id'] ;
					// }


					// if(empty($_GET['id']))
					// {
						// $ismai = $an."".$ismai  ;
					// }

 $qa = dbi_query(" SELECT * FROM `verification_pointage` WHERE `date` LIKE '$ismai%' ") ;
   list($indi) = dbi_fetch_row(dbi_query("SELECT COUNT(*) FROM `verification_pointage` WHERE `date` LIKE '$ismai%' and valide = 0")) ;
					 // echo "===>$an <br/>" ;
					// echo "===>$ismai <br/>" ;
					// echo "<pre>" ;
					// print_r($_GET) ;
					// echo "<pre>" ;

					?>

												<form id="bureau_mois" name="mois_form" method="POST" action="">
												  <div class="form-row">
													<div class="form-group col-md-2">
													  <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">sélectionner un mois  </option>
												<option  value='01' <?php if($_SESSION['mois']== '01'){echo 'SELECTED ' ; }?> > Janvier   </option>
												<option  value='02'  <?php if($_SESSION['mois']== '02'){echo 'SELECTED ' ; }?> > F&#233;vrier   </option>
												<option  value='03' <?php if($_SESSION['mois']== '03'){echo 'SELECTED ' ; }?> > Mars   </option>
												<option  value='04' <?php if($_SESSION['mois']== '04'){echo 'SELECTED ' ; }?>  > Avril   </option>
												<option  value='05' <?php if($_SESSION['mois']== '05'){echo 'SELECTED ' ; }?> > Mai   </option>
												<option  value='06' <?php if($_SESSION['mois']== '06'){echo 'SELECTED ' ; }?>  > Juin   </option>
												<option  value='07'<?php if($_SESSION['mois']== '07'){echo 'SELECTED ' ; }?>  > Juillet   </option>
												<option  value='08' <?php if($_SESSION['mois']== '08'){echo 'SELECTED ' ; }?>  > Aout   </option>
												<option  value='09' <?php if($_SESSION['mois']== '09'){echo 'SELECTED ' ; }?>  > Septembre   </option>
												<option  value='10' <?php if($_SESSION['mois']== '10'){echo 'SELECTED ' ; }?>  > Octobre   </option>
												<option  value='11' <?php if($_SESSION['mois']== '11'){echo 'SELECTED ' ; }?>  > Novembre   </option>
												<option  value='12' <?php if($_SESSION['mois']== '12'){echo 'SELECTED ' ; }?>  > Décembre   </option>
											  </select>
														</div>
													</div>



													<div class="form-group col-md-2">
														 <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($_SESSION['ans']== '2020'){echo 'SELECTED ' ; }?>  > 2020   </option>
													<option  value='2021' <?php if($_SESSION['ans']== '2021'){echo 'SELECTED ' ; }?> > 2021   </option>
													<option  value='2022' <?php if($_SESSION['ans']== '2022'){echo 'SELECTED ' ; }?> > 2022   </option>
													<option  value='2023' <?php if($_SESSION['ans']== '2023'){echo 'SELECTED ' ; }?> > 2023   </option>
													<option  value='2024' <?php if($_SESSION['ans']== '2024'){echo 'SELECTED ' ; }?> > 2024   </option>
													<option  value='2025' <?php if($_SESSION['ans']== '2025'){echo 'SELECTED ' ; }?> > 2025   </option>
													<option  value='2026' <?php if($_SESSION['ans']== '2026'){echo 'SELECTED ' ; }?> > 2026   </option>
																  </select>
									                   </div>
						                            </div>


													<div class="form-group col-md-4">
														 <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">


													  <?php


													// if($indi == 0)
													  // {
														// echo " Ce mois n'est pas encore créé" ;
													  // }

													  $qa = dbi_query(" SELECT * FROM `verification_pointage` WHERE `date` LIKE '$ismai%' ") ;
                                                      list($indi) = dbi_fetch_row(dbi_query("SELECT COUNT(*) FROM `verification_pointage` WHERE `date` LIKE '$ismai%' and valide = 0")) ;
														$etat_validation = ""  ;
														?>


														<table id="exam1" class="table table-bordered">
															<thead>
																<TR>
																<th align="center">Jour</th>
																  <th align="center">Etat</th>
																</TR>
															</thead>
															<tbody>
															<?php  while($tel = dbi_fetch_row($qa)) {

																list($nbpointage_valider) = dbi_fetch_row(dbi_query("SELECT count(*) FROM `telepointage` WHERE `jour` LIKE ".$tel['date']." and pointage_valider  = '1'")) ;
                                                                list($nbpointage) = dbi_fetch_row(dbi_query("SELECT count(*) FROM `telepointage` WHERE `jour` LIKE ".$tel['date'])) ;
																$nb_prestation_foi_deux =  $tel['nombre_prestation'] * 2 ;

																list($non_valide) = dbi_fetch_row(dbi_query("SELECT non_valide FROM `verification_pointage` WHERE `date` = ".$tel['date'])) ;

																// echo "==".$nbpointage_valider."=====".$nb_prestation_foi_deux."===".$non_valide."<br/>" ;
																if( ($tel['nombre_prestation'] == 0)  OR  ($nbpointage_valider <  $nb_prestation_foi_deux ) OR  ($non_valide  ==  1 )  ){
																	 $etat_validation = "Non Validé"  ;
																}else{

															   if($nb_prestation_foi_deux == $nbpointage_valider){
															   $etat_validation = "Validé"  ;
															   }

															    if(($nbpointage> $nb_prestation_foi_deux )){
																   $etat_validation = "Excès de pointage"  ;
															   }

															   // if(($nbpointage> $nb_prestation_foi_deux OR  $nbpointage_valider> $nb_prestation_foi_deux)){
																   // $etat_validation = "Excès de pointage"  ;
															   // }
															    // if($nbpointage_valider <  $nb_prestation_foi_deux ){
																    // $etat_validation = "Non Validé"  ;
															   // }

																}
																?>

													       <tr>
															 <td align="center"> <a href="Pres_jours2_new.php?date_j=<?=$tel['date']?>" target="" ><?php  echo int2date($tel['date'])."<br/>" ;  ?> </a></td></td>
														     <td align="center"><? echo $etat_validation  ; ?></td>
														   </tr>
															<?php  }?>
															</tbody>
														</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>






          <!-- ./col -->

        <!-- /.row -->
        <!-- Main row -->

          <!-- Left col -->
<!--<a href="pon_fourinc.php"><button type="button"  class="btn btn-block btn-primary">Retour à la sélection de l'étbalissement</button> -->





        </div>





      </div>
    </section>


  </div>
  <!-- /.content-wrapper -->





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

<script>
  $(function () {
    $("#example1").DataTable();
    $('#example2').DataTable({
      "paging": true,
      "lengthChange": false,
      "searching": false,
      "ordering": true,
      "info": true,
      "autoWidth": false,
    });
  });
</script>


<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 : 'massage_pointage_ajax', //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>

<?php

//vider la table automate_salarie on rempli cet table dans la page anomalies_salarie.php // include planning_prestation.php

dbi_query("TRUNCATE TABLE automate_salarie") ;

?>
</html>

AnonSec - 2021