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
| <?php
include("inc/conf.php");
// Récupération des paramètres POST
$id_ste = $_POST["id_ste"];
$acheteur = $_POST["acheteur"];
$vos_ref = $_POST["vos_ref"];
$frns = $_POST["frns"];
$date = $_POST["date"];
$condit_pay = $_POST["condit_pay"];
$bank = $_POST["bank"];
$echeance = $_POST["echeance"];
$projet = $_POST["projet"];
$devise = $_POST["devise"];
$tva = $_POST["tva"];
$tva_type = $_POST["tva_type"];
$id_enl = $_POST["id_enl"];
$id_liv = $_POST["id_liv"];
@mysql_pconnect($BD_serveur, $BD_utilisateur, $BD_motDePasse)
or die("Impossible de se connecter au serveur de bases de données.");
@mysql_select_db($BD_base)
or die("Impossible de se connecter à la base de données.");
$requete1 ="SELECT MAX(id_cmde) as id_cmde FROM table_achat WHERE id_ste=\"$id_ste\"";
$result1 = mysql_query($requete1) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
while ($data=mysql_fetch_array($result1))
{
$id_cmde1=$data['id_cmde']+1;
}
$requete = "INSERT INTO table_achat (id_cmde, id_ste,acheteur,vos_ref,frns,date,condit_pay,bank,echeance,projet,devise,tva,tva_type,id_enl,id_liv)
VALUES ('$id_cmde1','$id_ste','$acheteur','$vos_ref','$frns','$date','$condit_pay','$bank','$echeance','$projet','$devise','$tva','$tva_type','$id_enl','$id_liv')";
$result = @mysql_query($requete)or die('Erreur de selection '.mysql_error());
header("Location: add_order.php");
?> |
Partager