-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport.php
152 lines (141 loc) · 6.69 KB
/
export.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
<?php
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';
sec_session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Matelaslux : Bonjour <?php echo htmlentities($_SESSION['username']); ?></title>
<!-- Icon de main:apple windows android -->
<link rel="icon" href="imgs\icon.png">
<link rel="shortcut" href="imgs\icon.png">
<link rel="apple-touche-icon" href="imgs\icon.png">
<!-- SEO TAG FACEBOOK -->
<meta property="og:title" content="Gestion Matelaslux">
<meta property="og:description" content="<?php echo $Adresse; ?>">
<meta property="og:image" content="imgs\icon.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="720">
<meta property="og:type" content="website">
<meta property="og:url" content="https://crm.elbossinmobiliaria.com">
<meta property="fb:app_id" content="xxxxxxxxxxxxxxxxxxxx">
<!-- BOOTSTRAP -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<?php if (login_check($mysqli) == true) : ?>
<!-- ---------------------------------STAR PROGRAM--------------------------------- -->
<?php require_once'includes/psl-config.php'; ?>
<?php
// Export Only custum XLS
if(isset($_GET['bordereau']) and isset($_GET['user'])){
$ExportExel = $database->prepare("SELECT * FROM commandes WHERE id = :id");
$ExportExel->bindParam("id",$_GET['bordereau']);
if ($ExportExel->execute()) {
echo '
<table class="table table-striped" bordered="1">
<tr>
<th>Reference</th>
<th>Utilisateur</th>
<th>Rolde de page</th>
<th>Nom</th>
<th>Tel</th>
<th>Email</th>
<th>Date de commande</th>
<th>Adresse</th>
<th>Bat</th>
<th>Porte</th>
<th>Ville</th>
<th>Wilaya</th>
<th>C postal</th>
<th>Produit</th>
<th>Dimentions</th>
<th>Hauteur</th>
<th>Desite</th>
<th>Suivi</th>
<th>statue</th>
<th>Cout de laivraison</th>
<th>Vupon</th>
<th>prix</th>
<th>Note</th>
<th>Date Of Delivery</th>
</tr>';
foreach($ExportExel AS $row){
echo'<tr>
<td>'.$row["id"].'</td>
<td>'.$row["user"].'</td>
<td>'.openssl_decrypt($row["rol"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["nom"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["indi"],$crypting,$key,0,$iv).openssl_decrypt($row["tel"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["email"],$crypting,$key,0,$iv).'</td>
<td>'.$row["fecha"].'</td>
<td>'.openssl_decrypt($row["dir"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["bat"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["port"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["ville"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["wilaya"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["postal"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["tipo"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["dim"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["hut"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["den"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["track"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["statue"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["liv"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["cupon"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["prix"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["text"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["dateofdelivery"],$crypting,$key,0,$iv).']</td>
</tr>';
}
echo '</table>';
$fecha = date('y-m-d h-m-s');
header('Content-Type: application/xls');
header('Content-Disposition: attachment; filename=Bordoreaux_'.$fecha.'.xls');
}
}
?>
<?php
// Export All Lista XLS EXCEL
if(isset($_POST["export"])){
$ExportExel = $database->prepare("SELECT * FROM commandes");
if($ExportExel->execute())
{
echo '
<table class="table table-striped" bordered="1">
<tr>
<th>Name</th>
<th>Address</th>
<th>City</th>
<th>Postal Code</th>
<th>Postal Code</th>
</tr>
';
foreach($ExportExel AS $row){
echo '
<tr>
<td>'.openssl_decrypt($row["dir"],$crypting,$key,0,$iv).''.openssl_decrypt($row["bat"],$crypting,$key,0,$iv).''.openssl_decrypt($row["port"],$crypting,$key,0,$iv).''.openssl_decrypt($row["ville"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["wilaya"],$crypting,$key,0,$iv).''.openssl_decrypt($row["postal"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["tipo"],$crypting,$key,0,$iv).''.openssl_decrypt($row["dim"],$crypting,$key,0,$iv).''.openssl_decrypt($row["hut"],$crypting,$key,0,$iv).''.openssl_decrypt($row["den"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["track"],$crypting,$key,0,$iv).'</td>
<td>'.openssl_decrypt($row["prix"],$crypting,$key,0,$iv).'</td>
</tr>
';
}
echo '</table>';
$fecha = date('y-m-d h-m-s');
header('Content-Type: application/xls');
header('Content-Disposition: attachment; filename=Bordoreaux_'.$fecha.'.xls');
}
}
?>
<!-- ---------------------------------END PROGRAM--------------------------------- -->
<?php else : ?>
<p>
<span class="error">You are not authorized to access this page.</span> Please <a href="index.php">login</a>.
</p>
<?php endif; ?>
</body>
</html>