1: <?php
2: class ClCarrera
3: {
4:
5: function __construct($bd=null)
6: {
7: if(empty($bd)){
8: require_once('../core/incluir.php');
9: $nivel_dir = 3;
10: $libs = new Incluir($nivel_dir);
11: $this->bd = $libs->incluir('db');
12: }
13: $this->bd = (!empty($bd)) ? $bd : $this->bd;
14: }
15:
16: 17: 18: 19: 20:
21: public function listar_carrera($filtro=null)
22: {
23: $resultado = array();
24: $query = "select * from cl_carrera ";
25: $stmt = $this->bd->ejecutar($query);
26: while ($carrera = $this->bd->obtener_fila($stmt)) {
27: array_push($resultado, $carrera);
28: }
29: return $resultado;
30: }
31: }
32: ?>