-
Notifications
You must be signed in to change notification settings - Fork 0
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
46ea12c
commit cc5f2e1
Showing
40 changed files
with
12,146 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Empty file.
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,20 @@ | ||
<?php | ||
|
||
require 'repositorio_clientes.php'; | ||
|
||
$clienteRecebido = new Cliente( | ||
$_REQUEST['nome'], | ||
$_REQUEST['codigo'], | ||
$_REQUEST['cpf'], | ||
$_REQUEST['endereco'], | ||
$_REQUEST['data_cadastro'], | ||
$_REQUEST['saldo_devedor'], | ||
$_REQUEST['situacao'] | ||
); | ||
|
||
$repositorio->atualizarCliente($clienteRecebido); | ||
|
||
header('Location: clientes.php'); | ||
exit; | ||
|
||
?> |
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,18 @@ | ||
<?php | ||
|
||
require 'repositorio_filmes.php'; | ||
|
||
$filmeRecebido = new Filme( | ||
$_REQUEST['titulo'], | ||
$_REQUEST['codigo'], | ||
$_REQUEST['sinopse'], | ||
$_REQUEST['quantidade'], | ||
$_REQUEST['trailer'] | ||
); | ||
|
||
$repositorio->atualizarFilme($filmeRecebido); | ||
|
||
header('Location: filmes.php'); | ||
exit; | ||
|
||
?> |
Empty file.
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,101 @@ | ||
<?php | ||
|
||
/** | ||
* Filme | ||
*/ | ||
class Cliente | ||
{ | ||
private $nome; | ||
private $codigo; | ||
private $cpf; | ||
private $endereco; | ||
private $data_cadastro; | ||
private $saldo_devedor; | ||
private $situacao; | ||
|
||
function __construct($nome,$codigo,$cpf,$endereco,$data_cadastro,$saldo_devedor,$situacao) | ||
{ | ||
$this->nome = $nome; | ||
$this->codigo = $codigo; | ||
$this->cpf = $cpf; | ||
$this->endereco = $endereco; | ||
$this->data_cadastro = $data_cadastro; | ||
$this->saldo_devedor = $saldo_devedor; | ||
$this->situacao = $situacao; | ||
} | ||
|
||
public function setNome($nome) | ||
{ | ||
$this->nome = $nome; | ||
} | ||
|
||
public function getNome() | ||
{ | ||
return $this->nome; | ||
} | ||
|
||
|
||
public function setCodigo($codigo) | ||
{ | ||
$this->codigo = $codigo; | ||
} | ||
|
||
public function getCodigo() | ||
{ | ||
return $this->codigo; | ||
} | ||
|
||
|
||
public function setCPF($sionopse) | ||
{ | ||
$this->cpf = $sionopse; | ||
} | ||
|
||
public function getCPF() | ||
{ | ||
return $this->cpf; | ||
} | ||
|
||
|
||
public function setEndereco($endereco) | ||
{ | ||
$this->endereco = $endereco; | ||
} | ||
|
||
public function getEndereco() | ||
{ | ||
return $this->endereco; | ||
} | ||
|
||
|
||
public function setData_cadastro($data_cadastro) | ||
{ | ||
$this->data_cadastro = $data_cadastro; | ||
} | ||
|
||
public function getData_cadastro() | ||
{ | ||
return $this->data_cadastro; | ||
} | ||
|
||
public function setSaldo_devedor($saldo_devedor) | ||
{ | ||
$this->saldo_devedor = $saldo_devedor; | ||
} | ||
|
||
public function getSaldo_devedor() | ||
{ | ||
return $this->saldo_devedor; | ||
} | ||
|
||
public function setSituacao($situacao) | ||
{ | ||
$this->situacao = $situacao; | ||
} | ||
public function getSituacao() | ||
{ | ||
return $this->situacao; | ||
} | ||
|
||
|
||
} |
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,178 @@ | ||
<?php | ||
|
||
include 'header.php'; | ||
|
||
require 'repositorio_clientes.php'; | ||
|
||
$clientes = $repositorio->getListaClientes($_GET['filtro']); | ||
|
||
$destino = 'incluir_cliente.php'; | ||
|
||
if (isset($_GET['codigo']) ) { | ||
$codigo = $_GET['codigo']; | ||
|
||
$cliente = $repositorio->buscarCliente($codigo); | ||
|
||
$destino = "alterar_cliente.php"; | ||
$oculto = '<input type="hidden" name="codigo" value="'.$codigo.'" /> '; | ||
} | ||
|
||
# Função que ajuda a desenhar o controle HTML select | ||
function combobox($arrDados, $valorSelecionado = null) { | ||
echo "<option></option>"; | ||
foreach ($arrDados as $key => $value) { | ||
$selected = ($valorSelecionado == $key) ? "selected=\"selected\"" : null; | ||
echo "<option value=\"$key\" $selected>$value</option>"; | ||
} | ||
} | ||
|
||
$array_situacao = array( | ||
"Em atraso" => "Em atraso", | ||
"Em dia" => "Em dia", | ||
); | ||
|
||
?> | ||
|
||
<!-- Page Content --> | ||
<div class="container"> | ||
|
||
<!-- Marketing Icons Section --> | ||
<div class="row"> | ||
<div class="col-lg-12"> | ||
<h1 class="page-header"> | ||
Cadastrar cliente | ||
</h1> | ||
</div> | ||
<p> | ||
<!-- <a href="cliente.php"><button type="button" class="btn btn-primary btn-lg">NOVO</button></a> --> | ||
</p> | ||
<hr> | ||
|
||
<?php if ( !empty($m) ) { ?> | ||
<div class="alert alert-success" role="alert"><?=$m;?></div> | ||
<?php } ?> | ||
|
||
<div class="col-md-8"> | ||
<p> | ||
<strong>Inserir:</strong><br> | ||
<form name="frmAluno" method="post" action="<?=$destino;?>"> | ||
|
||
<input type="hidden" value="<?=$a;?>" name="a"> | ||
<?= @$oculto;?> | ||
|
||
<div class="form-group"> | ||
<input type="text" class="form-control" id="nome" name="nome" value="<? echo isset($cliente)?$cliente->getNome():"";?>" placeholder="Nome"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<input type="text" class="form-control" id="cpf" name="cpf" value="<? echo isset($cliente)?$cliente->getCPF():"";?>" placeholder="CPF"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<input type="text" class="form-control" id="endereco" name="endereco" value="<? echo isset($cliente)?$cliente->getendereco():"";?>" placeholder="endereco"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<input type="text" class="form-control" id="data_cadastro" name="data_cadastro" value="<? echo isset($cliente)?$cliente->getData_cadastro():"";?>" placeholder="Data Cadastro"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<input type="text" class="form-control" id="saldo_devedor" name="saldo_devedor" value="<? echo isset($cliente)?$cliente->getSaldo_devedor():"";?>" placeholder="Saldo devedor"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<select class="form-control" id="situacao" name="situacao"> | ||
<?php | ||
$aSituacao = isset($cliente)?$cliente->getSituacao():""; | ||
combobox($array_situacao, $aSituacao ); | ||
|
||
?> | ||
</select> | ||
</div> | ||
|
||
<button type="submit" class="btn btn-default">SALVAR</button> | ||
</form> | ||
|
||
</p> | ||
</div> | ||
<div class="col-md-3"> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
|
||
|
||
<div class="table-responsive"> | ||
<hr> | ||
<h2> Clientes Cadastrados</h2> | ||
<div class="col-md-9"> | ||
<p>Filtros:</p> | ||
<p> <a href="?filtro=">Todos</a> | <a href="?filtro=Em atraso"> Em Atraso</a> | <a href="?filtro=Em dia">Em Dia</a> | ||
</div> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Cliente</th> | ||
<th> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
|
||
<? | ||
|
||
while($clienteTemporario = array_shift($clientes)) { | ||
?> | ||
<tr> | ||
|
||
<td><?=$clienteTemporario->getNome();?></td> | ||
<td class="center"> | ||
|
||
<a href="clientes.php?codigo=<?=$clienteTemporario->getCodigo();?>" class="btn btn-default">Alterar</a> | ||
|
||
<a href="excluir_cliente.php?codigo=<?=$clienteTemporario->getCodigo();?>" class="btn btn-danger">Excluir</a> | ||
|
||
</td> | ||
</tr> | ||
|
||
<?php } ?> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
|
||
|
||
</div> | ||
<!-- /.row --> | ||
|
||
|
||
<hr> | ||
|
||
<!-- Footer --> | ||
<footer> | ||
<div class="row"> | ||
<div class="col-lg-12"> | ||
<p>Copyright © </p> | ||
</div> | ||
</div> | ||
</footer> | ||
|
||
</div> | ||
<!-- /.container --> | ||
|
||
<!-- jQuery --> | ||
<script src="js/jquery.js"></script> | ||
|
||
<!-- Bootstrap Core JavaScript --> | ||
<script src="js/bootstrap.min.js"></script> | ||
|
||
<!-- Script to Activate the Carousel --> | ||
<script> | ||
$('.carousel').carousel({ | ||
interval: 5000 //changes the speed | ||
}) | ||
</script> | ||
|
||
</body> | ||
|
||
</html> |
Empty file.
Oops, something went wrong.