/[phpcompta]/phpcompta/include/impress_rapport.php
ViewVC logotype

Diff of /phpcompta/include/impress_rapport.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by sparkyx, Thu Jul 21 11:07:52 2005 UTC revision 1.2 by sparkyx, Wed Jul 27 12:23:00 2005 UTC
# Line 27  if ( isset( $_POST['bt_html'] ) ) { Line 27  if ( isset( $_POST['bt_html'] ) ) {
27  include("class_rapport.php");  include("class_rapport.php");
28    $Form=new rapport($cn,$_POST['form_id']);    $Form=new rapport($cn,$_POST['form_id']);
29    $Form->GetName();    $Form->GetName();
30    $array=$Form->GetRow( $_POST['from_periode'],    // step asked ?
31                          $_POST['to_periode']    //--
32                          );    if ($_POST['p_step'] == 0 ) {
33        $array=$Form->GetRow( $_POST['from_periode'],
34                              $_POST['to_periode']
35                              );
36      } else {
37        // step are asked
38        //--
39        for ($e=$_POST['from_periode'];$e<=$_POST['to_periode'];$e+=$_POST['p_step'])
40          {
41            $array[]=$Form->GetRow($e,$e);
42            $periode_name[]=getPeriodeName($cn,$e);
43          }
44      }
45    
46    
47    $rep="";    $rep="";
48    $submit=new widget();    $submit=new widget();
# Line 51  include("class_rapport.php"); Line 64  include("class_rapport.php");
64      $hid->IOValue("type","rapport").      $hid->IOValue("type","rapport").
65      $hid->IOValue("form_id",$Form->id).      $hid->IOValue("form_id",$Form->id).
66      $hid->IOValue("from_periode",$_POST['from_periode']).      $hid->IOValue("from_periode",$_POST['from_periode']).
67      $hid->IOValue("to_periode",$_POST['to_periode']);      $hid->IOValue("to_periode",$_POST['to_periode']).
68        $hid->IOValue("p_step",$_POST['p_step']);
69    
70    
71    echo "</form></TD>";    echo "</form></TD>";
72    echo '<TD><form method="POST" ACTION="form_csv.php">'.    echo '<TD><form method="POST" ACTION="form_csv.php">'.
# Line 59  include("class_rapport.php"); Line 74  include("class_rapport.php");
74      $hid->IOValue("type","form").      $hid->IOValue("type","form").
75      $hid->IOValue("form_id",$Form->id).      $hid->IOValue("form_id",$Form->id).
76      $hid->IOValue("from_periode",$_POST['from_periode']).      $hid->IOValue("from_periode",$_POST['from_periode']).
77      $hid->IOValue("to_periode",$_POST['to_periode']);      $hid->IOValue("to_periode",$_POST['to_periode']).
78        $hid->IOValue("p_step",$_POST['p_step']);
79    
80    echo "</form></TD>";    echo "</form></TD>";
81    
# Line 69  include("class_rapport.php"); Line 85  include("class_rapport.php");
85    if ( count($Form->row ) == 0 )    if ( count($Form->row ) == 0 )
86          exit;          exit;
87    
88    echo "<TABLE width=\"100%\">";        if ( $_POST['p_step'] == 0)
89        echo "<TR>".          { // check the step
90          "<TH> Description </TH>".            // show tables
91          "<TH> montant </TH>".            ShowReportResult($Form->row);
92          "</TR>";          }
93            else
94    foreach ( $Form->row as $op ) {            {
95        echo "<TR>".              $a=0;
96          "<TD>".$op['desc']."</TD>".              foreach ( $array as $e) {
97          "<TD align=\"right\">".sprintf("% 8.2f",$op['montant'])."</TD>".                echo '<h2 class="info">Periode : '.$periode_name[$a]."</h2>";
98          "</TR>";                $a++;
99                      ShowReportResult($e);
100    }              }
101    echo "</table>";            }
102    
103    echo "</div>";    echo "</div>";
104    exit;    exit;
105  }  }
# Line 118  $w->label=" jusqu'ŕ "; Line 135  $w->label=" jusqu'ŕ ";
135  $periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode order by p_id");  $periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode order by p_id");
136  print $w->IOValue('to_periode',$periode_end);  print $w->IOValue('to_periode',$periode_end);
137  print "</TR>";  print "</TR>";
138    $aStep=array(
139                 array('value'=>0,'label'=>'Pas d\'étape'),
140                 array('value'=>1,'label'=>'1 mois')
141                 );
142    $w->label='Par étape de';
143    echo '<TR> '.$w->IOValue('p_step',$aStep);
144    echo '</TR>';
145    
146  echo '</TABLE>';  echo '</TABLE>';
147  print $w->Submit('bt_html','Impression');  print $w->Submit('bt_html','Impression');
148    
149  echo '</FORM>';  echo '</FORM>';
150  echo '</div>';  echo '</div>';
151    ////////////////////////////////////////////////////////////////////////////////
152    // Function
153    ////////////////////////////////////////////////////////////////////////////////
154     function ShowReportResult($p_array) {
155      
156       echo "<TABLE width=\"100%\">";
157       echo "<TR>".
158         "<TH> Description </TH>".
159         "<TH> montant </TH>".
160         "</TR>";
161       foreach ( $p_array as $op ) {
162         echo "<TR>".
163           "<TD>".$op['desc']."</TD>".
164           "<TD align=\"right\">".sprintf("% 8.2f",$op['montant'])."</TD>".
165           "</TR>";
166       }
167       echo "</table>";
168    
169     }
170    
171  ?>  ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26