<?php
require_once(LIB_DIR.SD."database.php");

class proveedor extends Tabla
{    
    public $id;
    public $nombre;
    public $telefono;
    public $direccion;
    
    protected static $nombre_tabla = "proveedor";
    protected static $campos_tabla = array("nombre","telefono","direccion");

    public static function rubros($id)
    {
        global $bd;
        $sql = "SELECT * FROM proveedor_rubro ";
        $sql .= " WHERE id=".$bd->preparar_consulta($id);
        $sql .= " ORDER BY ordeb ASC";
        return self::buscar_por_sql($sql);
    }
       
    public static function zonas($id)
    {
        global $bd;
        $sql = "SELECT * FROM proveedor_zona ";
        $sql .= " WHERE id=".$bd->preparar_consulta($id);
        $sql .= " ORDER BY ordeb ASC";
        return self::buscar_por_sql($sql);
    }

}
?>
