-
Notifications
You must be signed in to change notification settings - Fork 3
/
bon.php
executable file
·108 lines (107 loc) · 3.28 KB
/
bon.php
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
<?php
/*
* Factux le facturier libre
* Copyright (C) 2003-2005 Guy Hendrickx, 2017 Thomas Ingles
*
* Licensed under the terms of the GNU General Public License:
* http://opensource.org/licenses/GPL-3.0
*
* For further information visit:
* http://factux.free.fr
*
* File Name: bon.php
* Editor configuration settings.
*
* * * Version: 5.0.1
* * * * Modified: 10/06/2017
*
* File Authors:
* Guy Hendrickx
*.
*/
include_once("include/headers.php");
include_once("include/finhead.php");
?>
<table width="760" border="0" class="page" align="center">
<tr>
<td class="page" align="center">
<?php
$client=isset($_POST['listeclients'])?$_POST['listeclients']:"";
$date=isset($_POST['date'])?$_POST['date']:"";
if($client=='0'||$client==''){# '' si select client vide (aucun client enregisté)
$message="<h1>$lang_choix_client</h1>";
include('form_commande.php');
exit;
}
list($jour, $mois,$annee) = preg_split('/\//', $date, 3);
$sql_nom = "SELECT nom, nom2 FROM " . $tblpref ."client WHERE num_client = $client";
$req = mysql_query($sql_nom) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
while($data = mysql_fetch_array($req)){
$nom = $data['nom'];
$nom2 = $data['nom2'];
}
$sql1 = "INSERT INTO " . $tblpref ."bon_comm(client_num, date) VALUES ('$client', '$annee-$mois-$jour')";
mysql_query($sql1) or die('Erreur SQL !<br>'.$sql1.'<br>'.mysql_error());
$num_bon = mysql_insert_id();//le numero de bon créé
?>
<center>
<form name="formu2" method="post" action="edit_bon_suite.php">
<table width="760" border="0" class="page" align="center" class="boiteaction">
<caption><?php echo "$lang_donne_bon $lang_numero $num_bon $lang_de $nom"; ?></caption>
<tr>
<td class="texte0"><?php echo $lang_article; ?></td>
<td class="texte0">
<?php include("include/article_choix.php"); ?>
</td>
<?php if ($lot=='y') { ?>
<td class="texte0"><?php echo $lang_lot; ?></td>
<?php
$rqSql = "SELECT num, prod FROM " . $tblpref ."lot WHERE actif != 'non' ORDER BY num";
$result = mysql_query( $rqSql ) or die('Erreur SQL !<br>'.$rqSql.'<br>'.mysql_error());
?>
<td class="texte0">
<select name="lot">
<option value=''><?php echo $lang_choisissez; ?></option>
<?php
while ($row = mysql_fetch_array($result)) {
$num = $row["num"];
$prod = $row["prod"];
?>
<option value='<?php echo $num; ?>'><?php echo "$num $prod "; ?></option>
<?php } ?>
</select>
</td>
<?php } ?>
</tr>
<tr>
<td class="texte0"><?php echo $lang_quanti; ?> </td>
<td class="texte0" colspan="3"><input name="quanti" type="text" id="quanti" size="6"></td>
</tr>
<tr>
<td class="texte0"><?php echo $lang_remise; ?> </td>
<td class="texte0" colspan="3"><input name="remise" type="text" id="remise" size="6">%</td>
</tr>
<tr>
<td class="submit" colspan="4">
<input name="nom" type="hidden" id="nom" value="<?php echo $nom ?>">
<input type="submit" name="Submit" value="<?php echo $lang_valid; ?>">
</td>
</tr>
</table>
<input name="num_bon" type="hidden" value='<?php echo $num_bon; ?>'>
</form>
</center>
</td>
</tr>
<tr>
<td>
<?php
$aide='bon';
include("help.php");
include_once("include/bas.php");
?>
</td>
</tr>
</table>
</body>
</html>