AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.216.59
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/www/lrsys_apps/leve/application/plugins/module_fish/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/www/lrsys_apps/leve/application/plugins/module_fish/controllers/SpeciesController.php
<?php

include_once "Controller.php";
include_once __DIR__ . "/../models/SpeciesModel.php";

class SpeciesController extends Controller
{
    /**
     * @var ID Species
     */
    protected $id;

    /**
     * @var SpeciesModel
     */
    protected $model;

    /**
     * @param $ui
     * @param array $_L
     * @param array $config
     * @param $_pd
     */
    public function __construct($ui, $_L, $config, $_pd)
    {
        parent::__construct($ui, $_L, $config, $_pd);

        $this->ui->assign('_title', $this->_L['Fish Description module'] . ' - ' . $this->config['CompanyName']);

        $this->model = new SpeciesModel();
        $this->id = $this->routes[3];
    }

    /**
     * Show list to species
     */
    public function listSpecies()
    {
        // LISTAR ESPÉCIES
        $data = $this->model->all('id', true);
        $this->ui->assign('species', $data);

        $this->ui->assign('_st', $this->_L['Fish Description module']);
        $this->ui->assign('_include', 'species/' . __FUNCTION__);
        $this->ui->display('wrapper.tpl');
    }

    /**
     * Show add to type Species
     */
    public function add()
    {
        // CARREGA CSS E JS'S
        $css_arr = array('s2/css/select2.min', 'redactor/redactor');

        $js_arr = array(
            's2/js/select2.min',
            '/../../../application/plugins/module_fish/assets/js/default-species',
            'redactor/redactor.min',
            'redactor/fontcolor'
        );

        $assets_css = Asset::css($css_arr);
        $assets_js = Asset::js($js_arr);

        $this->ui->assign('xheader', $assets_css);
        $this->ui->assign('xfooter', $assets_js);

        $this->ui->assign('_st', $this->_L['Species_List_Fish']);
        $this->ui->assign('_include', 'species/' . __FUNCTION__);
        $this->ui->display('wrapper.tpl');
    }

    /**
     * Insert add to type Species
     */
    public function create()
    {
        $data = $_POST;

        $this->model->createSpecies($data);

        $this->ui->assign('_st', $this->_L['Species_Save_Msg']);
        r2(U . 'module_fish/species/listSpecies', 's', $this->_L['Species_Save_Msg']);
    }

    /**
     * Show form to edit Species
     */
    public function edit()
    {
        $this->id = $this->routes[3];

        if (empty($this->routes[3]) || !is_numeric($this->routes[3])) {
            die($this->_L['Id_Required']);
        }

        $data = $this->model->getOne($this->routes[3]);

        if (!$data) {
            die($this->_L['Not_Found']);
        }

        $this->ui->assign('specie', $data);

        // CARREGA CSS E JS'S
        $css_arr = array('s2/css/select2.min', 'redactor/redactor');

        $js_arr = array(
            's2/js/select2.min',
            '/../../../application/plugins/module_fish/assets/js/default-species',
            'redactor/redactor.min',
            'redactor/fontcolor'
        );

        $assets_css = Asset::css($css_arr);
        $assets_js = Asset::js($js_arr);

        $this->ui->assign('xheader', $assets_css);
        $this->ui->assign('xfooter', $assets_js);

        $this->ui->assign('_st', $this->_L['Species_List_Fish'] . ' - ' . $this->_L['Species_Edit_Module']);
        $this->ui->assign('_include', 'species/add');
        $this->ui->display('wrapper.tpl');
    }

    /**
     * Delete Species
     */
    public function delete()
    {
        $data = $this->validateSpecies();
        $this->model->deleteSpecies($data);

        $this->ui->assign('_st', $this->_L['Species_Del_Msg']);
        r2(U . 'module_fish/species/listSpecies', 's', $this->_L['Species_Del_Msg']);
        $this->ui->display('wrapper.tpl');
    }

    /**
     * Show form to update Species
     */
    public function update()
    {
        $specie = $this->validateSpecies();

        $this->model->updateSpecies($this->data, $specie);

        $this->ui->assign('_st', $this->_L['Species_Edit_Msg']);
        r2(U . 'module_fish/species/listSpecies', 's', $this->_L['Species_Edit_Msg']);
        $this->ui->display('wrapper.tpl');
    }

    /**
     * @return ORM
     */
    protected function validateSpecies()
    {
        $this->data = $_POST;
        if (empty($this->data['id']) || !is_numeric($this->data['id'])) {
            die($this->_L['Id_Required']);
        }

        $species = $this->model->getOne($this->data['id']);

        if (!$species) {
            die($this->_L['Not_Found']);
        }

        return $species;
    }
}

Anon7 - 2022
AnonSec Team