<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Prospects</title>
    <link rel="stylesheet" href="stylecli.css" media="all" />
  </head>
  <body >
    
    </header>
    <main>
      <div id="details" class="clearfix">
        <div id="client">
          <div class="to"><h1><br>
          Prospects pour clone offre<br></h1></div>
          <h2 class="name"></h2>
          <div class="address"></div>
          <div class="email"></div>
        </div>
        <div id="invoice">
          <h1></h1>
          <div class="date"></div>
          <div class="date"></div>
        </div>
      </div>
		
		
      <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=" ";

			
			$NumeroIndexDevis=$_POST['dnumdevis'];
			
// 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";
//$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"].$NumeroIndexDevis."</td>";
            print " <td class='desc'><h3>". $row["nom1"]. "</h3>". $row["societe"]."  ". $row["nom2"]."</td>";
		
		print "<form method='post' action='textecreaclone.php' name='demande'>";
			print "<input type='hidden' size='60' name='dnumdevis' id='dnumdevis' value='".$NumeroIndexDevis."' > ";
            print "<td class='unit'><button name='idxcli' id='liensubmit2' type='submit' value='". $row["id"]."'>Suivant</button></td>";
		
			print "</form>";
        
          print "</tr>";
    } 
    
	
	} 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>
     
      <div id="notices">
        <div><br></div>
        <div class="notice"><br></div>
      </div>
    </main>
    
  </body>
</html>