-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.php
More file actions
289 lines (252 loc) · 9.21 KB
/
list.php
File metadata and controls
289 lines (252 loc) · 9.21 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?php
/*
* This file is part of wForm
*
* Copyright (C) 2016 Zanini Massimo
*
* wForm is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* wForm 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with wForm. If not, see <http://www.gnu.org/licenses/>.
*
*/
//LIBRERIE
//carica db
require_once("lib/lib_word.php");
$dir = "doc/";
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
if ( $filename != "."
&& $filename != ".."
&& pathinfo($dir.$filename , PATHINFO_EXTENSION) == 'docx'
&& substr($filename, 0,1) != "~"
)
{
$doc_name = pathinfo($dir.$filename , PATHINFO_FILENAME);
$doc_info = docx_load_info($doc_name);
$doc_title = array_key_exists("dc:title",$doc_info) ? $doc_info['dc:title'] : $filename ;
$doc_keywords = array_key_exists("cp:keywords",$doc_info) ? $doc_info['cp:keywords'] : "" ;
$doc_description = array_key_exists("dc:description",$doc_info) ? $doc_info['dc:description'] : "" ;
$doc_created = date("d/m/Y H:i:s",strtotime($doc_info['dcterms:created']));
$doc_modified = date("d/m/Y H:i:s",strtotime($doc_info['dcterms:modified']));
$doc_creator = date("d/m/Y H:i:s",strtotime($doc_info['dc:creator']));
$doc_lastModifiedBy = date("d/m/Y H:i:s",strtotime($doc_info['cp:lastModifiedBy']));
$docs[] = Array( "doc_name" => $doc_name,
"doc_title" => $doc_title,
"doc_keywords" => $doc_keywords,
"doc_description" => $doc_description,
"doc_created" => $doc_created,
"doc_modified" => $doc_modified,
"doc_creator" => $doc_creator,
"doc_lastModifiedBy" => $doc_lastModifiedBy,
);
}
}
sort($docs);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>ChiantiBanca Minute</title>
<!-- dev wrapper for IE -->
<script src="/wform/js/dev.js"></script>
<!-- jQuery Version 1.11.3 -->
<script src="/wform/js/jquery.min.js"></script>
<script src="/wform/js/noty/packaged/jquery.noty.packaged.min.js"></script>
<!-- Load Bootstrap 3.3.6 -->
<link rel="stylesheet" href="/wform/css/bootstrap.min.css"
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
crossorigin="anonymous">
<link rel="stylesheet" href="/wform/css/bootstrap-theme.min.css"
integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r"
crossorigin="anonymous">
<!-- Main CSS -->
<link rel="stylesheet" href="/wform/css/style.css"
<!-- Main Js -->
<!-- Additional Js -->
<script src="/wform/js/clipboard/clipboard.min.js"></script>
<script src="/wform/js/jstorage/json2.js"></script>
<script src="/wform/js/jstorage/jstorage.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<script type="text/javascript">
$(document).ready( function() {
//carica Ultimi documenti
h_id = $.jStorage.get("h_id", "no_history")
h_data = $.jStorage.get("h_data", "no_history")
if(h_id=="no_history"){
//Nessun documento
$('#table_history tbody').html( '<tr>'+
' <td width="10%"> </td>'+
' <td><small><em>Nessuna minuta trovata.</em></small></td>'+
' <td></td>'+
' <td></td>'+
'</tr>');
}else{
//Carica ultimi documenti
var index;
for (index = 0; index < h_id.length; ++index) {
/*console.log(h_id[index] + ' ' + h_data[index].length +
' ' + h_data[index][0]+
' ' + h_data[index][1]+
' ' + h_data[index][2]+
' ' + h_data[index][3]+
' ' + h_data[index][4]
);*/
$('#table_history tbody').append( '<tr data-href="'+h_id[index]+'">'+
' <td width="1%"></td>'+
' <td width="10%" ><small><em>/'+h_id[index]+'</em></small></td>'+
' <td width="54%">'+h_data[index][1]+'</td>'+
' <td width="10%"><small>'+h_data[index][0]+'</small></td>'+
' <td width="20%"><small><em>'+h_data[index][2]+'</em></small></td>'+
' <td width="5%">'+(h_data[index][3]? "<a href='lib/req_word.php?action=gen&format=docx&id="+h_id[index]+"'><span class='glyphicon glyphicon-download-alt' aria-hidden='true'></span></a>" : "" )+'</td>'+
'</tr>');
}
}
//Tabelle con pointer
$(function(){
$('.table tr[data-href]').each(function(){
$(this).css('cursor','pointer').hover(
function(){
$(this).addClass('active');
},
function(){
$(this).removeClass('active');
}).mousedown( function(e){
switch(e.which)
{
case 1:
//left Click
document.location = $(this).attr('data-href');
return true;
break;
case 2:
//middle Click
//$( "#table_history tbody" ).append( "<a id='tmp_a' href='"+$(this).attr('data-href')+"' target='_blank' style='display:none;'> test </a>" );
//document.getElementById("tmp_a").click();
window.open( $(this).attr('data-href'),
'_blank');
return true;
break;
case 3:
//right Click
return false;
break;
}
}
);
});
});
});
</script>
<body>
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="list.php">Creazione Minuta per Notaio</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav pull-right">
<!--
<li>
<a href="">Link 1</a>
</li>
<li>
<a href="">Link 2</a>
</li>
-->
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container-fluid" style="margin:0px 10%">
<div class="row">
<div class="col-md-12" style="margin:40px 0px 0px 0px ;">
<h5 style="display:inline;"> <span class="glyphicon glyphicon-file" aria-hidden="true"></span> Crea nuova Minuta </h5>
<span style="display:inline;font-size: 0.8em;"> </span>
<hr style="margin:5px 0px 0px 0px;" />
</div>
</div>
<div class="row">
<div class="col-md-12">
<table id="table_doc" class="table table-hover">
<!-- <thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead> -->
<tbody>
<?php
foreach($docs as $doc){
?>
<tr data-href="<?php echo $doc['doc_name']; ?>">
<td width="1%"> </td>
<td><b><?php echo strtoupper($doc['doc_name']); ?></b></td>
<td><?php echo $doc['doc_title']; ?>
<br><small><em><?php echo $doc['doc_description']; ?></em></small>
</td>
<td><em><?php echo $doc['doc_keywords']; ?></em></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12" style="margin:40px 0px 0px 0px ;">
<h5 style="display:inline;"> <span class="glyphicon glyphicon-pushpin" aria-hidden="true"></span> Le tue ultime minute </h5>
<span style="display:inline;font-size: 0.8em;"> </span>
<hr style="margin:5px 0px 0px 0px;" />
</div>
</div>
<div class="row">
<div class="col-md-12">
<table id="table_history" class="table">
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<!-- /.container -->
<!-- Bootstrap Core JavaScript -->
<script src="/wform/js/bootstrap.min.js"
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
crossorigin="anonymous"></script>
</body>
</html>