0000648: Impression : déplacer les fichiers à importer dans la DB

This commit is contained in:
Dany De Bontridder 2012-06-20 22:42:33 +00:00
parent 8f84e0b3c4
commit 4fefaa03a2
3 changed files with 39 additions and 195 deletions

View file

@ -42,135 +42,8 @@ if ( $action=='X' || ! isset($_GET['act']) || $g_user->check_print($_GET['act'])
redirect("do.php?".dossier::get());
exit();
}
// get file and execute it
switch( $_GET['act'])
{
case 'CSV:histo':
require_once('export_histo_csv.php');
exit();
break;
case 'CSV:ledger':
require_once('export_ledger_csv.php');
exit();
break;
case 'PDF:ledger':
require_once('export_ledger_pdf.php');
exit();
break;
case 'CSV:postedetail':
require_once('export_poste_detail_csv.php');
exit();
break;
case 'PDF:postedetail':
require_once('export_poste_detail_pdf.php');
exit();
break;
case 'CSV:fichedetail':
require_once('export_fiche_detail_csv.php');
exit();
break;
case 'PDF:fichedetail':
require_once('export_fiche_detail_pdf.php');
exit();
break;
case 'CSV:fiche_balance':
require_once('export_fiche_balance_csv.php');
exit();
break;
case 'PDF:fiche_balance':
require_once('export_fiche_balance_pdf.php');
exit();
break;
case 'CSV:report':
require_once('export_form_csv.php');
exit();
break;
case 'PDF:report':
require_once('export_form_pdf.php');
exit();
break;
case 'CSV:fiche':
require_once('export_fiche_csv.php');
exit();
break;
case 'PDF:fiche':
require_once('export_fiche_pdf.php');
exit();
break;
case 'CSV:glcompte':
require_once('export_gl_csv.php');
exit();
break;
case 'PDF:glcompte':
require_once('export_gl_pdf.php');
exit();
break;
case 'PDF:sec':
require_once('export_security_pdf.php');
exit();
break;
case 'CSV:AncList':
require_once('export_anc_list_csv.php');
exit();
break;
case 'CSV:AncBalSimple':
require_once('export_anc_balance_simple_csv.php');
exit();
break;
case 'PDF:AncBalSimple':
require_once('export_anc_balance_simple_pdf.php');
exit();
break;
case 'CSV:AncBalDouble':
require_once('export_anc_balance_double_csv.php');
exit();
break;
case 'PDF:AncBalDouble':
require_once('export_anc_balance_double_pdf.php');
exit();
break;
case 'CSV:balance':
require_once('export_balance_csv.php');
exit();
break;
case 'PDF:balance':
require_once('export_balance_pdf.php');
exit();
break;
case 'CSV:AncTable':
require_once('export_anc_table_csv.php');
exit();
break;
case 'CSV:AncAccList':
require_once('export_anc_acc_list_csv.php');
exit();
break;
case 'CSV:AncBalGroup':
require_once('export_anc_balance_group_csv.php');
exit();
break;
case 'OTH:Bilan':
require_once 'export_bilan_oth.php';
exit();
break;
case 'CSV:AncGrandLivre':
require_once 'export_anc_grandlivre_csv.php';
break;
case 'CSV:reportinit':
require_once('export_reportinit_csv.php');
break;
case 'CSV:ActionGestion':
require_once 'export_follow_up_csv.php';
break;
case 'CSV:StockHisto': // Export Historique mouvement stock
require_once 'export_stock_histo.csv';
break;
case 'CSV:StockResmList' : // 'Export Résumé list stock
require_once 'export_stock_resume_list.php';
break;
default:
alert('Action inconnue '.$_GET['act']);
exit();
}
$prfile=$cn->get_value("select me_file from menu_ref where me_code=$1",array($_GET['act']));
require_once $prfile;
?>

View file

@ -1,63 +0,0 @@
<?php
/*
* This file is part of PhpCompta.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* PhpCompta is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/**
* @file
* @brief export in CSV the export of history
*
*/
require_once 'class_stock.php';
$stock=new Stock();
$sql = $stock->create_query_histo($_GET);
$sql .= " order by real_date asc";
$res=$cn->exec_sql($sql);
$max_row=Database::num_row($res);
header('Pragma: public');
header('Content-type: application/csv');
header('Content-Disposition: attachment;filename="histo-stock.csv"',FALSE);
printf('"Date";');
printf('"%s";','Code Stock');
printf('"%s";','Depot');
printf('"%s";','Fiche');
printf('"%s";','Commentaire');
printf('%s;','Quantité');
printf('"%s";','IN/OUT');
printf("\n\r");
for ($i=0;$i<$max_row;$i++)
{
$row=Database::fetch_array($res,$i);
printf('"%s";',$row['cdate']);
printf('"%s";',$row['sg_code']);
printf('"%s";',$row['r_name']);
printf('"%s";',$row['qcode']);
$row['ccomment']=str_replace('"','',$row['ccomment']);
printf('"%s";',$row['ccomment']);
printf('%s;',nbm($row['sg_quantity']));
printf('"%s";',$row['direction']);
printf("\n\r");
}
?>
Can't render this file because it has a wrong number of fields in line 6.

View file

@ -388,4 +388,38 @@ CREATE TABLE stock_change
ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE;
update action_gestion set ag_id=-1 ;
update action_gestion set ag_id=-1 ;
update menu_ref set me_code='CSV:reportinit' where me_code='CVS:reportinit';
update menu_ref set me_file='export_histo_csv.php' where me_code='CSV:histo';
update menu_ref set me_file='export_ledger_csv.php' where me_code='CSV:ledger';
update menu_ref set me_file='export_ledger_pdf.php' where me_code='PDF:ledger';
update menu_ref set me_file='export_poste_detail_csv.php' where me_code='CSV:postedetail';
update menu_ref set me_file='export_poste_detail_pdf.php' where me_code='PDF:postedetail';
update menu_ref set me_file='export_fiche_detail_csv.php' where me_code='CSV:fichedetail';
update menu_ref set me_file='export_fiche_detail_pdf.php' where me_code='PDF:fichedetail';
update menu_ref set me_file='export_fiche_balance_csv.php' where me_code='CSV:fiche_balance';
update menu_ref set me_file='export_fiche_balance_pdf.php' where me_code='PDF:fiche_balance';
update menu_ref set me_file='export_form_csv.php' where me_code='CSV:report';
update menu_ref set me_file='export_form_pdf.php' where me_code='PDF:report';
update menu_ref set me_file='export_fiche_csv.php' where me_code='CSV:fiche';
update menu_ref set me_file='export_fiche_pdf.php' where me_code='PDF:fiche';
update menu_ref set me_file='export_gl_csv.php' where me_code='CSV:glcompte';
update menu_ref set me_file='export_gl_pdf.php' where me_code='PDF:glcompte';
update menu_ref set me_file='export_security_pdf.php' where me_code='PDF:sec';
update menu_ref set me_file='export_anc_list_csv.php' where me_code='CSV:AncList';
update menu_ref set me_file='export_anc_balance_simple_csv.php' where me_code='CSV:AncBalSimple';
update menu_ref set me_file='export_anc_balance_simple_pdf.php' where me_code='PDF:AncBalSimple';
update menu_ref set me_file='export_anc_balance_double_csv.php' where me_code='CSV:AncBalDouble';
update menu_ref set me_file='export_anc_balance_double_pdf.php' where me_code='PDF:AncBalDouble';
update menu_ref set me_file='export_balance_csv.php' where me_code='CSV:balance';
update menu_ref set me_file='export_balance_pdf.php' where me_code='PDF:balance';
update menu_ref set me_file='export_anc_table_csv.php' where me_code='CSV:AncTable';
update menu_ref set me_file='export_anc_acc_list_csv.php' where me_code='CSV:AncAccList';
update menu_ref set me_file='export_anc_balance_group_csv.php' where me_code='CSV:AncBalGroup';
update menu_ref set me_file='export_bilan_oth.php' where me_code='OTH:Bilan';
update menu_ref set me_file='export_anc_grandlivre_csv.php' where me_code='CSV:AncGrandLivre';
update menu_ref set me_file='export_reportinit_csv.php' where me_code='CSV:reportinit';
update menu_ref set me_file='export_follow_up_csv.php' where me_code='CSV:ActionGestion';
update menu_ref set me_file='export_stock_histo_csv.php' where me_code='CSV:StockHisto';
update menu_ref set me_file='export_stock_resume_list.php' where me_code='CSV:StockResmList';