<?php

$regraMovimento = new Movimento();
?>
<div class="modal modal fade" id="movimentoNovoModal">
    <div class="modal-dialog">
        <form method="POST" class="form-horizontal">
        <input type="hidden" name="acao" value="movimento-novo" />
        <input type="hidden" id="movimento_pessoa" name="id_pessoa" value="0" />
        <input type="hidden" id="movimento_aluno" name="id_aluno" value="0" />
        <div class="modal-content form-horizontal">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title"><i class="icon icon-dollar"></i> Novo movimento</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-5">
                        <div class="btn-group" data-toggle="buttons">
                            <label class="btn active">
                                <input type="radio" name="cod_situacao" value="<?php 
echo MOVIMENTO_EM_ABERTO;
?>
" checked="checked"><i class="icon icon-dollar"></i> Em aberto
                            </label>
                            <label class="btn">
                                <input type="radio" name="cod_situacao" value="<?php 
echo MOVIMENTO_QUITADO;
?>
"><i class="icon icon-clock-o"></i> Quitado
                            </label>
예제 #2
0
session_cache_expire($timeout);
session_set_cookie_params($timeout);
session_start();
define('ID_ESCOLA', 1);
$regraUsuario = new Usuario();
if (basename($_SERVER["SCRIPT_FILENAME"], '.php') != 'login') {
    //var_dump(basename($_SERVER["SCRIPT_FILENAME"], '.php'));
    $usuario = $regraUsuario->pegarAtual();
    if (is_null($usuario)) {
        //var_dump($usuario);
        header('Location: ' . WEB_PATH . '/admin/login');
        exit;
    }
}
if (count($_POST) > 0) {
    $regraMovimento = new Movimento();
    if ($_POST['acao'] == 'movimento-novo') {
        $movimento = $regraMovimento->pegarDoPost();
        $regraMovimento->inserir($movimento);
    } elseif ($_POST['acao'] == 'movimento-pagar') {
        $id_movimento = intval($_POST['id_movimento']);
        $valor = $_POST['valor_pago'];
        $observacao = $_POST['observacao'];
        $regraMovimento->pagar($id_movimento, $valor, $observacao);
        //$movimento = $regraMovimento->pegarDoPost();
        //$regraMovimento->pagar($movimento);
    } elseif ($_POST['acao'] == 'movimento-cancelar') {
        $id_movimento = intval($_POST['id_movimento']);
        $observacao = $_POST['observacao'];
        $regraMovimento->cancelar($id_movimento, $observacao);
        //$movimento = $regraMovimento->pegarDoPost();
예제 #3
0
<?php

require 'common.inc.php';
$regraMovimento = new Movimento();
$id_tipo = intval($_GET['tipo']);
if (array_key_exists('situacao', $_GET)) {
    $cod_situacao = intval($_GET['situacao']);
} else {
    $cod_situacao = MOVIMENTO_EXECUTADO;
}
if (array_key_exists('ini', $_GET)) {
    $dataIni = explode('-', $_GET['ini']);
    $dataIni = mktime(0, 0, 0, $dataIni[1], $dataIni[2], $dataIni[0]);
} else {
    $dataIni = strtotime(date('Y-m-01'));
}
if (array_key_exists('fim', $_GET)) {
    $dataFim = explode('-', $_GET['fim']);
    $dataFim = mktime(0, 0, 0, $dataFim[1], $dataFim[2], $dataFim[0]);
} else {
    $dataFim = strtotime(date('Y-m-t'));
}
if (count($_POST) > 0) {
    //var_dump($_POST);
    //exit();
    try {
        if ($_POST['acao'] == 'movimento-filtrar') {
            $id_tipo = intval($_POST['id_tipo']);
            $cod_situacao = intval($_POST['cod_situacao']);
            $dataIni = explode('/', $_POST['ini']);
            $dataIni = mktime(0, 0, 0, $dataIni[1], $dataIni[0], $dataIni[2]);
<?php

require 'common.inc.php';
$regraMovimento = new Movimento();
try {
    if (array_key_exists('acao', $_POST) && $_POST['acao'] == 'gravar-tipo') {
        if (array_key_exists('id_tipo', $_POST)) {
            $id_tipo = intval($_POST['id_tipo']);
            $regraMovimento->alterarTipo($id_tipo, $_POST['nome']);
            $msgSucesso = _('Successfully changed move type.');
            header('Location: movimento-tipo?success=' . urlencode($msgSucesso));
            exit;
        } else {
            $regraMovimento->inserirTipo($_POST['nome']);
            $msgSucesso = _('Successfully included move type.');
            header('Location: movimento-tipo?success=' . urlencode($msgSucesso));
            exit;
        }
    } elseif (array_key_exists('excluir', $_GET)) {
        $id_tipo = $_GET['excluir'];
        $regraMovimento->excluirTipo($id_tipo);
        $msgSucesso = _('Move type deleted successfully.');
        header('Location: movimento-tipo?success=' . urlencode($msgSucesso));
        exit;
    }
} catch (Exception $e) {
    $msgErro = $e->getMessage();
}
$tipos = $regraMovimento->listarTipo();
if (!function_exists('toolbar_breadcrump')) {
    function toolbar_breadcrump()
예제 #5
0
<?php

$pessoa = $GLOBALS['_pessoa'];
$regraMovimento = new Movimento();
if ($pessoa->tipo == TIPO_ALUNO) {
    $movimentos = $regraMovimento->listar(null, $id_pessoa);
} else {
    $movimentos = $regraMovimento->listar($id_pessoa);
}
?>
<div class="panel panel-default">
    <div class="panel-body">
        <!--pre><?php 
//var_dump($movimentos);
?>
</pre-->
        <table class="table table-striped table-hover table-responsive">
            <thead>
                <tr>
                    <th><a href="#">Tipo</a></th>
                    <th class="text-right"><a href="#">Vencimento</a></th>
                    <th class="text-right"><a href="#">Crédito</a></th>
                    <th class="text-right"><a href="#">Débito</a></th>
                    <th><a href="#">Situação</a></th>
                    <th><a href="#">Opções</a></th>
                </tr>
            </thead>
            <tbody>
                <?php 
if (count($movimentos) > 0) {
    ?>
 /**
  * Remove the specified movimento from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Movimento::destroy($id);
     return Redirect::route('movimentos.index');
 }
 public function gerar()
 {
     $regraMovimento = new Movimento();
     $movimentos = $regraMovimento->listarCarne($this->id_pessoa, $this->mes, $this->ano);
     //echo '<pre>';
     //var_dump($movimentos);
     //echo '</pre>';
     //exit();
     $indice = 0;
     //define('MARGEM_SUPERIOR', 10);
     //define('MARGEM_ESQUERDA', 10);
     foreach ($movimentos as $movimento) {
         if ($indice == 0) {
             $this->AddPage();
             $this->SetXY(0, 0);
         }
         $altura = 42;
         $y = $indice * ($altura + 3) + 10;
         $this->Rect(10, $y, 60, $altura);
         $this->SetXY(10, $y);
         $this->SetFont('Arial', 'B', 10);
         $this->Cell(60, 8, "RECIBO DO SACADO", 0, 1, 'C');
         $this->Line(12, $y + 7, 68, $y + 7);
         $ny = $y + 8;
         $this->SetXY(11, $ny);
         $this->SetFont('Arial', '', 8);
         $this->Cell(23, 4, utf8_decode("Referente à"), 0, 1, 'R');
         $this->Line(35, $ny - 1, 35, $ny + 4);
         $dataVencimento = strtotime($movimento->data_vencimento);
         $this->SetXY(30, $ny);
         $this->SetFont('Arial', '', 8);
         $this->Cell(38, 4, utf8_decode(strtoupper(strftime("%B / %Y", $dataVencimento))), 0, 1, 'R');
         $this->Line(12, $ny + 4, 68, $ny + 4);
         $ny = $ny + 5;
         $this->SetXY(11, $ny);
         $this->SetFont('Arial', '', 8);
         $this->Cell(23, 4, utf8_decode("Vencimento"), 0, 1, 'R');
         $this->Line(35, $ny - 1, 35, $ny + 4);
         $this->SetXY(30, $ny);
         $this->SetFont('Arial', '', 8);
         $this->Cell(38, 4, utf8_decode(date('d/m/Y', $dataVencimento)), 0, 1, 'R');
         $this->Line(12, $ny + 4, 68, $ny + 4);
         $ny = $ny + 5;
         $this->SetXY(11, $ny);
         $this->SetFont('Arial', '', 8);
         $this->Cell(23, 4, utf8_decode("Valor"), 0, 1, 'R');
         $this->Line(35, $ny - 1, 35, $ny + 4);
         $this->SetXY(30, $ny);
         $this->SetFont('Arial', '', 8);
         $this->Cell(38, 4, utf8_decode('R$ ' . number_format($movimento->valor_total, 2, '.', ',')), 0, 1, 'R');
         $this->Line(12, $ny + 4, 68, $ny + 4);
         $ny = $ny + 5;
         $this->SetXY(11, $ny);
         $this->SetFont('Arial', '', 8);
         $this->Cell(23, 4, utf8_decode("Valor Pago"), 0, 1, 'R');
         $this->Line(35, $ny - 1, 35, $ny + 4);
         $this->Line(12, $ny + 4, 68, $ny + 4);
         $ny = $ny + 5;
         $this->SetXY(11, $ny);
         $this->SetFont('Arial', '', 8);
         $this->Cell(23, 4, utf8_decode("Data Pgto"), 0, 1, 'R');
         $this->Line(35, $ny - 1, 35, $ny + 4);
         $this->SetXY(30, $ny);
         $this->SetFont('Arial', '', 8);
         $this->Cell(38, 4, utf8_decode('/           /           '), 0, 1, 'R');
         $this->Line(12, $ny + 4, 68, $ny + 4);
         $ny = $ny + 8;
         $this->Line(12, $ny + 4, 68, $ny + 4);
         $this->Rect(75, $y, 125, $altura);
         $this->Line(160, $y, 160, $y + $altura);
         $this->Line(75, $y + 8, 200, $y + 8);
         $this->Line(75, $y + 16, 200, $y + 16);
         $this->Line(125, $y + 8, 125, $y + 16);
         $this->Line(160, $y + 24, 200, $y + 24);
         $this->Line(160, $y + 32, 200, $y + 32);
         $ny = $y;
         $this->SetXY(75, $ny + 0.5);
         $this->SetFont('Arial', '', 7);
         $this->Cell(85, 3, "cedente", 0, 1, 'L');
         $this->SetXY(75, $ny + 3);
         $this->SetFont('Arial', 'B', 10);
         $this->Cell(85, 5, "ESCOLA BEM ME QUER", 0, 1, 'L');
         $this->SetXY(160, $ny + 0.5);
         $this->SetFont('Arial', '', 7);
         $this->Cell(40, 3, "vencimento", 0, 1, 'R');
         $this->SetXY(160, $ny + 3);
         $this->SetFont('Arial', '', 10);
         $this->Cell(40, 5, utf8_decode(date('d/m/Y', $dataVencimento)), 0, 1, 'R');
         $ny = $ny + 8;
         $this->SetXY(75, $ny + 0.5);
         $this->SetFont('Arial', '', 7);
         $this->Cell(85, 3, "sacado", 0, 1, 'L');
         $this->SetXY(75, $ny + 3);
         $this->SetFont('Arial', '', 10);
         $this->Cell(85, 5, $movimento->nome, 0, 1, 'L');
         $this->SetXY(126, $ny + 0.5);
         $this->SetFont('Arial', '', 7);
         $this->Cell(85, 3, "cpf", 0, 1, 'L');
         $this->SetXY(126, $ny + 3);
         $this->SetFont('Arial', '', 10);
         $this->Cell(85, 5, $movimento->cpf_cnpj, 0, 1, 'L');
         $this->SetXY(160, $ny + 0.5);
         $this->SetFont('Arial', '', 7);
         $this->Cell(40, 3, "(=) valor documento", 0, 1, 'R');
         $this->SetXY(160, $ny + 3);
         $this->SetFont('Arial', '', 10);
         $this->Cell(40, 5, utf8_decode('R$ ' . number_format($movimento->valor_total, 2, '.', ',')), 0, 1, 'R');
         $ny = $ny + 8;
         $this->SetXY(75, $ny + 0.5);
         $this->SetFont('Arial', '', 7);
         $this->Cell(40, 3, utf8_decode("instruções"), 0, 1, 'L');
         $texto = "Referente a parcela do mês " . strftime("%B/%Y", $dataVencimento) . " ";
         if (count($movimento->movimentos) > 1) {
             $texto .= "dos alunos:\n";
         } else {
             $texto .= "do aluno:\n";
         }
         foreach ($movimento->movimentos as $aluno) {
             $texto .= $aluno->nome . ' - Turma ' . $aluno->turma . "\n";
         }
         $this->SetXY(75, $ny + 4);
         $this->SetFont('Arial', '', 9);
         $this->MultiCell(85, 4, utf8_decode($texto), 0, 'L');
         $this->SetXY(160, $ny + 0.5);
         $this->SetFont('Arial', '', 7);
         $this->Cell(40, 3, "(-) descontos", 0, 1, 'R');
         $ny = $ny + 8;
         $this->SetXY(160, $ny + 0.5);
         $this->SetFont('Arial', '', 7);
         $this->Cell(40, 3, "(+) multa / juros", 0, 1, 'R');
         $ny = $ny + 8;
         $this->SetXY(160, $ny + 0.5);
         $this->SetFont('Arial', '', 7);
         $this->Cell(40, 3, "(=) total cobrado", 0, 1, 'R');
         $indice++;
         if ($indice >= 6) {
             $indice = 0;
         }
     }
 }
예제 #8
0
        $msgsucesso = 'Pessoa removida com sucesso!';
        header('Location: ' . WEB_PATH . '/admin/pessoas?sucesso=' . urlencode($msgsucesso));
        exit;
    }
    if (array_key_exists('excluir-relacionamento', $_GET)) {
        $dados = explode('-', $_GET['excluir-relacionamento']);
        $id_pessoa = intval($_GET['pessoa']);
        $id_responsavel = intval($dados[0]);
        $id_aluno = intval($dados[1]);
        $regraPessoa->excluirRelacionamento($id_responsavel, $id_aluno);
        $msgsucesso = 'Relacionamento excluído com sucesso!';
        header('Location: ' . WEB_PATH . '/admin/pessoa?pessoa=' . $id_pessoa . '&sucesso=' . urlencode($msgsucesso));
        exit;
    }
    if (array_key_exists('gerar', $_GET)) {
        $regraMovimento = new Movimento();
        $id_pessoa = intval($_GET['pessoa']);
        $dados = explode('-', $_GET['gerar']);
        $mes = intval($dados[0]);
        if (!($mes > 0)) {
            $mes = null;
        }
        $ano = intval($dados[1]);
        $msgsucesso = 'Movimentos gerados com sucesso!';
        $regraMovimento->gerarMensalidade($ano, $mes, $id_pessoa);
        header('Location: ' . WEB_PATH . '/admin/pessoa?pessoa=' . $id_pessoa . '&sucesso=' . urlencode($msgsucesso));
        exit;
    }
} catch (Exception $e) {
    $msgerro = $e->getMessage();
}