|
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' ;
if($_GET['sup']== 1)
{
dbi_query("DELETE FROM `suivi`
WHERE suivi_id =".$_GET['suivi_id']) ;
header('Location:ajout_suivi.php?msg=bien supprimé&color=success');
// echo "<pre>" ;
// print_r($_GET) ;
// echo "</pre>" ;
// echo "bbb <br/>" ;
// exit() ;
}
if(!empty($_POST)){
// echo "tttt <br/>" ;
// echo"<pre>" ;
// print_r($_POST) ;
// echo"</pre>" ;
$suivi_intitule=$_POST['suivi_intitule'] ;
if($_POST['submitbtn']== "Ajouter")
{
dbi_query("INSERT INTO `suivi` (`suivi_id`, `suivi_intitule`, `suivi_ordre`, `suivi_client`, `suivi_salarier`) VALUES (NULL, '$suivi_intitule', '1', '1', '1')") ;
header('Location:ajout_suivi.php?msg= Suivi bien ajouté&color=success');
}
// $suivi_intitule=$_POST['suivi_intitule'] ;
// exit() ;
// $suivi_intitule=$_POST['suivi_intitule'] ;
if($_POST['submitbtn']== "modifier")
{
dbi_query("UPDATE `suivi` SET `suivi_intitule` = '$suivi_intitule' WHERE `suivi`.`suivi_id` =".$_POST['suivi_id']) ;
header('Location:ajout_suivi.php?msg= Suivi bien ajouté&color=success');
}
}
?>
<!DOCTYPE html>
<html>
<head>
<?php include('header.php'); ?>
</head>
<body class="hold-transition sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
<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>
<li>
<h3><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-suivi"><i class="fas fa-plus"></i> Nouveau suivi </button></h3>
</li>
</ul>
</nav>
<div class="modal fade" id="modal-suivi">
<div class="modal-dialog modal-lg">
<form action="" method="POST">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Nouveau suivi </h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="card-body">
<div class="form-row">
<div class="form-group col-md-12">
<label for="inputAddresse">Designation</label>
<textarea class="textarea" placeholder="Place some text here"
style="width: 100%; height: 200px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;" name="suivi_intitule" ></textarea>
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-primary" data-dismiss="modal">Fermer</button>
<button type="submit" name="submitbtn" value="Ajouter" class="btn btn-primary">Enregistrer</button>
</div>
</div>
</form>
</div>
</div>
<!-- BARRE DE NAVIGATION -->
<?php include('menu.php'); ?>
<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>
<!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
<div class="content-wrapper">
<?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
}
?>
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<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><!-- /.row -->
</div>
</div>
<!-- /.content-header -->
<!-- PAGE PRINCIPALE -->
<?php $q= dbi_query("SELECT * FROM `suivi`") ; $Lsuivi1['client_suivi_clos'] = 1 ; ?>
<section class="content">
<div class="row">
<div class="col-12">
<div class="card card-primary card-outline">
<div class="card-header">
<div class="row">
<div class="col-sm-11">
<h3 class="card-title"> <i class="nav-icon fas fa-id-card"></i> Ajouter suivi </h3>
</div>
</div>
</div>
<div class="card-body">
<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">Id</th>
<th align="center">Designation</th>
<th align="center">Suivi client </th>
<th align="center">Suivi salarier </th>
<th align="center">Modifier/Supprimer</th>
</TR>
</thead>
<tbody>
<?php while($suiv=dbi_fetch_row($q)) {?>
<tr>
<td> <?php echo $suiv['suivi_id'] ; ?> </td>
<td> <?php echo $suiv['suivi_intitule'] ; ?> </td>
<td>
<div class="custom-control custom-switch">
<input onclick="enableTxt(this)" onFocus="Complété" class="custom-control-input" type="checkbox" value="<?php echo $suiv['suivi_id'];?>" name="etat" id="todoCheck<?php echo $suiv['suivi_id'];?>" <?php if($suiv['suivi_client'] == 1 ) echo 'checked '; ?>>
<label class="custom-control-label" for="todoCheck<?php echo $suiv['suivi_id'];?>"></label>
</div>
</td>
<td>
<div class="custom-control custom-switch">
<input onclick="enableTxtS(this)" onFocus="Complété" class="custom-control-input" type="checkbox" value="<?php echo $suiv['suivi_id'];?>" name="etatS" id="todoCheckS<?php echo $suiv['suivi_id'];?>" <?php if($suiv['suivi_salarier'] == 1 ) echo 'checked '; ?>>
<label class="custom-control-label" for="todoCheckS<?php echo $suiv['suivi_id'];?>"></label>
</div>
</td>
<td align="center">
<?php echo '<a class="btn btn-info btn-sm" href="#myModal" id="custId" data-toggle="modal" data-id="'.$suiv['suivi_id'].'"><i class="fas fa-pencil-alt"></i></a>';?>
<a class="btn btn-danger btn-sm" href="ajout_suivi.php?suivi_id=<?=$suiv['suivi_id']?>&sup=1" onclick="return confirm('Voulez-vous vraiment supprimer suivi ?');">
<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 : 'ModifierSuivi.php', //Here you will fetch records
data : 'rowid='+ rowid, //Pass $id
success : function(data){
$('#fetch').html(data);//Show fetched data from database
}
});
});
});
function enableTxt(elem) {
var id = $(elem).val();
var c = 0;
if ( $(elem).prop( "checked" ) )
c = 1;
$.ajax({
type : 'post',
url : 'suivi_etat_client.php', //Here you will fetch records
data : 'id='+id+'&c='+c , //Pass $id
success : function(data){
// $('#fetch2').html(data);//Show fetched data from database
}
});
// $.ajax({
// type : 'post',
// url : 'suivi_sal_action_etat.php', //Here you will fetch records
// data : 'id='+id+'&c='+c ,//Pass $id
// success : function(data){
// $('#fetch2').html(data);//Show fetched data from database
// }
// });
// alert(id);
}
function enableTxtS(elem) {
var id = $(elem).val();
var c = 0;
if ( $(elem).prop( "checked" ) )
c = 1;
$.ajax({
type : 'post',
url : 'suivi_etat_salarier.php', //Here you will fetch records
data : 'id='+id+'&c='+c , //Pass $id
success : function(data){
// $('#fetch2').html(data);//Show fetched data from database
}
});
// $.ajax({
// type : 'post',
// url : 'suivi_sal_action_etat.php', //Here you will fetch records
// data : 'id='+id+'&c='+c ,//Pass $id
// success : function(data){
// $('#fetch2').html(data);//Show fetched data from database
// }
// });
// alert(id);
}
</script>
</body>
</html>
