-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexplnum_doc.php
More file actions
executable file
·62 lines (53 loc) · 2.08 KB
/
explnum_doc.php
File metadata and controls
executable file
·62 lines (53 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// | creator : Yves PRATTER |
// +-------------------------------------------------+
// $Id: explnum_doc.php,v 1.7 2015-04-03 11:16:23 jpermanne Exp $
// définition du minimum nécéssaire
$base_path = ".";
$base_auth = ""; //"CIRCULATION_AUTH";
$base_title = "";
$base_noheader = 1;
$base_nocheck = 1;
$base_nobody = 1;
$base_nosession = 1;
require_once ("$base_path/includes/init.inc.php");
require_once ("$include_path/explnum.inc.php");
$req_docnum = "SELECT explnum_doc_nomfichier, explnum_doc_mimetype, explnum_doc_data, explnum_doc_extfichier,explnum_doc_url as url
FROM explnum_doc WHERE id_explnum_doc = '$explnumdoc_id' ";
$resultat = pmb_mysql_query($req_docnum, $dbh);
$nb_res = pmb_mysql_num_rows($resultat) ;
if (!$nb_res) {
header("Location: images/mimetype/unknown.gif");
exit ;
}
$ligne = pmb_mysql_fetch_object($resultat);
if ($ligne->explnum_doc_data) {
create_tableau_mimetype() ;
$name=$_mimetypes_bymimetype_[$ligne->explnum_mimetype]["plugin"] ;
if ($name) {
$type = "" ;
// width='700' height='525'
$name = " name='$name' ";
} else $type="type='$ligne->explnum_mimetype'" ;
if ($_mimetypes_bymimetype_[$ligne->explnum_mimetype]["embeded"]=="yes") {
print "<html><body><EMBED src=\"./explnum_doc_data.php?explnumdoc_id=$explnumdoc_id\" $type $name controls='console' ></EMBED></body></html>" ;
exit ;
}
$nomfichier="";
if ($ligne->explnum_doc_nomfichier) {
$nomfichier=$ligne->explnum_doc_nomfichier;
}
elseif ($ligne->explnum_doc_extfichier)
$nomfichier="pmb".$ligne->explnum_id.".".$ligne->explnum_doc_extfichier;
if ($nomfichier) header("Content-Disposition: inline; filename=".$nomfichier);
header("Content-Type: ".$ligne->explnum_doc_mimetype);
print $ligne->explnum_doc_data;
exit ;
}
if ($ligne->explnum_doc_mimetype=="URL") {
if ($ligne->url) header("Location: $ligne->url");
exit ;
}
?>