Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Class.DownLoad.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Generated Header (not documented yet)
8  *
9  * @author Anakeen
10  * @version $Id: Class.DownLoad.php,v 1.2 2003/08/18 15:46:42 eric Exp $
11  * @package FDL
12  * @subpackage CORE
13  */
14 /**
15  */
16 // ---------------------------------------------------------------------------
17 // PHP PROMAN Task Class
18 // ---------------------------------------------------------------------------
19 // anakeen 2000 - Marianne Le Briquer
20 // ---------------------------------------------------------------------------
21 // This program is free software; you can redistribute it and/or modify
22 // it under the terms of the GNU General Public License as published by
23 // the Free Software Foundation; either version 2 of the License, or (at
24 // your option) any later version.
25 //
26 // This program is distributed in the hope that it will be useful, but
27 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
28 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
29 // for more details.
30 //
31 // You should have received a copy of the GNU General Public License along
32 // with this program; if not, write to the Free Software Foundation, Inc.,
33 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 // ---------------------------------------------------------------------------
35 // $Id:
36 // $Log:
37 // ---------------------------------------------------------------------------
38 // DownLoad
39 // Generer
40 // ---------------------------------------------------------------------------
41 //
43 
44 class DownLoad
45 {
46  var $dbid = - 1;
47 
49  var $FileType;
50 
51  var $array; // THE Array (2 dimensionnal)
52  var $fields; // array of the field names to show
53  var $NomModele = "";
54  var $Application = "";
55 
56  var $white = 0;
57  var $black = 0;
58  var $im = 0;
59  var $liste_extract = array();
60  // ---------------------------------------------------------------------------
61  // NOM : DownLoad
62  //
63  // DESCRIPTION : Constructeur, connexion à la base.
64  //
65  // PARAMETRES : entree: aucun.
66  //
67  // ---------------------------------------------------------------------------
68  function DownLoad()
69  {
70  $this->liste_extract["all"]["content"] = "application/vnd.ms-excel";
71  $this->liste_extract["all"]["extension"] = "";
72  $this->liste_extract["cvs"]["content"] = "application/vnd.ms-excel";
73  $this->liste_extract["cvs"]["extension"] = "cvs";
74  $this->liste_extract["rtf"]["content"] = "application/rtf";
75  $this->liste_extract["rtf"]["extension"] = "rtf";
76 
77  return TRUE;
78  }
79  // ---------------------------------------------------------------------------
80  function Generer($src, $p_type_file = "cvs", $p_filename = "extract", $add_ext = "OUI")
81  {
82  $this->FileType = $p_type_file;
83  $this->ConstruireFichier($src, $p_filename, $add_ext);
84  exit;
85  return (TRUE);
86  }
87  function ConstruireFichier($src, $p_filename, $add_ext)
88  {
89  $this->InitFile($p_filename, $add_ext);
90  $this->ShowContent($src);
91  $this->EndFile();
92 
93  return;
94  }
95  function InitFile($p_filename, $add_ext)
96  {
97  $name = $p_filename;
98  ###$this->ContentType=$this->liste_extract["{$this->FileType}"]["content"];
99  if ($add_ext == "OUI") {
100  $ext = $this->liste_extract["{$this->FileType}"]["extension"];
101  $name . "." . $ext;
102  }
103 
104  header("Content-Disposition: form-data;filename=$name");
105  header("CONTENT-TYPE: " . $this->FileType);
106  switch ($this->FileType) {
107  case "html":
108  $this->InitHtml();
109  break;
110  }
111  }
112  function InitHtml()
113  {
114  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n" . " <HTML>\n" . "<HEAD>" . "<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"../Style1/Css/style.css\">" . "<TITLE>Extraction</TITLE></HEAD>";
115  echo '<BODY BGCOLOR="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FF0000">';
116  }
117  function ShowContent($src)
118  {
119  echo $src;
120  }
121 
122  function EndFile()
123  {
124  switch ($this->FileType) {
125  case "html":
126  $this->EndHtml();
127  break;
128  }
129  }
130 
131  function EndHtml()
132  {
133  echo "</BODY>\n";
134  echo "</HTML>\n";
135  }
136 }
137 ?>
InitFile($p_filename, $add_ext)
$CLASS_DOWNLOAD_PHP
ConstruireFichier($src, $p_filename, $add_ext)
Generer($src, $p_type_file="cvs", $p_filename="extract", $add_ext="OUI")
switch($command) exit
Definition: checkVault.php:46
ShowContent($src)
← centre documentaire © anakeen