Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00029 require_once 'class_stock.php';
00030
00031 $stock=new Stock();
00032 $sql = $stock->create_query_histo($_GET);
00033 $sql .= " order by real_date asc";
00034
00035 $res=$cn->exec_sql($sql);
00036 $max_row=Database::num_row($res);
00037 header('Pragma: public');
00038 header('Content-type: application/csv');
00039 header('Content-Disposition: attachment;filename="histo-stock.csv"',FALSE);
00040 printf('"Date";');
00041 printf('"%s";','Code Stock');
00042 printf('"%s";','Depot');
00043 printf('"%s";','Fiche');
00044 printf('"%s";','Commentaire');
00045 printf('%s;','Quantité');
00046 printf('"%s";','IN/OUT');
00047 printf("\n\r");
00048 for ($i=0;$i<$max_row;$i++)
00049 {
00050 $row=Database::fetch_array($res,$i);
00051 printf('"%s";',$row['cdate']);
00052 printf('"%s";',$row['sg_code']);
00053 printf('"%s";',$row['r_name']);
00054 printf('"%s";',$row['qcode']);
00055 $row['ccomment']=str_replace('"','',$row['ccomment']);
00056 printf('"%s";',$row['ccomment']);
00057 printf('%s;',nbm($row['sg_quantity']));
00058 printf('"%s";',$row['direction']);
00059 printf("\n\r");
00060
00061 }
00062
00063 ?>