-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharquivo-perfil.php
217 lines (158 loc) · 8.28 KB
/
arquivo-perfil.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
<?php
include("conexao.php");
include_once("functions.php");
if(ProtegePag() == true){
global $banco;
if($_SESSION['acesso'] == 1){
//Servidor
$SQLServer = "SELECT * FROM arquivo";
$SQLServer = $banco->prepare($SQLServer);
$SQLServer->execute();
?>
<!-- START BREADCRUMB -->
<ul class="breadcrumb">
<li class="active">Configurações</li>
</ul>
<!-- END BREADCRUMB -->
<!-- PAGE TITLE -->
<div class="page-title">
<h2><span class="fa fa-file-o"></span> Arquivo de Perfil</h2>
</div>
<!-- END PAGE TITLE -->
<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="btn-group" style="padding:5px 0px 5px 0px;">
<button type="button" class="Adicionar btn btn-info active">Adicionar</button>
</div>
<div class="ExibirAllOpcoes btn-group" style="padding:5px 0px 5px 0px;"></div>
<ul class="panel-controls">
<li><a href="#" class="panel-fullscreen"><span class="fa fa-expand"></span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="fa fa-cog"></span></a>
<ul class="dropdown-menu">
<li><a href="#" class="panel-collapse"><span class="fa fa-angle-down"></span> Esconder</a></li>
<li><a href="#" class="panel-refresh"><span class="fa fa-refresh"></span> Atualizar</a></li>
</ul>
</li>
</ul>
</div>
<div class="panel-body">
<div class="table-responsive">
<table id="Tabela" class="table datatable">
<thead>
<tr>
<th>Operadora</th>
<th>Nome</th>
<th>Título</th>
<th>Descrição</th>
<th>Nome do Botão</th>
<th>APN</th>
<th>Imagem</th>
<th>Tipo</th>
<th>Opções</th>
</tr>
</thead>
<tbody>
<?php
while($LnServer = $SQLServer->fetch()){
$UrlArq = empty($LnServer['file']) ? $LnServer['url'] : UrlAtual()."download/".$LnServer['file'];
$tipo = "<a target=\"_blank\" href=\"".$UrlArq."\" class=\"btn btn-".$LnServer['tipo']."\">".$LnServer['botao']."</a>";
$APN = empty($LnServer['apn']) ? "Não" : $LnServer['apn'];
$SQLImagem = "SELECT imagem FROM imagem_perfil WHERE id = :id";
$SQLImagem = $banco->prepare($SQLImagem);
$SQLImagem->bindParam(':id', $LnServer['imagem'], PDO::PARAM_STR);
$SQLImagem->execute();
$LnImagem = $SQLImagem->fetch();
$img = "<img src=\"img/perfil/".$LnImagem['imagem']."\" height=\"54\" width=\"163\">";
echo "
<tr>
<td>".$LnServer['operadora']."</td>
<td>".$LnServer['nome']."</td>
<td>".$LnServer['titulo']."</td>
<td>".$LnServer['descricao']."</td>
<td>".$LnServer['botao']."</td>
<td>".$APN."</td>
<td>".$img."</td>
<td>".$tipo."</td>
";
echo "<td><div class=\"form-group\">";
echo "<a onclick=\"Deletar('".$LnServer['id']."', '".$LnServer['nome']."')\" class=\"deletar label label-danger\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Excluir\"><i class=\"fa fa-trash-o\"></i></a> ";
echo "<a onclick=\"Editar('".$LnServer['id']."')\" class=\"label label-warning\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Editar\"><i class=\"fa fa-pencil\"></i></a> ";
echo "</div>
</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- PAGE CONTENT WRAPPER -->
<div id="StatusGeral"></div>
<!-- START SCRIPTS -->
<!-- START PLUGINS -->
<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/plugins/bootstrap/bootstrap.min.js"></script>
<!-- END PLUGINS -->
<!-- START THIS PAGE PLUGINS-->
<script type='text/javascript' src='js/plugins/icheck/icheck.min.js'></script>
<script type="text/javascript" src="js/plugins/mcustomscrollbar/jquery.mCustomScrollbar.min.js"></script>
<script type='text/javascript' src='js/plugins/maskedinput/jquery.maskedinput.min.js'></script>
<script type="text/javascript" src="js/plugins/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/DataTables-br.js"></script>
<script type="text/javascript" src="js/plugins/bootstrap/bootstrap-file-input.js"></script>
<!-- END THIS PAGE PLUGINS-->
<!-- START TEMPLATE -->
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/actions.js"></script>
<!-- END TEMPLATE -->
<script type='text/javascript'>
function Editar(id){
panel_refresh($(".page-container"));
$.post('ScriptModalArquivoEditar.php', {id: id}, function(resposta) {
setTimeout(panel_refresh($(".page-container")),500);
$("#StatusGeral").html('');
$("#StatusGeral").html(resposta);
});
}
$(function(){
$("button.Adicionar").click(function() {
panel_refresh($(".page-container"));
$.post('ScriptModalArquivoAdicionar.php', function(resposta) {
setTimeout(panel_refresh($(".page-container")),500);
$("#StatusGeral").html('');
$("#StatusGeral").html(resposta);
});
});
});
function Deletar(id, nome){
var titulo = 'Excluir?';
var texto = 'Tem certeza que deseja excluir o servidor '+nome+'?';
var tipo = 'danger';
var url = 'EnviarDeletarArquivo';
var fa = 'fa fa-trash-o';
$.post('ScriptAlertaJS.php', {id: id, titulo: titulo, texto: texto, tipo: tipo, url: url, fa: fa}, function(resposta) {
$("#StatusGeral").html('');
$("#StatusGeral").html(resposta);
});
}
</script>
<!-- END SCRIPTS -->
<?php
}else{
echo Redirecionar('index.php');
}
}else{
echo Redirecionar('login.php');
}
?>