Skip to content

Commit

Permalink
Add novo na folha pgto
Browse files Browse the repository at this point in the history
  • Loading branch information
hiltonbruce committed Nov 4, 2016
1 parent 6387719 commit 8758e68
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 102 deletions.
4 changes: 2 additions & 2 deletions controller/despesa.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
require_once 'views/tesouraria/recPgto.php';
break;
case '8':
//Recibos para de pgto
//Recibos para de pgto e cadastrar membro no cargo despesa
$pgtoDias = new tes_cargo();
$listaPgto = $pgtoDias->cargoIgreja($_POST['rolIgreja'],$_POST['idfunc'] );
$recLink='#';
Expand All @@ -36,7 +36,7 @@
break;
case '9':
//
$titTabela = 'Demonstrativo de Pgto do mês:';
$titTabela = 'Demonstrativo de Pgto do mês:';
$lista = new agenda();
require_once 'views/tesouraria/despesaMes.php';//Cadastrar Membro no Cargo despesa
break;
Expand Down
11 changes: 8 additions & 3 deletions forms/pgtoagenda.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</td>
</tr>
<td>
<label><strong>Pagamento realizado pela fonte: </strong></label>
<label><strong>Pagamento realizado pela fonte:</strong></label>
<select name="acessoCreditar" id="caixa" class="form-control"
tabindex="<?PHP echo ++$ind; ?>" <?PHP echo $desCampoCta; ?> >
<?php
Expand Down Expand Up @@ -179,11 +179,16 @@
id="multa" class="form-control" tabindex="<?PHP echo ++$ind; ?>"
value="<?php echo $itemagenda->multa();?>">
</div>
<div class="col-xs-3"><label>Pago em: (Atual -> <?php echo $datapgto;?>)</label> <input type="text" name="data"
<?php
$datapgto = ($datapgto=='') ? '' : '(Atual->'.$datapgto.')' ;
$detVenc = ($itemagenda->vencimento()=='') ? 'Data Venc.:' : 'Venc. Atual->
'.conv_valor_br($itemagenda->vencimento());
?>
<div class="col-xs-3"><label>Data Pgto:<?php echo $datapgto;?></label> <input type="text" name="data"
id="data" class="form-control" tabindex="<?PHP echo ++$ind; ?>" maxlength="10"
value="<?php echo $datapgto;?>">
</div>
<div class="col-xs-3"><label><label>Vencimento: ( Atual -> <?php echo conv_valor_br($itemagenda->vencimento());?>)</label> <input type="text" name="vencimento"
<div class="col-xs-3"><label><?php echo $detVenc;?></label><input type="text" name="vencimento"
id="venc" class="form-control" tabindex="<?PHP echo ++$ind; ?>"
required="required" value="<?php echo conv_valor_br($itemagenda->vencimento());?>">
</div>
Expand Down
4 changes: 2 additions & 2 deletions forms/tes/buscaAgenda.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
?>
<fieldset>
<legend>Busca por Despesas Agendadas</legend>
<table>
<table class='table'>
<tbody>
<tr>
<td>
Expand Down Expand Up @@ -69,7 +69,7 @@
</tbody>
</table>
<form method="get" action="" class="form-vertical" >
<table>
<table class='table'>
<tbody>
<tr>
<td><label>Despesas:</label>
Expand Down
23 changes: 8 additions & 15 deletions models/menutes.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,24 @@ function mostra (){
//Executa a query no MySQL com limite de linhas para ser usado pelo while e montar a array
//inicia o cabe?alho de pagina??o
?>
<br />
<div class="box">
<div class="box-outer">
<div class="box-inner">
<div class="box-titulo">
<h4>Recibos Recentes</h4>
<table class='table table-bordered'>
<div class="list-group">
<span class="list-group-item active">
<h5>Recibos Recentes</h5>
</span>
<table class='table table-bordered table-striped table-condensed text-center'>
<colgroup>
<col id="N&ordm;">
<col id="Nome">
<col id="albumCol"/>
</colgroup>
<thead>
<tr>
<tr class="info">
<th scope="col">N&ordm;</th>
<th scope="col">Nome</th>
<th scope="col">Data</th>
</tr>
</thead>
<tbody id="recibos" >
<tbody>
<?PHP
$inc_pen=0;
while($coluna_pen = mysql_fetch_array($sql3_pen))
Expand Down Expand Up @@ -100,11 +98,6 @@ function mostra (){
?>
</tbody>
</table>
</div></div></div></div>
<div class="box">
<div class="box-outer">
<div class="box-inner">
<div class="box-titulo">
<?PHP
//Classe que monta o rodape
$_rod_pen = new rodape($paginas_pen,$this->pag_mostra,"pag_mostra",$_urlLi_pen,4);//(Quantidade de p?ginas,$_GET["pag_rodape"],mesmo nome dado ao parametro do $_GET anterior ,"$_urlLi",links por p?gina)
Expand All @@ -117,7 +110,7 @@ function mostra (){
echo "Com este crit&eacute;rio n&atilde;o obtivemos nenhum resultado, tente melhorar seu argumento de pesquisa!";
}
?>
</div></div></div></div>
</div>
<?php
//Fim das informa??es das pendencias
//In?cio das pendencias de disciplinados
Expand Down
8 changes: 2 additions & 6 deletions models/tes/cadCargoIgreja.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
* Insere dados no banco do form cad_usuario.php na tabela:usuario
*/
controle ("tes");

if ((((!empty($_POST['rol']) || (!empty($_POST['nome']) && !empty($_POST['cpf']) && !empty($_POST['rg']))))
if (((!empty($_POST['rol']) || (!empty($_POST['nome']) && !empty($_POST['cpf']) && !empty($_POST['rg'])))
|| ($_POST['id']!='')) && $_GET['remover']=='' ) {
if ($_POST['id']!='') {
$atualCargo = new DBRecord ('cargoigreja',$_POST['id'],'id');
Expand All @@ -34,8 +33,7 @@
$atualCargo->Update();
} else {
$cadMembro = new tes_ativaCargo ($_POST['rolIgreja'],$_POST['idfunc'],$_POST['hierarquia']);
$ativarCad = $cadMembro->cadMembroCargo($_POST['rol'],$_POST['nome'].',CPF: '.$_POST['cpf'].',RG: '.$_POST['rg'],$_POST['valor'],$_POST['diapgto'],$_POST['fonte'],$_POST['acesso']);

$ativarCad = $cadMembro->cadMembroCargo($_POST['rol'],$_POST['nome'].',CPF: '.$_POST['cpf'].',RG: '.$_POST['rg'],$_POST['valor'],$_POST['diapgto'],$_POST['caixa'],$_POST['acesso']);
//print_r ($ativarCad);
if ($ativarCad['Desativado']=='1') {
$atualCad = 'uma atualização!';
Expand All @@ -44,15 +42,13 @@
}else {
$atualCad = '';
}

if ($ativarCad['Cadastro']>'0') {
$insertCad = ' Um cadastro!';
}else {
$insertCad = ' Erro! Nenhumm cadastro realizado!';
}
}
}elseif (!empty($_GET['remover'])) {

$desativa = new DBRecord ('cargoigreja',$_GET['id'],'id');
if ($_GET['remover']=='2') {
$desativa->status = '0'; //Aqui é atribuido a esta variável um valor para UpDate
Expand Down
9 changes: 2 additions & 7 deletions models/tes/tes_ativaCargo.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,22 @@ class tes_ativaCargo {
protected $hierarquia;

function tes_ativaCargo ($igreja=0,$descricao=0,$hierarquia=0) {

$this->igreja = $igreja;
$this->descricao = $descricao;
$this->hierarquia = $hierarquia;

}

function cadMembroCargo($rol,$nome,$valor,$diapgto,$fonte,$codDespesa) {
//Cadastra e atualiza o cargo se já estive outro com a mesmo função exceto Ministério
$hist = $_SESSION['valid_user'].": ".$_SESSION['nome'];

global $db;

//Se tiver alguem no mesmo cargo destiva
// Once you have a valid DB object named $db...
$table_name = 'cargoigreja';
$table_fields = array('status', 'hist');
$table_values = array('0', $hist );
$table_where = 'descricao = '.$this->descricao.' AND igreja = '.$this->igreja.
' AND hierarquia= '.$this->hierarquia.' AND descricao <> "17" ';

$sth = $db->autoPrepare($table_name, $table_fields,
DB_AUTOQUERY_UPDATE, $table_where);

Expand All @@ -41,8 +36,8 @@ function cadMembroCargo($rol,$nome,$valor,$diapgto,$fonte,$codDespesa) {
$desativadoCad = $db->affectedRows();

//Insert o membro no cargo
$sth = $db->prepare('INSERT INTO cargoigreja VALUES ("",?,"", ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
$data = array( $this->descricao,'1', $this->igreja, $rol, $nome, $this->hierarquia, $valor, $diapgto, $fonte,$codDespesa, $hist, date('Y-m-d H:i:s'));
$sth = $db->prepare('INSERT INTO cargoigreja VALUES (?,?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
$data = array( '',$this->descricao,'0','1', $this->igreja, $rol, $nome, $this->hierarquia, $valor, $diapgto, $fonte,$codDespesa, $hist, date('Y-m-d H:i:s'));
$db->execute($sth, $data);// Always check that result is not an error
if (PEAR::isError($res)) {
die($res->getMessage());
Expand Down
8 changes: 0 additions & 8 deletions models/tes/tes_listDisponivel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
class tes_listDisponivel extends List_sele {

function __construct (){

$this->tabela = 'contas';//
$this->campo_retorno = 'acesso';//Campo que ser� retornado
$this->texto_field = 'acesso';//O nome que ser� relaciondo ao campo de retorno para envio pelo form
$this->query = 'SELECT * from '.$this->tabela.' WHERE tipo="D" AND saldo > "0"';

$this->sql_lst = mysql_query($this->query.' AND nivel3="1.1.1" AND acesso>"0" ORDER BY codigo ');
}

Expand All @@ -16,7 +14,6 @@ function List_Selec ($caixa){
//Mostra as linhas de select
$linha1='';
$linhas ="<option value=''>Escolha a fonte pagadora!</option>";

while($campoList = mysql_fetch_array($this->sql_lst))
{
if ($campoList["acesso"]==$caixa) {
Expand All @@ -26,7 +23,6 @@ function List_Selec ($caixa){
$linhas .='<option value='.$campoList["acesso"].'>'.$campoList['titulo'].
' -> Saldo : '.number_format($campoList['saldo'],2,',','.').'</option>';
}

return $linha1.$linhas;
}

Expand All @@ -35,18 +31,14 @@ function List_Selec_pop ($link,$id){
//Mostra as linhas de select
$linha1='';
$linhas .="<option value='./?$link{$campoList["id"]}'>Todas</option>";

while($campoList = mysql_fetch_array($this->sql_lst))
{
if ($campoList["id"]==$id) {
$linha1 = "<option value='./?$link{$campoList["id"]}'>".$campoList['titulo']."</option>";
}
$linhas .="<option value='./?$link{$campoList["id"]}'>".$campoList['titulo']."</option>";
}

echo $linha1.$linhas;
}

}

?>
2 changes: 0 additions & 2 deletions painel_direito.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@

}elseif (ver_nome ("tesouraria")){//Menu Tesouraria
echo "</div>";
?>
<?php
//$menu = new menutes();
$recBuscas->mostra();
$recBuscas->buscarecibo();
Expand Down
29 changes: 15 additions & 14 deletions relatorio/busca_apresent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,51 @@
$query = "SELECT * FROM cart_apresentacao WHERE ";
switch ($_GET["campo"]) {
case "dt_nasc":
$query .= " DATE_FORMAT(dt_nasc,'%d/%m/%Y') = '".trim($_GET["valor"])."' ORDER BY nome ";
$query .= " DATE_FORMAT(dt_nasc,'%d/%m/%Y') = '".trim($_GET["valor"])."' ";
break;
case "dt_apresent":
$query .= " DATE_FORMAT(dt_apresent,'%d/%m/%Y') = '".trim($_GET["valor"])."' ORDER BY nome ";
$query .= " DATE_FORMAT(dt_apresent,'%d/%m/%Y') = '".trim($_GET["valor"])."' ";
break;
case "id_cong":
$query .= " {$_GET["campo"]} = '".trim($_GET["valor"])."' ORDER BY nome ";
$query .= " {$_GET["campo"]} = '".trim($_GET["valor"])."' ";
break;
default:
$query .= "{$_GET["campo"]} LIKE '%".trim($_GET["valor"])."%' ORDER BY nome ";
$query .= "{$_GET["campo"]} LIKE '%".trim($_GET["valor"])."%' ";
break;
}
$query .= 'ORDER BY rol DESC,nome';

$nmpp="10"; //N�mero de mensagens por p�rginas
$paginacao = Array();
$paginacao['link'] = "?"; //Pagina��o na mesma p�gina

//Faz os calculos na pagina��o
$sql2 = mysql_query ("$query") or die (mysql_error());
$total = mysql_num_rows($sql2) ; //Retorna o total de linha na tabela
$paginas = ceil ($total/$nmpp); //Retorna o total de p�ginas

if ($_GET["pagina1"]<1) {
$_GET["pagina1"] = 1;
} elseif ($_GET["pagina1"]>$paginas) {
$_GET["pagina1"] = $paginas;
}

$pagina = $_GET["pagina1"]-1;

if ($pagina<0) {$pagina=0;} //Especifica um valor p vari�vel p�gina caso ela esteja setada
$inicio=$pagina * $nmpp; //Retorna qual ser� a primeira linha a ser mostrada no MySQL
$sql3 = mysql_query ("$query"." LIMIT $inicio,$nmpp") or die (mysql_error());
//Executa a query no MySQL com limite de linhas para ser usado pelo while e montar a array

//inicia o cabe�alho de pagina��o

{
?>
<table class='table table-striped'>
<table class='table table-striped table-bordered'>
<colgroup>
<col id="Reg.">
<col id="Data">
<col id="Crian&ccedil;a">
<col id="Congregacao">
<col id="albumCol"/>
</colgroup>
<thead>
<tr>
<th scope="col">Reg.</th>
<th scope="col">Data</th>
<th scope="col">Crian&ccedil;a</th>
<th scope="col">Congrega&ccedil;&atilde;o</th>
Expand All @@ -78,9 +76,13 @@
{$cor="class='od2'";
}
?>
<tr "<?php echo "$cor";?>">
<tr "<?php echo $cor;?>">
<td><?php printf ("%'04u",$coluna["rol"]);?></td>
<td><?php echo conv_valor_br ($coluna["dt_apresent"]);?></td>
<td><a href="./?escolha=relatorio/dados_apresent.php&menu=top_formulario&rol=<?php echo $coluna["rol"];?>"><?php echo $coluna["nome"];?></a></td>
<td><a href="./?escolha=relatorio/dados_apresent.php&menu=top_formulario
&rol=<?php echo $coluna["rol"];?>" target="_blank"><?php echo $coluna["nome"];?>
<span class="glyphicon glyphicon-new-window" aria-hidden="true"></span></a>
</td>
<td><?php echo $congrega->razao();?></td>
<td><?php echo $coluna["mae"];?></td>
</tr>
Expand Down Expand Up @@ -115,6 +117,5 @@
}else{
echo "Voc&ecirc; n&atilde;o colocou nenhum crit&eacute;rio de pesquisa!";
}

?>
</fieldset>
Loading

0 comments on commit 8758e68

Please sign in to comment.