-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdokument2.php
76 lines (75 loc) · 2.46 KB
/
dokument2.php
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
require_once("inc/stdLib.php");
include("inc/template.inc");
$did=($_GET["did"])?$_GET["did"]:$_POST["did"];
if ($_POST["ok"]) {
$doc = False;
$ext = strtolower(substr($_FILES['file']['name'],-3));
if ( $ext == 'sxw' ) {
$_POST["applikation"] = "O";
include('inc/phpOpenOffice.php');
$doc = new phpOpenOffice();
} else if ( $ext == 'rtf' ) {
$_POST["applikation"] = "R";
include('inc/phpRtf.php');
$doc = new phpRTF();
} else if ( $ext == 'tex' ) {
$_POST["applikation"] = "T";
include('inc/phpTex.php');
$doc = new phpTex();
} else if ( $ext == 'xls' ) {
$_POST["applikation"] = "B";
require('inc/phpBIN.php');
$doc = new phpBIN();
};
if ( $doc ) {
$did=saveDocVorlage($_POST,$_FILES);
if ( $_POST['did'] != $did ) {
$doc->loadDocument("vorlage/".$_FILES['file']['name']);
$vars = $doc->getTags();
if ( $ext == 'rtf') {
$doc->savefile("vorlage/".$_FILES['file']['name']);
};
$data['beschreibung'] = '';
$data['zeichen'] = '.';
$data['laenge'] = 25;
$data['docid'] = $did;
$p = 1;
foreach($vars as $hit) {
$data['feldname'] = $hit;
$data['platzhalter'] = $hit;
$data['position'] = $p;
insDocFld($data);
$p++;
}
}
$msg = '';
} else {
$msg = 'Falsches Dateiformat';
}
} else if ($_POST["del"]) {
$did=delDocVorlage($_POST);
}
$link2="dokument2.php?did=".$_GET["did"];
if ($did) {
$link3="dokument3.php?docid=".$did;
} else {
$link3="";
}
if ($did) {
$docdata=getDOCvorlage($did);
}
$t = new Template($base);
doHeader($t);
$t->set_file(array("doc" => "dokument2.tpl"));
$t->set_var(array(
Link2 => $link2,
Link3 => $link3,
vorlage => $docdata["document"]["vorlage"],
beschreibung => $docdata["document"]["beschreibung"],
file => $docdata["document"]["file"],
did => $did,
msg => $msg,
));
$t->pparse("out",array("doc"));
?>