| Server IP : 20.75.53.88 / Your IP : 216.73.217.138 [ 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/vicosa22/modulos/produto/ |
Upload File : |
<?php
/**
* Created by PhpStorm.
* User: RalpAlves
* Date: 04/03/15
* Time: 14:02
*/
ini_set('display_errors', 'off');
error_reporting(E_ALL ^ E_DEPRECATED);
/*if (isset($_POST['txt_pesq'])) {
$ntb = $_POST['txt_pesq'];
}*/
$ult_cod = &$_GET['cod_produto'];
mysql_select_db($banco, $conexao);
$rs_grp = mysql_query("SELECT * FROM grupoprod where grp_ativo='1'");
$rs_und = mysql_query("SELECT * FROM unidade where und_ativo='1'");
$rs_ebu = mysql_query("SELECT * FROM embalunit where ebu_ativo='1'");
$rs_ebs = mysql_query("SELECT * FROM embalsecund where ebs_ativo='1'");
$rs_mrc = mysql_query("SELECT * FROM marca where mrc_ativo='1'");
$rs_nat = mysql_query("SELECT * FROM natureza where nat_ativo='1'");
?>
<head>
<script>
function combo(id, acao, valor) {
$.ajax({
type: "GET",
url: '../../ajax.php?a=' + acao + '&valor=' + valor,
dataType: "html",
success: function (resultado) {
//alert(resultado);
$('#' + id).html(resultado);
//$('#resposta').html(resultado);
}
});
}
</script>
</head>
<!--FORM DE PRODUTOS-->
<!--<div class="container">
<button type="submit" name="bt_novo" class="btn" onclick=location.href='?page=./produto/produto'><i class="fa fa-arrow-left" title="voltar"></i></button>
</div>-->
<body style="padding-top: 40px;"/>
<form id="form1" name="form1" id="cad_produto" method="post" action="?page=./produto/produto_ins&var_acao=cadastrar">
<div class="container">
<div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title">
<button type="submit" name="bt_novo" class="btn botao_esquerda" onClick="location.href='?page=./produto/produto'">
<span class="fa fa-arrow-left" title="voltar"/></button></button>
<span style="font-size:20px;padding: 10px;"> Produto | Cadastro</span>
<button type="submit" name="bt_novo" class="btn botao_direita" title="salvar"><i class="fa fa-check"></i></button>
</div>
</div>
</div>
<!--
EDICAO DE PRODUTOS
-->
<div id="id_form" class="container">
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12 panel-body">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
<label for="">ID:</label>
<input type="text" name="txt_ID" readonly value="<?php echo $ult_cod ?>" size="4px" style="text-align: center;" class="form-control">
</div>
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
<label for="">Descrição do Produto</label>
<input type="text" name="txt_descricao" size="40" required autofocus class="form-control" style="text-transform: uppercase;">
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12 panel-body">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<label for="">Especificações Técnicas</label>
<textarea rows="3" cols="5" name="txt_especificacao" class="form-control"></textarea>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12 panel-body">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<label for="">Valor</label>
<input type="text" name="txt_valor" size="40" onkeyup="formataValor(this,event)" class="form-control" value="0">
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<label for="">Grupo do Produto</label>
<!--ADD DE OUTRO MÓDULO-->
<a class='janela70 text-black' href="index2.php?page=produto/marca"> <i class='glyphicon glyphicon-plus'></i></a>
<i class='glyphicon glyphicon-refresh' onclick="combo('grupo_produto','sel_grupoProduto','0')" style="cursor: hand;"></i>
<!--ADD DE OUTRO MÓDULO-->
<div id='grupo_produto'>
<select name="txt_grupo_produto" class="form-control select2">
<?php while ($_grp = mysql_fetch_array($rs_grp)) { ?>
<option value="<?php echo $_grp['grp_id'] ?>"><?php echo utf8_encode($_grp['grp_grupo']) ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<label for="">natureza</label>
<select name="txt_natureza" class="form-control select2">
<?php while ($_nat = mysql_fetch_array($rs_nat)) { ?>
<option value="<?php echo $_nat['nat_id'] ?>"><?php echo utf8_encode($_nat['nat_desc']) ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12 panel-body">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<label for="">marca do Produto</label>
<!--ADD DE OUTRO MÓDULO-->
<a class='janela70 text-black' href="index2.php?page=produto/marca"> <i class='glyphicon glyphicon-plus'></i></a>
<i class='glyphicon glyphicon-refresh' onclick="combo('marca_produto','sel_marcaProduto','0')" style="cursor: hand;"></i>
<!--ADD DE OUTRO MÓDULO-->
<div id='marca_produto'>
<select name="txt_marca_prod" class="form-control select2">
<?php while ($_mrc = mysql_fetch_array($rs_mrc)) { ?>
<option value="<?php echo $_mrc['mrc_id'] ?>"><?php echo utf8_encode($_mrc['mrc_marca']) ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<label for="">unidade</label>
<!--ADD DE OUTRO MÓDULO-->
<a class='janela70 text-black' href="index2.php?page=produto/unidade"> <i class='glyphicon glyphicon-plus'></i></a>
<i class='glyphicon glyphicon-refresh' onclick="combo('unidade','sel_unidade','0')" style="cursor: hand;"></i>
<!--ADD DE OUTRO MÓDULO-->
<div id='unidade'>
<select name="txt_unidade_produto" class="form-control select2">
<?php while ($_und = mysql_fetch_array($rs_und)) { ?>
<option value="<?php echo $_und['und_id'] ?>"><?php echo utf8_encode($_und['und_desc']) ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<label for="">Peso Unitário</label>
<input type="text" name="txt_peso_unitario" required onkeyup="formataValor(this,event)" class="form-control">
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12 panel-body">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<label for="">Unidade compra</label>
<!--ADD DE OUTRO MÓDULO-->
<a class='janela70 text-black' href="index2.php?page=produto/embunit"> <i class='glyphicon glyphicon-plus'></i></a>
<i class='glyphicon glyphicon-refresh' onclick="combo('unidadeCompra','sel_unidadeCompra','0')" style="cursor: hand;"></i>
<!--ADD DE OUTRO MÓDULO-->
<div id='unidadeCompra'>
<select name="txt_emb_unitaria" class="form-control select2">
<?php while ($_ebu = mysql_fetch_array($rs_ebu)) { ?>
<option value="<?php echo $_ebu['ebu_id'] ?>"><?php echo utf8_encode($_ebu['ebu_desc']) ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="ccol-lg-4 col-md-4 col-sm-4 col-xs-12">
<label for="">Unidade armazenamento</label>
<!--ADD DE OUTRO MÓDULO-->
<a class='janela70 text-black' href="index2.php?page=produto/embsec"> <i class='glyphicon glyphicon-plus'></i></a>
<i class='glyphicon glyphicon-refresh' onclick="combo('unidadeArmazenamento','sel_unidadeArmazenamento','0')" style="cursor: hand;"></i>
<!--ADD DE OUTRO MÓDULO-->
<div id='unidadeArmazenamento'>
<select name="txt_emb_secundaria" class="form-control select2">
<?php while ($_ebs = mysql_fetch_array($rs_ebs)) { ?>
<option value="<?php echo $_ebs['ebs_id'] ?>"><?php echo utf8_encode($_ebs['ebs_desc']) ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<label for="">Cont. und. armazenamento</label>
<input type="text" name="txt_cont_emb_sec" onkeyup="formataValor(this,event)" class="form-control">
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
<label for="">Fator correção</label>
<input type="text" name="txt_fcorrecao" class="form-control">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
<label for="">Indíce cocção</label>
<input type="text" name="txt_icoccao" class="form-control">
</div>
</div>
</div>
<br>
<div id="id_form_2" class="container panel-body">
<div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title">
<p style="font-size:20px;"> Composição Centesimal</p>
</div>
</div>
</div>
<div class="col-md-2">
Energia |Kcal|
<input type="text" name="txt_energia" class="form-control">
</div>
<div class="col-md-2">
Carboidratos |g|
<input type="text" name="txt_carboidrato" class="form-control">
</div>
<div class="col-md-2">
Proteinas |g|
<input type="text" name="txt_proteina" class="form-control">
</div>
<div class="col-md-2">
Lipídios |g|
<input type="text" name="txt_lipidios" class="form-control">
</div>
<div class="col-md-2">
Fibras |g|
<input type="text" name="txt_fibras" class="form-control">
</div>
<div class="col-md-2">
Vitamina A |mg|
<input type="text" name="txt_vit_a" class="form-control">
</div>
<div class="col-md-2">
Vitamina C |mg|
<input type="text" name="txt_vit_c" class="form-control">
</div>
<div class="col-md-2">
Cálcio |mg|
<input type="text" name="txt_calcio" class="form-control">
</div>
<div class="col-md-2">
Ferro |mg|
<input type="text" name="txt_ferro" class="form-control">
</div>
<div class="col-md-2">
Magnésio |mg|
<input type="text" name="txt_magnesio"class="form-control">
</div>
<div class="col-md-2">
Zinco |mg|
<input type="text" name="txt_zinco" class="form-control">
</div>
<div class="col-md-2">
Sódio |mg|
<input type="text" name="txt_sodio" class="form-control">
</div>
</div>
</form>
</html>