AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.94
Web Server : Apache
System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : coopiak ( 151928)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coopiak/amisdesseniors-fr/annonces/administrator/components/com_jlexreview/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/coopiak/amisdesseniors-fr/annonces/administrator/components/com_jlexreview/models/report.php
<?php
/**
 * @package     JLex Review
 * @version     4.2.3
 * @copyright   Copyright (c) 2013-2018 JLexArt. All rights reserved
 * @license     GNU General Public License version 2 or later;
 * @author      www.jlexart.com
 */

defined('_JEXEC') or die;

class JLexReviewModelReport extends JModelLegacy
{
    public $limitstart = 0;

    public $limit = 20;

    public $total = 0;

    public $sort = "report.created DESC";

    public $q = "";

    public $id = null;

    public function getItems()
    {
        $app    = JFactory::getApplication();
        $config = JLexReviewHelperAdmin::getConfig();
        $prefix = "com_jlexreview.report.";

        $mtable = "SELECT report.*, review.title,review.voting,review.entry_id, review.created_by author, review.ip_address type_ip FROM #__jlexreview_report AS report INNER JOIN #__jlexreview AS review ON review.id=report.type_id WHERE report.type_ob=1";
        $mtable.= "\nUNION ALL";
        $mtable.= "\nSELECT report.*, cm.comment AS title,0 AS voting, cm.entry_id, cm.created_by author, cm.ip_address type_ip FROM #__jlexreview_report AS report INNER JOIN #__jlexreview_cm AS cm ON cm.id=report.type_id WHERE report.type_ob=0";

        $query  = $this->_db->getQuery(true);
        $query->select("SQL_CALC_FOUND_ROWS report.* ,COUNT(report.id) AS count_report")
              ->from("($mtable) AS report")
              ->select("u.username")
              ->leftJoin("#__users u ON report.author=u.id")
              ->select("entry.object_name, entry.url AS entry_url, entry.object_id, entry.object")
              ->leftJoin("#__jlexreview_entry AS entry ON report.entry_id=entry.id")
              ->group("CONCAT(report.type_ob,'_',report.type_id)")
              ->where("entry.id IS NOT NULL")
              ->order($this->sort);
        
        
        if($this->q!="")
        {
            $query->where("report.title LIKE ".$this->_db->quote("%".$this->q."%"));
        }

        $items = $this->_db->setQuery($query, $this->limitstart, $this->limit)->loadObjectList();

        $this->total = (int) $this->_db->setQuery("SELECT FOUND_ROWS()")->loadResult();

        if(!$items) return null;

        foreach($items as $k=>$item)
        {
            if($item->voting==1)
            {
                $items[$k]->title = JText::_('JR_VOTING');
            } elseif (preg_match('/^\s*$/', $item->title)) {
                $items[$k]->title = JText::_('JR_NO_PREVIEW');
            } else {
                $items[$k]->title = substr($item->title, 0, 40) . "....";
            }

            if($item->type_ob==1)
            {
                $items[$k]->url = JUri::base(true) . "/index.php?option=com_jlexreview&view=rating&id=" . $item->type_id;
            } else {
                $items[$k]->url = JUri::base(true) . "/index.php?option=com_jlexreview&view=cm&layout=form&id=" . $item->type_id;
            }

            // entry url
            if($config->get("link_type",0)=="1")
            {
                $up = JLexReviewHelperAdmin::getItemDetail($item->object, $item->object_id, $item->object_name, $item->entry_url);
                $items[$k]->object_name = $up->title;
            }

            $items[$k]->entry_url = JUri::base(true) . "/index.php?option=com_jlexreview&view=items&hl=" . $item->entry_id;

            $items[$k]->url_detail = JUri::base(true) . "/index.php?option=com_jlexreview&view=report&layout=detail&id=" . $item->type_ob . "," . $item->type_id;

            $items[$k]->jprofile = JUri::base(true) . "/index.php?option=com_users&task=user.edit&id=" . $item->author;
        
            // blacklist
            $items[$k]->blist_user = JUri::base(true) . "/index.php?option=com_jlexreview&view=blacklist&layout=form&method_type=user&method_value=" . $item->author;
            $items[$k]->blist_ip = JUri::base(true) . "/index.php?option=com_jlexreview&view=blacklist&layout=form&method_type=ip&method_value=" . $item->type_ip;
        
            $items[$k]->created = JHtml::date($item->created, $this->_db->getDateFormat());
        }
        
        return $items;
    }

    public function getReportings()
    {
        $matches = array();
        if(!preg_match("/^([0-1]),([1-9][0-9]*)$/", $this->id, $matches))
        {
            throw new Exception(JText::_("JR_PAGE_NOT_FOUND"), 404);
        }

        $query = $this->_db->getQuery(true);
        $query->select("report.*, u.username")
              ->from("#__jlexreview_report AS report")
              ->leftJoin("#__users u ON u.id=report.created_by")
              ->where(array(
                    "report.type_ob=" . $this->_db->quote($matches[1]),
                    "report.type_id=" . $this->_db->quote($matches[2])
                ))
              ->order($this->sort);

        $items = $this->_db->setQuery($query, $this->limitstart, $this->limit)->loadObjectList();
        $this->total = (int) $this->_db->setQuery("SELECT FOUND_ROWS()")->loadResult();

        if(!$items) return null;

        foreach($items as $k=>$item)
        {
            $items[$k]->jprofile = JUri::base(true) . "/index.php?option=com_users&task=user.edit&id=" . $item->created_by;
            $items[$k]->created = JHtml::date($item->created, $this->_db->getDateFormat());
        }

        return $items;
    }

    public function getPagaNav()
    {
        jimport('joomla.html.pagination');
        return new JPagination($this->total, $this->limitstart, $this->limit);
    }

    public function resolved()
    {
        $app = JFactory::getApplication();
        $cid = $app->input->get("cid", null, "array");

        if(is_null($cid) || !count($cid))
        {
            $this->setError(JText::_('JR_SELECT_ROW_TO_TASK'));
            return false;
        }
        
        $query = $this->_db->getQuery(true);
        foreach($cid as $id)
        {
            $matches = array();
            if(!preg_match("/^([0-1]),([1-9][0-9]*)$/", $id, $matches)) continue;

            $query->clear()
                  ->delete("#__jlexreview_report")
                  ->where([
                        "type_ob=".$this->_db->quote($matches[1]),
                        "type_id=".$this->_db->quote($matches[2])
                    ]);
            
            $this->_db->setQuery($query)->execute();
        }
        
        return true;
    }

    public function remove()
    {
        $app = JFactory::getApplication();
        $cid = $app->input->get("cid", null, "array");

        if(is_null($cid) || !count($cid))
        {
            $this->setError(JText::_('JR_SELECT_ROW_TO_TASK'));
            return false;
        }
        
        $query = $this->_db->getQuery(true);
        $query->delete("#__jlexreview_report")
              ->where("id IN(".implode(",", $cid).")");
        
        $this->_db->setQuery($query)->execute();
        
        return true;
    }
}

Anon7 - 2022
AnonSec Team