Viewing File: /home/cienp/public_html/portal/sql_labt.php
<?
$dt_atua = date("Y-m-d");
echo ".";
switch ($_POST[opc]){
case "ins":
require "$this->include_dir/conecta.php";
$s_nm_labt = protecao($_POST[nm_labt]);
$sql = "INSERT INTO ".$pref_tabl."labt ";
$sql .= "(nm_labt, dt_cads, id_cads) ";
$sql .= "VALUES ('$s_nm_labt', '$dt_atua', $linhau[id_user])";
#echo $sql;
$res = mysqli_query($conn, $sql);
if ($res) {
$onde = "index1.php?pg=ins_labt&certo=S";
} else
$onde = "index1.php?pg=ins_labt&certo=N";
break;
case "alt":
$erros = 0;
require "$this->include_dir/conecta.php";
if ($erros == 0) {
$s_nm_labt = protecao($_POST[nm_labt]);
$s_fl_atvo = protecao($_POST[fl_atvo]);
$s_id_labt = protecao($_POST[id_labt],'inteiro');
$sql = "UPDATE ".$pref_tabl."labt ";
$sql .= "SET nm_labt = '$s_nm_labt', ";
$sql .= "id_cads = '$linhau[id_user]', ";
$sql .= "dt_cads = '$dt_atua', ";
$sql .= "fl_atvo = '$s_fl_atvo' ";
$sql .= "WHERE id_labt = $s_id_labt ";
$sql .= "LIMIT 1";
$res = mysqli_query($conn, $sql);
if ($res) {
$onde = "index1.php?pg=alt_labt&certo=S";
} else
$onde = "index1.php?pg=alt_labt&certo=N";
}
break;
}
?>
<form name="retorna" method="post" action="">
<input type="hidden" name="id_labt" id="id_labt" value="<?=$_POST[id_labt]?>">
<input type="hidden" name="v_nm_labt" id="v_nm_labt" value="<?=$_POST[v_nm_labt]?>">
<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