db_fieldsmemory($result, 0);
parse_str(base64_decode($HTTP_SERVER_VARS["QUERY_STRING"]));
if (isset($again)) {
    db_logs("", "", "0", "index.php - usuario fez log-off.");
    db_redireciona("index.php");
}
if (isset($login)) {
    $sSql = "select db_usuarios.id_usuario, senha, u.cgmlogin, usuarioativo         ";
    $sSql .= "  from db_usuarios                                                     ";
    $sSql .= "       inner join db_usuacgm u on u.id_usuario = db_usuarios.id_usuario";
    $sSql .= " where login        = '******'                                      ";
    $sSql .= "   and usuext       = 1                                                ";
    $result = db_query($conn, $sSql);
    if (pg_numrows($result) == 0) {
        $erroscripts = "1";
    } elseif (Encriptacao::hash($DB_senha) != pg_result($result, 0, "senha")) {
        $erroscripts = "2";
    } elseif (pg_result($result, 0, "usuarioativo") != 1) {
        $erroscripts = "5";
    } else {
        session_register("DB_login");
        db_fieldsmemory($result, 0, true, true);
        $HTTP_SESSION_VARS["DB_login"] = $cgmlogin;
        $DB_LOGADO = "";
        db_logs("", "", "0", "index.php - Usuário fez login.");
        $sql = "select fc_permissaodbpref({$cgmlogin},0,0)";
        $result = db_query($sql);
        if (pg_numrows($result) == 0) {
            //db_redireciona("index.php?".base64_encode("erroscripts='4'"));
            ?>
<script>parent.location="index.php?".base64_encode("erroscripts='4'";</script><?php 
if (!isset($HTTP_POST_VARS["cria_senha"])) {
    $result = @db_query("select senha from db_usuarios where login = '******' and senha != '' ");
    if (@pg_num_rows($result) == 0) {
        msgbox("Login inválido");
        redireciona("digitafornecedor.php");
        exit;
    } else {
        if (Encriptacao::hash($DB_senha) != @pg_result($result, 0, 0)) {
            msgbox("ERRO: Senha Incorreta.");
            redireciona("digitafornecedor.php");
            exit;
        }
    }
}
//reenvio de senha
if (Encriptacao::hash($DB_senha) != @pg_result($result, 1, 0)) {
    $result = @db_query("select login,senha from db_usuarios where trim(login) = '{$cgccpf}' ");
}
if (@pg_num_rows($result) == 0) {
    msgbox("ERRO: REGISTRO NÃO ENCONTRADO.");
    exit;
}
//////////////////////////////////////////////////////////////
db_mensagem("opcoesfornecedor_cab", "opcoesfornecedor_rod");
mens_help();
?>
<html>
<head>
<title>opcoesimovel</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="javascript/db_script.js"></script>
include "libs/smtp.class.php";
require_once "libs/db_encriptacao.php";
$cldb_usuarios = new cl_db_usuarios();
$cldb_usuacgm = new cl_db_usuacgm();
$clcgm = new cl_cgm();
parse_str(base64_decode($HTTP_SERVER_VARS["QUERY_STRING"]));
db_logs("", "", 0, "Pedido de Senha.");
$oGet = db_utils::postmemory($_GET);
$oPost = db_utils::postmemory($_POST);
$sMatric = $oGet->nummatricula;
$sNome = $oGet->nome;
$sCgcCpf = formataCpfBanco($oGet->numcpf);
$sDataNasc = formataDataNascBanco($oGet->datansc);
$sNomeMae = $oGet->nomemae;
$sEmailServ = $oGet->emailsrv;
$sPassword = Encriptacao::encriptaSenha($oPost->senhasrv);
$sHeader = $oGet->header;
$mostar = 1;
// pedido de senha e executado se chave == 't'
if (isset($oGet->chave) && $oGet->chave == 't') {
    $sql = " select rh01_regist,\n                  z01_numcgm,\n                  z01_nome,\n                  z01_cgccpf,\n                  z01_nasc,\n                  z01_mae,\n                  z01_email,\n                  email,\n                  senha,\n                  login\n             from rhpessoal\n                  inner join cgm on rh01_numcgm = z01_numcgm\n                  left join db_usuarios on db_usuarios.nome  =  cgm.z01_nome\n            where rh01_regist = '{$sMatric}'\n              and z01_nasc is not null\n              and z01_mae is not null limit 1 ";
    $result = db_query($sql);
    $total = pg_num_rows($result);
    if ($total == 0) {
        db_logs("", "", 0, "Solicitação de senha para fornecedor: cgc ou cpf não encontrado. {$sCgcCpf}");
    }
    if ($total > 0) {
        db_fieldsmemory($result, 0);
    }
    if ($total > 0) {
        db_logs("", "", 0, "Solicitação de senha para fornecedor: cgc ou cpf - {$sCgcCpf}");
parse_str(base64_decode($HTTP_SERVER_VARS["QUERY_STRING"]));
$result = db_query("SELECT distinct m_publico,m_arquivo,m_descricao\r\n                       FROM db_menupref\r\n                       WHERE m_arquivo = 'digitaaidof.php'\r\n                       ORDER BY m_descricao\r\n                       ");
db_fieldsmemory($result, 0);
if ($m_publico != 't') {
    if (!session_is_registered("DB_acesso")) {
        echo "<script>location.href='index.php?" . base64_encode('erroscripts=3') . "'</script>";
    }
}
mens_help();
if (isset($HTTP_POST_VARS["alterar"])) {
    db_postmemory($HTTP_POST_VARS);
    $result = db_query("select senha as senhaantiga from db_usuarios where id_usuario = {$id_usuario}");
    db_fieldsmemory($result, 0);
    if ($senhaantiga == Encriptacao::encriptaSenha($senhaatual)) {
        db_query("BEGIN");
        db_query("update db_usuarios set\r\n                                     senha = '" . Encriptacao::encriptaSenha($senha) . "'\r\n                               where id_usuario = {$id_usuario}") or die("Erro(38) alterando db_usuarios: " . pg_errormessage());
        db_query("COMMIT");
    } else {
        db_msgbox("campo senha atual não confere!");
        db_redireciona($HTTP_SERVER_VARS['PHP_SELF'] . "?" . base64_encode("id_usuario=" . $id_usuario));
    }
    if (isset($enviaemail) && $enviaemail == "sim") {
        $mensagemDestinatario = "\r\n<html>\r\n<head>\r\n<title>DBSeller Inform&aacute;tica Ltda.</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n</head>\r\n\r\n<body bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\r\n<table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n  <tr>\r\n    <td nowrap align=\"center\" valign=\"top\"><table width=\"100%\" height=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n        <tr>\r\n          <td width=\"146\" nowrap bgcolor=\"#6699CC\"><font color=\"#FFFFFF\" ></font></td>\r\n          <td height=\"60\"  nowrap align=\"left\" bgcolor=\"#6699CC\"><font color=\"#FFFFFF\"><strong>&nbsp;&nbsp;&nbsp;.: Senha Alterada :.\r\n        </tr>\r\n        <tr>\r\n          <td colspan=\"2\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n              <tr>\r\n                <td>&nbsp;</td>\r\n              </tr>\r\n              <tr>\r\n                <td><ul>\r\n                    <li><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Você alterou sua senha no site Prefeitura-OnLine,<br> este e-mail foi enviado conforme solicitado no site para verificação</li>\r\n                  </ul></td>\r\n              </tr>\r\n              <tr>\r\n                <td><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">&nbsp;</font></td>\r\n              </tr>\r\n              <tr>\r\n                <td><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">&nbsp;</font></td>\r\n              </tr>\r\n              <tr>\r\n                <td><ul>\r\n                    <li>Usuário : <font size=\"2\" face=\"Arial, Helvetica, sans-serif\"><strong>{$nome}</strong></font></li>\r\n                  </ul></td>\r\n              </tr>\r\n              <tr>\r\n                <td><ul>\r\n                    <li>Login : <font size=\"2\" face=\"Arial, Helvetica, sans-serif\"><strong>{$login}</strong></font></li>\r\n                  </ul></td>\r\n              </tr>\r\n              <tr>\r\n                <td><ul>\r\n                    <li>Nova Senha : <font size=\"2\" face=\"Arial, Helvetica, sans-serif\"><strong>{$senha}</strong></font></li>\r\n                  </ul></td>\r\n              </tr>\r\n              <tr>\r\n                <td><ul>\r\n                    <li>Data da alteração : <font size=\"2\" face=\"Arial, Helvetica, sans-serif\"><strong>" . db_formatar(date("Y-m-d"), 'd') . "</strong></font></li>\r\n                  </ul></td>\r\n              </tr>\r\n              <tr>\r\n                <td><ul>\r\n                    <li>Hora : <font size=\"2\" face=\"Arial, Helvetica, sans-serif\"><strong>" . ($hora = db_getsession("hora") . "</strong></font></li>\r\n                  </ul></td>\r\n              </tr>\r\n              <tr>\r\n                <td><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">&nbsp;</font></td>\r\n              </tr>\r\n              <tr>\r\n                <td>&nbsp;</td>\r\n              </tr>\r\n              <tr>\r\n                <td align=\"center\"><p><font size=\"1\">Este e-mail foi enviado automaticamente\r\n                    por favor não responda-o</font></p></td>\r\n              </tr>\r\n              <tr>\r\n                <td align=\"center\"><p><a href=\"http://200.102.214.168\"><font size=\"1\">DBSeller Inform&aacute;tica\r\n                    Ltda.</font></a></p></td>\r\n              </tr>\r\n            </table></td>\r\n        </tr>\r\n      </table></td>\r\n  </tr>\r\n</table>\r\n\r\n</body>\r\n</html>");
        $rsConsultaConfigDBPref = $clconfigdbpref->sql_record($clconfigdbpref->sql_query_file(db_getsession('DB_instit'), "w13_emailadmin"));
        db_fieldsmemory($rsConsultaConfigDBPref, 0);
        $oMail = new Smtp();
        $oMail->Send($email, $w13_emailadmin, 'Alteração de senha do site Prefeitura On-Line', $mensagemDestinatario);
    }
    db_msgbox("Senha alterada com sucesso!");
    db_redireciona("centro_pref.php");
}
 function enviar_senha($id_usuario, $email, $nome, $login, $senha, $nomeinst, $url = null, $enviar)
 {
     $erro = false;
     if ($enviar == true) {
         $sConso = "bcdfghjklmnpqrstvwxyzbcdfghjklmnpqrstvwxyz";
         $sVogal = "aeiou";
         $sNum = "123456789";
         $passwd = "";
         $y = strlen($sConso) - 1;
         //conta o num de caracteres da variavel $sConso
         $z = strlen($sVogal) - 1;
         //conta o num de caracteres da variavel $sVogal
         $r = strlen($sNum) - 1;
         //conta o num de caracteres da variavel $sNum
         for ($x = 0; $x <= 1; $x++) {
             $rand = rand(0, $y);
             //Funcao rand() - gera um valor randomico
             $rand1 = rand(0, $z);
             $rand2 = rand(0, $r);
             $str = substr($sConso, $rand, 1);
             // substr() - retorna parte de uma string
             $str1 = substr($sVogal, $rand1, 1);
             $str2 = substr($sNum, $rand2, 1);
             $passwd .= $str . $str1 . $str2;
         }
         $mensagemDestinatario = "<html>\n                                    <head>\n                                        <title>DBSeller Inform&aacute;tica Ltda.</title>\n                                        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n                                    </head>\n                                  <body bgcolor=#CCCCCC bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n                                    <table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n                                      <tr>\n                                        <td nowrap align=\"center\" valign=\"top\">\n                                          <table width=\"100%\" height=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n                                            <tr>\n                                              <td nowrap bgcolor=\"#6699CC\"><font size=\"1\" color=\"#FFFFFF\" >&nbsp;&nbsp;{$nomeinst}</font></td>\n                                              <td height=\"60\"  nowrap align=\"left\" bgcolor=\"#6699CC\"><font color=\"#FFFFFF\"><strong>&nbsp;&nbsp;&nbsp;.: Bem-vindo ao Prefeitura On-Line :.\n                                            </tr>\n                                            <tr>\n                                              <td colspan=\"2\">\n                                                <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n                                                  <tr>\n                                                    <td>&nbsp;</td>\n                                                  </tr>\n                                                  <tr>\n                                                    <td><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Foi solicitada uma senha para o usuario\n                                                        <strong>{$nome}</strong>,<br> Esta senha foi gerada automaticamente para voce ter acesso ao sistema\n                                                        <strong>Prefeitura On-Line.</strong>\n                                                    </td>\n                                                  </tr>\n                                                  <tr>\n                                                    <td><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">&nbsp;</font></td>\n                                                  </tr>\n                                                  <tr>\n                                                        <td>\n                                                      <fieldset>\n                                                        <legend><strong><font size=\"2\"> Dados da conta</font> </strong></legend>\n                                                                  <table>\n                                                           <tr>\n                                                                       <td><ul>\n                                                                           <li><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Login: <strong>{$login}</strong></font></li>\n                                                                 </ul></td>\n                                                                     </tr>\n                                                                       <tr>\n                                                                         <td><ul>\n                                                               <li><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Senha: </font><font size=\"2\" face=\"Arial, Helvetica, sans-serif\" atyle=\"letter-spacing:0.3em\"><strong>{$passwd}</strong></font></li>\n                                                                                   </ul></td>\n                                                                       </tr>\n                                                                       <tr>\n                                                                         <td><ul>\n                                                                                 <li><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Data de criacao: </font><font size=\"2\" face=\"Arial, Helvetica, sans-serif\" atyle=\"letter-spacing:0.3em\"><strong>" . date("d-m-Y", db_getsession("DB_datausu")) . "</strong></font></li>\n                                                                 </ul></td>\n                                                                       </tr>\n                                                                       <tr>\n                                                                       <td><ul>\n                                                                                 <li><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Hora de criacao: </font><font size=\"2\" face=\"Arial, Helvetica, sans-serif\" atyle=\"letter-spacing:0.3em\"><strong>" . db_hora() . "</strong></font></li>\n                                                                                 </ul></td>\n                                                                       </tr>\n                                                                      </table>\n                                                            </fieldset>\n                                                          </td>\n                                                        </tr>\n                                                  <tr>\n                                                    <td><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">&nbsp;</font></td>\n                                                  </tr>";
         if ($url != null) {
             $mensagemDestinatario .= "\n                                                  <tr>\n                                                    <td align=\"center\"><p><a target=\"_blank\" href=\"{$url}\"><font size=\"2\">Para acessar o sistema clique aqui e escolha a opcao Prefeitura OnLine</font></a></p></td>\n                                                  </tr>";
         }
         $mensagemDestinatario .= "\n                                                  <tr>\n                                                    <td>&nbsp;</td>\n                                                  </tr>\n                                                  <tr>\n                                                    <td align=\"center\"><p><font size=\"1\">Este e-mail foi enviado automaticamente,\n                                                                                             por favor nao responda.</font></p></td>\n                                                  </tr>\n                                                  <tr>\n                                                    <td align=\"center\"><p><a target=\"_blank\" href=\"http://www.dbseller.com.br\"><font size=\"1\">DBSeller Inform&aacute;tica Ltda.</font></a></p></td>\n                                                  </tr>\n                                                </table></td>\n                                            </tr>\n                                          </table></td>\n                                        </tr>\n                                      </table>\n                                    </body>\n                                  </html>";
     } else {
         $mensagemDestinatario = "<html>\n                                   <head>\n                                    <title>DBSeller Inform&aacute;tica Ltda.</title>\n                                    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n                                   </head>\n                                   <body bgcolor=#CCCCCC bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n                                    <table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n                                     <tr>\n                                       <td nowrap align=\"center\" valign=\"top\">\n                                         <table width=\"100%\" height=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n                                          <tr>\n                                            <td nowrap bgcolor=\"#6699CC\"><font size=\"1\" color=\"#FFFFFF\" >&nbsp;&nbsp;{$nomeinst}</font></td>\n                                            <td height=\"60\"  nowrap align=\"left\" bgcolor=\"#6699CC\"><font color=\"#FFFFFF\"><strong>&nbsp;&nbsp;&nbsp;.: Bem-vindo ao Prefeitura On-Line :.\n                                          </tr>\n                                          <tr>\n                                            <td colspan=\"2\">\n                                              <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n                                               <tr>\n                                                 <td>&nbsp;</td>\n                                               </tr>\n                                               <tr>\n                                                 <td><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Usuario <strong>{$nome}</strong> foi incluido com sucesso, <br> Esta cadastro servira para voce ter acesso ao sistema\n                                                     <strong>Prefeitura On-Line.</strong>\n                                                 </td>\n                                               </tr>\n                                               <tr>\n                                                 <td><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">&nbsp;</font></td>\n                                               </tr>\n                                               <tr>\n                                                       <td>\n                                                               <fieldset>\n                                                                 <legend><strong><font size=\"2\"> Dados da conta</font> </strong></legend>\n                                                                   <table>\n                                                                    <tr>\n                                                                      <td><ul>\n                                                                              <li><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Login: <strong>{$login}</strong></font></li>\n                                                                                </ul></td>\n                                                                    </tr>\n                                                                    <tr>\n                                                                      <td><ul>\n                                                                              <li><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Senha: </font><font size=\"2\" face=\"Arial, Helvetica, sans-serif\" atyle=\"letter-spacing:0.3em\"><strong>{$senha}</strong></font></li>\n                                                                                </ul></td>\n                                                                    </tr>\n                                                                    <tr>\n                                                                      <td nowrap><ul>\n                                                                              <li><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Data de criacao: </font><font size=\"2\" face=\"Arial, Helvetica, sans-serif\" atyle=\"letter-spacing:0.3em\"><strong>" . date("d-m-Y", db_getsession("DB_datausu")) . "</strong></font></li>\n                                                                                 </ul></td>\n                                                        </tr>\n                                                                    <tr>\n                                                                      <td><ul>\n                                                                              <li><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Hora de criacao: </font><font size=\"2\" face=\"Arial, Helvetica, sans-serif\" atyle=\"letter-spacing:0.3em\"><strong>" . db_hora() . "</strong></font></li>\n                                                                                </ul></td>\n                                                                    </tr>\n                                                                  </table>\n                                                         </fieldset>\n                                                       </td>\n                                                     </tr>\n                                               <tr>\n                                                 <td><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">&nbsp;</font></td>\n                                               </tr>";
         if ($url != null) {
             $mensagemDestinatario .= "\n                                               <tr>\n                                                 <td align=\"center\"><p><a target=\"_blank\" href=\"{$url}\"><font size=\"2\">Para acessar o sistema clique aqui e escolha a opcao Prefeitura OnLine</font></a></p></td>\n                                               </tr>";
         }
         $mensagemDestinatario .= "\n                                               <tr>\n                                                 <td>&nbsp;</td>\n                                               </tr>\n                                               <tr>\n                                                 <td align=\"center\"><p><font size=\"1\">Este e-mail foi enviado automaticamente,\n                                                                                          por favor nao responda.</font></p></td>\n                                               </tr>\n                                               <tr>\n                                                 <td align=\"center\"><p><a target=\"_blank\" href=\"http://www.dbseller.com.br\"><font size=\"1\">DBSeller Inform&aacute;tica Ltda.</font></a></p></td>\n                                               </tr>\n                                              </table></td>\n                                            </tr>\n                                         </table></td>\n                                       </tr>\n                                     </table>\n                                   </body>\n                                 </html>";
     }
     $headers = "Content-Type:text/html;";
     $erro = mail($email, "Senha do site Prefeitura On-Line", $mensagemDestinatario, $headers);
     if ($erro == false && $enviar == true) {
         $this->senha = Encriptacao::encriptaSenha($passwd);
         $this->alterar($id_usuario);
         if ($this->erro_status == "0") {
             $erro = true;
         }
     }
     return $erro;
 }
 $z = strlen($sVogal) - 1;
 //conta o nº de caracteres da variável $sVogal
 $r = strlen($sNum) - 1;
 //conta o nº de caracteres da variável $sNum
 for ($x = 0; $x <= 1; $x++) {
     $rand = rand(0, $y);
     //Funçao rand() - gera um valor randômico
     $rand1 = rand(0, $z);
     $rand2 = rand(0, $r);
     $str = substr($sConso, $rand, 1);
     // substr() - retorna parte de uma string
     $str1 = substr($sVogal, $rand1, 1);
     $str2 = substr($sNum, $rand2, 1);
     $passwd .= $str . $str1 . $str2;
 }
 $passwd2 = Encriptacao::encriptaSenha($passwd);
 $mailpref = "{$emailContr}";
 //verifica se usuário já é cadastrado
 $result1 = @db_query("select login from db_usuarios where login = '******'");
 $linhas1 = @pg_num_rows($result1);
 if ($linhas1 == 0) {
     //cadastra novo usuário
     $sqlusu = "select nextval('db_usuarios_id_usuario_seq') as x";
     $result = db_query($sqlusu);
     $id_usuario = pg_result($result, 0, 0);
     $datatoken = date("Y-m-d");
     $result2 = @db_query("insert into db_usuarios ( id_usuario,\n\t\t                                                 nome,\n\t\t                  login,\n\t\t                  senha,\n\t\t                  usuarioativo,\n\t\t                  email,\n\t\t                  usuext,\n                      datatoken\n                      )\n\t\t                  values (\n\t\t                  {$id_usuario},\n\t\t                  '{$z01_nome}',\n\t\t                  '{$z01_numcgm}',\n\t\t                  '" . (@$passwd == "" ? '' : $passwd2) . "',\n\t\t                  '1',\n\t\t                  '{$z01_email}',\n\t\t                  1,\n                      '{$datatoken}')") or die("Erro(23) inserindo em db_usuarios: " . pg_errormessage());
     $result3 = @db_query("insert into db_usuacgm (id_usuario,cgmlogin) values({$id_usuario},{$z01_numcgm})");
     $sCpf = formataCpf($z01_cgccpf);
     $mensagemDestinatario = "\n    \t\t                         {$nomeinst}\n\n    \t\t                         Pedido de Senha Internet - Prefeitura On-Line\n\n    \t\t                         --------------------------------------------------------\n\n    \t\t                         Nome:     {$z01_nome}\n\n    \t\t                         CPF/CNPJ: {$sCpf}\n\n    \t\t                         E-mail:   {$z01_email}\n\n    \t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\n    \t\t                         Login Internet: {$z01_numcgm}\n\n    \t\t                         Senha Internet: {$passwd}\n\n    \t\t\t\t\t\t\t\t\t\t\t\t\t   \n\n    \t\t                         Utilize Login e Senha para acessar suas informações no Portal da Prefeitura na Internet.\n\n    \t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\n    \t\t                         {$url}/dbpref/\n\n    \t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\n    \t\t                         Não responda este e-mail, ele foi gerado automaticamente pelo Servidor.\n\n    \t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\n    \t\t                         --------------------------------------------------------\n\n    \t\t                         " . date("d/m/Y - H:i:s") . " - " . getenv("REMOTE_ADDR");
 } else {