noalyss Version-9
export_fiche_csv.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19// Copyright Author Dany De Bontridder danydb@aevalys.eu
20/*! \file
21 * \brief Send a CSV file with card
22 */
23if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
24include_once NOALYSS_INCLUDE."/lib/ac_common.php";
25include_once NOALYSS_INCLUDE.'/class/fiche.class.php';
26
28
31
32
33$export=new Noalyss_Csv(_('fiche'));
34$export->send_header();
35
36
37
38if ( isset ($_GET['fd_id']))
39{
40 $fiche_def=new Fiche_Def($cn,$http->get('fd_id',"number"));
41 $fiche=new Fiche($cn);
42 $e=$fiche_def->get_by_type();
43 $o=0;
44 // Heading
45 $fiche_def->GetAttribut();
46 $title=array();
47 foreach ($fiche_def->attribut as $attribut)
48 {
49 $title[]=$attribut->ad_text;
50 }
51 $export->write_header($title);
52
53 // Details
54
55 foreach ($e as $fiche)
56 {
57 $detail=new Fiche($cn,$fiche['f_id']);
58
59 $detail->getAttribut();
60
61 foreach ( $detail->attribut as $dattribut )
62 {
63 if ( $dattribut->ad_type=="numeric")
64 $export->add($dattribut->av_text,"number");
65 else
66 $export->add($dattribut->av_text);
67
68 }
69 $export->write();
70 }
71
72
73}
75?>
$input_from id
Definition: balance.inc.php:63
$_GET['qcode']
if($action=='add_line') if( $action=='remove_line') if($action=='remove_cat') if(isset($_POST['change_name'])) if($action=='save_line') if(isset($_POST['add_modele'])) $fiche_def
static connect()
define Class fiche and fiche def, those class are using class attribut
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Definition: fiche.class.php:38
manage the http input (get , post, request) and extract from an array
Manage the CSV : manage files and write CSV record.
if(isset($_GET['fd_id'])) exit