-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSelecionarOpcoes.php
83 lines (69 loc) · 2.17 KB
/
SelecionarOpcoes.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
<?php
include("conexao.php");
include_once("functions.php");
if(ProtegePag() == true){
if( ($_SESSION['acesso'] == 1) || ($_SESSION['acesso'] == 2)){
?>
<script type='text/javascript'>
$(function(){
$("a.ExibirOpcoes").click(function() {
var status = $(this).attr("status");
if(status == 'alterarrev'){
statusE = 'Alterar Revendedor';
}
else if(status == 'renovarall'){
statusE = 'Renovar';
var fa = 'fa fa-repeat';
var tipo = 'info';
}
else if(status == 'excluirall'){
statusE = 'Excluir';
var fa = 'fa fa-trash-o';
var tipo = 'danger';
}
else{
statusE = 'Opções';
var fa = 'fa fa-gear';
var tipo = 'success';
}
$("#StatusEG").html(statusE);
camposMarcados = new Array();
$("input[type=checkbox][name='SelectUser[]']:checked").each(function(){
camposMarcados.push($(this).val());
});
if(status == 'alterarrev'){
$.post('ScriptModalAlterarRevUser.php', {camposMarcados: camposMarcados}, function(resposta) {
$("#StatusGeral").html('');
$("#StatusGeral").html(resposta);
});
}
else{
var titulo = statusE + '?';
var texto = 'Tem certeza que deseja '+statusE+'?';
var url = 'EnviarOpcoesUser';
$.post('ScriptAlertaJS2.php', {camposMarcados: camposMarcados, status: status, titulo: titulo, texto: texto, tipo: tipo, url: url, fa: fa}, function(resposta) {
$("#StatusGeral").html('');
$("#StatusGeral").html(resposta);
});
}
});
});
</script>
<button type="button" class="btn btn-default"><span id="StatusEG">Opções</span></button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<?php
echo "<li><a status=\"alterarrev\" class=\"ExibirOpcoes pointer\">Alterar Revendedor</a></li>";
echo "<li><a status=\"renovarall\" class=\"ExibirOpcoes pointer\">Renovar</a></li>";
echo "<li><a status=\"excluirall\" class=\"ExibirOpcoes pointer\">Excluir</a></li>";
?>
</ul>
<?php
}else{
echo Redirecionar('index.php');
}
}else{
echo Redirecionar('login.php');
}
?>