<?php

class SevenRegistrar extends SevenBase{
        	
    protected $ruc = '', $subdominio = '', $nombre_bd = '';

    public function getEmpresa($ruc){
        $data = DB::query("
            SELECT * FROM empresas
            WHERE ruc = '".$ruc."' AND estado = 1 ORDER BY id_empresa DESC
            LIMIT 1
            ");
        
        return $data;
    }

    public function getEmpresas(){
        $data = DB::query("
            SELECT * FROM empresas
            WHERE estado = 1 ORDER BY subdominio ASC
            ");
        
        return $data;
    }

    public function insertar($ruc, $subdominio, $nombre_bd){         
        
        DB::query("
            INSERT INTO empresas (ruc, subdominio, nombre_bd)
            VALUES ( '".$ruc."', '".$subdominio."', '".$nombre_bd."' )
        ");

        return DB::getMySQLiObject();
    }

}

?>