-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsultationAnnée.php
327 lines (295 loc) · 14.4 KB
/
consultationAnnée.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
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<?php require "MasterPage/header.php"; ?>
<link rel="stylesheet" href="ContextMenu/css/bootstrap.css">
<script src="ContextMenu/dist/BootstrapMenu.min.js"></script>
<style>
#demo1Box:active {
background-color: #e8f0fe;
}
#demo1Box:focus {
background-color: #e8f0fe;
}
</style>
<?php
session_name('SESSION');
session_start();
$id = $_GET['id'];
$Nom = $_GET['NOM'];
$mystring =$Nom;
$find = "'";
$pos = strpos($mystring, $find);
if ($pos != false) {
$Nom =str_replace("'","''",$mystring);
}
$_SESSION["SocieteName"] = $_GET['NOM'];
$_SESSION["id"] = $_GET['id'];
// ---------------------------------------------
$db = parse_ini_file("assets/ini/Config.ini");
$connectionInfo = array("Database" => $db['name'], "UID" => $db['user'], "PWD" => $db['pass']);
$con = sqlsrv_connect($db['host'], $connectionInfo);
$cmd ="SELECT * FROM Societe where IdSociete= ".$id."";
$query = sqlsrv_query( $con, $cmd );
if( sqlsrv_num_fields( $query ) )
{
while( $obj = sqlsrv_fetch_object($query))
{
$RaisonSocialeSociete= $obj->RaisonSocialeSociete;
$IFSociete= $obj->IFSociete;
$ICESociete= $obj->ICESociete;
$ITVASociete= $obj->ITVASociete;
}
}
?>
<div class="row" style="margin-bottom: 23px;">
<div class="col-12">
<div style ="background: rgba(82, 95, 127, 0.05);border-radius: .375rem;border-top-left-radius: 0.375rem;border-bottom-left-radius: 0.375rem; margin-bottom: 12px;margin-top: -35px">
<p style="text-align: center;padding-top: 10px;padding-bottom: 10px;font-weight: bold;"><i class="fas fa-map-signs"></i> Les informations suivantes seront organisées comme suit<br> Année <i class="fas fa-arrow-right"></i> Produit <i class="fas fa-arrow-right"></i> Documents(PDF)</p>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="card shadow">
<div class="card-header border-0">
<div class="row">
<div class="col-md-10">
<h3 class="mb-0">
<ol class="breadcrumb" style="background-color:white">
<a href="company.php"><i class="fas fa-arrow-left"></i></a>
<i class="far fa-calendar-alt" style="margin-top: 4px;"></i>
<li class="breadcrumb-item active" aria-current="page"><?= $_GET['NOM']; ?></li>
</ol>
</h3>
</div>
<div class="col-md-2">
<?php if( $_SESSION['CompteUSER']=='A'){ ?>
<button type="button" class="btn btn-sm btn-info" data-toggle="modal" data-target="#myModal">Ajouter</button>
<?php } ?>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog" style="margin-top: 7%;">
<form method="post" action="Function/AddFolderInSociete.php" id="my_form">
<!-- Modal content-->
<div class="modal-content" style="margin-left: 17%;">
<div class="modal-header" style="padding-bottom: 0px;">
<button type="button" class="btn btn-sm" data-dismiss="modal" style="margin-left: 418px;"><i class="fas fa-times"></i></button>
</div>
<div class="modal-body" style="padding-bottom: 0px;">
<div class="col-lg-12">
<div class="form-group">
<label class="form-control-label" for="Année">Ajouter une nouvelle année</label>
<input type="number" id="Année" name="Année" class="form-control" placeholder="Année" required>
</div>
<div class="text-right">
<div class="form-group">
<a href="javascript:{}" onclick="document.getElementById('my_form').submit(); return false;" class="btn btn-sm btn-info">Ajouter</a>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div><!-- Modal-->
</div><!--row-->
</div><!--header-->
<div class="card-body " style="padding-bottom: 0.5rem;">
<div class="row">
<div class="col-lg-4">
<div>
<div class="form-group">
<label class="form-control-label" for="input-first-name">Raison Sociale</label>
<input type="text" class="form-control" readonly value="<?=$RaisonSocialeSociete ?>">
</div>
<div class="form-group">
<label class="form-control-label" for="input-first-name">Identifiant Fiscale (IF)</label>
<input type="text" class="form-control" readonly value="<?=$IFSociete ?>">
</div>
<div class="form-group">
<label class="form-control-label" for="input-first-name">(ICE)</label>
<input type="text" class="form-control" readonly value="<?=$ICESociete ?>">
</div>
<div class="form-group">
<label class="form-control-label" for="input-first-name">Identifiant TVA (ITVA)</label>
<input type="text" class="form-control" readonly value="<?=$ITVASociete ?>">
</div>
</div>
</div>
<div class="col-lg-8">
<div>
<?php
$file_pointer = ".\\CodeGed\\".$_GET['NOM']."";
if (file_exists($file_pointer)) {
$directory = $file_pointer;
$results_array = array();
if (is_dir($directory))
{
if ($handle = opendir($directory))
{
//Notice the parentheses I added:
while(($file = readdir($handle)) !== FALSE)
{
$results_array[] = $file;
}
closedir($handle);
}
}
echo ' <div class="row">';
for ($i=0; $i < count($results_array); $i++) {
if ($results_array[$i] == "." || $results_array[$i] == "..") {
continue;
}
$folder=$file_pointer.'\\'.$results_array[$i];
$QuHide = "SELECT * FROM Hide WHERE IdUSER=".$_SESSION['IdUser']." AND folder='".$folder."'";
$RsHide = sqlsrv_query($con, $QuHide);
if(sqlsrv_has_rows($RsHide) != 0)
{
continue;
}
?>
<?php
$string=$results_array[$i];
?>
<a href="ConsultationProduit.php?Year=<?= $results_array[$i]?>">
<div class="col-auto mb-3" >
<div id="demo1Box<?= $i?>" style="padding: 3px 11px;border-radius: 6px;border: 1px solid #dadce0;width: 210px;transition: box-shadow 200ms cubic-bezier(0.4,0.0,0.2,1);" draggable="true" ondragstart="drag(event)">
<div class="row">
<div class="col-4">
<i class="fas fa-folder fa-3x" style="color: rgba(0, 0, 0, .5)"></i>
</div>
<div class="col-8" style=" display: flex;align-items: center;flex-wrap: wrap;">
<p class="" title="<?= $string?>" style="color: rgba(0,0,0,.72);">
<?php
if (strlen($string) > 14)
{
$string = substr($string,0,14)." ..";
}
echo $string;
?>
</p>
</div>
</div>
</div>
</div>
</a>
<script>
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
//copy
function copyStringToClipboard (str) {
var el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style = {position: 'absolute', left: '-9999px'};
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
}
var menu = new BootstrapMenu('#demo1Box<?= $i?>', {
actions: [{
name: '<a style="color:rgba(0, 0, 0, .5);" href="#"><i class="fas fa-folder-open"></i> Open</a>',
onClick: function() {
window.location.href = "ConsultationProduit.php?Year=<?= $results_array[$i]?>";
}
}, {
name: '<a style="color:rgba(0, 0, 0, .5);" href="#"><i class="fas fa-link"></i> obtenir le lien</a>',
onClick: function() {
copyStringToClipboard("<?="http".(($_SERVER['SERVER_PORT'] == 443) ? "s" : "")."://".$_SERVER['HTTP_HOST']?>/<?=$db['Folder_Container']?>/ConsultationProduit.php?Year=<?= $results_array[$i]?>");
}
}, {
name: '<a style="color:rgba(0, 0, 0, .5);" href="#"><i class="fas fa-eye-slash"></i> Masquer le dossier</a>',
onClick: function() {
$('#myModalHide<?= $i?>').modal('show');
}
}]
});
</script>
<div class="modal fade" id="myModalHide<?= $i?>" role="dialog">
<div class="modal-dialog" >
<?php
$CurrentPage=utf8_encode((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}");
echo' <form method="post" action="function/F_Hide_Show.php">';
?>
<div class="modal-content" >
<div class="modal-header">
<h5 class="modal-title">Cacher le dossier "<?=$string ?>"</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<input type="text" name="CurrentPage" value="<?=$CurrentPage ?>" style="display: none;">
<input type="text" name="folder" value="<?=$folder ?>" style="display: none;">
</div>
<div class="modal-body" style="padding-bottom: 0px;">
<div class="col-lg-12">
<p>choisissez les utilisateurs auxquels vous voulez masquer le dossier</p>
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$queryUSERS ="SELECT * FROM USERS where Request=0";
$resultUSERS = sqlsrv_query( $con, $queryUSERS );
?>
<div class="list-group">
<?php
$b=1;
while( $obj = sqlsrv_fetch_object($resultUSERS))
{
if ($obj->IdUSER==$_SESSION['IdUser']){
continue;
}
$queryHide = "SELECT * FROM Hide WHERE IdUSER=".$obj->IdUSER." AND folder='".$folder."'";
$resultHide = sqlsrv_query($con, $queryHide);
if(sqlsrv_has_rows($resultHide) != 1)
{
echo '
<a href="#" class="list-group-item list-group-item-action" for="tableDefaultCheck'.$b.$i.'">
<div class="custom-control custom-checkbox">
<input type="checkbox" name="check_list[]" value="'.$obj->IdUSER.'" class="custom-control-input" id="tableDefaultCheck'.$b.$i.'">
<label class="custom-control-label" for="tableDefaultCheck'.$b.$i.'">'.utf8_encode($obj->NomUSER) .' '.utf8_encode($obj->PrenomUSER) . '</label>
</div>
</a>
';
}
else
{
echo '
<a href="#" class="list-group-item list-group-item-action" for="tableDefaultCheck'.$b.$i.'">
<div class="custom-control custom-checkbox">
<input type="checkbox" checked name="check_list[]" value="'.$obj->IdUSER.'" class="custom-control-input" id="tableDefaultCheck'.$b.$i.'">
<label class="custom-control-label" for="tableDefaultCheck'.$b.$i.'">'.utf8_encode($obj->NomUSER) .' '.utf8_encode($obj->PrenomUSER) .'</label>
</div>
</a>
';
}$b=$b+1;
}
echo'
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-info">terminé</button>
</div> ';
?>
</div>
</form>
</div>
</div>
<?php }
echo "</div>";
}else {
echo "Pas de données disponibles!";
// echo $file_pointer; path
}
?>
</div>
</div>
</div>
</div>
</div> <!--card shadow-->
</div>
</div>
<?php require "MasterPage/footer.php"; ?>