<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Liste client</title>
     <link rel="stylesheet" href="css/bootstrap.css" media="all" />
      
  </head>
    
    
    
    <table class="table" border="0" cellspacing="0" cellpadding="0">
        <thead>
          <tr>
            <th class="no">#</th>
            <th class="desc">DESCRIPTION </th>
            <th class="unit"> </th>
          
          </tr>
        </thead>
		  
		  
        <tbody>
<?php
			
$SOC=" ";
$NOM1=" ";
$NOM2=" ";
$NOM3=" ";
$NOM4=" ";
$NOM5=" ";
$TITRE=" ";
$PUB=" ";
$AC1=" ";
$AC2=" ";
$O1=" ";
$O2=" ";
$O3=" ";
$MAIL=" ";
$GSM=" ";
$TEL=" ";
$FAC1=" ";
$FAC2=" ";
$FAC3=" ";
$FAC4=" ";
// on se connecte à notre base

$servername = "localhost:8889";
$username = "test";
$password = "test";
$dbname = "Clients";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

$sql = "SELECT * FROM data where nom1 LIKE '%".$_POST['client']."%' ";
//$sql = "SELECT * FROM data WHERE id=1";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        //echo "Soc: " . $row["societe"]. " - Nom: " . $row["nom1"]. " - idx: " . $row["id"]. " " . $row["nom2"]. "<br>";
		//echo "Soc: " . $row["societe"]. " - Nom: " . $row["nom1"]. "  " . $row["nom2"]. "<br>";
		
		 print "<tr>";
            print " <td class='no'>". $row["id"]."</td>";
            print " <td class='desc'><h3>". $row["nom1"]. "</h3>". $row["societe"]."  ". $row["nom2"]." ". $row["nom3"]."</td>";
			//print "<form method='post' action='clientaf2.php' name='demande'>";
		print "<td class='unit'><form method='post' action='picdrop.php' name='demande'>";
            print "<button name='dnumdevis' type='submit' value='". $row["nom1"]."'>Suivant</button></td>";
		
			print "</form>";
        
          print "</tr>";
      
    } 
     // print $sql;
	
	} else {
    echo "0 results";
}

//$sql = "INSERT INTO data (societe,nom1,nom2,nom3,nom4,nom5,titre,ac1,ac2,o1,o2,o3,mail,tel,gsm,pub,jour)
//VALUES ('$SOC' , '$NOM1', '$NOM2', '$NOM3', '$NOM4', '$NOM5', '$TITRE', '$AC1', '$AC2', '$O1', '$O2', '$O3', '$MAIL', '$TEL', '$GSM', '$PUB', //'$today')";


$conn->close();


		?>	
               </tbody>
        
      </table>
</html>
			