-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Notificação para aprovar ou negar um locar;
- Loading branch information
Showing
1 changed file
with
26 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
// Função para aprovar o formulário | ||
function aprovar_formulario($id) { | ||
global $wpdb; | ||
|
@@ -62,6 +63,7 @@ function excluir_formulario($id) { | |
</head> | ||
<body> | ||
<div id="mapa_admin" style="height: 400px; margin-bottom: 10px;"></div> | ||
|
||
<div class="wrap"> | ||
<?php | ||
// Definições das categorias de formulários | ||
|
@@ -130,38 +132,51 @@ function excluir_formulario($id) { | |
|
||
echo '<form method="post" action="">'; | ||
echo '<input type="hidden" name="id" value="' . $dados->id . '">'; | ||
|
||
// Botões de ação com base na situação do formulário | ||
if ($situacao === 'Pendente') { | ||
echo '<button type="submit" name="action" value="approve">Aprovar</button>'; | ||
echo '<button type="submit" name="action" value="reprove">Negar</button>'; | ||
if ($situacao === 'Pendente') { | ||
echo '<button type="submit" name="action" value="approve" onclick="return confirm(\'Deseja realmente aprovar este formulário?\')">Aprovar</button>'; | ||
echo '<button type="submit" name="action" value="reprove" onclick="return confirm(\'Deseja realmente negar este formulário?\')">Negar</button>'; | ||
} elseif ($situacao === 'Aprovado') { | ||
echo '<button type="submit" name="action" value="reprove">Negar</button>'; | ||
echo '<button type="submit" name="action" value="reprove" >Negar</button>'; | ||
} elseif ($situacao === 'Negado') { | ||
echo '<button type="submit" name="action" value="approve">Aprovar</button>'; | ||
} | ||
|
||
echo '<button type="submit" name="action" value="exclude">Excluir</button>'; | ||
echo '<button type="submit" name="action" value="exclude" data-confirm="exclude" data-confirm-message="Deseja realmente excluir este formulário?">Excluir</button>'; | ||
echo '<button type="button">Editar</button>'; | ||
echo '</form>'; | ||
echo '</td>'; | ||
echo '</tr>'; | ||
|
||
|
||
} | ||
|
||
echo '</tbody>'; | ||
echo '</table>'; | ||
|
||
} | ||
} | ||
//linkando arquivo javascript | ||
echo '<script src="' . plugin_dir_url(__FILE__) . 'admin_script.js"></script>'; | ||
echo '<script src="' . plugin_dir_url(__FILE__) . 'admin_script.js"></script>'; | ||
|
||
?> | ||
</div> | ||
|
||
<!-- Modal de confirmação --> | ||
<div id="modal-confirmacao" class="modal"> | ||
<div class="modal-content"> | ||
<span class="close">×</span> | ||
<p>Deseja realmente aprovar este formulário?</p> | ||
<div class="modal-buttons"> | ||
<button id="confirmar-aprovacao">Sim</button> | ||
<button class="close">Cancelar</button> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- Carregue o jQuery antes de qualquer outro script que o utilize --> | ||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | ||
<!-- Carregue o Leaflet antes de qualquer script que o utilize --> | ||
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> | ||
|
||
</body> | ||
</html> |