17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 |
*/ |
*/ |
19 |
/* $Revision$ */ |
/* $Revision$ */ |
20 |
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr |
include_once("class_widget.php"); |
21 |
|
//////////////////////////////////////////////////////////////////////////////// |
22 |
|
// If print is asked |
23 |
|
// First time in html |
24 |
|
// after in pdf or cvs |
25 |
|
//////////////////////////////////////////////////////////////////////////////// |
26 |
|
if ( isset( $_POST['bt_html'] ) ) { |
27 |
|
include("class_form.php"); |
28 |
|
$Form=new formulaire($cn,$_POST['form_id']); |
29 |
|
$Form->GetName(); |
30 |
|
$array=$Form->GetRow( $_POST['from_periode'], |
31 |
|
$_POST['to_periode'] |
32 |
|
); |
33 |
|
|
34 |
|
$rep=""; |
35 |
|
$submit=new widget(); |
36 |
|
$hid=new widget("hidden"); |
37 |
|
echo '<div class="u_redcontent">'; |
38 |
|
$t=($_POST['from_periode']==$_POST['to_periode'])?"":" -> ".getPeriodeName($cn,$_POST['to_periode'],'p_end'); |
39 |
|
echo '<h2 class="info">'.$Form->id." ".$Form->name. |
40 |
|
" - ".getPeriodeName($cn,$_POST['from_periode'],'p_start'). |
41 |
|
" ".$t. |
42 |
|
'</h2>'; |
43 |
|
echo "<table>"; |
44 |
|
echo '<TR>'; |
45 |
|
echo '<TD><form method="GET" ACTION="user_impress.php">'. |
46 |
|
$submit->Submit('bt_other',"Autre Formulaire"). |
47 |
|
$hid->IOValue("type","form")."</form></TD>"; |
48 |
|
|
49 |
|
echo '<TD><form method="POST" ACTION="form_pdf.php">'. |
50 |
|
$submit->Submit('bt_pdf',"Export PDF"). |
51 |
|
$hid->IOValue("type","form"). |
52 |
|
$hid->IOValue("form_id",$Form->id). |
53 |
|
$hid->IOValue("from_periode",$_POST['from_periode']). |
54 |
|
$hid->IOValue("to_periode",$_POST['to_periode']); |
55 |
|
|
56 |
|
echo "</form></TD>"; |
57 |
|
echo '<TD><form method="POST" ACTION="form_csv.php">'. |
58 |
|
$submit->Submit('bt_csv',"Export CSV"). |
59 |
|
$hid->IOValue("type","form"). |
60 |
|
$hid->IOValue("form_id",$Form->id). |
61 |
|
$hid->IOValue("from_periode",$_POST['from_periode']). |
62 |
|
$hid->IOValue("to_periode",$_POST['to_periode']); |
63 |
|
|
64 |
|
echo "</form></TD>"; |
65 |
|
|
66 |
|
echo "</TR>"; |
67 |
|
|
68 |
|
echo "</table>"; |
69 |
|
if ( count($Form->row ) == 0 ) |
70 |
|
exit; |
71 |
|
|
72 |
|
echo "<TABLE width=\"100%\">"; |
73 |
|
echo "<TR>". |
74 |
|
"<TH> Description </TH>". |
75 |
|
"<TH> montant </TH>". |
76 |
|
"</TR>"; |
77 |
|
|
78 |
|
foreach ( $Form->row as $op ) { |
79 |
|
echo "<TR>". |
80 |
|
"<TD>".$op['desc']."</TD>". |
81 |
|
"<TD align=\"right\">".sprintf("% 8.2f",$op['montant'])."</TD>". |
82 |
|
"</TR>"; |
83 |
|
|
84 |
|
} |
85 |
|
echo "</table>"; |
86 |
|
echo "</div>"; |
87 |
|
exit; |
88 |
|
} |
89 |
|
|
90 |
|
//////////////////////////////////////////////////////////////////////////////// |
91 |
|
// Show the jrn and date |
92 |
|
//////////////////////////////////////////////////////////////////////////////// |
93 |
|
include_once('form_input.php'); |
94 |
|
include_once("postgres.php"); |
95 |
|
$ret=make_array($cn,"select fr_id,fr_label |
96 |
|
from formdef |
97 |
|
order by fr_label"); |
98 |
|
//////////////////////////////////////////////////////////////////////////////// |
99 |
|
// Form |
100 |
|
//////////////////////////////////////////////////////////////////////////////// |
101 |
|
echo '<div class="redcontent">'; |
102 |
|
echo '<FORM ACTION="?type=form" METHOD="POST">'; |
103 |
|
echo '<TABLE><TR>'; |
104 |
|
$w=new widget("select"); |
105 |
|
$w->table=1; |
106 |
|
$w->label="Choississez le formulaire"; |
107 |
|
print $w->IOValue("form_id",$ret); |
108 |
|
print '</TR>'; |
109 |
|
print '<TR>'; |
110 |
|
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id"); |
111 |
|
$w->label="Depuis"; |
112 |
|
print $w->IOValue('from_periode',$periode_start); |
113 |
|
$w->label=" jusqu'à "; |
114 |
|
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode order by p_id"); |
115 |
|
print $w->IOValue('to_periode',$periode_end); |
116 |
|
print "</TR>"; |
117 |
|
echo '</TABLE>'; |
118 |
|
print $w->Submit('bt_html','Impression'); |
119 |
|
|
120 |
|
echo '</FORM>'; |
121 |
|
echo '</div>'; |
122 |
|
?> |