AnonSec Team
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 (0755) :  /home/logmcpe/www/TMCPRO/test/../TESTMAILBOX/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/TMCPRO/test/../TESTMAILBOX/fetch_record2.php
<?php
	// print_r($_GET);
	// print_r($_POST);
	// exit() ;
// $userAnswer =z $_POST['name'];
// echo json_encode($userAnswer);



// $DateAndTime = date('m-d-Y h:i:s a', time());
// echo "The current date and time are $DateAndTime.";
$date_heure_creation = date('d-m-Y h:i:s', time());

$date_heure_fin_tach = date('d-m-Y h:i:s', time());
// echo "The current date and time are $DateAndTimee.";
// exit() ;


// if(!empty($_POST))
// {
	// echo "<pre>" ;
	// print_r($_POST);
	// echo "</pre>" ;
	// exit();
// }
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;



if(!empty($_POST['update_tache']))
{


// $tache_sujet = addslashes($_POST['tache_sujet']) ;

$salarie_id = $_POST['salarie_id'] ;
$client_id = $_POST['client_id'] ;






dbi_query("UPDATE `tache` SET `client_id` = '$client_id ', `salarie_id` = '$salarie_id', `tache_description` = '".$_POST['tache_description']."',
 `tache_titre_id` = '".$_POST['tache_titre_id']."' WHERE `tache`.`tache_id` = ".$_POST['update_tache']) ;

	header("Location:fetch_record.php?msg=Tache bien mofifié&color=success");

}


if($_POST['complete']=="complete")
{

	// echo "<pre>" ;
	// print_r($_POST) ;
	// echo "<pre>" ;
	$tache_id = $_POST['tache_id'] ;

             list($numbre) = dbi_fetch_row(dbi_query(" SELECT count(*) as numbre FROM `sous_tache` WHERE `tache_id` = $tache_id  and sous_tache_status = 0 ")) ;

			 // echo "====> $numbre <br/>" ;
			 if($numbre == 0)
			 {


	if($_POST['tache_status']==1)
	{
	$tache_status = 1 ;
	}
	else{$tache_status = 0 ; }
	dbi_query("UPDATE `tache` SET `tache_status` = '$tache_status' WHERE `tache`.`tache_id` = ".$tache_id ) ;

	header('Location:fetch_record.php?msg= <strong> Bien : </strong>  Tache bien modifié&color=success');
			 }
			 else
			 {
			 // echo "  <br/>" ;
			 				 header("Location:fetch_record.php?msg= <strong> Attention : </strong> l'opération echoué, il a des sous taches non complétés !!!!!!&color=danger");

			 }


}

if(!empty($_GET['page']))
{

 $_SESSION["page"]=$_GET['page'] ;
 $_SESSION["rowid"]=$_GET['rowid'] ;
}



// echo "<pre>" ;
// print_r($_GET);
// echo "</pre>" ;


// echo "<pre>" ;
// print_r($_SESSION);
// echo "</pre>" ;


// exit() ;


// exit() ;
  $page =   $_SESSION["page"] ;
  $tache_id =  $_SESSION["rowid"] ;
  $_POST['rowid'] = $_SESSION["rowid"] ;

  // echo "=================> ". $tache_id."<br/>" ;



	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/tache";


if((!empty($_FILES)) and (empty($_POST['Modifier'])))
{





	// echo "<pre>" ;
	// print_r($_FILES) ;
	// echo "<pre>" ;


	// echo "<pre>" ;
	// print_r($_POST) ;
	// echo "<pre>" ;


	// exit() ;SELECT client_id FROM `tache` WHERE `tache_id` = 118
           list($client_id)=  dbi_fetch_row(dbi_query( "SELECT client_id FROM `tache` WHERE `tache_id` = ".$tache_id)) ;
		   list($salarie_id)=  dbi_fetch_row(dbi_query( "SELECT salarie_id FROM `tache` WHERE `tache_id` = ".$tache_id)) ;

	       list($document_id)=  dbi_fetch_row(dbi_query( "SELECT max(doc_id) FROM `document_tache`")) ;
		  $document_id= $document_id + 1 ;
				  $target_dir = "documents/tache/";
				  $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_tache (

						document_nom,
						client_id,
						tache_id,
						date_doc,
						salarie_id,
						document_emplacement )

						VALUES (

						'$document_nom',
						'$client_id',
					    '$tache_id',
						'$date_document',
						'$salarie_id',
						'$target_file'

					    )") ;
						header('Location:fetch_record2.php?msg=Document bien ajouté&color=success');





	}


  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:fetch_record.php?msg= <strong> Bien : </strong> sous tache bien modifié&color=success');
  }





if($_GET['sup']== 1)
{


	$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:fetch_record.php?msg= <strong> Bien : </strong>sous tache bien supprimé&color=success');

}

if($_POST['ajout']== "ajout")
{

echo "<pre>" ;
print_r($_POST);
echo "</pre>" ;
exit() ;

$sous_tache_designation = addslashes ($_POST['sous_tache_designation']) ;
		    $sous_tache_date_fin = $_POST['sous_tache_date_fin'];
			$user_id = $_POST['user_id'];
			// $sous_tache_status = $_POST['sous_tache_status'][$index];
			$sous_tache_id = $_POST['sous_tache_id'][$index];
			$sous_tache_status  =  $_POST['sous_tache_status'];

			$today_p = date('Ymd');

	$res = dbi_query(" INSER INTO  sous_tache (tache_id,sous_tache_designation, sous_tache_date_fin,user_id, sous_tache_status,actif,date_creation,date_heure_creation)
				 VALUES  ('$tache_id','$sous_tache_designation','$sous_tache_date_fin','$user_id','$sous_tache_status','1','$today_p','$date_heure_creation')") ;
				 header('Location:fetch_record.php?msg= <strong> Bien : </strong> sous tache bien ajouté&#233;&color=success');

}

// $res = dbi_query(" INSERT INTO  sous_tache (sous_tache_designation, sous_tache_date_fin,user_id, sous_tache_status,tache_id,actif)
				 // VALUES  ('$sous_tache_designation','$sous_tache_date_fin','$user_id','$sous_tache_status','$tache_id','1')") ;

if($_POST['rowid']) {
    $id = $_POST['rowid'];
	$q= dbi_query("SELECT * FROM tache t , users u where  t.`user_id` = u.`user_id` and t.tache_id =".$id."" );
	$cl=dbi_fetch_row($q);
	if($cl['tache_Priorite']== 1)
					{
						$tache_Priorite= "Moyen" ;
					}
					elseif($cl['tache_Priorite']== 2)
					{
						 $tache_Priorite= "Haute" ;
					}
					elseif($cl['tache_Priorite']== 3)
					{
					$tache_Priorite= "Urgente" ;
					}

					if($cl['salarie_id']!= 0)
					{

										list($salarie_nom , $salarie_prenom)= dbi_fetch_row(dbi_query("SELECT salarie_nom , salarie_prenom FROM `salarie` WHERE `salarie_id` = ".$cl['salarie_id'])) ;
					 $salarie_id=  $cl['salarie_id'] ;
					     $chain_salarie =  $salarie_nom." ".$salarie_prenom ;
						 $chain_salarie = "<a href='TacheSalarie.php?salarie_id=$salarie_id' >".$chain_salarie."</a>" ;
					}
					if(empty($salarie_nom) AND empty($salarie_prenom))
					{
						 $chain_salarie =  " <strong> N.C </strong>" ;

					}



					if($cl['client_id']<100) // pour identifier les prospect car on peut pas faire la diffrence entre les prospect et les clients
					{


					  list($client_nom)= dbi_fetch_row(dbi_query("SELECT prospect_nom   FROM `prospect` WHERE `prospect_id` = ".$cl['client_id'])) ;
					    $nom_de_client=$client_nom." (Prospect) " ;
					  $client_id=$cl['client_id'] ;

                    }
					else
					{

					  if($cl['client_id']!= 0)
					  {
					  list($client_nom)= dbi_fetch_row(dbi_query("SELECT client_nom   FROM `client` WHERE `client_id` = ".$cl['client_id'])) ;
					    $nom_de_client=$client_nom ;
					  $client_id=$cl['client_id'] ;
					  $client_nom = "<a href='profilclient.php?client_id=$client_id' >".$client_nom."</a>" ;
					  }
					  else
					  { $client_nom = " <strong> N.C </strong>"; }

				    }

				   $date_creation = $cl['date_creation'] ;
				    $tache_description = $cl['tache_description'] ;
				   $userrr = $cl['user_nom']." ".$cl['user_prenom'] ;
				   // echo "==> $user <br/>" ;
}



?>

<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">
								 <!-- Placer ici l'élément à positionner à droite du TOP MENU -->
								</ul>

							  </nav>


<!-- BARRE DE NAVIGATION -->


<?php include('menu.php'); ?>
   <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>

	  <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="modal-tache">
        <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">&times;</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>


	&nbsp;&nbsp;














              <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>

				<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" class="btn btn-primary">Enregistrer</button>

			  </form>
            </div>
          </div>
          <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
      </div>






 <!-- 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">
																			<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="myModal3" 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="fetch3" >
																					</div>

																					</div>
																				</div>
																			</div>
													</div><!-- /.row -->
												  </div>
												</div>
												<!-- /.content-header -->

    <!-- PAGE PRINCIPALE -->


    <section class="content">

      <?php
if(isset($_GET["msg"])){
?>
<div class="alert alert-<?php echo $_GET["color"]; ?>  alert-dismissible col-12" role="alert">
<?php echo $_GET["msg"]; ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php
}
?>

      <!-- Default box -->
      <div class="card">

        <div class="card-body">
          <div class="row">
            <div class="col-12 col-md-12 col-lg-8 order-2 order-md-1">
              <div class="row">
                <div class="col-12 col-sm-4">
                  <div class="info-box bg-light">
                    <div class="info-box-content">
                      <span class="info-box-text text-center text-muted">Date de création</span>
                      <span class="info-box-number text-center text-muted mb-0"><?=int2date($date_creation)?></span>
                    </div>
                  </div>
                </div>
                <div class="col-12 col-sm-4">
                  <div class="info-box bg-light">
                    <div class="info-box-content">
                      <span class="info-box-text text-center text-muted">Client</span>
                      <span class="info-box-number text-center text-muted mb-0"><?php echo $client_nom ;  ?></span>
                    </div>
                  </div>
                </div>
                <div class="col-12 col-sm-4">
                  <div class="info-box bg-light">
                    <div class="info-box-content">
                      <span class="info-box-text text-center text-muted">Salarié</span>
                      <span class="info-box-number text-center text-muted mb-0"><?php echo $chain_salarie  ;  ?></span>
                    </div>
                  </div>
                </div>
              </div>




              <div class="row">
                <div class="col-12">
                  <h3><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-tache"><i class="fas fa-plus"></i> Action</button></h3>


                  <?php
                  $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']

                  ?>



                  <?php
                  }
                  ?>



                  <table id="example1" class="table table-hover">
                    <thead>
                    <tr>
                <th></th>     		<!-- /.Table Client - Champs client_nom -->
                <th>Actions</th>
                <th></th>
                <th></th> 				  <!-- /.Table Client - Champs client_adr1 -->
                        <!-- /.Table Client - Champs client_cp -->
                <th></th>
                  <th></th>




                    </tr>
                    </thead>
                    <tbody>
                <?php
                $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."'> EN COURS </span>" ;
                }
                else{

                $badge = 'badge-success';
                $sous_tache_status="<span class='badge ".$badge."'> TERMINE </span>" ;

                }
                // ."==>".$soustache['sous_tache_id']

                ?>

                <tr data-widget="expandable-table" aria-expanded="true">

                  <TD><?=$sous_tache_status?>  <strong> <?=$user_chaine ?> </strong></TD>
                  <td> </td>
                  <td></td>
                  <td><?= int2date(date2int_DSI($soustache['sous_tache_date_fin']))?></td>
                  <td align="center">
                    <?php echo '<a class="btn btn-info btn-sm" href="#myModal"  id="custId" data-toggle="modal" data-id="'.$soustache['sous_tache_id'].'"><i class="fas fa-pencil-alt"></i> Editer</a>';?>
                  </td>
                  <td>  <a class="btn btn-danger btn-sm" href="fetch_record.php?sous_tache_id=<?=$soustache['sous_tache_id']?>&sup=1" onclick="return confirm('Voulez-vous vraiment supprimer ce sous tache ?');"><i class="fas fa-trash"></i> Supprimer</a>
                </td>
</tr>
<tr class="expandable-body">
  <td colspan="5">
    <p>
    <?="<i>".$user_chaine_crea." : </i>".$soustache['sous_tache_designation'] ?>
    </p>
  </td>
  <td colspan="1">
    <?php echo '<a class="btn btn-info btn-sm" href="#myModal"  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="fetch_record.php?sous_tache_id=<?=$soustache['sous_tache_id']?>&sup=1" onclick="return confirm('Voulez-vous vraiment supprimer ce sous tache ?');"><i class="fas fa-trash"></i></a>
  </td>

  </td>
</tr>

                <?php
                }
                ?>




                    </tbody>

                  </table>

                  <table class="table table-hover">
                    <thead>
                      <tr>
                        <th>Statut</th>
                        <th>De</th>
                        <th>Date de Création</th>
                        <th>Date d'échéance</th>
                        <th>Action</th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr data-widget="expandable-table" aria-expanded="true">
                        <td><?=$sous_tache_status?></td>
                        <td> <?=$user_chaine ?></td>
                        <td>11-7-2014</td>
                        <td><?= int2date(date2int_DSI($soustache['sous_tache_date_fin']))?></td>
                        <td>  <?php echo '<a class="btn btn-info btn-sm" href="#myModal"  id="custId" data-toggle="modal" data-id="'.$soustache['sous_tache_id'].'"><i class="fas fa-pencil-alt"></i></a>';?></td>
                        <td><a class="btn btn-danger btn-sm" href="fetch_record.php?sous_tache_id=<?=$soustache['sous_tache_id']?>&sup=1" onclick="return confirm('Voulez-vous vraiment supprimer ce sous tache ?');"><i class="fas fa-trash"></i></a></td>
                      </tr>
                      <tr class="expandable-body">
                        <td colspan="5">
                          <p>
                          De <?="<i>".$user_chaine_crea." : </i> ".$soustache['sous_tache_designation'] ?>....<?php echo '<a class="fas fa-pencil-alt" href="#myModal"  id="custId" data-toggle="modal" data-id="'.$soustache['sous_tache_id'].'"></i></a>';?>
                          </p>
                        </td>
                      </tr>















                    </tbody>
                  </table>






                </div>
              </div>
            </div>
            <div class="col-12 col-md-12 col-lg-4 order-1 order-md-2">

			 <?  list($tache_sujet) =   dbi_fetch_row(dbi_query("  SELECT tache_sujet FROM `tache_titre` WHERE `tache_titre_id`  = ".$cl['tache_titre_id'] )) ;
               if(empty($tache_sujet)){
				    $tache_sujet = $cl['tache_sujet'] ;
			   }
			 ?>


              <h3 class="text-primary"    href="#myModal3"  id="custId" data-toggle="modal" data-id="<?=$tache_id?>" ><i class="far fa-edit" ></i> <?php echo $tache_sujet ;  ?></h3>
              <p class="text-muted"><?=$tache_description?></p>
              <br>
              <div class="text-muted">
                <p class="text-sm">Tâche créée par :
                  <b class="d-block"><?=$userrr?></b>
                </p>

              </div>
			  <?php $q_d =   dbi_query("SELECT * FROM `document_tache` WHERE `tache_id` = ".$tache_id) ;



			  ?>

              <h5 class="mt-5 text-muted">Pièces jointes</h5>
              <ul class="list-unstyled">
			  <? while($q_doc=dbi_fetch_row($q_d)){
				   $nomrepp =  $q_doc['document_emplacement'] ;
				   ?>
                <li>
                  <a  href="<?=$nomrepp?>" class="btn-link text-secondary" target="_blank" ><i class="far fa-fw fa-file-word"></i> <?=$q_doc['document_nom']?></a>
                </li>
			  <? }?>


              </ul>
              <div class="text-center mt-5 mb-3">
                <a href="#myModal_doc"  id="custId" data-toggle="modal" type="button" class="btn btn-primary" ><i class="fas fa-download" ></i> Upload</a>




              </div>
            </div>
          </div>
        </div>
        <!-- /.card-body -->
      </div>
      <!-- /.card -->

    </section>






	</div>


<?php include('footerr.php'); ?>

<script src="../../plugins/summernote/summernote-bs4.min.js"></script>
<script>
  $(function () {
    // Summernote
    $('.textarea').summernote()
  })
</script>


<script type="text/javascript">
  $( document ).ready(function() {
	  // alert('OK');
    // $("#salarie_mutuelle").click(function () {
      // val=$(this).val();
      // if(val==1){
        // $("#end").prop('disabled', false);
      // }else{
        // $("#end").prop('disabled', true);
      // }

    // });

	$('#myModal1').on('show.bs.modal', function (e) {
        var rowid = $(e.relatedTarget).data('id');
        $.ajax({
            type : 'post',
            url : 'suivi_sal_action.php', //Here you will fetch records
            data :  'rowid='+ rowid, //Pass $id
            success : function(data){
            $('#fetch1').html(data);//Show fetched data from database
            }
        });
     });
	$('#myModal2').on('show.bs.modal', function (e) {
        var rowid = $(e.relatedTarget).data('id');
		var client_id= $(this).attr('client_id');
		// alert(rowid);
        $.ajax({
            type : 'post',
            url : 'suivi_sal_action_upt.php', //Here you will fetch records
            data :  'rowid='+ rowid+'&client_id='+client_id, //Pass $id
            success : function(data){
            $('#fetch2').html(data);//Show fetched data from database
            }
        });
     });



// if ($("#yourCheckboxID").is(":checked")) {
    // checkbox is checked
// } else {
    // checkbox is not checked
// }

});



function enableTxt(elem) {
    var id = $(elem).val();

	var c = 0;

if ( $(elem).prop( "checked" ) )
	c = 1;
        $.ajax({
            type : 'post',
            url : 'cloturer_tache.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>


<script type="text/javascript">
$(document).ready(function(){
    $('#myModal').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').html(data);//Show fetched data from database
            }
        });
     });
});


</script>



<script type="text/javascript">
$(document).ready(function(){
    $('#myModal3').on('show.bs.modal', function (e) {
        var rowid = $(e.relatedTarget).data('id');
        $.ajax({
            type : 'post',
            url : 'AjaxModifTache_fetch_record.php', //Here you will fetch records
            data :  'rowid='+ rowid, //Pass $id
            success : function(data){
            $('#fetch3').html(data);//Show fetched data from database
            }
        });
     });
});


</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>
</html>

AnonSec - 2021