<?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';
	function Conectar() {
		if (!@mysqli_connect($this->host,$this->user,$this->pass)){
			print $this->i_Servidor;
				
		} else { 
			if (!@mysqli_select_db($this->db)) {
				print $this->i_DB;		
			} 
		}
	}
	function Buscar($q) {
		$query = mysqli_query($con,"SELECT * FROM hc_paciente WHERE cc = '$q'");
		if (mysqli_num_rows($query)<=0){		
		} else {
			print '<div id="alert_cc">	';
			while ($row = mysqli_fetch_assoc($query)) {
				print 'Cedula Existente';
			}
			print '</div>';
		}
			
	}
}
?>