28 require_once
'class_rapav_declaration.php';
34 if (isset($_POST[
'save']))
37 $decl->d_description =strip_tags($_GET[
'p_description']);
38 $decl->d_id = $_POST[
'd_id'];
41 $decl->f_id = $_POST[
'p_form'];
43 if (
$decl->d_step == 0)
45 $decl->generate_document();
49 $decl->d_filename = null;
51 $decl->d_mimetype = null;
56 echo
'<p class="notice">' . _(
' Sauvé ') . date(
'd-m-Y H:i') .
'</p>';
58 $ref_csv = HtmlInput::array_to_string(array(
'gDossier',
'plugin_code',
'd_id'),
$_REQUEST,
'extension.raw.php?');
59 $ref_csv.=
"&act=export_decla_csv";
60 echo HtmlInput::button_anchor(
"Export CSV", $ref_csv,
'export_id',
"",
'small_button');
61 if (
$decl->d_filename !=
'' &&
$decl->d_step == 0)
62 echo
$decl->anchor_document();
68 if (isset($_GET[
'compute']))
71 if (isDate($_GET[
'p_start']) == 0 || isDate($_GET[
'p_end']) == 0)
73 alert(
'Date invalide');
76 $decl->d_description = $_GET[
'p_description'];
77 $decl->compute($_GET[
'p_form'], $_GET[
'p_start'], $_GET[
'p_end'], $_GET[
'p_step']);
78 echo
'<form class="print" method="POST">';
79 echo HtmlInput::hidden(
'p_form', $_GET[
'p_form']);
81 echo HtmlInput::submit(
'save',
'Sauver');
91 $hidden = HtmlInput::array_to_hidden(array(
'gDossier',
'ac',
'plugin_code',
'sa'), $_GET);
93 $select->value =
$cn->make_array(
'select f_id,f_title from rapport_advanced.formulaire order by 2');
102 array(
'label' =>
'Aucun',
'value' => 0),
103 array(
'label' =>
'7 jours',
'value' => 1),
104 array(
'label' =>
'14 jours',
'value' => 2),
105 array(
'label' =>
'1 mois',
'value' => 3),
106 array(
'label' =>
'2 mois',
'value' => 4),
107 array(
'label' =>
'3 mois',
'value' => 5),
108 array(
'label' =>
'6 mois',
'value' => 6),
109 array(
'label' =>
'1 an',
'value' => 7)
117 $select_listing->value =
$cn->make_array(
"select l_id, l_name from rapport_advanced.listing order by 2");
118 $select_listing->javascript=
' onchange ="generation_fill_condition ();generation_fill_description()"';
126 array(
'value' => 0,
'label' =>
'Toutes les opérations'),
127 array(
'value' => 1,
'label' =>
'Uniquement les opérations payées'),
128 array(
'value' => 2,
'label' =>
'Uniquement les opérations non payées')
131 <div
id=
"id_rapport_div" style=
"display: block">
132 <form
id=
"declaration_form_id" method=
"GET" onsubmit=
"return validate()">
134 <input type=
"hidden" name=
"form" value=
"rapport">
145 <td> Description</td><td> <?php echo
$description->input() ?></td>
168 <?php echo
$istep->input() ?>
173 <?php echo HtmlInput::submit(
'compute',
'Générer') ?>
177 <script charset=
"UTF8" lang=
"javascript">
178 function validate() {
179 if (check_date_id(
'<?php echo $date_start->id ?>') ==
false) {
180 smoke.alert(
'Date de début incorrecte');
181 $(
'<?php echo $date_start->id ?>').style.borderColor =
'red';
182 $(
'<?php echo $date_start->id ?>').style.borderWidth = 2;
185 if (check_date_id(
'<?php echo $date_end->id ?>') ==
false) {
186 smoke.alert(
'Date de fin incorrecte');
187 $(
'<?php echo $date_end->id ?>').style.borderColor =
'red';
188 $(
'<?php echo $date_end->id ?>').style.borderWidth = 2;
compute, save and display a declaration
if(isset($_POST['save'])) if(isset($_GET['compute'])) $date_start