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

Diff of /phpcompta/html/form_csv.php

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

revision 1.3 by sparkyx, Thu Jul 21 09:41:39 2005 UTC revision 1.4 by sparkyx, Wed Jul 27 12:23:00 2005 UTC
# Line 36  $User->Check(); Line 36  $User->Check();
36    
37  $Form=new rapport($cn,$_POST['form_id']);  $Form=new rapport($cn,$_POST['form_id']);
38  $Form->GetName();  $Form->GetName();
39  $array=$Form->GetRow( $_POST['from_periode'],  // Step ?
40                                                  $_POST['to_periode']  //--
41                                                  );  if ( $_POST['p_step'] == 0 )
42  if ( count($Form->row ) == 0 )    {
43    exit;      $array=$Form->GetRow( $_POST['from_periode'],
44                              $_POST['to_periode']
45  echo       "\"Description\"\t,".                            );
46             "\"Montant\"\t";      if ( count($Form->row ) == 0 )
47          exit;
48        
49        echo       "\"Description\"\t,".
50          "\"Montant\"\t";
51    
52    
53    
54    foreach ( $Form->row as $op ) {      foreach ( $Form->row as $op ) {
55        echo '"'.$op['desc'].'"'."\t,".        echo '"'.$op['desc'].'"'."\t,".
56          sprintf("%8.2f",$op['montant'])."\t".          sprintf("%8.2f",$op['montant'])."\t".
57          "\n";          "\n";
58              
59    }      }
60      }
61     else
62       {
63         // Gather all the data
64         //---
65         for ($e=$_POST['from_periode'];$e<=$_POST['to_periode'];$e+=$_POST['p_step'])
66           {
67             $array[]=$Form->GetRow($e,$e);
68             $periode_name[]=getPeriodeName($cn,$e);
69           }
70         // Display column heading
71         //--
72         $x="";
73         foreach ($array[0] as $e)
74           {
75             printf("%s%s",$x,$e['desc']);
76             $x=";";
77    
78           }
79         printf("\n");
80         // Display value for each line
81         //--
82         $a=0;
83         foreach ($array as $e )
84           {
85             print $periode_name[$a];
86             $a++;
87             foreach ($e as $elt)
88               {
89                 printf(";%s",$elt['montant']);
90               }
91             printf("\n");
92           }
93       }
94    exit;    exit;
95  ?>  ?>

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

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