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

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/TMCPRO/pages/maps.php
<?php 
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;

// $a=dbi_query("SELECT * FROM `clientb`") ; 

// while($res= dbi_fetch_row($a))
// {
	
	// $latitude= $res['F'] ;

	// $longitude= $res['G'] ;
	// $client_id = $res['A'] ;
	
	// dbi_query("UPDATE `tmcpro`.`client` SET `latitude` = '$latitude', `longitude` = '$longitude' WHERE `client`.`client_id` = $client_id") ; 

// }

// exit() ; 

function get_distance_m($lat1, $lng1, $lat2, $lng2) {
      $earth_radius = 6378137;   // Terre = sphère de 6378km de rayon
      $rlo1 = deg2rad($lng1);
      $rla1 = deg2rad($lat1);
      $rlo2 = deg2rad($lng2);
      $rla2 = deg2rad($lat2);
      $dlo = ($rlo2 - $rlo1) / 2;
      $dla = ($rla2 - $rla1) / 2;
      $a = (sin($dla) * sin($dla)) + cos($rla1) * cos($rla2) * (sin($dlo) * sin(
$dlo));
      $d = 2 * atan2(sqrt($a), sqrt(1 - $a));
      return ($earth_radius * $d);
    }
	
	
	
$client_id1 = $client_id2 = 0;
// print_r($_POST);
	if(isset($_POST['client_id1']) && isset($_POST['client_id2']) && $_POST['client_id1'] > 0 && $_POST['client_id2'] > 0) 
{
	$client_id1 = $_POST['client_id1'];
	$client_id2 = $_POST['client_id2'];
	
	$cl1 = dbi_fetch_row( dbi_query("SELECT * FROM client  WHERE client_statut =  '1' AND client_id = $client_id1  ORDER BY client_nom ASC")) ;
	$cl2 = dbi_fetch_row( dbi_query("SELECT * FROM client  WHERE client_statut =  '1' AND client_id = $client_id2  ORDER BY client_nom ASC")) ;
	
	$resultat = (round(get_distance_m($cl1['latitude'], $cl1['longitude'], $cl2['latitude'], $cl2['longitude']) / 1000, 3)). ' km';
	// echo $resultat;
}

?>
<html> 
<head> 
<script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AZFZERGOPNRGPNERGPIONERGPN&exp&sensor=false&libraries=places">sensor=false"></script><br>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <!-- Enregistrer le titre de la page --><title> LogMCPRO | NOUVEAU 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">
</head> 
<style>

.abc{
    color:red !important;
    font-weight: 500;
}
button.gm-control-active.gm-fullscreen-control {
    display: none !important;
}

.gm-svpc {
    display: none !important;
}
.cstm-hding{
      color: #A52A2A !important;
    font-size: 19px !important;
}
.cstm-txt{
  font-size:13px !important;
}
.link-txt{
  text-decoration: none;
  color:#b1aeae;
}
.map-marker {
    cursor: pointer;
    position: absolute;
    background: #4F83F0 no-repeat;
    background-size: contain;
    height: 18px;
    width: 18px;
    padding: 0;
    border: none;
    border-radius: 100%;
    box-shadow: inset 0 0 0 2px white, 0 1px 2px 1px rgba(0,0,0,0.2);
    z-index: 100;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
</style>

  

  



<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 class="nav-item d-none d-sm-inline-block">
        
      </li>
      <li class="nav-item d-none d-sm-inline-block">
        
      </li>
     <li class="nav-item d-none d-sm-inline-block">
       
      </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 -->


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


 <!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
  <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">
          <div class="col-sm-6">
            <h6></h6>
          </div>
          <div class="col-sm-6">
            <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-->
   

 <!-- CONTENU DE LA PAGE PRINCIPALE -->
    <section class="content"> <!-- Ne pas toucher cette ligne -->

 <!-- Card Principale -->
      <div class="card">
     
     
     <!--  Titre de la Card Principale -->
        <div class="card-header">
          <h3 class="card-title"> <i class="nav-icon fas fa-user-plus"></i>CLIENT MAP </h3>

    </div>
       <!--  Fin du Titre de la Card Principale -->
     
     
     <!-- Contenu de la Card Principale -->
    <div class="card-body">
	
	
	
	
	
	
	
	
	
	
	
	<form  method="POST"  action="">	
										<div class="row">
										
										

												
										
												<div class="col-sm-6">
												  <div class="form-group">
													<label>Client 1 </label>
													<select class="form-control select2" style="width: 100%;" name="client_id1" id="client_id1">
													<option value="0" "selected";>------------ Choisir client 1 ----------- </option>
														<?php   $req =dbi_query("SELECT * FROM client  WHERE client_statut =  '1' ORDER BY client_nom ASC") ;
																while(  $cl=dbi_fetch_row($req)) { 
																if(!empty($cl['latitude']) && !empty($cl['longitude'])){
																?>
																<option value="<?php echo $cl['client_id'] ; ?>"  <?php if($cl['client_id'] == $client_id1) echo "selected"; ?>><?php echo $cl['client_nom'].''; ?></option>
																<?php   }}	?>
													</select>				
												  </div>
												</div>
												<div class="col-sm-6">
												  <div class="form-group">
													<label>Client 2 </label>
													<select class="form-control select2" style="width: 100%;" name="client_id2" id="client_id2">
													<option value="0" "selected";>------------ Choisir client 2 ----------- </option>
														<?php   $req =dbi_query("SELECT * FROM client  WHERE client_statut =  '1' ORDER BY client_nom ASC") ;
																while(  $cl=dbi_fetch_row($req)) { 
																if(!empty($cl['latitude']) && !empty($cl['longitude'])){
																?>
																<option value="<?php echo $cl['client_id'] ; ?>"  <?php if($cl['client_id'] == $client_id2) echo "selected"; ?>><?php echo $cl['client_nom'].''; ?></option>
																<?php   }}	?>
													</select>				
												  </div>
												</div>
												
											

										
										</div>
										<div class="row">
										
										

												
												<div class="col-sm-4">
												  <div class="form-group">
													<label> </label>
													<button type="submit" class="btn btn-primary">Calculer</button>				
												  </div>
												</div>
											

										
										</div>
										

									</form>
									<?php if(isset($resultat)) { ?>
			<div class="row">
				<div class="col-lg-6 col-6">

				</div>
				<div class="col-lg-3 col-6">
					<div class="small-box bg-info">
						<a href="#" class="small-box-footer">Distance  : 
							<h3><?php echo $resultat;?></h3>
						</a>
					</div>
				</div>

			</div>
									
									<?php } ?>
	
	
	
	
	
	
 <div id="map" style="width: 100%; height: 800px;"></div>
  
 
 <!-- Fin du Formulaire -->
     
     
<!--  Fin du Contenu de la Card Principale Ne pas toucher au Div en dessous-->
                </div>
     <!-- Footer de la Card Principale -->
        <div class="card-footer">
          <!--  Inserer ici si besoin texte Footer-->
        </div>
        <!-- fin du Footer de la Card Principale -->
      
 <!-- NE PAS TOUCHER EN DESSOUS -->   
    </div>
  </section>
  </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 </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>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<?php 
$qq =dbi_query("SELECT * FROM `client` Where   latitude != '' and prospect = '0' ") ;
$qqq =dbi_query("SELECT * FROM `client` Where client_statut = '1' and latitude != '' ") ;
 // while($catt = dbi_fetch_row($qqq)) {

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

 // }
 
 // echo ttt "tetddddddddddddddddddddddddddddddddddddddddddddddddddtts <br/>" ; 
?>
<script type="text/javascript">
    var locations = [ <?php 
      while($cat = dbi_fetch_row($qq)) {?>
      ["<span class='cstm-txt'> <?=$cat["client_nom"]?>  <br><span class='cstm-txt'> <?=$cat["client_adr1"]?> </span> </span><br><span class='cstm-txt'> <?=$cat["client_cp"]?> </span><br><span class='cstm-txt'> <?=$cat["client_ville"]?> </span>", <?=$cat['latitude']?>,<?=$cat['longitude']?>, 9],
    <?php } ?>
      

      
     
      
      
    ];

    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 14,
      center: new google.maps.LatLng(48.8744558, 2.3543068),
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    var infowindow = new google.maps.InfoWindow();

    var marker, i;

  
    for (i = 0; i < locations.length; i++) { 
     
      marker = new google.maps.Marker({
        position: new google.maps.LatLng(locations[i][1], locations[i][2]),
        map: map,
        
      });

      google.maps.event.addListener(marker, 'mouseover', (function(marker, i) {
        return function() {
          infowindow.setContent(locations[i][0]);
          infowindow.open(map, marker);
        }
      })(marker, i));
    }
  </script>
</body>
</html>

AnonSec - 2021