Skip to content

Commit

Permalink
Bug impressão corrigido
Browse files Browse the repository at this point in the history
  • Loading branch information
hiltonbruce committed Apr 3, 2014
1 parent 3f8257e commit e525a74
Show file tree
Hide file tree
Showing 22 changed files with 118 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/fotos_igreja
/func_class/constantes.php
/flash
/docs
/_notes
Expand All @@ -11,4 +12,3 @@
.directory
.buildpath
.project
func_class/constantes.php
Empty file modified .metadata/.lock
100644 → 100755
Empty file.
Empty file modified .metadata/.log
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified .metadata/.plugins/org.eclipse.core.resources/.root/2.tree
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified .metadata/.plugins/org.eclipse.dltk.core/Containers.dat
100644 → 100755
Empty file.
Empty file modified .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
100644 → 100755
Empty file.
Empty file modified .metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml
100644 → 100755
Empty file.
Empty file modified .metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml
100644 → 100755
Empty file.
Empty file modified .metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
100644 → 100755
Empty file.
Empty file modified .metadata/version.ini
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions controller/limpeza.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ function __autoload ($classe) {
require_once ("aniv/style.css");
echo "</style>";
//Mostrar totalizador dentro da aplicação
echo '<a href="./controller/limpeza.php?limpeza=1"><button type="button">Imprimir totalizador</button></a>';
$todascongreg = './models/limplisttotcong.php';//Lista os pedidos das outras congregações
echo '<a href="controller/limpeza.php?limpeza=1"><button type="button">Imprimir totalizador</button></a>';
$todascongreg = 'models/limplisttotcong.php';//Lista os pedidos das outras congregações
require_once 'views/limpezatot.php';
break;
case '3':
Expand Down
64 changes: 64 additions & 0 deletions help/tes/tabLimpeza.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
//Monta a tabela
foreach ($tbodytab->tabelaLimp($congregcao->rol()) as $key => $valor){
$inclimp++;
//Faz o trabalho de zebrar a tabela
if ($inclimp%2=="0") {
echo "<tr class='odd' >";
} else {
echo '<tr>';
}
list($colUnid,$colDescr,$colQuant1,$colQuant2,$colQuant3) = explode(",", $valor);

/*
* Extrai o 1º valor e atribui para a variável adequada a coluna
*/
list($mesRef1,$valor1) = explode (' ',$colQuant1);
if ($mesRef1==$mesref) {
$valorAtual = $valor1;
}elseif ($mesRef1==$periodo['1']) {
$valorAnt1 = $valor1;
}elseif ($mesRef1==$periodo['2']){
$valorAnt2 = $valor1;
}

/*
* Extrai o 2º valor e atribui para a variável adequada a coluna
*/
list($mesRef2,$valor2) = explode (' ',$colQuant2);
if ($mesRef2==$periodo['1']) {
$valorAnt1 = $valor2;
}elseif ($mesRef2==$periodo['2']){
$valorAnt2 = $valor2;
}

/*
* Extrai o 3º valor e atribui para a variável adequada a coluna
*/
list($mesRef3,$valor3) = explode (' ',$colQuant3);
if ($mesRef3==$periodo['2']){
$valorAnt2 = $valor3;
}

//echo $key.' - '.$valor;//Coluna Item
printf("<td>%'03u</td>",$key);

//Coluna Anterior1
printf("<td style='text-align: center;'>%s</td>",$valorAnt2);
//Coluna Anterior2
printf("<td style='text-align: center;'>%s</td>",$valorAnt1);

//Coluna Unidade
printf("<td>%s</td>",$colUnid);

//Coluna Discriminação
echo '<td> '.$colDescr.' </td>';//Modificar qdo apliar para outros documentos

//Coluna Atual
printf("<td style='text-align: center;'>%s</td></tr>",$valorAtual);

$valorAtual=''; $valorAnt1 =''; $valorAnt2 ='';

}

?>
50 changes: 50 additions & 0 deletions models/limplista.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,56 @@ function tabelaLimp ($igreja) {

}

function tabLimp ($igreja) {
$sql = 'SELECT l.quant,p.discrim,p.unid,p.quant as qunid ';
$sql .= 'FROM limpezpedid AS l, limpeza AS p ';
$sql .= 'WHERE igreja = "'.$igreja.'" AND mesref="'.$this->mesref.'" AND ';
$sql .= 'p.id = l.item ORDER BY p.discrim ';
$sqlLimp = mysql_query($sql);
$incrrc=0; //indece p/ zebrar tabela
$this->tabtbody = ''; //Limpa variável para receber os dados da tabela


if (mysql_num_rows($sqlLimp)>0) {

while($lista = mysql_fetch_array($sqlLimp)){

//Faz o trabalho de zebrar a tabela
if ($inclimp%2=="0") {
$this->tabtbody .= "<tr class='odd' >";
} else {
$this->tabtbody .= '<tr>';
}

++$inclimp;

//Coluna Item
$this->tabtbody .= sprintf("<td>%'03u</td>",$inclimp);

//Coluna Unidade
$this->tabtbody .= sprintf("<td>%s %s</td>",$lista['qunid'],$lista['unid']);

//Coluna Discriminação
$this->tabtbody .= '<td> '.$lista['discrim'].' </td>';//Modificar qdo apliar para outros documentos

//Coluna Quantidade Solicitada
$this->tabtbody .= sprintf("<td style='text-align: center;'>%s</td>",$lista['quant']);

//Coluna Quantidade entregue
$this->tabtbody .= "<td></td>";

}

}else {
//Coluna Quantidade entregue
$this->tabtbody .= "<td colspan='5'> Nenhum item Solicitado</td>";

}

return $this->tabtbody;

}

public function TotMaterial() {
//Select mysql na tabela limpeza para listar o total para o período

Expand Down
2 changes: 1 addition & 1 deletion models/limplisttotcong.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</tr>
</thead>
<tbody>';
$tabtodas .= $tbodytab->tabelaLimp ($roligreja['rol']);//$tbodytab->tabelaLimp($roligreja['rol']) -> vem do script que o chama /views/limpezatot.php
$tabtodas .= $tbodytab->tabLimp ($roligreja['rol']);//$tbodytab->tabelaLimp($roligreja['rol']) -> vem do script que o chama /views/limpezatot.php

$tabtodas .= '</tbody></table>';
$tabtodas .= '<fieldset><legend>Obs.:</legend> As congregações que não enviarem a lista de material de limpeza
Expand Down
Empty file modified views/limpezaLista.php
100644 → 100755
Empty file.

0 comments on commit e525a74

Please sign in to comment.