Exemplo n.º 1
0
function verifica($email, $senha)
{
    //ver o extends
    include "../dao/conexao.php";
    $link = new conexao();
    $conexao = $link->conecta();
    $sql = "SELECT id, tipo FROM pessoa WHERE email = '" . $email . "' AND senha = '" . $senha . "'";
    $query = $conexao->prepare($sql);
    $query->execute();
    $retorno = $query->fetchAll(PDO::FETCH_ASSOC);
    session_start();
    if (isset($retorno[0])) {
        $_SESSION["email"] = $email;
        $_SESSION["tipo"] = $retorno[0]['tipo'];
        header("Location: ../view/dash.php");
    } else {
        header("Location: ../view/index.php?email=" . $email);
    }
    $conexao = $link->desconecta($conexao);
}
}
?>
	    		</select>
	   		
	    		<div style="width:40%; float:left; margin-right:20%;">
	    			<label>Data</label>
	   				<input type="date" class="form-control" id="data" name="data" required>
	   			</div>	
	   			<div style="width:40%;  float:left;">
	   				<label>Semestre</label>
	   				<input type="text" class="form-control" id="semestre" name="semestre" value="2015.1" required>
		   		</div>
			</form>

			<button type="button" class="waves-effect waves-light btn" onclick="filtraSolicitacao();" >Pesquisar</button>
		</center>
	</div>
	
	<div>
		
	</div>
	<?php 
//fecha a conexão
//mysql_close($conexao);
$conexao = $link->desconecta($conexao);
?>

</div>

<?php 
include "rodape.php";
Exemplo n.º 3
0
<?php

//require_once ("../../includes/classes/conecta.class.php");
//require_once ("../../includes/functions/funcoes.inc");
//include ("../../includes/config.inc.php");
if (is_file("../../includes/classes/conecta.class.php")) {
    require_once "../../includes/classes/conecta.class.php";
} else {
    if (is_file("../conecta.class.php")) {
        require_once "../conecta.class.php";
    } else {
        if (is_file("./includes/classes/conecta.class.php")) {
            require_once "./includes/classes/conecta.class.php";
        }
    }
}
$conec = new conexao();
$conec->conecta('MYSQL');
$qryConf = "SELECT * FROM config";
$execConf = mysql_query($qryConf);
$rowConf = mysql_fetch_array($execConf);
define("LANG", $rowConf['conf_language']);
$conec->desconecta('MYSQL');