This repository has been archived by the owner on Jan 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dedcd8d
commit 9c49a43
Showing
5 changed files
with
98 additions
and
10 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
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
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php require('head.php'); | ||
if (! $USER->admin()) { | ||
echo "<p class='alert alert-danger'>Acesso negado</p>"; | ||
exit; | ||
} | ||
require('menu.php'); | ||
?> | ||
<h2>Administração de impedimentos</h2> | ||
<?php | ||
if (isset($_REQUEST['delete'])) { | ||
$pr = new Proibidos($_REQUEST['delete']); | ||
if ($pr->remove()) | ||
echo "<p class='alert alert-success'>Impedimento removido</p>"; | ||
else | ||
echo "<p class='alert alert-danger'>Erro ao remover impedimento!</p>"; | ||
} | ||
if(isset($_REQUEST['submit'])) { | ||
$pr = new Proibidos(); | ||
if ($pr->create($_REQUEST['nome'])) | ||
echo "<p class='alert alert-success'>Impedimento criado</p>"; | ||
else | ||
echo "<p class='alert alert-danger'>Erro ao criar impedimento!</p>"; | ||
} | ||
?> | ||
<p>Impedimentos globais cadastrados:</p> | ||
<p>(Para detalhes de como impedimentos funcionam, veja <a href="https://github.com/lageIBUSP/notaR/wiki/Gerenciando-arquivos-e-proibi%C3%A7%C3%B5es">aqui</a>). | ||
<table><tr><th colspan=2>Palavra</th></tr> | ||
<?php | ||
foreach (ListProibidos(true) as $pr) { | ||
echo "<tr><td>"; | ||
if (!$pr->getHard()) | ||
echo "<a href='?delete=".$pr->getId()."'><span class='glyphicon glyphicon-remove'></span></a>"; | ||
echo "</td><td>".$pr->getPalavra()."</td></tr>"; | ||
} | ||
?> | ||
</table> | ||
|
||
<p>Exercícios com impedimentos locais:</p> | ||
<table><tr><th colspan=2>Palavra</th><th>Exercício</th></tr> | ||
<?php | ||
foreach (ListProibidos(false) as $pr) { | ||
echo "<tr><td>"; | ||
$EX = new Exercicio($pr->getExercicio()); | ||
echo "<a href='cadastra.php?exerc=".$pr->getExercicio()."'><span class='glyphicon glyphicon-pencil'></span></a>"; | ||
echo "</td><td>".$pr->getPalavra()."</td><td>".$EX->getNome()."</td></tr>"; | ||
} | ||
?> | ||
</table> | ||
|
||
<form name="cadastro" action="?" method="post"> | ||
<p> </p> | ||
<p>Criar novo impedimento global: <input type="text" name="nome" style="width: 300px;"></p> | ||
<p><button type="submit" name="submit" value="submit">ok</button></p> | ||
</form> | ||
|
||
</div> | ||
</body> | ||
</html> |
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
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