/[phpcompta]/phpcompta/html/form_pdf.php
ViewVC logotype

Diff of /phpcompta/html/form_pdf.php

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

revision 1.2 by sparkyx, Thu Jul 21 09:41:39 2005 UTC revision 1.3 by sparkyx, Wed Jul 27 12:23:00 2005 UTC
# Line 37  $pdf=& new Cezpdf(); Line 37  $pdf=& new Cezpdf();
37  $pdf->selectFont('./addon/fonts/Helvetica.afm');  $pdf->selectFont('./addon/fonts/Helvetica.afm');
38    
39  $Form=new rapport($cn,$form_id);  $Form=new rapport($cn,$form_id);
40  $array=$Form->GetRow($from_periode,$to_periode);  // Step ??
41    //--
42    if ( $_POST['p_step'] == 0 )
43      {
44        // No step asked
45        //--
46        $array=$Form->GetRow($from_periode,$to_periode);
47      }
48     else
49       {
50         // yes with step
51         //--
52         for ($e=$_POST['from_periode'];$e<=$_POST['to_periode'];$e+=$_POST['p_step'])
53           {
54             $array[]=$Form->GetRow($e,$e);
55             $periode_name[]=getPeriodeName($cn,$e);
56           }
57    
58       }
59    
60  $Libelle=sprintf("(%s) %s ",$Form->id,$Form->GetName());  $Libelle=sprintf("(%s) %s ",$Form->id,$Form->GetName());
61            
62      $pdf->ezText($Libelle,30);      $pdf->ezText($Libelle,30);
63  $q=getPeriodeName($cn,$from_periode);  // without step
64  if ( $from_periode != $to_periode){  if ( $_POST['p_step'] == 0 )
65    $periode=sprintf("Période %s à %s",$q,getPeriodeName($cn,$to_periode));    {
66   } else {      $q=getPeriodeName($cn,$from_periode);
67    $periode=sprintf("Période %s",$q);      if ( $from_periode != $to_periode){
68   }        $periode=sprintf("Période %s à %s",$q,getPeriodeName($cn,$to_periode));
69  $pdf->ezText($periode,25);      } else {
70          $periode=sprintf("Période %s",$q);
71        }
72        
73        $pdf->ezText($periode,25);
74      $pdf->ezTable($array,      $pdf->ezTable($array,
75                    array ('desc'=>'Description',                    array ('desc'=>'Description',
76                         'montant' => 'Montant'                           'montant' => 'Montant'
77                         ),$Libelle,                         ),$Libelle,
78                  array('shaded'=>0,'showHeadings'=>1,'width'=>500,                    array('shaded'=>0,'showHeadings'=>1,'width'=>500,
79                        'cols'=>array('montant'=> array('justification'=>'right'),                          'cols'=>array('montant'=> array('justification'=>'right'),
80                                      )));                                        )));
81    //New page      //New page
82    //$pdf->ezNewPage();      //$pdf->ezNewPage();
83  //}          //}    
84      }
85     else
86       { // With Step
87         $a=0;
88         foreach ($array as $e)
89           {
90             $pdf->ezText($periode_name[$a],25);
91             $a++;
92             $pdf->ezTable($e,
93                           array ('desc'=>'Description',
94                                  'montant' => 'Montant'
95                                  ),$Libelle,
96                           array('shaded'=>0,'showHeadings'=>1,'width'=>500,
97                                 'cols'=>array('montant'=> array('justification'=>'right'),
98                                               )));
99           }
100       }
101  $pdf->ezStream();  $pdf->ezStream();
102    
103  ?>  ?>

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

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