<?php

include 'database.php';

class UsuariosmodificacongeladorII extends DataBase{
    
    public function __construct() {
        parent::__construct();
    }
    
    public function buscar($usuario){
        $_SESSION['datos'] = array();
        $sth = $this->prepare('SELECT * FROM congeladores WHERE cliente LIKE "%'.$usuario.'%" ORDER BY cliente');
        $sth->execute();
        $result = $sth->fetchAll();

  foreach ($result as $key => $value) {
    
            $_SESSION['datos'][] = array("value" => $value['cliente'], 
                                         "codigocongelador" => $value['codigo'], 
                                         "idUsuario" => $value['idcliente'], 
                                         "estado" => $value['estado'] ); 


}
     
        return $_SESSION['datos'];
        
    }
    
}


