-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar.php
248 lines (232 loc) · 12.7 KB
/
sidebar.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
<?php
// os icones originais do menu estão no arquivo "icones.html"
$menu = array(
array(
"titulo" => "Painel",
"url" => "painel.php",
"icone" => '<i class="fas fa-home"></i>'
),
array(
"titulo" => "Produtor",
"url" => "produtor.php",
"icone" => '<i class="fas fa-user-alt"></i>'
),
array(
"titulo" => "Produtos",
"url" => "produtos.php",
"icone" => '<i class="fas fa-apple-crate"></i>'
),
array(
"titulo" => "Pedidos",
"url" => "pedidos.php",
"icone" => '<i class="fas fa-list"></i>'
),
array(
"titulo" => "Pagamentos",
"url" => "pagamentos.php",
"icone" => '<i class="fas fa-money-check-alt"></i>'
),
);
$posicaoBarra = strripos($_SERVER['PHP_SELF'], "/");
$url;
if($posicaoBarra == -1) $url = $_SERVER['PHP_SELF'];
else $url = substr($_SERVER['PHP_SELF'], $posicaoBarra+1);
function itemMenuEstaSelecionado($urlItemMenu)
{
if($urlItemMenu == $GLOBALS["url"]) return true;
else return false;
}
?>
<!-- Desktop sidebar -->
<aside class="z-20 hidden w-64 overflow-y-auto bg-white bg-verdecoopaf-menu dark:bg-gray-800 md:block flex-shrink-0">
<!-- @@ -->
<div class="py-4 xtext-gray-700 text-white dark:text-gray-400">
<!-- <a class="ml-6 text-lg font-bold text-white dark:text-gray-200">
CoopAF
</a> -->
<!-- <img class="px-6" style="width: 10rem" src="./assets/img/coopaf.png"> -->
<img aria-hidden="true"
style="width: 10rem"
class="px-6 dark:hidden p-4"
src="./assets/img/coopaf_b.png"
alt="Logo CoopAF" />
<img aria-hidden="true"
style="width: 10rem"
class="hidden px-6 dark:block p-4"
src="./assets/img/coopaf.png"
alt="Logo CoopAF" />
<ul class="mt-4">
<?php
foreach ($menu as $keyItemMenu => $itemMenu)
{
$itemEstaSelecionado = itemMenuEstaSelecionado($itemMenu["url"]);
?>
<li class="relative">
<?php if($itemEstaSelecionado) { ?>
<span class="absolute inset-y-0 left-0 w-1 bg-white dark:bg-verdecoopaf-700 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
<?php } ?>
<a class="px-6 py-3 focus:outline-none focus-visible:shadow-outline-gray inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 XXXXX_hover:text-gray-800 dark:hover:text-gray-200 <?php if($itemEstaSelecionado) echo "XXXXX_hover:text-gray-800 dark:text-gray-100"; ?>" href="<?php echo $itemMenu["url"]; ?>">
<?php echo $itemMenu["icone"]?>
<span class="ml-4"><?php echo $itemMenu["titulo"] ?></span>
</a>
</li>
<?php } ?>
<!-- <li class="relative px-6 py-3">
<button class="inline-flex items-center justify-between w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200" @click="togglePagesMenu" aria-haspopup="true">
<span class="inline-flex items-center">
<svg class="w-5 h-5" aria-hidden="true" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor">
<path
d="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"
></path>
</svg>
<span class="ml-4">Pages</span>
</span>
<svg class="w-4 h-4" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path>
</svg>
</button>
<template x-if="isPagesMenuOpen">
<ul
x-transition:enter="transition-all ease-in-out duration-300"
x-transition:enter-start="opacity-25 max-h-0"
x-transition:enter-end="opacity-100 max-h-xl"
x-transition:leave="transition-all ease-in-out duration-300"
x-transition:leave-start="opacity-100 max-h-xl"
x-transition:leave-end="opacity-0 max-h-0"
class="p-2 mt-2 space-y-2 overflow-hidden text-sm font-medium text-gray-500 rounded-md shadow-inner bg-gray-50 dark:text-gray-400 dark:bg-gray-900"
aria-label="submenu"
>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="index.php">Login</a>
</li>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="create-account.php">
Create account
</a>
</li>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="forgot-password.php">
Forgot password
</a>
</li>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="404.php">404</a>
</li>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="blank.php">Blank</a>
</li>
</ul>
</template>
</li> -->
</ul>
<!-- <div class="px-6 my-6">
<button
class="flex items-center justify-between w-full px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-verdecoopaf-600 border border-transparent rounded-lg active:bg-verdecoopaf-600 hover:bg-verdecoopaf-700 focus:outline-none focus:shadow-outline-verdecoopaf"
>
Create account
<span class="ml-2" aria-hidden="true">+</span>
</button>
</div> -->
</div>
</aside>
<!-- Mobile sidebar -->
<!-- Backdrop -->
<div
x-show="isSideMenuOpen"
x-transition:enter="transition ease-in-out duration-150"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in-out duration-150"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
class="fixed inset-0 z-10 flex items-end bg-black bg-opacity-50 sm:items-center sm:justify-center"
></div>
<aside
class="fixed inset-y-0 z-20 flex-shrink-0 w-64 mt-16 overflow-y-auto bg-white dark:bg-gray-800 md:hidden"
x-show="isSideMenuOpen"
x-transition:enter="transition ease-in-out duration-150"
x-transition:enter-start="opacity-0 transform -translate-x-20"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in-out duration-150"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0 transform -translate-x-20"
@click.away="closeSideMenu"
@keydown.escape="closeSideMenu"
>
<!-- @@ -->
<div class="py-4 xtext-gray-700 text-white dark:text-gray-400">
<a class="ml-6 text-lg font-bold text-gray-800 dark:text-gray-200" href="#">
Windmill
</a>
<ul class="mt-6">
<?php
foreach ($menu as $keyItemMenu => $itemMenu)
{
$itemEstaSelecionado = itemMenuEstaSelecionado($itemMenu["url"]);
?>
<li class="relative px-6 py-3">
<?php if($itemEstaSelecionado){ ?>
<span class="absolute inset-y-0 left-0 w-1 bg-verdecoopaf-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
<?php } ?>
<a class="inline-flex items-center w-full text-sm font-semibold <?php if($itemEstaSelecionado) echo "text-gray-800 dark:text-gray-100" ?> transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200" href="<?php echo $itemMenu["url"]; ?>">
<?php echo $itemMenu["icone"]?>
<span class="ml-4"><?php echo $itemMenu["titulo"]; ?></span>
</a>
</li>
<?php } ?>
<!-- <li class="relative px-6 py-3">
<button class="inline-flex items-center justify-between w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200" @click="togglePagesMenu" aria-haspopup="true">
<span class="inline-flex items-center">
<svg class="w-5 h-5" aria-hidden="true" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor">
<path
d="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"
></path>
</svg>
<span class="ml-4">Pages</span>
</span>
<svg class="w-4 h-4" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path>
</svg>
</button>
<template x-if="isPagesMenuOpen">
<ul
x-transition:enter="transition-all ease-in-out duration-300"
x-transition:enter-start="opacity-25 max-h-0"
x-transition:enter-end="opacity-100 max-h-xl"
x-transition:leave="transition-all ease-in-out duration-300"
x-transition:leave-start="opacity-100 max-h-xl"
x-transition:leave-end="opacity-0 max-h-0"
class="p-2 mt-2 space-y-2 overflow-hidden text-sm font-medium text-gray-500 rounded-md shadow-inner bg-gray-50 dark:text-gray-400 dark:bg-gray-900"
aria-label="submenu"
>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="index.php">Login</a>
</li>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="create-account.php">
Create account
</a>
</li>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="forgot-password.php">
Forgot password
</a>
</li>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="404.php">404</a>
</li>
<li class="px-2 py-1 transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200">
<a class="w-full" href="blank.php">Blank</a>
</li>
</ul>
</template>
</li> -->
</ul>
<!-- <div class="px-6 my-6">
<button class="flex items-center justify-between px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-verdecoopaf-600 border border-transparent rounded-lg active:bg-verdecoopaf-600 hover:bg-verdecoopaf-700 focus:outline-none focus:shadow-outline-verdecoopaf">
Create account
<span class="ml-2" aria-hidden="true">+</span>
</button>
</div> -->
</div>
</aside>