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 (0705) :  /home/logmcpe/www/mcg/pages/feuillesroute/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/mcg/pages/feuillesroute/../sms_all.php
<?php
	require __DIR__ . '/vendor_sms_recu/autoload.php';
	include 'includes_sms_recu/ovhhh.php';

include 'includes/config_tmcpro.php' ;
	include 'includes/stable_functions_tmcpro.php' ;






?>


<!DOCTYPE html>
<html>

<head>

  <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <!-- Enresgistrer le titre de la page --><title> LogMCPRO | </title>
												<!-- Tell the browser to be n 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">
  
    <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">
  <!-- DataTables -->
  <link rel="stylesheet" href="../../plugins/datatables-bs4/css/dataTables.bootstrap4.css">
  <!-- Theme style -->
  <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 -->
  <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 type="button" class="btn btn-info" data-toggle="modal" data-target="#modal-nouveaucontact"> NOUVEAU SMS</button></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 -->
  
  
<!-- BARRE DE NAVIGATION -->

 <!-- Couleur et caracteristiques de la barre de navigation-->
<?php include('menu.php'); ?>
  
  

 <!-- Ne pas toucher au dessus / fin de la BARRE DE NAVIGATION-->	

 <!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
 
    <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="content-wrapper">
   
  <!-- TITRE DE LA PAGE PRINCIPALE A PLACE ENTRE LES BALISES H1 & ARBORESCENCE SUR LA DROITE-->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row">
          <div class="col-sm-9">
            
          </div>
          <div class="col-sm-3">
            <ol class="breadcrumb float-sm-right">
             
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
  <!-- FIN DU TITRE DE LA PAGE PRINCIPALE A PLACE ENTRE LES BALISES H1 & ARBORESCENCE SUR LA DROITE-->
   

 
    <!-- Main content -->
	
	
	
    <section class="content">
      <div class="row">
        <div class="col-12">
         <div class="card">
            <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> SMS reçu / envoyé </h3> </div>
			  <div class="col-sm-1"></div>
			   
            </div> 
            </div>
            <!-- /.card-header example1 -->
            <div class="card-body">
              <table id="" class="table table-bordered table-striped">
                <thead>
                <tr>
				
				   <th>   </th>
                     		<!-- /.Table Client - Champs client_nom -->
                  <th>Expediteur</th> 		<!-- /.Table Client - Champs client_adr1 -->
				   <th>Destinataire</th> 		<!-- /.Table Client - Champs client_adr1 -->
				   
                  <th>Message</th> 	<!-- /.Table Client - Champs client_cp -->
                  <th>Date</th>	<!-- /.Table Client - Champs client_ville -->
				  <th> Heure  </th>
				  
				  
			
				  <th>R</th> 
                  <th>action</th>  
                </tr>
                </thead>
                <tbody>
				<?php
				
				
				
						foreach ($messagesDetails as $messagesDetail) {
					
					
					$receiver = str_replace('+33', '0',$messagesDetail['receiver']);
					
					// $receiver = $messagesDetail['receiver'];
					
					// echo $receiver."<br/>" ; 
					
					// echo "<pre>" ; 
					// print_r($messagesDetails) ; 
					// echo "</pre>" ; 
					 
					 
					 // exit() ; 
					 
					 
					 list($id_sms_recu) = dbi_fetch_row(dbi_query(" SELECT 	id_sms_envoi FROM `sms_evoi` WHERE `id` = ".$messagesDetail['id'])) ; 
					
					// echo "====>  $id_sms_recu <br/>" ; 
					if($id_sms_recu == "")
					{
												$date_only = date2int_DSI(substr($messagesDetail['creationDatetime'],0,10))  ;

						// echo "==> $date_only <br/>" ; 
						// exit() ; 
						
						$heure_only=substr($messagesDetail['creationDatetime'],11,5) ; 
						
						 $heure_forma = heure2int($heure_only) ;
						 
						// dbi_query("INSERT INTO `sms_evoi` (`id_sms_envoi`, `id`, `message`, `sender`, `date_recu`) VALUES ('4', '".$messagesDetail['id']."', '".addslashes($messagesDetail['message'])."', '".$messagesDetail['sender']."', '".$messagesDetail['creationDatetime']."')") ; 
					
						dbi_query("INSERT INTO `sms_evoi` (`id_sms_envoi`, `id`, `message`, `receiver`, `date_recu`, date_only ,heure_only,heure_forma) VALUES ('4', '".$messagesDetail['id']."', '".addslashes($messagesDetail['message'])."', '".$messagesDetail['receiver']."', '".$messagesDetail['creationDatetime']."', '".$date_only."', '".$heure_only."', '".$heure_forma."')") ; 
					     dbi_query("INSERT INTO `boit_send_receives` (`id_sms`, `message`, `number`, `date_full`, date_only ,heure_only,heure_forma,type) VALUES ('".$messagesDetail['id']."', '".addslashes($messagesDetail['message'])."', '".$messagesDetail['receiver']."', '".$messagesDetail['creationDatetime']."', '".$date_only."', '".$heure_only."', '".$heure_forma."',2)") ; 
					
					}
					 
				}
				
				
				
				
				
				
				
				
				$i = 1 ;
				// $a = dbi_query("SELECT * FROM prospect ") ; 
					// $a= dbi_query("SELECT * FROM contacts_2") ; 
					 
					 
					 // while( $contact = dbi_fetch_row($a)) 
					 // {
						   // $replaced = str_replace(' ', '',$contact['tel1']);
						   // $replaced = str_replace('.', '',$replaced);
					 // echo "===> ".$contact['tel1']."===>".$replaced."<br/>" ;
					 // }
					 

					
					$qu = dbi_query("SELECT * FROM `boit_send_receives` ORDER BY date_only DESC, heure_forma DESC ") ; 
					
					while($messagesDetail=dbi_fetch_row($qu))
					{
						
						
						if($messagesDetail['type']==1)  // le cas de sms recu
						{
						$Destinataire= "MCPRO" ; 
						
						
						
																							 $sender = str_replace('+33', '0',$messagesDetail['number']);
									  list($client_nom)=  dbi_fetch_row(dbi_query("SELECT client_nom  FROM contact con , client c  where contact_tele1 =  $sender and c.client_id = con.client_id ")) ; 
									$temp= 0 ;
									
								if(empty($client_nom))
								{
									list($salarie_nom ,$salarie_prenom )=  dbi_fetch_row(dbi_query("SELECT salarie_nom,salarie_prenom FROM `salarie` WHERE `salarie_tele1` LIKE '$sender'")) ; 
									
									// echo "SELECT salarie_nom,salarie_prenom FROM `salarie` WHERE `salarie_tele1` LIKE '$receiver'<br/>" ; 
									
								if(!empty($salarie_nom))
								{
										// echo "====$Expediteur <br/>" ; 
								$Expediteur = $salarie_nom." ".$salarie_prenom  ; 
								}
								else
								{
								$Expediteur  = $sender ; 	
								}
									// echo "====ùù $Expediteur <br/>" ; 
								}
						
						
						}
						
						
						
						
						
						
							if($messagesDetail['type']==2) // si envoi
						{
						$Expediteur= "MCPROO" ; 
						
						
											 $receiver = str_replace('+33', '0',$messagesDetail['number']);
									  list($client_nom)=  dbi_fetch_row(dbi_query("SELECT client_nom  FROM contact con , client c  where contact_tele1 =  $receiver and c.client_id = con.client_id ")) ; 
									$temp= 0 ;
									
								if(empty($client_nom))
								{
									list($salarie_nom ,$salarie_prenom )=  dbi_fetch_row(dbi_query("SELECT salarie_nom,salarie_prenom FROM `salarie` WHERE `salarie_tele1` LIKE '$receiver'")) ; 
									
									// echo "SELECT salarie_nom,salarie_prenom FROM `salarie` WHERE `salarie_tele1` LIKE '$receiver'<br/>" ; 
									
								if(!empty($salarie_nom))
								{									
								$Destinataire = $salarie_nom." ".$salarie_prenom  ; 
								}
								else
								{
								$Destinataire  = $receiver ; 	
								}
									
								}
								
								


				 // if(!empty($client_nom ))
									 // { 
								   // = $client_nom ; 
									 // }
									 // else
									 // {
										 
								 

							 
									 // }
						
						
						
						}
						
						
						
						
					
					
					// $sender = str_replace('+33', '0',$messagesDetail['sender']);
					
					 // if(!empty($sender))
					 // {
					  // list($client_nom)=  dbi_fetch_row(dbi_query("SELECT client_nom  FROM contact con , client c  where contact_tele1 =  $sender and c.client_id = con.client_id ")) ; 
					 // }
					 
					 // if(!empty($client_nom ))
					 // { 
				 // $chain  = $client_nom ; 
					 // }
					 // else
					 // {
						 
				 // $chain  = $sender   fgf ; 		 
					 // }
					 
					
               echo "
			   <tr>" ; 
			   
			    	if($messagesDetail['type']==2) // si envoi j
						{
				echo " <td><font color='red'> <i class='fas fa-sign-out-alt'></i> </font></td>";
						}
					else 
					{
					echo " <td> <font color='green'>  <i class='fas fa-sign-in-alt'></i> </font> </td>";
					}
                echo"
                <td>" . $Expediteur . "</td>
				<td>" . $Destinataire . "</td>
		
				
				
                <td>" . (strlen($messagesDetail['message']) < 3 ? $messagesDetail['message'] : ($messagesDetail['message']) ) . "</td>
                <td>" . int2date($messagesDetail['date_only']). "</td>
				 <td>" . $messagesDetail['heure_only'] . "</td> " ; 
				 
				
				
				echo '<td>' . '<a class="btn btn-info " href="#myModal"  id="custId" data-toggle="modal" data-id="'.$messagesDetail['sender'].'"> Répondre </a>'. "</td>" ; 
				if($messagesDetail['type']==1)
				{
                echo " <td scope='row'><a class='btn btn-primary btn-small btn-danger' href='includes_sms_recu/deletion.php?id=" . $messagesDetail['id'] . "' onClick=\"javascript:return confirm('êtes-vous sûr de vouloir supprimer ce sms ?');\">Supprimer</a></td>";
				}
				else
				{
					 echo " <td scope='row'>  <a class='btn btn-primary btn-small btn-danger' href='includes_sms_recu/deletion.php?id=" . $messagesDetail['id'] . "' onClick=\"javascript:return confirm('êtes-vous sûr de vouloir supprimer ce sms ?');\">Supprimer</a></td>";
				}
				
				echo"</tr>";
++$i;
					}

				
				
				
				
				
				
				list($nbr_sms) = dbi_fetch_row(dbi_query(" SELECT count(*) FROM `sms_recu` ")) ; 
				
				dbi_query("UPDATE `config_sms` SET `value_sms` = $nbr_sms WHERE `config_sms`.`id` = 1") ; 
				
				?>
                
                           
                
               
                </tbody>
 
              </table>
            </div>
            <!-- /.card-body -->
          </div>
          <!-- /.card -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- NE PAS TOUCHER AU DESSUS DESSOUS -->	 




<!-- DEBUT DU PIED DE PAGE -->
  
  <footer class="main-footer">
    <div class="float-right d-none d-sm-block">
      <b>Version</b> 3.0.1
    </div>
    <strong>Copyright &copy; 2019 MCPRO</strong> 
  </footer>
<!-- FIN DU PIED DE PAGE -->

<!-- NE PAS TOUCHER CI-DESSOUS -->
  <!-- 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>
<!-- DataTables -->
<script src="../../plugins/datatables/jquery.dataTables.js"></script>
<script src="../../plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<script type="text/javascript">

$(document).ready(function(){
   // $("#my_form").on("submit", function () {
        // var hvalue = $('.suivi_annotation').text();
        // $(this).append("<input type='hidden' name='suivi_annotation' value=' " + hvalue.trim() + " '/>");
    // });
	
		$("#suivi_id").on('change',function(){	
		var suivi_id = $(this).val();
				if(suivi_id > 0){
					$.ajax({
					type:'POST',
					url: 'ajaxmailsuivi.php',
					data:'suivi_id='+suivi_id,
					success:function(html){
						$("#suivi_biais_id").html(html);
						}
					});
				}					
		 });
});
</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 : 'repondre_sms.php', //Here you will fetch records 
            data :  'rowid='+ rowid, //Pass $id
            success : function(data){
            $('#fetch').html(data);//Show fetched data from database
            }
        });
     });
});

    
</script>

<script>
  $(function () {
    $("#example1").DataTable();
    $('#example2').DataTable({
      "paging": true,
      "lengthChange": false,
      "searching": false,
      "ordering": true,
      "info": true,
      "autoWidth": false,
    });
  });
</script>
</body>
</html>

AnonSec - 2021