<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" type="image/png" href="favicon.png">
    
	<link rel="stylesheet" type="text/css" href="./css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="style.css">
	<link rel="stylesheet" type="text/css" href="./css/font-awesome.min.css">
	
    
	<script src="./js/jquery-2.1.0.min.js"></script>
	<script src="./js/bootstrap.min.js"></script>
	<script src="./js/blocs.min.js"></script>
	<script src="./js/lazysizes.min.js" defer></script>
    <title>Home</title>

    
<!-- Google Analytics -->
 
<!-- Google Analytics END -->
    
</head>
<body>
<!-- Main container -->
<div class="page-container">
<!-- ScrollToTop Button -->
<a class="bloc-button btn btn-d scrollToTop" onclick="scrollToTarget('1')"><span class="fa fa-chevron-up"></span></a>
<!-- ScrollToTop Button END-->


<!-- Footer - bloc-0 -->
<div class="bloc bgc-white bg-highway d-bloc " id="bloc-0">
	<div class="container bloc-lg">
		<div class="row">	
			<div class="col-sm-10">
<h3 class="mg-md">
					Modifier Client
				</h3>
				
				
			
<?php
				
				 if(isset($_POST['update'])) {

					 
					 // on se connecte à notre base

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

$SOC="testttt";//$_POST['_SOC'];
$NOM1=$row["nom1"];
$NOM2=$row["nom2"];
$NOM3=$row["nom3"];
$NOM4=$row["nom4"];
$NOM5=$row["nom5"];
$TITRE=$row["titre"];
$PUB=$row["pub"];
$AC1=$row["ac1"];
$AC2=$row["ac2"];
$O1=$row["o1"];
$O2=$row["o2"];
$O3=$row["o3"];
$MAIL=$row["mail"];
$GSM=$row["gsm"];
$TEL=$row["tel"];
					 
$sql = "SELECT * FROM data";
$sql = "SELECT * FROM data WHERE id=3";
$sql = "UPDATE 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') WHERE id=3";
$sql = "UPDATE data SET societe='YEAAAAHHH'  WHERE id=3";
$sql = "UPDATE\n". "  `data`\n"." SET\n". " societe = \'testoooyeahhh\'\n". "WHERE\n". " id = 3";

$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>";
    } 
    
	
	} 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();
					 
					 
					 
					 
					 
					 }else {
$SOC=" ";
$NOM1=" ";
$NOM2=" ";
$NOM3=" ";
$NOM4=" ";
$NOM5=" ";
$TITRE=" ";
$PUB=" ";
$AC1=" ";
$AC2=" ";
$O1=" ";
$O2=" ";
$O3=" ";
$MAIL=" ";
$GSM=" ";
$TEL=" ";

// 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=3";
					// $sql = "UPDATE\n". "  `data`\n"." SET\n". " societe = \'testoooyeahhh\'\n". "WHERE\n". " id = 3";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
		
$SOC=$row["societe"];
$NOM1=$row["nom1"];
$NOM2=$row["nom2"];
$NOM3=$row["nom3"];
$NOM4=$row["nom4"];
$NOM5=$row["nom5"];
$TITRE=$row["titre"];
$PUB=$row["pub"];
$AC1=$row["ac1"];
$AC2=$row["ac2"];
$O1=$row["o1"];
$O2=$row["o2"];
$O3=$row["o3"];
$MAIL=$row["mail"];
$GSM=$row["gsm"];
$TEL=$row["tel"];
		
        echo "Soc: " . $row["societe"]. " - Nom: " . $row["nom1"]. " - idx: " . $row["id"]. " " . $row["nom2"]. "<br>";
		//echo "Soc: " . $row["societe"]. " - Nom: " . $row["nom1"]. "  " . $row["nom2"]. "<br>";
    } 
    
	
	} 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();
					 
	}			
				
?>
				
				
<form method = "post" action = "<?php $_PHP_SELF ?>">
<h3>
<table
style="text-align: left; height: 598px; width: 100%; "
border="0" cellpadding="1" cellspacing="1" class="mg-md">
<tbody>
<tr>
<td style="vertical-align: top; width: 97px;">Nom de la société : <br>
</td>
<td style="vertical-align: top; width: 128px;"><input class="form-control" size="30"
name="_SOC" id="_SOC" value="<?php echo $SOC ?>"><br>
</td>
</tr>

	  <input class="form-control" name = "update" type = "submit" id = "update" value = "Update">
	<br>
</td>
</tr>
</tbody>
	</table></h3>

</form>




			</div>

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



</body>
</html>
