-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdevis_non_commandes.php
executable file
·121 lines (121 loc) · 3.97 KB
/
devis_non_commandes.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
<?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: fckconfig.js
* Editor configuration settings.
*
* * * Version: 5.0.0
* * * * Modified: 07/10/2016
*
* File Authors:
* Guy Hendrickx
*.
*/
include_once("include/headers.php");
?><script type="text/javascript" src="javascripts/confdel.js"></script><?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_dev == 'n') {
echo "<h1>$lang_devis_droit</h1>";
include_once("include/bas.php");
exit;
}
$num_dev=isset($_GET['num_dev'])?$_GET['num_dev']:"";
if ($num_dev !='') {
$sql2 = "UPDATE " . $tblpref ."devis SET resu = '-1' WHERE num_dev = $num_dev";
mysql_query($sql2) or die('Erreur SQL2 !<br>'.$sql2.'<br>'.mysql_error());
echo "<p>$lang_de_per</p>";
}
?>
<center>
<table class='page boiteaction'>
<caption><?php echo $lang_devis_perdus; ?></caption>
<tr>
<th><?php echo $lang_numero; ?></th>
<th><?php echo $lang_client; ?></th>
<th><?php echo $lang_date; ?></th>
<th><?php echo $lang_total_h_tva; ?></th>
<th><?php echo $lang_total_ttc; ?></th>
<th colspan ="2"><?php echo $lang_action; ?></th>
</tr>
<?php
$sql = "
SELECT num_dev, tot_htva, tot_tva, DATE_FORMAT(date,'%d/%m/%Y') AS date, nom
FROM " . $tblpref ."devis
LEFT JOIN " . $tblpref ."client on " . $tblpref ."devis.client_num = num_client
WHERE num_dev >0 AND resu = '-1'";
if ($user_dev == 'r') {
$sql .= "
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,%'";
}
$sql .= "
ORDER BY " . $tblpref ."devis.num_dev DESC ";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$c=0;
while($data = mysql_fetch_array($req)){
$num_dev = $data['num_dev'];
$total = $data['tot_htva'];
$tva = $data['tot_tva'];
$date = $data['date'];
$nom = $data['nom'];
$ttc = $total + $tva ;
if($c++ & 1){
$line="0";
}else{
$line="1";
}
?>
<tr class="texte<?php echo $line; ?>" onmouseover="this.className='highlight'" onmouseout="this.className='texte<?php echo $line; ?>'">
<td class='<?php echo couleur_alternee (); ?>'><?php echo $num_dev; ?></td>
<td class='<?php echo couleur_alternee (FALSE); ?>'><?php echo $nom; ?></td>
<td class='<?php echo couleur_alternee (FALSE, "c texte"); ?>'><?php echo $date; ?></td>
<td class='<?php echo couleur_alternee (FALSE, "nombre"); ?>'><?php echo montant_financier($total); ?></td>
<td class='<?php echo couleur_alternee (FALSE, "nombre"); ?>'><?php echo montant_financier($ttc); ?></td>
<td class='<?php echo couleur_alternee (FALSE, "c texte"); ?>'>
<a href="delete_dev.php?num_dev=<?php echo $num_dev; ?>&nom=<?php echo $nom; ?>"
onClick='return confirmDelete("<?php echo "$lang_con_dev_effa"; ?>")'>
<img border='0' src='image/delete.jpg' alt='<?php echo $lang_effacer; ?>'>
</a>
</td>
<td class='<?php echo couleur_alternee (FALSE, "c texte"); ?>'>
<form action="fpdf/devis_pdf.php" method="post" target="_blank">
<input type="hidden" name="num_dev" value="<?php echo $num_dev; ?>" />
<input type="hidden" name="nom" value="<?php echo $nom; ?>" />
<input type="hidden" name="user" value="adm" />
<input type="image" src="image/printer.gif" style="border:none;margin:0;" alt="<?php echo $lang_imprimer; ?>" />
</form>
</td>
</tr>
<?php } ?>
</table>
</center>
</td>
</tr>
<tr>
<td>
<?php
$aide='devis';
include("help.php");
include_once("include/bas.php");
?>
</td>
</tr>
</table>
</body>
</html>