1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| <?php
session_start();
if(isset($_SESSION["loginClient"]) && $_SESSION["loginClient"]!="")
{
?>
<?php
include("fonction.php");
?>
<html>
<head>
<!-- header du site à trouver et à intégrer ou placer ce code directement sur jommla => en tête de la page action="formulaireP1.php" -->
<!-- intégration du thème de joomla => pareil -->
<title> Kheops organisation </title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<meta name="robots" content="noindex">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
//$connexion=mysql_connect("wathkevin.sql.free.fr ", "wathkevin", "SW4wYmaj") or die("erreur lors de la connexion à phpmyadmin");
$connexion=mysql_connect("localhost", "root", "") or die("erreur lors de la connexion à phpmyadmin");
//Choix de la base de donnée
$bdd=mysql_select_db("bdd_khops", $connexion) or die("erreur lors de la connexion à la bdd");
?>
<?php
$reponse=mysql_query("SELECT *
FROM client ");
while ($donnees= mysql_fetch_array($reponse) or die(mysql_error()))
{
?>
<form method="POST" name="base" action="testBdc.php" enctype="multipart/form-data">
<h2 style="text-align:left;">BON DE COMMANDE</h2>
<!-- ICI il y a mon code html que j'ai enlevé afin que ce ne soit pas trop long -->
<input type="submit" name="valider" value="Modifier"/>
</form>
<?php
if(isset($_POST['valider'])){
//on récupère les valeurs entrées par l'utilisateur :
$id = $_POST['id'];
$intitule=$_POST['intitule'];
$detail=$_POST['detail'];
$contactCommercial=$_POST['contactCommercial'];
$date=$_POST['date'];
$rs=$_POST['rs'];
$siret=$_POST['siret'];
$codeAPENAF=$_POST['codeAPENAF'];
$TVAIntra=$_POST['TVAIntra'];
$adresse=$_POST['adresse'];
$ville=$_POST['ville'];
$cp=$_POST['cp'];
$rl_nom=$_POST['rl_nom'];
$rl_prenom=$_POST['rl_prenom'];
$rl_fonction=$_POST['rl_fonction'];
$rl_tel=$_POST['rl_tel'];
$rl_mobile=$_POST['rl_mobile'];
$rl_mail=$_POST['rl_mail'];
$cf_nom=$_POST['cf_nom'];
$cf_prenom=$_POST['cf_prenom'];
$cf_fonction=$_POST['cf_fonction'];
$cf_tel=$_POST['cf_tel'];
$cf_mobile=$_POST['cf_mobile'];
$cf_mail=$_POST['cf_mail'];
$ct_nom=$_POST['ct_nom'];
$ct_prenom=$_POST['ct_prenom'];
$ct_fonction=$_POST['ct_fonction'];
$ct_tel=$_POST['ct_tel'];
$ct_mobile=$_POST['ct_mobile'];
$ct_mail=$_POST['ct_mail'];
connectKheops();
$sql = ("UPDATE client
SET intitule = '$intitule', detail = '$detail', contactCommercial = '$contactCommercial', date='$date', rs = '$rs', siret = '$siret',
codeAPENAF = '$codeAPENAF', TVAIntra = '$TVAIntra', adresse = '$adresse', ville = '$ville', cp = '$cp', rl_nom = '$rl_nom', rl_prenom = '$rl_prenom', rl_fonction = '$rl_fonction',
rl_tel = '$rl_tel', rl_mobile = '$rl_mobile', rl_mail = '$rl_mail', cf_nom = '$cf_nom', cf_prenom = '$cf_prenom', cf_fonction = '$cf_fonction', cf_tel = '$cf_tel', cf_mobile = '$cf_mobile',
cf_mail = '$cf_mail', ct_nom = '$ct_nom', ct_prenom = '$ct_prenom', ct_fonction = '$ct_fonction', ct_tel = '$ct_tel', ct_mobile = '$ct_mobile', ct_mail = '$ct_mail'
WHERE id='$id'");
mysql_query($sql) or die ('Erreur SQL!'.$sql.' '.mysql_error());
}
?>
<?php
}
mysql_close(); // On oubli pas de déconnecter la base de données
?>
<?php
}
//Redirection vers l'accueil sinon
else
{
header('Location: index.php');
exit;
}
?>
</html> |
Partager