|
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 ] |
|---|
<?php
// 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["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>" ;
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<< 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');
// print_r($liste_fichiers ) ;
// exit() ;
foreach($liste_fichiers as $fichier)
{
// echo $fichier. '<br/>';
$ret = ftp_nb_get($my_connection, "input.txt", $fichier, FTP_BINARY);
while ($ret == FTP_MOREDATA) {
// Faites ce que vous voulez...
// echo ".";
// Continue le téléchargement...
$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]);
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) ;
}
}
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") ;
}
//=======================================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/>" ;
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 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 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'); ?>
</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">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
</li>
<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>
<!-- 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.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-briefcase"></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-4 col-6">
<!-- small box -->
<div class="small-box bg-warning">
<div class="inner">
<h3>CONTROLE QUOTIDIEN</h3>
<p>Vérification des pointages par jour</p>
</div>
<div class="icon">
<i class="ion ion-android-calendar"></i>
</div>
<a href="Pres_jours2.php" class="small-box-footer">Voir <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-4 col-6">
<!-- small box -->
<div class="small-box bg-success">
<div class="inner">
<h3>LISTING MENSUEL</h3>
<p>Affichage de tous les pointages par mois</p>
</div>
<div class="icon">
<i class="ion ion-android-list"></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-4 col-6">
<!-- 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-android-alert"></i>
</div>
<a href="Parametrage.php" class="small-box-footer">Voir <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<!-- ./col -->
<!-- ./col -->
<!-- ./col -->
</div>
<div class="row">
<div class="col-lg-4 col-6">
<!-- small box -->
<div class="small-box bg-success">
<div class="inner">
<h3>Pointages Restants</h3>
<p>Affichage les pointages sant validation</p>
</div>
<div class="icon">
<i class="ion ion-android-list"></i>
</div>
<a href="pointages_restant1.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-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-4">
<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'> Janvier </option>
<option value='02'> Février </option>
<option value='03'> Mars </option>
<option value='04'> Avril </option>
<option value='05'> Mai </option>
<option value='06'> Juin </option>
<option value='07'> Juillet </option>
<option value='08'> Aout </option>
<option value='09'> Septembre </option>
<option value='10'> Octobre </option>
<option value='11'> Novembre </option>
<option value='12'> Décembre </option>
</select>
</div>
</div>
<div class="form-group col-md-4">
<div class="input-group">
<select class="form-control select" style="width: 100%;" name="ans" onchange="GetIdans()";>
<option selected="selected">selectionner un année </option>
<option value='2020'> 2020 </option>
<option value='2021'> 2021 </option>
<option value='2022'> 2022 </option>
<option value='2023'> 2023 </option>
<option value='2024'> 2024 </option>
<option value='2025'> 2025 </option>
<option value='2026'> 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 ne pas encore enregitrer" ;
}else{
echo "les jours restant sans verfications <br/>" ;
while($tel = dbi_fetch_row($qa)) {
if($tel['valide'] == 0){
?>
<a href="Pres_jours2_new.php?date_j=<?=$tel['date']?>" target="" ><?php echo int2date($tel['date'])."<br/>" ; ?> </a></td>
<?
}
// echo $tel['pointage_validee']."==".$tel['pointage_reel']."<br/>" ;
if($tel['valide'] == 1 and $tel['pointage_validee'] != $tel['pointage_reel']){
?>
<a href="Pres_jours2_new.php?date_j=<?=$tel['date']?>" target="" ><?php echo int2date($tel['date'])." (excès de pointage) <br/>" ; ?> </a></td>
<?
}
}}
?>
</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 -->
<!-- jQuery -->
<script src="../plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="../dist/js/adminlte.min.js"></script>
<!-- Page Script -->
<!-- AdminLTE for demo purposes -->
<script src="../dist/js/demo.js"></script>
<!-- <script src="libbox/loadingoverlay.js"></script> -->
<!-- jQuery -->
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<!-- Bootstrap -->
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="../plugins/datatables/jquery.dataTables.js"></script>
<script src="../plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
<!-- loading-overlay -->
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false,
});
});
</script>
<script src="../plugins/select2/js/select2.full.min.js"></script>
<script>
$(function () {
//Initialize Select2 Elements
$('.select2').select2()
//Initialize Select2 Elements
$('.select2bs4').select2({
theme: 'bootstrap4'
})
})
</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>
