<?php

class Articulos_model extends Databases {

    private $db = DB_NAME_HEAD;
    protected $token = false;

    public function obtenerDatosArt($sec, $art) {
        $sql = "exec " . $this->db . ".dbo.ACTUALIZA_EXISTENCIA_VENTAS @SECTOR=$sec,@ARTICULO=$art, @EMPRESA=1, @EXISTENCIA=0, @FECHA='".date('Ymd H:m:s')."'";
        $data = parent::query($sql);
        $sql="SELECT DET,EVE from " . $this->db . ".dbo.ART_CUE where SEC=$sec and COD=$art and EMP=1";
        $data = parent::query($sql);
        if ($data && count($data) > 0) {
            return $data;
        } else
            return false;
    }
}