<?
include("config.php");
include("conexao_sinsweb.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Administra&ccedil;&atilde;o</title>

<style>
body {
    font-size:10px;
    font-family:arial;
}
input, select {
    font-size:12px;
}
.formulario {
	padding:5px;
	border:1px solid #EBEBEB;
	background-color: #F9F9F9;
	width:500px;
}
.formulario .label { 
    font: bold 12px arial;
}
.formulario .label2 { 
    font: 12px arial;
}
.titulo {
    font: bold 17px tahoma;
}

.texto {font-family: Arial, Helvetica, sans-serif;font-size: 9px;font-weight: bold;color: #333333;text-decoration: none;
}
</style>
<script type="text/javascript" src="../js/MascaraValidacao.js"> </script>
<script type="text/javascript" src="../js/initAjax.js"></script>
<script type="text/javascript" src="../js/agendamento.js"></script>
<script type="text/javascript" language="JavaScript1.2">

function fRetornar()
  {window.parent.open("index.php", "_top");}

function sAgenda()
{
  if (sConsiste(document.cep))

{window.open("lista_agenda_emp.php?cnpj="+document.cep.cnpj.value,"Aviso","width=1200,height=495,top=30,left=190,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no");}

}

function sLiberaAgenda()
{
  if (sConsiste(document.cep))

{window.open("acoes.php?cnpj="+document.cep.cnpj.value+"&destino=gerar.php","Aviso","width=1200,height=495,top=30,left=190,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no");}

}

function sConsiste(df)
{
if (df.cnpj.value == "")
	{
	alert("ATENÇÃO!! Digite o CNPJ da Empresa!");
	df.cnpj.focus();
	return false;
	}
return true;
}
</script>

</head>
<body>
<form name="cep">
  <h1 class="titulo">Cadastro de Empresa</h1>
<table width="100%" class="formulario">
        <tr>
          <td class="label">CNPJ/CEI/CPF:</td>
          <td colspan="2" class="campo"><input name="cnpj" type="text" id="cnpj" onblur="atualizaCEP(this.value);" onkeypress="if (event.keycode &lt; 48 || event.keycode &gt; 57) event.returnvalue = false"  
            onkeyup="if (this.value.length==14) { cep.btnAgendamentos.focus();return false; }" value="" size="30" maxlength="14" /></td>
          <td class="campo"><span class="label">Telefone:</span></td>
          <td colspan="3" class="campo"><input type="text" name="telefone" id="telefone" style="width:100%" readonly="readonly" value="" onblur="javascript:document.forms[0].telefone.value=document.forms[0].telefone.value.toUpperCase()"/></td>
        </tr>
        <tr>
          <td class="label">Raz&atilde;o Social:</td>
          <td colspan="6" class="campo"><input type="text" name="nome" id="nome" style="width:100%" value="" readonly="readonly" onblur="javascript:document.forms[0].nome.value=document.forms[0].nome.value.toUpperCase()"/></td>
        </tr>

        <tr>
          <td colspan="7" class="label"><table width="100%" border="0" cellpadding="0" cellspacing="0" height="1">
        <tr >
          <td colspan="6" class="label" style='background:#A8B7BF'>&nbsp;</td>
        </tr>
                  </table></td>
        </tr>
        <tr>
            <td width="70" class="label">CEP:</td>
            <td colspan="2" class="campo"><input name="empresa_cep" type="text" id="empresa_cep" readonly="readonly" value="" size="15" maxlength="8" /></td>
            <td width="48" class="campo">&nbsp;</td>
            <td width="22" class="campo">&nbsp;</td>
            <td width="83" colspan="2" class="campo">&nbsp;</td>
        </tr>
        <tr>
            <td class="label">Endere&ccedil;o:</td>
            <td colspan="6" class="campo"><input type="text" name="endereco" id="endereco" style="width:100%" readonly="readonly" value="" onBlur="javascript:document.forms[0].endereco.value=document.forms[0].endereco.value.toUpperCase()"/></td>
        </tr>
        <tr>
          <td class="label"><span class="campo">N&uacute;mero:</span></td>
          <td width="133" class="campo"><input type="text" name="numero" id="numero" style="width:70%" readonly="readonly" value="" onBlur="javascript:document.forms[0].numero.value=document.forms[0].numero.value.toUpperCase()"/></td>
          <td width="74" class="label">Complemento:</td>
          <td colspan="4" class="campo"><input type="text" name="complemento" id="complemento" style="width:100%" readonly="readonly" value="" onBlur="javascript:document.forms[0].complemento.value=document.forms[0].complemento.value.toUpperCase()"/></td>
        </tr>
        <tr>
            <td class="label">Bairro:</td>
            <td colspan="6" class="campo"><input type="text" name="bairro" id="bairro" readonly="readonly" value="" style="width:100%" onBlur="javascript:document.forms[0].bairro.value=document.forms[0].bairro.value.toUpperCase()"/></td>
        </tr>
        <tr>
            <td class="label">Cidade:</td>
            <td colspan="4" class="campo"><input type="text" name="cidade" id="cidade" readonly="readonly" value="" style="width:95%" onBlur="javascript:document.forms[0].cidade.value=document.forms[0].cidade.value.toUpperCase()"/></td>
            <td class="campo">UF</td>
          <td class="campo"><input type="text" name="empresa_uf" id="empresa_uf" readonly="readonly" value="" style="width:40%" onblur="javascript:document.forms[0].empresa_uf.value=document.forms[0].empresa_uf.value.toUpperCase()"/></td>
        </tr>
        <tr>
          <td colspan="7" class="label"><table width="100%" border="0" cellpadding="0" cellspacing="0" height="1">
            <tr >
              <td colspan="6" class="label" style='background:#A8B7BF'>&nbsp;</td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td class="label">CNAE:</td>
          <td colspan="7" class="campo">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><input name="cnae" type="text" id="cnae" onkeypress="if (event.keycode &lt; 48 || event.keycode &gt; 57) event.returnvalue = false"  
            onkeyup="if (this.value.length==7) { cep.atividade.focus();return false; }" readonly="readonly" value="" size="15" maxlength="7" /></td>
            </tr>
            <tr>
              <td class="campo"><label for="atividade"></label>
              <textarea name="atividade" cols="50" rows="3" readonly="readonly" class="label2" id="atividade"></textarea></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td class="label">&nbsp;</td>
          <td colspan="7" class="campo">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="8" class="label"><div align="center">
            <input name="btnAgendamentos" type="button" style="font-family: Tahoma; font-size: 8 pt; color: #000000"  id="btnAgendamentos" value="Listar Agendamentos" onclick="sAgenda(document.cep)"/>
          </div></td>
        </tr>
        <tr>
          <td colspan="8" class="label"><div align="center"><span class="texto">
        <input type="button" name="Button4" value="Liberar Agendamento" onclick="sLiberaAgenda(document.cep)" style="font-family: Tahoma; font-size: 8 pt; color: #FF0000" />
            </span></div></td>
        </tr>
    </table>
</form>
<table class="MsoNormalTable" border="0" cellpadding="0" width="98%"
 style='width:98.0%;mso-cellspacing:1.5pt;mso-padding-alt:0cm 0cm 0cm 0cm'>
  <tr style='mso-yfti-irow:5'>
    <td style='padding:0cm 0cm 0cm 0cm'><p class="MsoNormal"><span style='font-size:7.5pt;font-family:Verdana;
  color:#333333'> <img width="1" height="5"
  src="../img/image002.gif" v:shapes="_x0000_i1033" />
      <o:p></o:p>
    </span></p></td>
  </tr>
  <tr style='mso-yfti-irow:6'>
    <td style='background:#A8B7BF;padding:0cm 0cm 0cm 0cm'><p class="MsoNormal"><span style='font-size:7.5pt;font-family:Verdana;
  color:#333333'> <img width="1" height="1"
  src="../img/image003.gif" v:shapes="_x0000_i1034" />
      <o:p></o:p>
    </span></p></td>
  </tr>
  <tr style='mso-yfti-irow:7'>
    <td style='padding:0cm 0cm 0cm 0cm'><p class="MsoNormal" align="right" style='text-align:right'><span
  style='font-size:8.5pt;font-family:Verdana;color:black'> <img width="1" height="5"
  src="../img/image002.gif" v:shapes="_x0000_i1035" />
      <o:p></o:p>
    </span></p></td>
  </tr>
  <tr style='mso-yfti-irow:8;mso-yfti-lastrow:yes'>
    <td><div align="center"><img border="0" src="../img/btnVoltar.gif" onclick="fRetornar();"/></div></td>
  </tr>
</table>
</body>
</html>