| 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/mnova21/modulos/movimento/ |
Upload File : |
<?php
/**
* Criado por PhpStorm.
* Projeto: SGAE.
* Arquivo: ordcompra_edt.php.
* Usuário: RalpAlves
* Data: 15/09/2015
* Hora: 13:33
*/
mysql_select_db($banco, $conexao);
$cod_id = $_GET['cod_id'];
$rsResult = mysql_query("SELECT * FROM v_lista_ordem_compra where odc_id=$cod_id");
$row = mysql_fetch_array($rsResult);
$id_prg = $row['prg_id'];
$rsItens = mysql_query("SELECT * FROM v_lista_ordem_compra_itens where oci_odc_id=$cod_id and oci_prg_id=$id_prg ORDER BY pro_produto");
$mes = date('m');
$rsSaldo = mysql_query("SELECT sigla, valor, sum(oci_vrusado) as oci_vrusado, valor-sum(oci_vrusado) as oci_vrsaldo FROM v_lista_ordem_compra_valor_real where mes=$mes and SUBSTRING(odc_data,4,2) = $mes");
$saldo = mysql_fetch_array($rsSaldo);
$ioc = mysql_fetch_array($rsResult);
?>
<head xmlns="http://www.w3.org/1999/html">
<script type="text/javascript">
$(document).ready(function () {
$('#tabela').DataTable({
"pagingType": "full_numbers", "lengthMenu": [[8, 25, 50, -1], [8, 25, 50, "Todos"]], stateSave: true, "oLanguage": {
"sProcessing": "Processando. Aguarde...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "NENHUM REGISTRO ENCONTRADO!",
"sInfo": "Mostrando _START_ até _END_ de _TOTAL_ registros",
"sInfoEmpty": "Mostrando 0 até 0 de 0 registros",
"sInfoFiltered": "(de _MAX_ registros no total)",
"sInfoPostFix": "",
"sSearch": "<em class='fa fa-search' title='pesquisar'></em>",
"sUrl": "",
"oPaginate": {
"sFirst": "<em class='fa fa-angle-double-left' title='primeiro registro'>",
"sPrevious": "<em class='fa fa-arrow-circle-left' title='registro anterior'></em>",
"sNext": "<em class='fa fa-arrow-circle-right' title='próximo registro'></em>",
"sLast": "<em class='fa fa-angle-double-right ' title='último registro'>"
}
}
});
});
</script>
<script type="text/javascript" language="javascript">
function atualiza(codCon) {
var Qtd = document.getElementById('vqtd' + codCon).value;
$.ajax({
type: "GET", url: './modulos/movimento/ordcompra_insitem.php?qtd=' + Qtd + '&codcon=' + codCon, dataType: "html", success: function (resultado) {
$('#LicCont').html(resultado);
//alert(resultado)
}
});
//alert ('Quantidade: ' + Qtd + ' do produto: ' + codCon + ' adicinada com sucesso!');
//location.reload();
}
</script>
<script>
function Mudarestado(el) {
var display = document.getElementById(el).style.display;
if (display == "none")
document.getElementById(el).style.display = 'block';
else
document.getElementById(el).style.display = 'none';
}
</script>
</head>
<body style="padding-top: 70px;"/>
<div class="container">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
<button type="submit" id="#sign-up" name="bt_novo" class="btn botao_esquerda" onClick="location.href='?page=movimento/ordcompra'"><span class="glyphicon
glyphicon-arrow-left" title="voltar"/></button>
<span style="font-size:20px;"> Ordem de compra nº </span><b><?php echo $row['odc_numordcomp'] ?></b>
<a href="modulos/movimento/rel_ordcompra.php?id=<?=$cod_id?>"
target='_blank'>
<i class="glyphicon glyphicon-print text-print botao_direita" title="gerar PDF"></i>
</a>
</h3>
</div>
<div class="row">
<div class=" col-md-12 col-lg-12 col-xs-12">
<table class="table table-user-information">
<tbody>
<tr>
<td><b>ID:</b></td>
<?php echo "<td>" . $row['odc_id'] . "</td>" ?>
<td><b>Unidade gestora:</b></td>
<?php echo "<td>" . $row['uo_nome'] . "</td>" ?>
</tr>
<tr>
<td><b>Programa:</b></td>
<?php echo "<td>" . $row['prg_programa'] . "</td>" ?>
<td><b>Nº proc. licitatório:</b></td>
<?php echo "<td>" . $row['cpl_numproc_lic'] . "</td>" ?>
</tr>
<tr>
<td><b>Fornecedor:</b></td>
<?php echo "<td>" . utf8_encode($row['pes_pessoa']) . "</td>" ?>
<td><b>Cardápio:</b></td>
<?php echo "<td>" . $row['cdp_id'] . '-' . utf8_encode($row['cdp_nmcardapio']) . ' (repete: ' . ($row['odc_repete']) . ')' . "</td>" ?>
</tr>
<tr>
<td><b>Data:</b></td>
<?php echo "<td>" . utf8_encode($row['odc_data']) . "</td>" ?>
<td><b>Período</b></td>
<?php echo "<td>" . $row['odc_dtinic'] . " a " . $row['odc_dtfim'] . "</td>" ?>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="lista">
<div class='panel panel-body panel-primary'>
<form id='frm_pesq' method='post'>
<div class='centro'>
<div>
<b><span style="font-size:14px;color: black;">Valor disponível para <?php echo '<b><span style="color: #8a6d3b"> ' . utf8_encode($saldo['sigla']) . '</span></b>:' ?>
</span>R$ <?=number_format($saldo['valor'], 2, ',', '.')?></b> |
<b><span style="font-size:13px;color: #843534;">utilizado: </span>R$ <?=number_format($saldo['oci_vrusado'], 2, ',', '.')?></b> |
<b><span style="font-size:13px;color: #008000;">Saldo: </span>R$ <?=number_format($saldo['oci_vrsaldo'], 2, ',', '.')?></b>
</div>
<div class='panel-body'>
<button type='submit' name='bt_refresh' class='btn' onclick='location.reload()'>
<i class="fa fa-check" title="Atualizar ordem de compra"></i>
</button>
</div>
</div>
<table class='tabe1 table table-striped table-hover dt-responsive' cellspacing='0' width='100%' border='0'>
<thead>
<tr>
<th>ID</th>
<th>Produto</th>
<th>Und.</th>
<th style='text-align: center;'>Programa</th>
<th style='text-align: right;'>Licitado</th>
<th style='text-align: right;'>Saldo</th>
<th style='text-align: right;'>Quant.</th>
<th style='text-align: right;'>Valor Unt.</th>
<th style='text-align: right;'>Total</th>
<th class="text-center"></th>
</tr>
</thead>
<tbody>
<?php
$numorc = $row['odc_numordcomp'];
while ($r = mysql_fetch_array($rsItens)) {
$cod_id = $r['oci_id'];
$cod_pd = $r['oci_item_id'];
$cod_prg = $r['oci_prg_id'];
$cod_oc = $r['odc_id'];
$cod_pip = $r['oci_pip_id'];
$id_ordem = $row['odc_id'];
$cdp_id = $row['cdp_id'];
//SALDO DO PRODUTO
$rsSaldo = mysql_query("SELECT * FROM v_l_saldo_licitacao where pip_id='$cod_pip'");
$sal = mysql_fetch_array($rsSaldo);
//LISTA ITENS DO CARDAPIO PARA COMPARACAO
$icard = mysql_query("SELECT * FROM v_lista_ordem_compra_itens_cardapio where ref_cdp_id='$cdp_id' and prd_proid=$cod_pd");
$ic = mysql_fetch_array($icard);
//TOTAL DE ALUNOS POR PROGRAMA
$i_tot = mysql_query("SELECT * FROM v_lista_total_alunos_programas WHERE esp_prg_id = $cod_prg");
$t = mysql_fetch_array($i_tot);
echo "<tr>";
echo "<td>" . $r['oci_id'] . "</td>";
//VERIFICAR SE ITEM EXISTE NO CARDAPIO
if ($ic['prd_proid']==$cod_pd) {
echo "<td style='color: #008000;' class='text-orange-2'>" . utf8_encode($r['pro_produto']) . '-' . $r['oci_item_id'] . "</td>";
} else {
echo "<td style='color: #df3814;'>" . utf8_encode($r['pro_produto']) . '-' . $r['oci_item_id'] . "</td>";
}
echo "<td>" . $r['und_desc'] . "</td>";
echo "<td style='text-align: center;'><b>" . $r['prg_programa'] . "</b></td>";
//LICITADO
echo "<td style='text-align: right; color: #008000;'><b>" . number_format($sal['pip_qtd'], 0, '.', '.') . "</b></td>";
//SALDO
if ($r['oci_quant'] > $sal['saldo']) {
echo "<td style='text-align: right; color: #ba2f14;' title='saldo negativo!'><b class='piscar-red'><i class='fa fa-exclamation-triangle'></i> " . number_format($sal['saldo'], 0, '.', '.') . "</b></td>";
} else {
echo "<td style='text-align: right; color: #008000;'><b>" . number_format($sal['saldo'], 0, ',', '.') . "</b></td>";
}
//CALCULO DA QUANTIDADE A PEDIR
$alunos = $t['total_prg'];
$percap = $ic['prd_percapta'];
$repete = $r['odc_repete'];
// $pedir = ceil(number_format((($percap * $alunos) * $repete), 2, ',', '.'));
$_calc = (($percap * $alunos) * $repete);
$pedir = ceil($_calc);
//if ($r['oci_situ_ent']=='1') {
// echo "<td style='text-align: right;'>" . number_format($r['oci_quant'], 2, ',', '.') . "</td>";
// } else {
$v_quant = number_format($r['oci_quant'], 2, ',', '.');
echo "<td style='text-align: right;'>
<input type='text' onblur='atualiza($cod_id)' onkeyup='formataValor(this,event)' required name='txt_qtd'
id='vqtd" . $cod_id . "' autofocus class='form-control input-sm' value='$v_quant'>
</td>";
// }
echo "<td style='text-align: right;'>" . number_format($r['oci_vrunit'], 2, ',', '.') . "</td>";
echo "<td style='text-align: right;'>" . number_format($r['oci_vrtotal'], 2, ',', '.') . "</td>";
//if ($ic['prd_proid']!=$cod_pd) {
echo "<td class='text-center'><a href='?page=movimento/ordcompra_crud&cod_id=$cod_id&odc_id=$id_ordem&var_acao=exc_ordem_item'>
<em class='fa fa-trash text-red' title='Excluir registro' onclick='excluir_registro(event);'/></a></td>";
echo "</tr>";
//} else {
// echo "<td class='text-center'><a href='#'>
// <em class='fa fa-check-circle text-green_grid' title='Registro consta no cardápio' onclick='excluir_registro(event);'/></a></td>";
///echo "</tr>";
// }
}
?>
</tbody>
</table>
</form>
<div class="container form-group">
<div class="row col-md-12 text-center">
<a href='?page=movimento/ordcompra_crud&cod_id=<?php echo $cod_id ?>&odc_id=<?php echo $id_ordem ?>&cdp_id=<?php echo $cdp_id ?>&var_acao=exc_ordem_item_fora_cardapio'>
<em class='fa fa-trash text-red' title='Excluir registros' onclick='excluir_registro(event);'>
<span>Excluir itens que não fazem parte do cardápio</span>
</em>
</a>
</div>
</div>
</div>
</div>
</div>