public function __construct($s = FALSE) { parent::__construct('registros_sat', 'plugins/SAT/'); if ($s) { $this->nsat = intval($s['nsat']); $this->prioridad = intval($s['prioridad']); $this->fentrada = date('d-m-Y', strtotime($s['fentrada'])); $this->fcomienzo = NULL; if (isset($s['fcomienzo'])) { $this->fcomienzo = date('d-m-Y', strtotime($s['fcomienzo'])); } $this->ffin = NULL; if (isset($s['ffin'])) { $this->ffin = date('d-m-Y', strtotime($s['ffin'])); } $this->modelo = $s['modelo']; $this->codcliente = $s['codcliente']; $this->estado = intval($s['estado']); $this->prioridad = intval($s['prioridad']); $this->averia = $s['averia']; $this->accesorios = $s['accesorios']; $this->observaciones = $s['observaciones']; $this->posicion = $s['posicion']; $this->nombre_cliente = $s['nombre']; $this->telefono1_cliente = $s['telefono1']; $this->telefono2_cliente = $s['telefono2']; $this->contacto = ''; if (isset($s['contacto'])) { $this->contacto = $s['contacto']; } $this->codagente = NULL; if (isset($s['codagente'])) { $this->codagente = $s['codagente']; } } else { $this->nsat = NULL; $this->prioridad = 3; $this->fentrada = date('d-m-Y'); $this->fcomienzo = date('d-m-Y'); $this->ffin = NULL; $this->modelo = ''; $this->codcliente = NULL; $this->estado = 1; $this->averia = ''; $this->accesorios = ''; $this->observaciones = ''; $this->posicion = ''; $this->contacto = ''; $this->codagente = NULL; $this->nombre_cliente = ''; $this->telefono1_cliente = ''; $this->telefono2_cliente = ''; } if (!isset(self::$estados)) { $estado = new estado_sat(); self::$estados = $estado->all(); } }