-
Notifications
You must be signed in to change notification settings - Fork 3
/
form_facture.php
executable file
·124 lines (122 loc) · 4.76 KB
/
form_facture.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?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: form_facture.php
* formulaire de création des factures
*
* * * Version: 5.0.0
* * * * Modified: 07/10/2016
*
* 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
include_once("include/head.php");
if ($user_fact == 'n') {
echo "<h1>$lang_facture_droit</h1>";
include_once("include/bas.php");
exit;
}
if (isset($message)&&$message!='') {
echo $message; $message='';
}
$rqSql = "SELECT num_client, nom FROM " . $tblpref ."client WHERE actif != 'non'";
if ($user_fact == 'r') {
$rqSql .= "
and (" . $tblpref ."client.permi LIKE '$user_num,'
or " . $tblpref ."client.permi LIKE '%,$user_num,'
or " . $tblpref ."client.permi LIKE '%,$user_num,%'
or " . $tblpref ."client.permi LIKE '$user_num,%')
";
}
$mois = date("m");
$annee = date("Y");
$jour = date("d");
$acompte=isset($_POST['acompte'])?$_POST['acompte']:"";
$date_deb=isset($_POST['date_deb'])?$_POST['date_deb']:"1/$mois/$annee";
$date_fin=isset($_POST['date_fin'])?$_POST['date_fin']:"$jour/$mois/$annee";
$date_fact=isset($_POST['date_fact'])?$_POST['date_fact']:"$jour/$mois/$annee";
$coment=isset($_POST['coment'])?$_POST['coment']:"";
$num="";
if(isset($_POST['simuler']))
$num=isset($client)?$client:"";
?>
<form name="formu" method="post" action="fact.php">
<table border='0' class='page' align='center'>
<caption><?php echo $lang_facture_creer; ?></caption>
<tr>
<td class="texte0"> <?php echo $lang_client; ?></td>
<td class="texte0">
<?php
if ($liste_cli!='y') {
$rqSql="$rqSql order by nom";
$result = mysql_query( $rqSql ) or die('Erreur SQL !<br>'.$rqSql.'<br>'.mysql_error());
?>
<select name='listeclients'>
<option value=""><?php echo $lang_choisissez; ?></option>
<?php
while ( $row = mysql_fetch_array( $result)) {
$numclient = $row["num_client"];
$nom = $row["nom"];
?>
<option value='<?php echo $numclient; ?>'<?php echo ($num==$numclient)?" selected='selected'":''; ?>><?php echo $nom; ?></option>
<?php } ?>
</select>
<?php }else{ include_once("include/choix_cli.php");} ?>
</td>
</tr>
<tr>
<td class='<?php echo couleur_alternee (); ?>'><?php echo $lang_date_deb; ?></td>
<td class='<?php echo couleur_alternee (FALSE); ?>'>
<input type="text" name="date_deb" value="<?php echo $date_deb; ?>" readonly="readonly"/>
<a href="#" onClick=" window.open('include/pop.calendrier.php?frm=formu&ch=date_deb','calendrier','width=460,height=170,scrollbars=0').focus();"><img src="image/petit_calendrier.gif" border="0" alt="calendrier"/></a>
</td>
</tr>
<tr>
<td class='<?php echo couleur_alternee (); ?>'><?php echo $lang_date_fin; ?></td>
<td class='<?php echo couleur_alternee (FALSE); ?>'><input type="text" name="date_fin" value="<?php echo $date_fin; ?>" readonly="readonly"/>
<a href="#" onClick=" window.open('include/pop.calendrier.php?frm=formu&ch=date_fin','calendrier','width=460,height=170,scrollbars=0').focus();"><img src="image/petit_calendrier.gif" border="0" alt="calendrier"/></a>
</td>
</tr>
<tr>
<td class='<?php echo couleur_alternee (); ?>'><?php echo $lang_facture_date; ?></td>
<td class='<?php echo couleur_alternee (FALSE); ?>'><input type="text" name="date_fact" value="<?php echo $date_fact; ?>" readonly="readonly"/>
<a href="#" onClick=" window.open('include/pop.calendrier.php?frm=formu&ch=date_fact','calendrier','width=460,height=170,scrollbars=0').focus();"><img src="image/petit_calendrier.gif" border="0" alt="calendrier"/></a>
</td>
</tr>
<tr>
<td class='<?php echo couleur_alternee (); ?>'><?php echo $lang_acompte; ?></td>
<td class='<?php echo couleur_alternee (FALSE); ?>'><input type="text" name="acompte" value="<?php echo $acompte; ?>"/><?php echo $devise; ?></td>
</tr>
<tr>
<th colspan="2"><?php echo $lang_ajo_fact ?></th>
</tr>
<tr>
<td class="submit" colspan="2">
<textarea name="coment" cols="45" rows="3"><?php echo $coment; ?></textarea><br>
<input type="submit" name="Submit" value="<?php echo $lang_facture_creer_bouton; ?>">
<input alt="<?php echo $lang_simu; ?>" type="checkbox" name="simuler" <?php echo (isset($_POST['simuler']))?' checked="checked"':'';?> />
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td>
<?php
include_once("lister_factures.php");