[#] hm X_Shell Backd00r [#]
<?php
require_once 'conexion.class.php';
class ConsularAcreditaciones{
public function __construct(){
$this->conex = Conexion::singleton_conexion();
}
public function acreditaciones(){
try{
$sql = "SELECT * FROM `registro` ORDER BY id DESC";
$query = $this->conex->prepare($sql);
$query->execute();
$r = $query->fetchAll(PDO::FETCH_ASSOC);
if($query->rowCount() > 0):
return $r;
else:
return false;
endif;
}catch(PDOExeption $e){
print 'Error! '.$e->getMessage();
}
}
public function busquedaAcreditaciones($str){
try{
$sql = "SELECT * FROM `registro` WHERE codigo LIKE '%$str%' ORDER BY id DESC";
$query = $this->conex->prepare($sql);
$query->execute();
$r = $query->fetchAll(PDO::FETCH_ASSOC);
if($query->rowCount() > 0):
return $r;
else:
return false;
endif;
}catch(PDOExeption $e){
print 'Error! '.$e->getMessage();
}
}
}
?>
Mr.hm X_Shell Backd00r 1.0, Coded By Mr.hm X_Shell Backd00r