| Server IP : 20.75.53.88 / Your IP : 216.73.217.72 [ Web Server : Apache System : Linux VMRALP-3 4.4.0-256-generic #290~14.04.1-Ubuntu SMP Thu Jun 20 09:24:50 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29+esm15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Domains : 3 Domains MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/merenda/mnova20/modulos/escola_almox/ |
Upload File : |
<?php
/**
* Criado por PhpStorm.
* Projeto: SGAE.
* Arquivo: remessaavulsa_edt.php.
* Usuário: RalpAlves
* Data: 19/07/2015
* Hora: 16:10
*/
session_start();
$prefeitura = $_SESSION['prefeitura'];
$cod_id = $_GET['cod_id'];
$escid = explode('|', $_POST['txt_escola']);
$escn = $escid[1];
$esci = $escid[0];
$entradas = mysql_query("SELECT * FROM v_lista_saldo_entrada_produtos_avulsa WHERE esc_esc_id=$esci");
?>
<body>
<head>
<title> | Saldo</title>
<script>
function cont() {
var conteudo = document.getElementById('print').innerHTML;
tela_impressao = window.open('Saldo de produtos');
tela_impressao.document.write(conteudo);
tela_impressao.window.print();
tela_impressao.window.close();
}
</script>
</head>
<!--FORMULARIO-->
<body style="margin-top: 55px;"/>
<div id='print' class='container'>
<div class="container panel panel-primary">
<div class="panel-body">
<p><?php echo $esci . '-' . $escn ?></p>
<SPAN style="font-size:18px;">Saldo de Produtos</SPAN>
<a href="modulos/escola_almox/remessa_saldo_avulso_pdf.php?txt_escola=<? echo $esci ?>&escola=<?php echo $escn ?>"
target='_blank'> <i class="glyphicon glyphicon-print text-print navbar-right" title="Imprimir saldo"></i>
</a>
</div>
</div>
<!--ITENS DA REMESSA-->
<div class="container">
<div class="panel with-nav-tabs panel-primary">
<div class="panel-heading">
</div>
<div class="panel-body">
<div class="tab-content">
<div class="panel panel-body panel-primary">
<table class="tabe1 table table-striped table-hover dt-responsive' cellspacing='0' width='100%' border='0'">
<thead>
<tr>
<!-- <th>ID</th>-->
<th style="text-align: left; font-size: 12px;" width="55%">Produto</th>
<th style="text-align: left; font-size: 12px;" width="2%">Unidade</th>
<th style="font-size: 12px;" class='direita'>Provisionado</th>
<!-- <th style="font-size: 12px;" class='direita'>Implantação</th>-->
<th style="font-size: 12px;" class='direita'>Remessas</th>
<th style="font-size: 12px;" class='direita'>Saídas</th>
<th style="font-size: 12px;" class='direita'>Saldo</th>
</tr>
</thead>
<tbody>
<?php
while ($entra = mysql_fetch_array($entradas)) {
$cod_pd = $entra['pro_id'];
$saidas = mysql_query("select * from v_lista_saldo_saida_produtos_avulsa_escola WHERE pro_id=$cod_pd and ra_escola=$esci");
$sai = mysql_fetch_array($saidas);
$implanta = mysql_query("select * from v_lista_saldo_implantacao_produtos_avulsa_escola WHERE imi_codprod=$cod_pd and imp_esc_id=$esci");
$inv = mysql_fetch_array($implanta);
$provisao = mysql_query("SELECT * FROM v_lista_saldo_entrada_produtos_avulsa_provisao WHERE esc_esc_id=$esci and pro_id=$cod_pd");
$imp = mysql_fetch_array($provisao);
$saldo = ($entra['entradas'] + $inv['implanta']) - ($sai['saidas']);
// $saldo = ($entra['entradas']) - ($sai['saidas']);
echo "<tr>";
echo "<td style='font-size: 15px;font-weight: bold;'>" . utf8_encode($entra['pro_produto']) . '-' . $entra['pro_id'] . "</td>";
echo "<td style='font-size: 15px;'>" . $entra['und_desc'] . "</td>";
echo "<td style='color: #cc661a; font-weight: bold; text-align: right; font-size: 15px;'>" . floatval($imp['entradas']) . "</td>";
// echo "<td style='color: #374850; font-weight: bold; text-align: right; font-size: 15px;'>" . floatval($inv['implanta']) . "</td>";
echo "<td style='color: darkgreen; font-weight: bold; text-align: right; font-size: 15px;'>" . (floatval($entra['entradas'])+floatval($inv['implanta'])) . "</td>";
// echo "<td style='color: darkgreen; font-weight: bold; text-align: right; font-size: 15px;'>" . number_format($imp['implanta'], 2, ',', '.') . "</td>";
echo "<td style='color: #920826; font-weight: bold; text-align: right; font-size: 15px;'>" . floatval($sai['saidas']) . "</td>";
if ($saldo > 0) {
echo "<td style='color: blue; font-weight: bold; text-align: right; font-size: 15px;'>" . floatval($saldo) . "</td>";
} else {
echo "<td style='color: red; font-weight: bold; text-align: right; font-size: 15px;'>" . floatval($saldo) . "</td>";
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</body>