示例#1
0
 protected function private_core()
 {
     /// ¿El usuario tiene permiso para eliminar en esta página?
     $this->allow_delete = $this->user->allow_delete_on(__CLASS__);
     $this->fabricante = FALSE;
     if (isset($_REQUEST['cod'])) {
         $fab = new fabricante();
         $this->fabricante = $fab->get($_REQUEST['cod']);
     }
     if ($this->fabricante) {
         $this->page->title = $this->fabricante->codfabricante;
         if (isset($_POST['cod'])) {
             $this->fabricante->nombre = $_POST['nombre'];
             if ($this->fabricante->save()) {
                 $this->new_message("Datos modificados correctamente");
             } else {
                 $this->new_error_msg("Imposible modificar los datos.");
             }
         }
         $this->offset = 0;
         if (isset($_GET['offset'])) {
             $this->offset = intval($_GET['offset']);
         }
         $this->articulos = $this->fabricante->get_articulos($this->offset);
     } else {
         $this->new_error_msg("Fabricante no encontrado.");
     }
 }
示例#2
0
 /**
  * Devuelve el fabricante del artículo.
  * @return fabricante
  */
 public function get_fabricante()
 {
     $fab = new fabricante();
     return $fab->get($this->codfabricante);
 }
示例#3
0
 /**
  * Devuelve el fabricante del artículo.
  * @return fabricante
  */
 public function get_fabricante()
 {
     if (is_null($this->codfabricante)) {
         return FALSE;
     } else {
         $fab = new \fabricante();
         return $fab->get($this->codfabricante);
     }
 }