<?php
session_start();
require('45789417/ref4780.php');
if (!isset($_SESSION['userid'])) {
	echo "<script language='Javascript'> location.href='login.php';</script>";
   	exit();
	};
class Buscador {
	var $host=DB_SERVER,$user=DB_USER,$pass=DB_PASS,$db=DB_NAME,$c_Servidor='Se conecto con el servidor correctamente',$i_Servidor='No se conecto con el Servidor',$c_DB='Se selecciono correctamente la DB',$i_DB='No se selecciono la DB';
	public function Conectar() {	
    		$this->conexion = new mysqli($this->host, $this->user, $this->pass,$this->db) or die(mysql_error());
      		$this->conexion->set_charset("utf8");
	} 
	public function Buscar($q) {
		$query = $this->conexion->query("SELECT * FROM hc_paciente WHERE cc = '$q'")or die($this->conexion->error);
		if (mysqli_num_rows($query)<=0){		
		} else {
			print '<div id="alert_cc">	';
			while ($row = mysqli_fetch_assoc($query)) {
				print 'Cedula Existente';
			}
			print '</div>';
		}
			
	}
}
?>
