Viewing File: /home/cienp/public_html/portal/sql_patr_marc.php
<?
$dt_atua = date("Y-m-d");
echo ".";
switch ($_POST[opc]){
case "ins":
require "$this->include_dir/conecta.php";
$s_de_marc = protecao($_POST[de_marc]);
$sql = "INSERT INTO ".$pref_tabl."patr_marc ";
$sql .= "(de_marc, dt_cads, id_cads) ";
$sql .= "VALUES ('$s_de_marc', '$dt_atua', $linhau[id_user])";
#echo $sql;
$res = mysqli_query($conn, $sql);
if ($res) {
$onde = "index1.php?pg=ins_patr_marc&certo=S";
} else
$onde = "index1.php?pg=ins_patr_marc&certo=N";
break;
case "alt":
$erros = 0;
require "$this->include_dir/conecta.php";
if ($erros == 0) {
$s_de_marc = protecao($_POST[de_marc]);
$s_fl_atvo = protecao($_POST[fl_atvo]);
$s_id_marc = protecao($_POST[id_marc],'inteiro');
$sql = "UPDATE ".$pref_tabl."patr_marc ";
$sql .= "SET de_marc = '$s_de_marc', ";
$sql .= "id_altr = '$linhau[id_user]', ";
$sql .= "dt_altr = '$dt_atua', ";
$sql .= "fl_atvo = '$s_fl_atvo' ";
$sql .= "WHERE id_marc = $s_id_marc ";
$sql .= "LIMIT 1";
$res = mysqli_query($conn, $sql);
if ($res) {
$onde = "index1.php?pg=alt_patr_marc&certo=S";
} else
$onde = "index1.php?pg=alt_patr_marc&certo=N";
}
break;
}
?>
<form name="retorna" method="post" action="">
<input type="hidden" name="id_marc" id="id_marc" value="<?=$_POST[id_marc]?>">
<input type="hidden" name="v_de_marc" id="v_de_marc" value="<?=$_POST[v_de_marc]?>">
<input type="hidden" name="v_fl_atvo" id="v_fl_atvo" value="<?=$_POST[v_fl_atvo]?>">
<input name="passa" type="hidden" id="passa" value="yes">
</form>
<?
echo "<SCRIPT LANGUAGE=javascript> \n";
echo "document.retorna.action = '$onde'; \n";
echo "document.retorna.submit(); \n";
echo "</script>";
?>
Back to Directory
File Manager