Your IP : 216.73.216.248


Current Path : /home/digilove/public_html/components/com_marketplace/controllers/
Upload File :
Current File : /home/digilove/public_html/components/com_marketplace/controllers/sellerlist.php

<?php
/**
 * Marketplace - Component Marketplace 
 * ******************************************************************
 *
 * PHP version 7.0
 *
 * @category   Component
 * @package    Joomla
 * @author     WebKul software private limited <support@webkul.com>
 * @copyright  2010 WebKul software private limited
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version    GIT:5.2
 * @filesource http://store.webkul.com
 * @link       Technical Support:  webkul.uvdesk.com
 * ******************************************************************
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.controller');
jimport('joomla.filesystem.file');
if (!class_exists('MarketplaceControllerSellerlist')) {
    /**
     * MarketplaceControllerSellerlist class
     * 
     * @category Component
     * @package  Joomla
     * @author   WebKul software private limited <support@webkul.com>
     * @license  http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
     * @link     Technical Support:  webkul.uvdesk.com
     */
    class MarketplaceControllerSellerlist extends JControllerLegacy
    {
        /**
         * Display function
         *
         * @param boolean $cachable  var
         * @param array   $urlparams var
         * 
         * @return void
         */
        function display($cachable = false, $urlparams = array())
        {
            parent::display();
        }
        /**
         * LazyLoad function
         *
         * @return void
         */
        function lazyLoad()
        {
            $app = JFactory::getApplication();
            $_input = $app->input;
            $start=$_input->get('start', 0);
            $limit=$_input->get('limit', 0);
            $mode=$_input->get('mode', '');
            $model=$this->getModel('sellerlist');
            $lazy_seller=$model->getRecords($start, $limit);
            $data='';
            $jinput=JFactory::getApplication()->input;
            $sellerprofilemenu=plgSystemMarketplace::getMenuId(
                'index.php?option=com_marketplace&view=sellerprofile'
            );
            if ($mode=='grid') {
                foreach ($lazy_seller as $key=>$value) {
                    if (!strlen(trim($value->screenname))) {
                        $seller_name=JFactory::getUser($value->seller_id)->name;
                    } else {
                        $seller_name=$value->screenname;
                    }
                    if (!strlen(trim($value->email))) {
                        $seller_email='N/A';
                    } else {
                        $seller_email=$value->email;
                    }
                    if (!strlen(trim($value->companyname))) {
                        $seller_shopname='N/A';
                    } else {
                        $seller_shopname=$value->companyname;
                    }

                    if (isset($value->phone_1)) {
                        $contact=$value->phone_1;
                    } else {
                        $contact='N/A';
                    }
                    
                    if (!strlen(trim($value->companylogo))) {
                        $src=JURI::root().
                            'administrator/components/com_marketpla'.
                            'ce/assets/images/no-image.png';
                    } else {
                        $src=JURI::root().$value->companylogo;
                    }
                    $data.='<a href="'.JRoute::_("index.php?option=com_marketplace&view=sellerprofile&Itemid=".$sellerprofilemenu.'&seller_id='.$value->seller_id).'"><div class="seller_pane"><div class="seller_pane_overlay"><div class="sellerInfo"><div class="infocontains"><p><strong>'.JText::_('SHOP_NAME').'</strong></p><p>'.$seller_shopname.'</p></div><div class="infocontains"><p><strong>'.JText::_('SELLER_EMAIL').'</strong></p><p>'.$seller_email.'</p></div><div class="infocontains"><p><strong>'.JText::_('SELLER_CONTACT').'</strong></p><p>';
                    
                    $data.=$contact;

                    $data.='</p></div></div></div><div class="wk_seller_image"><img src="'.$src.'" class="seller_img_size"></div><div class="wk_seller_name"><div class="wk_seller_tooltip"></div><div class="wk_seller_heading"><p>'.$seller_name.'</p></div></div></div></a>';
                }
            } else {
                $model=$this->getModel('sellerlist');
                $i=0;
                foreach ($lazy_seller as $value) {
                    if ($value->phone_1==null) {
                        $value->phone_1='N/A';
                    }
                    if ($value->email==null) {
                        $value->email='N/A';
                    }
                    if (!strlen($value->screenname)) {
                        $value->screenname
                            =JFactory::getUser($value->seller_id)->name;
                    }
                    
                    if ($value->companyname==null) {
                        $value->companyname='N/A';
                    }
                    if (strlen(trim($value->companylogo))) {
                        $src=JURI::root().$value->companylogo;
                    } else {
                        $src=JURI::root().'administrator/components/com_marketplace/assets/images/no-image.png';
                    }
                    if ($i%2==0) {
                        $class="active";
                    } else {
                        $class="warning";
                    }
                    $data.='<tr  class="mprow '.$class.'" ><td data-title="'.JText::_('SELLER').'" class="center"><a class="seller_avatar" href="'.JRoute::_('index.php?option=com_marketplace&view=sellerprofile&Itemid='.$sellerprofilemenu.'&seller_id='.$value->seller_id).'"><img class="avatarimg" src="'.$src.'"/></a></td><td class="center" data-title="'.JText::_('SELLER_NAME').'"><a href="'.JRoute::_('index.php?option=com_marketplace&view=sellerprofile&Itemid='.$sellerprofilemenu.'&seller_id='.$value->seller_id).'">'.$value->screenname.'</a></td><td class="center" data-title="'.JText::_('SHOP_NAME').'"><a href="'.JRoute::_('index.php?option=com_marketplace&view=sellerprofile&Itemid='.$sellerprofilemenu.'&seller_id='.$value->seller_id).'">'.$value->companyname.'</a></td><td class="center" data-title="'.JText::_('CONTACT_NO').'">'.$value->phone_1.'</td><td  data-title="'.JText::_('E_MAIL').'" class="center">'.$value->email.'</td></tr>';
                    $i++;
                }
            }
            echo $data;
            JFactory::getApplication()->close();
        }
    }
}
?>