Mini Shell
<?php
include"menu.php";
?>
<?
if($_POST){
$id = $_POST["id"];
$situacao = $_POST["situacao"];
$razaosocial = $_POST["razaosocial"];
$razaosocial = utf8_decode($razaosocial);
$fantasia = $_POST["fantasia"];
$fantasia = utf8_decode($fantasia);
$cnpj = $_POST["cnpj"];
$inscricao_estadual = $_POST["inscricao_estadual"];
$email = $_POST["email"];
$tel_com1 = $_POST["tel_com1"];
$tel_com2 = $_POST["tel_com2"];
$cidade = $_POST["cidade"];
$logradouro = $_POST["logradouro"];
$bairro = $_POST["bairro"];
$numero = $_POST["numero"];
$complemento = $_POST["complemento"];
$cep = $_POST["cep"];
$site = $_POST["site"];
$tipo = $_POST["tipo"];
// print_r($_POST);
include"conexao.php";
// Check connection
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
$sql = "INSERT INTO tab_empresa (id_situacao,fantasia,razao_social,cnpj,inscricao_estadual,email,tel_com1,tel_com2,cidade,
logradouro,bairro,numero,complemento,cep,site,tipo)
VALUES ('$situacao','$fantasia','$razaosocial','$cnpj','$inscricao_estadual','$email','$tel_com1','$tel_com2','$cidade',
'$logradouro','$bairro','$numero','$complemento','$cep','$site','$tipo')";
//echo"$sql";
if ($con->query($sql) === TRUE) {
} else {
echo "Error: " . $sql . "<br>" . $con->error;
}
$con->close();
$id = base64_encode($id);
echo"<script type='text/javascript'>
window.alert('INCLUIDO COM SUCESSO!');
window.open(\"empresas.php?id=$id\",\"_parent\");
</script>";
exit();
}
$id = $_GET["id"];
$sql = "select * from tab_usuario where id_usuario = '$id'";
$res = mysqli_query($con, $sql);
$total = mysqli_num_rows($res);
while ($f = mysqli_fetch_array($res))
{
$nomee = $f['nome'];
$loginn = $f['login'];
$emaill = $f['email'];
$celular = $f['celular'];
$cidade = $f['cidade'];
}
?>
<form name="form1" action="addempresa.php" method="post" >
<div align="center">
<input type="hidden" name="id" value = "<? echo $id ;?>" class = "form-control animated bounceInleft " placeholder=" CELULAR" style="width:180px; margin-bottom:10px">
<label style = "margin-right:15px;" >
Razão Social</br>
<input type="text" name="razaosocial" size="30" class = "form-control animated bounceInleft " placeholder=" RAZÃO SOCIAL" style="width:180px; margin-bottom:10px">
</label>
<label style = "margin-right:15px;" >
Nome Fantasia</br>
<input type="text" name="fantasia" size="30" class = "form-control animated bounceInleft " placeholder=" NOME FANTASIA" style="width:180px; margin-bottom:10px">
</label>
<label style = "margin-right:15px;" >
CNPJ</br>
<input type="text" name="cnpj" size="30" class = "form-control animated bounceInleft " placeholder="CNPJ" style="width:280px; margin-bottom:10px">
</label>
<label style = "margin-right:15px;" >
Inscrição Estadual</br>
<input type="text" name="inscricao_estadual" size="30" class = "form-control animated bounceInleft " placeholder="Inscrição Estadual" style="width:280px; margin-bottom:10px">
</label>
</br>
<label style = "margin-right:15px;" >
E-mail </br>
<input type="email" name="email" size="30" value = "<? echo $emaill ;?>" class = "form-control animated bounceInleft " placeholder=" EMAIL" style="width:180px; margin-bottom:10px">
</label>
<label style = "margin-right:15px;" >
Telefones </br>
<input type="text" name="tel_com1" size="20" value = "<? echo $celular ;?>" class = "form-control animated bounceInleft " placeholder="1º TELEFONE" style="width:180px; margin-bottom:10px">
</label>
<label>
<input type="text" name="tel_com2" size="20" class = "form-control animated bounceInleft " placeholder="2º TELEFONE" style="width:180px; margin-bottom:10px">
</label>
</br>
<label style = "margin-right:15px;" >
Cidade </br>
<?
echo"<input list=\"browsers\" placeholder=\"Cidade\" value = \"$cidade\" class=\"form-control\" name=\"cidade\" style=\"width:100% ;width:210px; margin-bottom:10px; height :30px;\">
<datalist id=\"browsers\">
";
$sql = "SELECT * FROM cidades where cidade <> '$cidade' ";
$res = mysqli_query($con, $sql);
$total = mysqli_num_rows($res);
while ($f = mysqli_fetch_array($res))
{
$cidadee = $f["cidade"];
echo"<option value=\"$cidadee\">";
}
// fecha a conexão
print'</datalist>';
?>
</label>
<label style = "margin-right:15px;" >
logradouro </br>
<input type="text" name="logradouro" size="30" class = "form-control animated bounceInleft " placeholder="Logradouro" style="width:280px; margin-bottom:10px">
</label>
<label style = "margin-right:15px;" >
Complemento </br>
<input type="text" name="complemento" size="30" class = "form-control animated bounceInleft " placeholder="Complemento" style="width:280px; margin-bottom:10px">
</label>
<label style = "margin-right:15px;" >
Número </br>
<input type="text" name="numero" size="30" class = "form-control animated bounceInleft " placeholder="número" style="width:80px; margin-bottom:10px">
</label>
<label style = "margin-right:15px;" >
Bairro </br>
<input type="text" name="bairro" size="30" class = "form-control animated bounceInleft " placeholder="Bairro" style="width:180px; margin-bottom:10px">
</label>
<label style = "margin-right:15px;" >
CEP </br>
<input type="text" name="cep" size="30" class = "form-control animated bounceInleft " placeholder="CEP" style="width:100px; margin-bottom:10px">
</label>
</br>
<label style = "margin-right:15px;" >
Situação </br>
<select name="situacao" required class="form-control animated bounceInUp" placeholder="Situação" style="width:180px; margin-bottom:10px">
<option value="" disabled selected>SITUAÇÃO</option>
<?
$sql = "SELECT * FROM tab_situacao ";
$res = mysqli_query($con, $sql);
$total = mysqli_num_rows($res);
while ($f = mysqli_fetch_array($res))
{
$situacao = $f["situacao"];
$id_situacao = $f["id_situacao"];
echo"<option value=\"$id_situacao\">$situacao</option>";
}
?>
</select>
</label>
<label style = "margin-right:15px;" >
Site </br>
<input type="text" name="site" size="30" class = "form-control animated bounceInleft " placeholder="SITE" style="width:180px; margin-bottom:10px">
</label>
<label style = "margin-right:15px;" >
Tipo de Empresa </br>
<select name="tipo" required class="form-control animated bounceInUp" placeholder="Situação" style="width:180px; margin-bottom:10px">
<?
echo"<option value=\"$tipo\" selected>$tipo</option>";
$sql = "SELECT * FROM tab_tipodeempresa where tipo <> '$tipo' ";
$res = mysqli_query($con, $sql);
$total = mysqli_num_rows($res);
while ($f = mysqli_fetch_array($res))
{
$tipoo = $f["tipo"];
echo"<option value=\"$tipoo\">$tipoo</option>";
}
?>
?>
</select>
</label>
</br></br>
<input type="submit" name="buttom" class = "btn btn-success animated bounceInright " value="SALVAR" style="width:180px; margin-bottom:10px">
</div>
</form>
<p align="center"> </p>
<p align="center"></p>
<?
include"rodape.php";
?>
Zerion Mini Shell 1.0