<!doctype html>
<html lang="pt-br">
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
    <meta name="viewport" content="width=device-width" />
    
    <title>12º Congresso Internacional de Compliance</title>
    
    <link href="css/bootstrap.css" rel="stylesheet" />
	<link href="css/style.css" rel="stylesheet" />    
    
    <!--     Fonts     -->
    <link href="http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Grand+Hotel' rel='stylesheet' type='text/css'>
  
</head>

<body>

<div class="main" style="background-image: url('../certificado/images/fundo.jpg')">


    
    <div class="cover black" data-color="black"></div>
     


    <div class="container">
        <div class="logo">
            <img src="../certificado/images/logo.png">
        </div>

        
        <div class="content">
           <div class="subscribe">
                
				<div class="col-md-8 col-md-offset-2">
				<h5 class="info-text">
                    Agradecemos sua presença no "12º Congresso Internacional de Compliance".</br> 
Para ter acesso ao seu certificado insira o número do documento apresentado para o credenciamento.
                </h5>
				</div>
				
				<?php
					$cpfvalido = "";
					if(isset($_GET['cpf'])) {
						$cpf = $_GET['cpf'];
						
						$ponteiro = fopen ("certificado/lista.txt","r");
						$cpfvalido = "inválido";
						while (!feof ($ponteiro)) {
							$linha = fgets($ponteiro,4096);
							$aux = substr($linha,0,strpos($linha,";"));
							
							if (str_replace("-", "", str_replace(".", "", $cpf)) == str_replace("-", "", str_replace(".", "", $aux)))
							{
								$cpfvalido = 'ok';
								echo "<script type='text/javascript'>window.location = 'tela2.php?cpf=$cpf' </script>";
								break;
							}
						}
						fclose ($ponteiro);
					}
				?>
				
                <div class="row">
                    <div class="col-md-4 col-md-offset-4 col-sm6-6 col-sm-offset-3 ">
                        <form class="form-inline" role="form" method="get">
                          <div class="form-group">
                            <input type="text" name="cpf" required onclick="document.getElementById('msg').innerHTML = '';" class="form-control transparent" placeholder="CPF ou RG">
                          </div>
                          <button type="submit" class="btn btn-danger btn-fill">Acessar</button>
						  <?php 
							if ($cpfvalido == "inválido")
								echo "<span id='msg' style='color: red'>Documento $cpfvalido</span>";
						  ?>
                        </form>

                    </div>
                </div>
            </div>
        </div>
    </div>
    
 </div>
 </body>
   <script src="../certificado/js/jquery-1.10.2.js" type="text/javascript"></script>
   <script src="../certificado/js/bootstrap.min.js" type="text/javascript"></script>

</html>