Your IP : 216.73.216.231


Current Path : /home/digilove/public_html/components/com_marketplace/views/profile/tmpl/
Upload File :
Current File : /home/digilove/public_html/components/com_marketplace/views/profile/tmpl/default.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.filter.output');
jimport('joomla.environment.browser');
JHtml::_('behavior.formvalidator');
$browser =JBrowser::getInstance();
$browserType = $browser->getBrowser();
$browserVersion = $browser->getAgentString();

$doc = JFactory::getDocument();
JHtml::_('jquery.framework');
if (!class_exists('VmConfig')) {
    include JPATH_ADMINISTRATOR.'/components/com_virtuemart/helpers/config.php';
}
if (!class_exists('MarketplaceHelper')) {
    include JPATH_ADMINISTRATOR.DIRECTORY_SEPARATOR.
    'components'.DIRECTORY_SEPARATOR.'com_marketplace'.
    DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.
    'marketplace.php';
}
VmConfig::loadConfig();
$wk_model=$this->getModel('profile');
/*code to get auth id by stripeconnect*/
if (JFactory::getApplication()->input->get('code')
    && JFactory::getApplication()->input->get('code') !=null
) {
    $code = JFactory::getApplication()->input->get('code');
    $token_request_body = array(
        'grant_type' => 'authorization_code',
        'client_id' => $this->stripe_client_id,
        'code' => $code,
        'client_secret' => $this->secret_key
    );

    $req = curl_init('https://connect.stripe.com/oauth/token');
    curl_setopt($req, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($req, CURLOPT_POST, true);
    curl_setopt($req, CURLOPT_POSTFIELDS, http_build_query($token_request_body));
    // TODO: Additional error handling
    $respCode = curl_getinfo($req, CURLINFO_HTTP_CODE);
    curl_setopt($req, CURLOPT_SSL_VERIFYPEER, false);
    $resp = json_decode(curl_exec($req), true);
    $state1='insert';
    
    $wk_model->storeStripeData(
        $resp,
        $this->secret_key,
        $this->public_key,
        $this->stripe_client_id,
        $state1
    );
    JFactory::getApplication()->redirect(
        'index.php?option=com_marketplace&view=profile',
        'Account connected',
        'success'
    );
} elseif (JFactory::getApplication()->input->get('error')) {
    JFactory::getApplication()->redirect(
        'index.php?option=com_marketplace&view=profile',
        JFactory::getApplication()->input->get('error_description'),
        'error'
    );
}
/**
 * Fetching remita seller info if remita instatlled
 */
$checkRemitaInstallation=JPluginHelper::getPlugin('vmpayment', 'remitasplit');
if (!empty($checkRemitaInstallation)) {
    $remitaSellerData=$wk_model->getRemitaSeller();
    if (!$remitaSellerData) {
        $remitaSellerData =new stdClass();
        $remitaSellerData->name="";
        $remitaSellerData->account="";
        $remitaSellerData->bankcode="";
    }
}
$params = JComponentHelper::getParams('com_languages');
$defaultcountry_code = trim($params->get('site'));
$GLOBALS['virtuemart_categories_table_name'] = strtolower(
    str_replace(
        "-",
        "_",
        $defaultcountry_code
    )
);
$document = JFactory::getDocument();
$param  = JComponentHelper::getParams('com_marketplace');
$mapkey=trim($param->get('mapkey'));
$bgcolor=trim($param->get('head_bg_color'));
$textcolor=trim($param->get('head_txt_color'));
$document->addStyleSheet(
    JURI::root().
    'components/com_marketplace/css/newdesign/marketplace.css'
);
$document->addStyleSheet(
    JURI::root().
    'components/com_marketplace/css/marketplacesupport.css'
);
$document->addStyleSheet(
    JURI::root().'components/com_marketplace/css/styles.css'
);
$document->addStyleSheet(
    JURI::root().'components/com_marketplace/css/newdesign/addproduct.css'
);
$document->addStyleSheet(
    JURI::root().'components/com_marketplace/css/profile.css'
);
$document->addStyleSheet(
    JURI::root().'components/com_marketplace/css/msdropdown/dd.css'
);
$document->addStyleSheet(
    JURI::root().'components/com_marketplace/css/msdropdown/flags.css'
);
$document->addScript(
    JURI::root().'components/com_marketplace/js/msdropdown/jquery.dd.min.js'
);
$document->addScript(
    '//maps.googleapis.com/maps/api/js?libraries=plac'.
    'es&key='.$mapkey.'&language=en-GB'
);
$document->addScript(
    JURI::root().
    'components/com_marketplace/assets/fancybox/jquery.easing-1.3.pack.js'
);

if ($browserType!="mozilla") {
    $document->addScript(JURI::root().'components/com_marketplace/js/profile3.js');
    $document->addScript(
        JURI::root().'components/com_marketplace/assets/webcam/webcam123.js'
    );
} else {
    $document->addScript(JURI::root().'components/com_marketplace/js/profile2.js');
}
$document->addStyleSheet(
    'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css'
);
$document->addStyleSheet(
    JURI::root().'components/com_marketplace/css/easy-responsive-tabs.css'
);
$document->addScript(
    JURI::root().'components/com_marketplace/js/easy-responsive-tabs.js'
);
JHtml::_('jquery.ui');
JHtml::_('bootstrap.framework');
$model=$this->getModel();
$countryid=$model->getCountryId(JFactory::getUser()->id);

for ($i=0, $n=count($this->data); $i < $n; $i++) {
    $item = $this->data[$i];
    $l=explode('::', $item->shop_location);
    
    if (count($l)<2) {
        $lg=0;
        $lt=0;
    } elseif ($l[0]=='' && $l[1]=='') {
        $lg=0.00;
        $lt=0.00;
    } else {
        $lg=$l[1];
        $lt=$l[0];
    }
    
    /**
     * *****************************************
     * For country select list
     */
    $country_html_id="countries";
    $country_html_name="countries";
    $country_select = MarketplaceHelper::getCountrySelectField(
        $item->countrylogo, $country_html_id, $country_html_name,
        "width:92%", " required"
    );
    /**
     * For country select list
     * ****************END HERE*****************
     */
    $country_mod = VmModel::getModel("Country");
    $country_data = $country_mod->getCountryByCode($item->countrylogo);
    $state_mod = VmModel::getModel("State");
    if ($country_data != false) {
        $state_data = $state_mod->getStates($country_data->virtuemart_country_id);
    } else {
        $state_data = array();
    }
    $state_arr=array();
    foreach ($state_data as $key => $value) {
        $state_arr[]= array(
            'value' => $value->virtuemart_state_id,
            'text' => $value->state_name,
        );
    }

    $name="state_vm";
    $options = array(
        'id' => "virtuemart_state_id", // HTML id for select field
        'list.attr' => array( // additional HTML attributes for select field
            'class'=>'field-groups',
            "style"=>'width:92%;'
        ),
        'option.key'=>'value', // key name for value in data array
        'option.text'=>'text', // key name for text in data array
        'list.select'=>$item->state_vm, // value of the SELECTED field
    );
    $state_html = JHtmlSelect::genericlist($state_arr, $name, $options);
    $document->addScriptDeclaration(
        'jQuery(document).ready(function(){
            var oDropdown = jQuery("#virtuemart_state_id").msDropdown().data("dd");
            jQuery("#'.$country_html_id.'").change(function() {
                oDropdown = jQuery("#virtuemart_state_id").msDropdown().data("dd");
                oDropdown.destroy();
                var countryid = jQuery(this).children(":selected").attr("data-id");
                jQuery.ajax({
                    type:"post",
                    url:"'.JRoute::_(
            'index.php?option=com_marketplace&task=mpregistration.getRegistrationState',
            false
        ).          '",
                    data: {"ID" : countryid},
                    success:function(data){
                        jQuery("#virtuemart_state_id").html(data);
                        jQuery("#virtuemart_state_id").msDropdown().data("dd");
                    }
                });
            });
        });
        
      '
    );
    /*********Calculated Modules******************/
    $obj=new JDocumentHTML();
    $mod="";
    if (!$obj->countModules('wk_marketplace-left')&& !$obj->countModules('wk_marketplace-right')) {
        $both=0;
    } elseif ((!$obj->countModules('wk_marketplace-left') && $obj->countModules('wk_marketplace-right'))||($obj->countModules('wk_marketplace-left') && $obj->countModules('wk_marketplace-right'))) {
        $both=1;
        if (!$obj->countModules('wk_marketplace-left') && $obj->countModules('wk_marketplace-right')) {
            $mod="r";
        } else {
            $mod="l";
        }
    } else {
        $both=2;
    }
    if ($both==0) {
        $maxwidth="900";
    } elseif ($both==1) {
        $maxwidth="700";
    } else {
        $maxwidth="550";
    }
    
?>
<style type="text/css">
    .order_history{
background-color:<?php echo $bgcolor;?>;

}
.detail_text{
color:<?php echo $textcolor;?>;
}
.payment_method i{
color: #2196F3!important;
}
.wk_separate {
    margin-top: 10px !important;
    height: 50px;
}
.wk_main_loader{
        position: relative;
}
.wk_main_loader_overlay{
    position: absolute;
    background-color: #FFF ! important; 
    z-index: 2147483647; 
    width:101%;
    height:100%;
    border: 1px solid #CCCCCC;
    border-radius: 10px;
}
</style>
<?php
/*********Calculated Modules End******************/
?>
<script type="text/javascript">

jQuery(document).ready(function () {
    jQuery(".selectpicker").msDropdown();
        navigator.getMedia = (navigator.getUserMedia || // use the proper vendor prefix
            navigator.webkitGetUserMedia ||
            navigator.mozGetUserMedia ||
            navigator.msGetUserMedia);

        if (navigator.getMedia !== undefined) {
            navigator.getMedia({
                video: true
            }, function () {}, function () {
                jQuery('.update_pic_options .take_pic_').css('display', 'none');
            });
        } else
            jQuery('.update_pic_options .take_pic_').css('display', 'none');
    jQuery("iframe").height(120);
});
jQuery(window).load(function () {
    jQuery('.wk_main_loader_overlay').css('display', 'none');
});
jQuery('body').on('change', '.soc_options input[type="checkbox"]', function () {

    if (jQuery(this).is(':checked')) {
        jQuery(this).parent().parent().next('.wk_social_ids').css('display', 'block');
        if (jQuery(this).attr('id') == 'wk_facebook') {
            jQuery(this).attr('value', "FACEBOOK_CHECK");
        } else if (jQuery(this).attr('id') == 'wk_twitter') {
            jQuery(this).attr('value', "TWITTER_CHECK");
        } else if (jQuery(this).attr('id') == 'wk_google') {
            jQuery(this).attr('value', "GOOGLE_CHECK");
        } else if (jQuery(this).attr('id') == 'wk_linkedin') {
            jQuery(this).attr('value', "LINKEDIN_CHECK");
        }
    } else {
        jQuery(this).parent().parent().next('.wk_social_ids').children('input').val('');
        jQuery(this).parent().parent().next('.wk_social_ids').css('display', 'none');
        jQuery(this).attr('value', "")
    }
});
jQuery('body').on('change', '.wk_payment_single input[type="checkbox"]', function () {
    if (jQuery(this).is(':checked')) {
        jQuery(this).parent().parent().next().children('input,textarea').attr('name', 'payment[]');
        jQuery(this).parent().parent().next('.wk_payment_ids').children().css('display', 'block');

    } else {
        jQuery(this).parent().parent().next('.wk_payment_ids').children().css('display', 'none');
        jQuery(this).parent().parent().next().children('textarea,input[name="payment[]"]').removeAttr('name');
    }
});
jQuery('.update_profile_pic').click(function () {
    jQuery(this).css('display', 'none!important');
});

jQuery(function () {
    if (jQuery('.en_check').is(":checked")) {

        jQuery('.en_check').parent('.social_check').fadeIn();
    }
    <?php if (isset($soc_mode)>0) {
    ?>
    var soc_mode = jQuery.parseJSON('<?php echo json_encode($soc_mode); ?>');
    var soc_id = jQuery.parseJSON('<?php echo json_encode($soc_id); ?>');
    jQuery.each(soc_mode, function (key, val) {
        jQuery('#' + val).attr("checked", 'true');
        jQuery('#' + val).next('.lbl').after("&nbsp;&nbsp;<input class='entry width-100-mp text-padd soc_chk_txt' type='text' value=" + soc_id[key] + " name='social_id[]' placeholder='Enter ID related to Social Platform. eg. google'>");
    });
    <?php } ?>
});
/*++++++++++++++++++Social Tab++++++++++++++++++++++++++++++++++*/
var oldMarker;

function initialize() {
    var icon = "green";
    var latlng = {
        lat: <?php echo ' '.$lt; ?>,
        lng: <?php echo ' '.$lg; ?>
    };
    var map = new google.maps.Map(document.getElementById('map_canvas'), {
        zoom: 12,
        center: latlng
    });
    icon = "http://maps.google.com/mapfiles/ms/icons/" + icon + ".png";
    var marker = new google.maps.Marker({
        position: latlng,
        map: map,
        icon: new google.maps.MarkerImage(icon),
        title: 'saved location'
    });
    google.maps.event.addListener(map, 'click', function (event) {
        jQuery('#lat').val(event.latLng.lat());
        jQuery('#lang').val(event.latLng.lng());
        placeMarker(event.latLng);
    });

    function placeMarker(location) {
        var iconBase = '//maps.google.com/mapfiles/kml/shapes/';
        var infowindow = new google.maps.InfoWindow({
            content: 'Your location'
        });
        icon = "red";
        icon = "//maps.google.com/mapfiles/ms/icons/" + icon + ".png";
        marker1 = new google.maps.Marker({
            position: location,
            map: map,
            icon: new google.maps.MarkerImage(icon),
            animation: google.maps.Animation.BOUNCE
        });
        if (typeof oldMarker != 'undefined') {
            oldMarker.setMap(null);
        }
        oldMarker = marker1;
        map.setCenter(location);
        marker1.addListener('click', function () {
            infowindow.open(map, marker1);
        });
    }
    var input = document.getElementById('pac_input');
    var searchBox = new google.maps.places.SearchBox(input);
    map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
    // Bias the SearchBox results towards current map's viewport.
    map.addListener('bounds_changed', function () {
        searchBox.setBounds(map.getBounds());
    });
    var markers = [];
    searchBox.addListener('places_changed', function () {
        var places = searchBox.getPlaces();
        if (places.length == 0) {
            return;
        }
        // Clear out the old markers.
        markers.forEach(function (marker) {
            marker.setMap(null);
        });
        markers = [];
        // For each place, get the icon, name and location.
        var bounds = new google.maps.LatLngBounds();
        places.forEach(function (place) {
            var icon = {
                url: place.icon,
                size: new google.maps.Size(71, 71),
                origin: new google.maps.Point(0, 0),
                anchor: new google.maps.Point(17, 34),
                scaledSize: new google.maps.Size(25, 25)
            };
            // Create a marker for each place.
            markers.push(new google.maps.Marker({
                map: map,
                icon: icon,
                title: place.name,
                position: place.geometry.location
            }));
            if (place.geometry.viewport) {
                // Only geocodes have viewport.
                bounds.union(place.geometry.viewport);
            } else {
                bounds.extend(place.geometry.location);
            }
        });
        map.fitBounds(bounds);
    });
}
jQuery(function () {
    jQuery('.resp-tabs-container .resp-accordion:nth-child(1)').addClass('resp-tab-active');
    jQuery('.resp-tabs-container .contentbar:nth-child(1)').addClass('resp-tab-content-active');
    jQuery('#horizontalTab').easyResponsiveTabs({
        type: 'vertical', //Types: default, vertical, accordion
        width: 'auto', //auto or any width like 600px
        fit: true, // 100% fit in a container
        closed: 'accordion', // Start closed if in accordion view
        activate: function (event) { // Callback function if tab is switched
            var $tab = jQuery(this);
            var $info = jQuery('#tabInfo');
            var $name = jQuery('span', $info);
            $name.text($tab.text());
            $info.show();
        }
    });
    jQuery('#verticalTab').easyResponsiveTabs({
        type: 'vertical',
        width: 'auto',
        fit: true
    });
});
</script>
<style type="text/css">
    .sellerprofile_main,.marketplace_position1,.marketplace_position2 {
        margin: 5px;
        display:inline-block;
        vertical-align: top;
    }
    .wk_payment_ids{
        margin-top: 15px;
    }
    .sellerprofile_main *{
        font-size: 15px!important;
    }
    .update_cover_options .take_pic_ {
        display: none;
    }
    
</style>
<!--****************Custom Position********************************* -->
<div style="width:100%;" class="wk_main_loader">
    <div class="wk_main_loader_overlay" >
        <img style="display:block;margin:0 auto;" src="<?php echo "components/com_marketplace/"?>images/ajaxspinner1.gif"/>
    </div>

<div class="Wk_outer">
    <div class="marketplace_position-top" style="clear:both;"><?php echo JHTML::_('content.prepare', '{loadposition wk_marketplace-top}'); ?></div>
    <div class="marketplace_position1"><?php echo JHTML::_('content.prepare', '{loadposition wk_marketplace-left}'); ?></div>
    <!-- ****************Custom Position end********************************* -->
    <?php
        $profilemenu=plgSystemMarketplace::getMenuId('index.php?option=com_marketplace&view=profile');
    ?>
    <div class="sellerprofile_main">
        <div class="order_history"><span class="detail_design"></span><span class="detail_text"><?php echo JText::_('MY_PROFILE')?></span></div>
        <div id="horizontalTab">
            <!-- <input checked data-toggle="toggle" data-on="Enable" data-off="Disable" data-onstyle="success" data-offstyle="warning" data-style="ios" type="checkbox" id=""> -->
            <form class="form-validate" id="profile_form" action="<?php echo JRoute::_('index.php?option=com_marketplace&view=profile&Itemid='.$profilemenu, false)?>" method="post" enctype="multipart/form-data">
                <ul class="resp-tabs-list">
                    <li id="p_p"><?php echo JText::_('PERSONAL_PROFILE');?></li>
                    <li id="s_p"><?php echo JText::_('SOCIAL_PROFILE');?></li>
                    <li id="a_s"><?php echo JText::_('ABOUT_SHOP');?></li>
                    <li id="p_m"><?php echo JText::_('PAYMENT_MODE');?></li>
                    <?php
                    $i=0;
                    foreach ($this->addonData as $value) {
                        echo "<li id='addon".$i++."'>".$value["title"]."</li>";
                    }
                    ?>
                </ul>
                <div class="resp-tabs-container">
                    <div class="panel-body contentbar">
                        <?php if ($item->companybanner == '') { ?>
                                <div class="mp_banner">
                                    <img class="wk_banner" src="components/com_marketplace/images/defaultcover.png" />
                                    <div id="dvPreview1">
                                    </div>
                                    <div  class="change_cover"><i class="fa fa-pencil"></i><div class="change_cover_text"><?php echo JText::_("CHANGE_COVER");?></div>
                                    <div class="update_cover_options">
                                        <div class="upload_cover_"><?php echo JText::_("UPLOAD_PHOTO");?></div>
                                        <div class="remove_cover_"><?php echo JText::_("REMOVE");?></div>
                                    </div></div>
                                </div>
                                <?php } else { ?>
                                <div class="mp_banner">
                                    <img class="wk_banner" src="<?php echo $item->companybanner; ?>" />
                                    <div id="dvPreview1">
                                    </div>
                                    <div  class="change_cover"><i class="fa fa-pencil"></i><div class="change_cover_text"><?php echo JText::_("CHANGE_COVER");?></div>
                                    <div class="update_cover_options">
                                        <div class="upload_cover_"><?php echo JText::_("UPLOAD_PHOTO");?></div>
                                        <div class="take_pic_"><i class="fa fa-camera" style="padding-left:0px !important;"></i>Take a photo</div>
                                        <div class="remove_cover_"><?php echo JText::_("REMOVE");?></div>
                                    </div></div>
                                </div>
                                <?php } if ($item->companylogo == '') { ?>
                                <div class="mp_pro_pic">
                                    <img class="wk_mplogo" src="<?php echo juri::root(); ?>components/com_marketplace/images/generic-pic.png" />
                                    <div id="dvPreview">
                                    </div>
                                <?php } else { ?>
                                    <div class="mp_pro_pic">
                                        <img class="wk_mplogo" src="<?php echo $item->companylogo; ?>" />
                                <?php }  ?>
                                        <div id="dvPreview">
                                        </div>
                                        <div  class="update_profile_pic"><?php echo JText::_("UPDATE_PROFILE_PICTURE");?></div>
                                        <div  class="update_pic_options">
                                            <div class="upload_pic_"><?php echo JText::_("UPLOAD_PHOTO");?></div>
                                            <input id="upload_pic_" accept="image/*;capture=camcorder" type="file" name="companylogo">
                                            <div class="take_pic_"><i class="fa fa-camera" style="padding-left:0px !important;"></i><?php echo JText::_("TAKE_A_PHOTO");?></div>
                                            <div class="remove_pic_"><?php echo JText::_("REMOVE");?></div>
                                        </div>
                                        <input id="change_mpcover" class="entry form-control" type="file" name="companybanner" />
                                    </div>
                        
                                    <!--******************photobooth start*************************************-->
                                    <style type="text/css">
                                    #close_cam:hover{
                                        color: red;
                                        cursor: pointer;
                                    }
                                    </style>
                                    <div class="seprator">
                                        
                                        <div class="desk">
                                            <div id="result"><img></div>
                                            <div id="camera" style="display:none;">
                                                <span id="close_cam">X</span>
                                    <?php
                                    if ($browserType!="mozilla") { ?>
                                        <div id="video"></div>
                                        <input type=button value="Capture" id="cam_snap">
                                        <div id="canvas" width="600" height="400"></div>
                                    <?php } else { ?>
                                        <video id="video" autoplay></video>
                                        <input type="button" id="cam_snap" value="Capture" name="cam_snap">
                                        <canvas id="canvas" width="600" height="400"></canvas>
                                    <?php }
                                    ?>
                                        <button id="new">New</button>
                                        </div>
                                    </div>
                                </div>
                                <?php
                                if ($browserType!="mozilla") { ?>
                                    <script src="components/com_marketplace/assets/webcam/webcam123.js"></script>
                                    <script language="JavaScript">
                                        Webcam.set({
                                            // live preview size
                                            width: 600,
                                            height: 400,
                                            // device capture size
                                            dest_width: 600,
                                            dest_height: 400,
                                            
                                            // final cropped size
                                            crop_width: 600,
                                            crop_height: 400,
                                            
                                            // format and quality
                                            image_format: 'jpeg',
                                            jpeg_quality: 90
                                        });
                                        Webcam.attach( '#video' );
                                    </script>
                                <?php } else { ?>
                                        <script src="components/com_marketplace/assets/webcam/webcam.js"></script>
                                        <script src="components/com_marketplace/js/script.js"></script>
                                <?php }
                                ?>
                                <script>
                                // Put event listeners into place
                                var wk_coun="<?php echo $item->countrylogo;?>";
                                jQuery('.mp_pro_pic').on('click',function(){
                                    jQuery( ".update_profile_pic").css("display","block");
                                });
                                jQuery( ".mp_pro_pic, .update_profile_pic" ).on('mouseenter',function() {
                                jQuery( ".update_profile_pic").css( "display","block");
                                });
                                jQuery( ".mp_pro_pic, .update_profile_pic" ).on('mouseleave',function() {
                                jQuery( ".update_profile_pic").css( "display","none");
                                });
                                jQuery('.update_profile_pic').click(function() {
                                jQuery( ".update_pic_options" ).toggle();
                                });
                                jQuery(document).ready(function(){
                                    if(wk_coun!=null){
                                        jQuery(".wk_country #countries").val(wk_coun);
                                    }
                                    jQuery("span[aria-controls='tab_item-0']").addClass("resp-tab-active");
                                    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
                                        jQuery('.take_pic_').css('display','none');
                                    }
                                    jQuery('#new').hide(0);
                                    jQuery('#upload_pic').hide(0);
                                    var videoObj='';
                                    // Trigger photo take
                                    jQuery("#cam_snap").on("click", function(e) {
                                        <?php
                                        if ($browserType!="mozilla") { ?>
                                            Webcam.snap(function(data_uri) {
                                                document.getElementById('canvas').innerHTML =
                                                '<img src="' + data_uri + '"/>';
                                            });
                                        <?php } else { ?>
                                            var canvas = document.getElementById("canvas"),
                                            context = canvas.getContext("2d")
                                            context.drawImage(video, 0, 0, 600, 400);
                                        <?php } ?>
                                        jQuery('#video').hide('slow');
                                        jQuery('#canvas').show('slow');
                                        jQuery('#cam_snap').hide('slow');
                                        jQuery('#new').show('slow');
                                        jQuery('#upload_pic').show('slow');
                                        e.preventDefault();
                                    
                                    });
                                    
                                    // Capture New Photo
                                    jQuery("#new").on("click", function(e) {
                                        jQuery('#video').show('slow');
                                        jQuery('#canvas').hide('slow');
                                        jQuery('#cam_snap').show('slow');
                                        jQuery('#new').hide();
                                        jQuery('#upload_pic').hide();
                                        e.preventDefault();
                                    });
                                    // Upload image to sever
                                    jQuery("body").on("click",'#upload_pic', function(e){
                                        <?php
                                        if ($browserType!="mozilla") { ?>
                                            var dataUrl = jQuery("#canvas").find("img").attr("src");
                                        <?php } else { ?>
                                            var dataUrl = canvas.toDataURL();
                                        <?php } ?>
                                        jQuery.ajax({
                                            type: "post",
                                            url: "<?php echo JRoute::_('index.php?option=com_marketplace&view=profile&task=profile.uploadpic', false);?>",
                                            data: {
                                            imgBase64: dataUrl,seller_id:"<?php echo $item->seller_id;?>"},
                                            success: function(data)
                                            {
                                                var name=data;
                                                
                                                jQuery(".wk_mplogo").attr('src',data);
                                                jQuery('#video').show('slow');
                                                jQuery('#canvas').hide('slow');
                                                jQuery('#cam_snap').show('slow');
                                                jQuery('#new').hide();
                                                jQuery('#upload_pic').hide();
                                                jQuery('#camera').hide();
                                                
                                            }
                                        });
                                        e.preventDefault();
                                    });
                                });
                                var both=<?php echo $both;?>;
                                var mod="<?php echo $mod;?>";
                                jQuery(window).on('load resize',function(){
                                    if(both==2){
                                        if(jQuery('.Wk_outer').width()>=900){
                                            jQuery('.marketplace_position1').css("width","19%");
                                            jQuery('.marketplace_position2').css("width","19%");
                                            jQuery('.sellerprofile_main').css("width","57%");
                                        }
                                        else if(jQuery('.Wk_outer').width()<766 && jQuery('.Wk_outer').width()>650){
                                            jQuery('.marketplace_position1').css("width","23%");
                                            jQuery('.marketplace_position2').css("width","99%");
                                            jQuery('.sellerprofile_main').css("width","73%");
                                        }
                                        else if( jQuery('.Wk_outer').width()<=650){
                                            jQuery('.marketplace_position1').css("width","99.5%");
                                            jQuery('.marketplace_position2').css("width","99.5%");
                                            jQuery('.sellerprofile_main').css("width","99.5%");
                                        }
                                    }
                                    else if(both==1){
                                        if(jQuery('.Wk_outer').width()>=724){
                                            if (mod=="l")
                                                jQuery('.marketplace_position1').css("width","23.5%");
                                            else
                                                jQuery('.marketplace_position2').css("width","23.5%");
                                            jQuery('.sellerprofile_main').css("width","70.5%");
                                        }
                                        else if( jQuery('.Wk_outer').width()<724){
                                            if (mod=="l")
                                                jQuery('.marketplace_position1').css("width","99.5%");
                                            else
                                                jQuery('.marketplace_position2').css("width","99.5%");
                                            jQuery('.sellerprofile_main').css("width","99.5%");
                                        }
                                    }
                                    else{
                                        jQuery('.sellerprofile_main').css("width","99.5%");
                                    }
                                });
                                
                                    var seller_id='<?php echo $item->seller_id; ?>';
                                    var wkurl='<?php echo juri::root();?>';
                                </script>
                                <script>
                                jQuery(document).ready(function() {
                                    jQuery("#countries").msDropdown();
                                });
                                </script>
                                <div style="clear:both;"></div>
                        <div class="wk_input_wrapper">
                            <div class="wk_input_label">
                                <i class="fa fa-user" aria-hidden="true"></i>
                                <label for="sell_screen"><?php echo JText::_('SCREEN_NAME');?></label>
                            </div>
                            <div class="wk_input_box">
                                <input id="sell_screen" data-field="<?php echo JText::_('SCREEN_NAME');?>" placeholder="<?php echo JText::_('WK_ONLYALPHABET_NAME');?>" value="<?php echo htmlspecialchars($item->screenname, ENT_QUOTES); ?>" name="screenname" type="text" class="inputbox validate-screen required">
                            </div>
                        </div>
                        <div class="wk_input_wrapper">
                            <div class="wk_input_label">
                                <i class="fa fa-venus-mars" aria-hidden="true"></i>
                                <label for="sell_gender" data-error="<?php echo JText::_("WK_SELECT_GENDER");?>"><?php echo JText::_("GENDER");?></label>
                            </div>
                            <div class="wk_input_box">
                                <select id="sell_gender" name='gender' style="width:102.5%;" class="entry selectpicker wdth-select required" data-style="btn-primary">
                                    <option class='wk-option' value="" selected="selected"><h3><?php echo JText::_("SELECT_GENDER");?></h3></option>
                                    <option class='wk-option' value="1"
                                        <?php
                                        if ($item->gender=='1') {
                                            echo 'selected="selected"';
                                        }
                                        ?>
                                    ><?php echo JText::_("MALE");?></option>
                                    <option class='wk-option'
                                        <?php
                                        if ($item->gender=='2') {
                                            echo 'selected="selected"';
                                        }
                                        ?>
                                    value="2"><?php echo JText::_("FEMALE");?></option>
                                </select>
                                <div style="clear:both;"></div>
                            </div>
                        </div>
                        <div class="wk_input_wrapper">
                            <div class="wk_input_label">
                                <i class="fa fa-user" aria-hidden="true"></i>
                                <label for="first_name"><?php echo JText::_('FIRST_NAME');?></label>
                            </div>
                            <div class="wk_input_box">
                                <input id="first_name" data-field="<?php echo JText::_('FIRST_NAME');?>" placeholder="<?php echo JText::_('SELLER_USERNAME_FL');?>" value="<?php echo htmlspecialchars($item->first_name, ENT_QUOTES); ?>" name="first_name" type="text" class="validate-name required">
                            </div>
                        </div>
                        <div class="wk_input_wrapper">
                            <div class="wk_input_label">
                                <i class="fa fa-user" aria-hidden="true"></i>
                                <label for="last_name"><?php echo JText::_('LAST_NAME');?></label>
                            </div>
                            <div class="wk_input_box">
                                <input id="last_name" data-field="<?php echo JText::_('LAST_NAME');?>" placeholder="<?php echo JText::_('SELLER_USERNAME_FL');?>" value="<?php echo htmlspecialchars($item->last_name, ENT_QUOTES); ?>" name="last_name" type="text" class="validate-name required">
                            </div>
                        </div>
                        <div class="wk_input_wrapper">
                            <div class="wk_input_label">
                                <i class="fa fa-shopping-bag" aria-hidden="true"></i>
                                <label for="sell_companyname"><?php echo JText::_('SHOP_NAME');?></label>
                            </div>
                            <div class="wk_input_box">
                                <input id="sell_companyname" data-field="<?php echo JText::_('SHOP_NAME');?>" placeholder="<?php echo JText::_('SELLER_USERNAME_COMPANY');?>" value="<?php echo htmlspecialchars($item->companyname, ENT_QUOTES); ?>" name="companyname" type="text" class="validate-company required">
                            </div>
                        </div>
                        <div class="wk_input_wrapper">
                            <div class="wk_input_label">
                                <i class="fa fa-phone-square" aria-hidden="true"></i>
                                <label for="sell_phone"><?php echo JText::_('PHONE_NO_1');?></label>
                            </div>
                            <div class="wk_input_box">
                                <input id="sell_phone" value="<?php echo $item->phone; ?>" data-field="<?php echo JText::_('PHONE_NO_1');?>" placeholder="<?php echo JText::_('SELLER_PHONE');?>" name="phone" type="text" class="validate-phone required">
                            </div>
                        </div>
                        <div class="wk_country">
                            <div class="wk_input_label">
                                <i class="fa fa-map" aria-hidden="true"></i>
                                <label for="<?php echo $country_html_id;?>" data-error="<?php echo JText::_("SELECT_ONE_COUNTRY");?>"><?php echo JText::_('SELECT_YOUR_COUNTRY');?></label>
                            </div>
                            <?php
                            echo $country_select
                            ?>
                        </div>
                        <div class="wk_country">
                            <div class="wk_input_label">
                                <i class="fa fa-map" aria-hidden="true"></i>
                                <label for="virtuemart_state_id"><?php echo JText::_('SELECT_YOUR_STATE');?></label>
                            </div>
                            <?php
                            echo $state_html;
                            ?>
                        </div>
                        <div class="wk_input_wrapper">
                            <div class="wk_input_label">
                                <i class="fa fa-globe" aria-hidden="true"></i>
                                <label for="sell_companylocality"><?php echo JText::_('SHOP_LOCALITY');?></label>
                            </div>
                            <div class="wk_input_box" >
                                <input id="sell_companylocality" value="<?php echo htmlspecialchars($item->companylocality, ENT_QUOTES); ?>" data-field="<?php echo JText::_('SHOP_LOCALITY');?>" placeholder="<?php echo JText::_('SELLER_CITY');?>" name="companylocality" type="text" class="validate-screen required"/>
                            </div>
                        </div>
                        <div class="wk_input_wrapper">
                            <div class="wk_input_label">
                                <i class="fa fa-globe" aria-hidden="true"></i>
                                <label for="sell_add"><?php echo JText::_('SHOP_ADDRESS');?></label>
                            </div>
                            <div class="wk_input_box" >
                                <input id="sell_add" value="<?php echo htmlspecialchars($item->address, ENT_QUOTES); ?>" data-field="<?php echo JText::_('SHOP_ADDRESS'); ?>" placeholder="<?php echo JText::_('SHOP_ADDRESS'); ?>" name="address" type="text" class="required"/>
                            </div>
                        </div>
                        <div class="wk_input_wrapper">
                            <div class="wk_input_label">
                                <i class="fa fa-globe" aria-hidden="true"></i>
                                <label for="sell_zip"><?php echo JText::_('ZIP_POSTAL_CODE');?></label>
                            </div>
                            <div class="wk_input_box" >
                                <input id="sell_zip" value="<?php echo $item->zip; ?>" data-field="<?php echo JText::_('ZIP_POSTAL_CODE');?>" placeholder="<?php echo JText::_('SELLER_ZIP');?>" name="zip" type="text" class="validate-zip required"/>
                            </div>
                        </div>
                        <!--<div class="wk_input_wrapper_6">
                            <div class="wk_input_label">
                                <span class="icon-location" style="margin-left:5%;"></span>
                                <label for="icon_prefix"><?php echo JText::_('SHOP_LOCATION_LANGTITUDE');?></label>
                            </div>
                            <div class="wk_input_box" >
                                <input readonly="true" value="<?php echo $lg;?>" id="lang" style="width:96%" placeholder="<?php echo JText::_("SHOP_LOCATION_LANGTITUDE");?>" name="longtitude" type="text" >
                            </div>
                        </div>
                        <div class="wk_input_wrapper_6">
                            <div class="wk_input_label">
                                <span class="icon-location" style="margin-left:5%;"></span>
                                
                                <label for="icon_prefix"><?php echo JText::_('SHOP_LOCATION_LATITUDE');?></label>
                            </div>
                            <div class="wk_input_box" >
                                <input readonly="true" type="text" id="lat" style="width:96%" value="<?php echo $lt; ?>" name="latitude" placeholder="<?php echo JText::_("SHOP_LOCATION_LATITUDE");?>" >
                            </div>
                        </div>
                        <body  onload="initialize()" >
                            <input id="pac_input" class="controls" type="text" placeholder="<?php echo JText::_('SEARCH_LOCATION');?>" style="height:35px!important;width:130px;">
                            <div  style="position:relative; width:90%">
                                <div class="wk_input_wrapper"  id="map_canvas" height:"500px" width="100%">
                                </div>
                                <!-- Map Area -->
                            <!--</div>-->
                            <div class="wk-seller-profile">
                                <div class="input-profile ">
                                    <input class="btn btn-primary profile_submit validate" style="width:120px;margin-top:5px;height:30px;" type="submit" value="<?php echo JText::_('SAVE');?>" id="profile_submit"/>
                                </div>
                            </div>
                        </div>
                       
                        <?php
                        $soc_mod=explode(",", $item->social_mode);
                        $soc_id=explode(",", $item->social_id);
                        $i=0;
                        $social_chk=array();
                        foreach ($soc_mod as $value) {
                            if (isset($soc_id[$i])) {
                                $social_chk[$value]=$soc_id[$i++];
                            }
                        }
                        ?>
                        <div class="panel-body contentbar">
                            <div class="social_check">
                                <span><?php echo JText::_("ENABLE_SOCIAL_PROFILE")?>&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                <div class="soc_options">
                                    <div class="alert alert-info"><?php echo JText::_("SOCIAL_NOTE");?></div>
                                    <div class="wk_separate">
                                        <label for="wk_facebook"><i class="fa fa-2 fa-facebook-square"></i>
                                            <span class="lbl"><?php echo JText::_("FACEBOOK_CHECK")?>
                                            </span>&nbsp;&nbsp;
                                        </label>
                                        <?php
                                        $check='';
                                        if (isset($soc_id[0]) && strlen(trim($soc_id[0]))) {
                                            $check="value=\"FACEBOOK_CHECK\" checked";
                                            $style="style='display:block;'";
                                        } else {
                                            $check='value=" "';
                                            $style="";
                                        }
                                        ?>
                                        <label class="switch">
                                          <input type="checkbox" id="wk_facebook" name="social_mode[]" <?php echo $check;?> />
                                          <div class="slider round"></div>
                                        </label>
                                        
                                    </div>
                                    <div class="wk_social_ids" <?php echo $style;?>>
                                        <input type="text" id="fb_id" placeholder="<?php echo JText::_("FILL_VALUE_NOTE"); ?>" name="social_id[]" value="<?php if(isset($soc_id[0]) && strlen(trim($soc_id[0]))) echo htmlspecialchars($soc_id[0], ENT_QUOTES);
                                        else echo ""; ?>" class="entry form-control width-100-mp text-padd soc_chk_txt" rel="" >
                                    </div>
                                    <div class="wk_separate">
                                        <label for="wk_twitter"><i class="fa fa-2 fa-twitter-square"></i>
                                            <span class="lbl"><?php echo JText::_("TWITTER_CHECK")?></span>&nbsp;&nbsp;
                                        </label>
                                        <?php
                                        $check='';
                                        if (isset($soc_id[1]) && strlen(trim($soc_id[1]))) {
                                            $check="value=\"TWITTER_CHECK\" checked";
                                            $style="style='display:block;'";
                                        } else {
                                            $check='value=" "';
                                            $style="";
                                        }
                                        ?>
                                        <label class="switch">
                                            <input type="checkbox" id="wk_twitter" name="social_mode[]"  <?php echo $check;?> />
                                          <div class="slider round"></div>
                                        </label>
                                        
                                    </div>
                                    <div class="wk_social_ids" <?php echo $style;?>>
                                        <input type="text" id="tw_id" placeholder="<?php echo JText::_("FILL_VALUE_NOTE"); ?>" name="social_id[]" value="<?php if(isset($soc_id[1]) && strlen(trim($soc_id[1]))) echo htmlspecialchars($soc_id[1], ENT_QUOTES);
                                        else echo ""; ?>" class="entry form-control width-100-mp text-padd soc_chk_txt" rel="">
                                    </div>
                                    <div class="wk_separate">
                                        <label for="wk_google"><i class="fa fa-2 fa-google-plus-square" aria-hidden="true"></i>
                                            <span class="lbl"><?php echo JText::_("GOOGLE_CHECK")?></span>&nbsp;&nbsp;
                                        </label>
                                        <?php
                                        $check='';
                                        if (isset($soc_id[2]) && strlen(trim($soc_id[2]))) {
                                            $check="value=\"GOOGLE_CHECK\" checked";
                                            $style="style='display:block;'";
                                        } else {
                                            $check='value=" "';
                                            $style="";
                                        }
                                        ?>
                                        <label class="switch">
                                            <input type="checkbox" id="wk_google" name="social_mode[]"  <?php echo $check;?> />
                                            <div class="slider round"></div>
                                        </label>
                                            
                                        
                                    </div>
                                    <div class="wk_social_ids" <?php echo $style;?>>
                                        <input type="text" id="goo_id" placeholder="<?php echo JText::_("FILL_VALUE_NOTE"); ?>" name="social_id[]" value="<?php if(isset($soc_id[2])&& strlen(trim($soc_id[2]))) echo htmlspecialchars($soc_id[2], ENT_QUOTES);
                                        else echo ""; ?>" class="entry form-control width-100-mp text-padd soc_chk_txt" rel="">
                                    </div>
                                    <div class="wk_separate">
                                        <label for="wk_linkedin"><i class="fa fa-2 fa-linkedin-square" aria-hidden="true"></i>
                                            <span class="lbl"><?php echo JText::_("LINKEDIN_CHECK")?></span>&nbsp;&nbsp;
                                        </label>
                                        <?php
                                        if (isset($soc_id[3])&& strlen(trim($soc_id[3]))) {
                                            $check="value=\"LINKEDIN_CHECK\" checked";
                                            $style="style='display:block;'";
                                        } else {
                                            $check='value=" "';
                                            $style="";
                                        } ?>
                                        <label class="switch">
                                          <input type="checkbox" id="wk_linkedin" name="social_mode[]"  <?php echo $check;?> />
                                          <div class="slider round"></div>
                                        </label>
                                    </div>
                                    <div class="wk_social_ids" <?php echo $style;?>>
                                        <input type="text" id="in_id" placeholder="<?php echo JText::_("FILL_VALUE_NOTE"); ?>" name="social_id[]" value="<?php if(isset($soc_id[3])&& strlen(trim($soc_id[3]))) echo htmlspecialchars($soc_id[3], ENT_QUOTES);
                                        else echo ""; ?>" class="entry form-control width-100-mp text-padd soc_chk_txt" rel="">
                                    </div>
                                </div>
                                <div class="wk-seller-profile">
                                    <div class="input-profile ">
                                        <input class="btn btn-primary profile_submit validate" style="width:120px;margin-top:5px;height:30px;" type="submit" value="<?php echo JText::_('SAVE');?>" id="profile_submit"/>
                                    </div>
                                </div>
                            </div>
                            
                        </div>
                        <div class="panel-body contentbar">
                            <div class="label1"><?php echo JText::_("SHOP_DESCRIPTION");?></div>
                            <div>
                                <span id="companydesc" class="tinymce-entry" style="width:98%;">
                                    <?php
                                        jimport('joomla.html.editor');
                                        $editor = JFactory::getEditor();
                                        $params =  array(
                                            'smilies'=> '0',
                                            'style'  => '1',
                                            'layer'  => '0',
                                            'table'  => '0',
                                            'clear_entities'=>'0'
                                        );
                                        echo $editor->display(
                                            'companydescription',
                                            htmlspecialchars($item->companydescription),
                                            '97%',
                                            '100',
                                            '20',
                                            '20',
                                            false,
                                            null,
                                            null,
                                            null,
                                            $params
                                        );
                                    ?>
                                </span>
                            </div>
                            <div class="label1"><?php echo JText::_("META_DESCRIPTION");?></div>
                            <div>
                                <span id="companydescshort" class="tinymce-entry" style="width:98%!important;">
                                    <?php
                                        jimport('joomla.html.editor');
                                        $editor = JFactory::getEditor('none');
                                        $params = array();
                                        echo $editor->display(
                                            'descriptioninhtml',
                                            htmlspecialchars($item->descriptioninhtml),
                                            '97%',
                                            '100',
                                            '20',
                                            '20',
                                            false,
                                            null,
                                            null,
                                            null,
                                            $params
                                        );
                                    ?>
                                </span>
                            </div>
                            <div class="wk-seller-profile">
                                <div class="input-profile ">
                                    <input class="btn btn-primary profile_submit validate" style="width:120px;margin-top:5px;height:30px;" type="submit" value="<?php echo JText::_('SAVE');?>" id="profile_submit"/>
                                </div>
                            </div>
                        </div>
                        <div class="payment_method" >
                            <div class="label1"><?php echo JText::_("PAYMENT_MODE");?></div>
                            <?php
                            $payment_result=$model->getPaymentInfo();
                            
                            $pay_mode=explode(",", $item->payment_mode);
                            $pay_desc=explode(",", $item->payment_desc);
                            $stan=-1;
                            //To Do
                            $pay_array=array();
                            $payment_script='';
                            foreach ($payment_result as $payment) {
                                $checked='';
                                $value='';
                                $check='';
                                $descvalue='';
                                $payment_name1=$payment->payment_element;
                                $display=" style='display:none;'";
                                if ($payment->payment_element=='standard') {
                                    if (in_array($payment->payment_element."-".$payment->virtuemart_paymentmethod_id, $pay_mode)) {
                                        $descvalue=array_search($payment->payment_element."-".$payment->virtuemart_paymentmethod_id, $pay_mode);
                                        $value=$pay_desc[$descvalue];
                                        $stan=1;
                                        $check="checked";
                                        $display=" style='display:block;'";
                                    }
                                    if (@strlen($pay_desc[$descvalue])) {
                                        $display="name='payment[]' style='display:block;'";
                                    } else {
                                        $display=" style='display:none;'";
                                    }
                                    $pd_id=str_replace(' ', '_', $payment_name1);
                                    $payment->payment_name = strlen($payment->payment_name) > 150 ? substr($payment->payment_name, 0, 150)."..." : $payment->payment_name;
                                    echo '<div class="wk_payment_single"><label for="wk_cod"><i class="fa fa-bank" aria-hidden="true"></i><span class="lbl">'.$payment->payment_name.'</span>&nbsp;&nbsp;
                                        </label>
                                        <label class="switch">
                                          <input type="checkbox" id="wk_cod" class="'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-chk" name="payment_mode[]" value="'.$payment_name1."-".$payment->virtuemart_paymentmethod_id.'"  '.$check.' />
                                          <div class="slider round"></div>
                                        </label>
                                        
                                    </div>
                                    <div class="wk_payment_ids">
                                        <textarea  rows="1" cols="40" placeholder="لطفا جزئیات گزینه پرداخت خود را وارد کنید"   class="entry form-control width-100-mp text-padd '.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val" '.$display.' >'.$value.'</textarea>
                                        </div>
                                    ';
                                    $payment_script.='
                                    if(jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-chk").prop("checked") && jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val").val().trim()===""){
                                        jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val").css("border","2px dotted red");
                                        pm_chk = false;
                                    } else {
                                        jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val").css("border","1px solid #ccc");
                                    }
                                    ';
                                } elseif ($payment->payment_element=='paypal') {
                                    $checked='';
                                    $descvalue=array_search($payment->payment_element."-".$payment->virtuemart_paymentmethod_id, $pay_mode);
                                    if (in_array($payment->payment_element."-".$payment->virtuemart_paymentmethod_id, $pay_mode)) {
                                        $value=$pay_desc[$descvalue];
                                        $checked="checked";
                                    }
                                    $index=-1;
                                    for ($i=0; $i <sizeof($pay_mode); $i++) {
                                        if ($payment->payment_element."-".$payment->virtuemart_paymentmethod_id==$pay_mode[$i]) {
                                            $index=$i;
                                            break;
                                        }
                                    }
                                    $pd_id=str_replace(' ', '_', $payment_name1);
                                    if($stan==1)
                                        $index-=1;
                                    if (@strlen($pay_desc[$index])) {
                                        $display="name='payment[]' style='display:block;'";
                                    } else {
                                        $value='';
                                        $display=" style='display:none;'";
                                    }
                                    $payment->payment_name = strlen($payment->payment_name) > 20 ? substr($payment->payment_name, 0, 20)."..." : $payment->payment_name;
                                    echo '<div class="wk_payment_single">
                                    <label for="wk_paypal"><i class="fa fa-paypal" aria-hidden="true"></i>
                                        <span class="lbl">'.$payment->payment_name.'</span>&nbsp;&nbsp;
                                    </label>
                                    <label class="switch">
                                      <input class="'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-chk" type="checkbox" id="wk_paypal" name="payment_mode[]" value="'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'"  '.$checked.' />
                                      <div class="slider round"></div>
                                    </label>
                                    </div>
                                    <div class="wk_payment_ids">
                                    <input type="text" placeholder="Enter Registered Paypal Email Id" value="'.$value.'" '.$display.' class="entry form-control width-100-mp text-padd soc_chk_txt '.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val" rel="">
                                    </div>';
                                    $payment_script.='
                                    if(jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-chk").prop("checked")) {
                                        if (jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val").val().trim()==="" || !em.test(jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val").val())){
                                            jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val").css("border","2px dotted red");
                                            pm_chk = false;
                                            jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val").focus();
                                        }
                                        else {
                                            jQuery(".'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'-val").css("border","1px solid #ccc");
                                        }
                                    }
                                    ';
                                }
                                else
                                    continue;
                            }?>
                            <hr>
                            <div class="label1"><?php echo JText::_("SPLIT_PAYMENT_MODE");?></div>
                                <?php
                                foreach ($payment_result as $payment) {
                                    if ($payment->payment_element=='stripeconnect') {
                                        if (($this->stripe_client_id && $this->secret_key)&&$this->public_key) {
                                            $url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$this->stripe_client_id.'&scope=read_write';
                                            $url_deauth=JURI::current() . "?option=com_marketplace&view=profile&deauth=true";
                                            echo "<div class='wk_payment_single'>
                                                    <label for='stripeconnect'><i class='fa fa-cc-stripe' aria-hidden='true'></i>
                                                        <span class='lbl'>".$payment->payment_name."</span>&nbsp;&nbsp;
                                                    </label>
                                                    <label class='switch'>
                                                          <input type='checkbox' disabled='true' id='stripeconnect' name='payment_mode[]' value='".$payment->payment_name."' />
                                                          <div class='slider round'></div>
                                                    </label>
                                                </div>
                                                <div class='wk_payment_ids' >
                                                    <input  type='text' placeholder='' readonly='true' name='payment_id[]' value='' id='seller_stripe_id'class='entry form-control width-100-mp text-padd soc_chk_txt' rel='' style='display:none'>
                                                </div>
                                                <div id='wk_stripe_links'>
                                                    <a id='stripe_connect' href=".$url."><img src='".JUri::root()."/plugins/vmpayment/stripeconnect/images/blue-on-light.png' alt='Connect With Stripe' />					
                                                    </a>
                                                    <a style='display:none' id='stripe_disconnect' href=".$url_deauth.">
                                                        <img src='".JUri::root()."/plugins/vmpayment/stripeconnect/images/blue-on-light-disconnect.png' alt='Connect With Stripe' />	
                                                    </a>
                                                </div>
                                                ";
                                        }
                                    } elseif ($payment->payment_element=='adaptivepaypal') {
                                        $checked='';
                                        $descvalue=array_search($payment->payment_element."-".$payment->virtuemart_paymentmethod_id, $pay_mode);
                                        if (in_array($payment->payment_element."-".$payment->virtuemart_paymentmethod_id, $pay_mode)) {
                                            $value=$pay_desc[$descvalue];
                                            $checked="checked";
                                        }
                                    
                                        $index=-1;
                                        for ($i=0; $i <sizeof($pay_mode); $i++) {
                                            if ($payment->payment_element."-".$payment->virtuemart_paymentmethod_id==$pay_mode[$i]) {
                                                $index=$i;
                                                break;
                                            }
                                        }
                                        $pd_id=str_replace(' ', '_', $payment->payment_element);
                                        if ($stan==1) {
                                            $index-=1;
                                        }
                                        if (@strlen($pay_desc[$index])) {
                                            $display="name='payment[]' style='display:block;'";
                                        } else {
                                            $value='';
                                            $display=" style='display:none;'";
                                        }
                                        $payment->payment_name = strlen($payment->payment_name) > 10 ? substr($payment->payment_name, 0, 10)."..." : $payment->payment_name;
                                        echo '<div class="wk_payment_single">
                                                <label for="wk_adaptive"><i class="fa fa-paypal" aria-hidden="true"></i>
                                                    <span class="lbl">'. $payment->payment_name.'
                                                    </span>&nbsp;&nbsp;
                                                </label>
                                                <label class="switch">
                                                    <input type="checkbox" id="wk_adaptive" name="payment_mode[]" value="'.$payment->payment_element."-".$payment->virtuemart_paymentmethod_id.'" '.$checked.' >
                                                    <div class="slider round"></div>
                                                </label>
                                            </div>
                                            <div class="wk_payment_ids">
                                                <input type="text" placeholder="Enter Id " value="'.$value.'" class="entry form-control width-100-mp text-padd soc_chk_txt" rel="" '.$display.'>
                                            </div>';
                                        
                                    } elseif ($payment->payment_element=='remitasplit') {
                                        if (!empty($checkRemitaInstallation)) {
                                            $checked='';
                                            $descvalue=array_search($payment->payment_element, $pay_mode);
                                            $payment->payment_name = strlen($payment->payment_name) > 10 ? substr($payment->payment_name, 0, 10)."..." : $payment->payment_name;
                                            if (in_array('remitasplit', $pay_mode)) {
                                                $checked="checked";
                                            }
                                            if ($checked) {
                                                $display=" style='display:block;'";
                                            } else {
                                                $display=" style='display:none;'";
                                            }
                                            echo '<div class="wk_payment_single">
                                                    <label for="wk_remitasplit"><i class="fa fa-money" aria-hidden="true"></i>
                                                        <span class="lbl">'. JText::_("REMITA_SPLIT").'
                                                        </span>&nbsp;&nbsp;
                                                    </label>
                                                    <label class="switch">
                                                        <input type="checkbox" id="wk_remitasplit" name="payment_mode[]" value="remitasplit" '.$checked.' >
                                                        <div class="slider round"></div>
                                                    </label>
                                                </div>
                                                <div class="wk_payment_ids" >
                                                    <div '.$display.'>
                                                        <div style="text-align:center" class="label1">'.JText::_("FILL_REMITA_BANK_DETAILS").'
                                                        </div>
                                                        <label for="remita_name" class="label1">'.JText::_("REMITA_NAME").'</label>
                                                        <div>
                                                            <input class="entry form-control width-100-mp text-padd" type="text" value="'.$remitaSellerData->name.'" name="remita_name" id="remita_name" placeholder="'.JText::_('REMITA_NAME').'" />
                                                        </div>
                                                        <label for="remita_account" class="label1">'.JText::_("ACCOUNT_NUMBER").'</label>
                                                        <div>
                                                            <input class="entry form-control width-100-mp text-padd" type="text" value="'.$remitaSellerData->account.'" name="remita_account" id="remita_account" placeholder="'.JText::_('ACCOUNT_NUMBER').'"/>
                                                        </div>
                                                        <label for="remita_bank_code" class="label1">'.JText::_("BANK_CODE").' </label>
                                                        <div>
                                                            <select name="remita_bank_code" id="remita_bank_code">
                                                                <option selected value="">'.JText::_("REMITA_SELECT_TEXT").'</option>
                                                                <option value="044" >Access Bank (044)</option>
                                                                <option value="014" >Afribank (014)</option>
                                                                <option value="023" >Citibank (023)</option>
                                                                <option value="063" >Diamond Bank (063)</option>
                                                                <option value="050" >Ecobank (050)</option>
                                                                <option value="040" >Equitorial Trust Bank (040)</option>
                                                                <option value="011" >First Bank (011)</option>
                                                                <option value="214" >FCMB (214)</option>
                                                                <option value="070" >Fidelity Bank (070)</option>
                                                                <option value="085" >Finbank (085)</option>
                                                                <option value="058" >Guaranty Trust Bank (058)</option>
                                                                <option value="069" >Intercontinental Bank (069)</option>
                                                                <option value="056" >Oceanic Bank (056)</option>
                                                                <option value="082" >BankPhb (082)</option>
                                                                <option value="076" >Skye Bank (076)</option>
                                                                <option value="084" >Spring Bank (084)</option>
                                                                <option value="221" >StanbicIBTC (221)</option>
                                                                <option value="068" >Standard Chartered Bank (068)</option>
                                                                <option value="232" >Sterling Bank (232)</option>
                                                                <option value="033" >United Bank Of Africa (033)</option>
                                                                <option value="032" >Union Bank (032)</option>
                                                                <option value="035" >Wema Bank (035)</option>
                                                                <option value="057" >Zenith Bank (057)</option>
                                                                <option value="215" >Unity Bank (215)</option>
                                                            </select>
                                                        </div>

                                                    </div>
                                                </div>';
                                            /*add script for remita split*/
                                            $doc->addScriptDeclaration(
                                                '
                                                jQuery(document).ready(function(){
                                                    jQuery("#remita_bank_code option[value=\''.$remitaSellerData->bankcode.'\']").attr("selected","selected");
                                                });
                                                '
                                            );
                                        }
                                    }
                                    else
                                        continue;
                                }
                                $checkStripeInstallation=JPluginHelper::getPlugin('vmpayment', 'stripeconnect');
                                if (!empty($checkStripeInstallation)) {
                                    $wk_model=$this->getModel('profile');
                                    $wk_get_result=$wk_model->getStripeData();
                                    if ($wk_get_result && $wk_get_result !='') {
                                        $url= JURI::current() . "?option=com_marketplace&view=profile&deauth=true";
                                        ?>
                                    <script type="text/javascript">
                                        jQuery("#stripeconnect").attr("checked","true");
                                        jQuery("#stripe_disconnect").show();
                                        jQuery("#seller_stripe_id").show();
                                        jQuery("#seller_stripe_id").val("<?php echo 'account id :  '.$wk_get_result;?>");
                                        jQuery('#stripe_connect').hide();
                                    </script>
                                    <?php
                                    }
                                    //code to deauthorize account
                                    if (JFactory::getApplication()->input->get('deauth')&& JFactory::getApplication()->input->get('deauth') !=null) {
                                        $url = "https://connect.stripe.com/oauth/deauthorize";
                                        $data = array(
                                          'client_secret'  =>$this->secret_key,
                                          'client_id'      => $this->stripe_client_id,
                                          'stripe_user_id' => $wk_get_result,
                                        );
                                        $body = http_build_query($data);
                                        $ch = curl_init(); 
                                        curl_setopt($ch, CURLOPT_URL, $url);
                                        curl_setopt($ch, CURLOPT_POST, 1);
                                        curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
                                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                        $output= json_decode(curl_exec($ch), true);
                                        $state='update';
                                        if (isset($output['stripe_user_id']) && $output['stripe_user_id'] !=null) {
                                            $wk_model=$this->getModel('profile');
                                            $wk_model->storeStripeData(
                                                $output,
                                                $this->secret_key,
                                                $this->public_key,
                                                $this->stripe_client_id,
                                                $state
                                            );
                                            JFactory::getApplication()->redirect(
                                                'index.php?option=com_marketplace&view=profile',
                                                'Your account is deactivated',
                                                'success'
                                            );
                                        } else {
                                            JFactory::getApplication()->redirect(
                                                'index.php?option=com_marketplace&view=profile',
                                                $output['error'],
                                                'error'
                                            );
                                        }
                                    }
                                }
                                ?>
                    <div class="wk-seller-profile">
                        <div class="input-profile ">
                            <input class="btn btn-primary profile_submit validate" style="width:120px;margin-top:5px;height:30px;" type="submit" value="<?php echo JText::_('SAVE');?>" id="profile_submit"/>
                        </div>
                    </div>
                </div>
                <?php
                $str="";
                foreach ($this->addonData as $value) {
                    $str.='<div class="panel-body contentbar">';
                    $str.=$value["content"];
                    $str.='<div class="wk-seller-profile"><div class="input-profile ">
                            <input class="btn btn-primary profile_submit validate" style="width:120px;margin-top:5px;height:30px;" type="submit" value="'.JText::_('SAVE').'" id="profile_submit"/>
                        </div></div>';
                    $str.='</div>';
                }
                echo $str;
            ?>
            </div>
        </div>
        <input type="hidden" name="task" value="profile.profileSave" />
        <input type="hidden" id='countrylogo' name="countrylogo" value="<?php echo $item->countrylogo; ?>" />
        <input type="hidden" name="seller_id" value="<?php echo $item->seller_id; ?>" />
        <?php echo JHTML::_('form.token'); ?>
    </form>
</div>
<?php
} ?>
<script src="//cdnjs.cloudflare.com/ajax/libs/xregexp/3.1.1/xregexp-all.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
    document.formvalidator.setHandler('name', function (value) {
        var regex=/^[پچجحخهعغفقثصضشسیبلاتنمکگوئدذرزطظژؤإأءًa-zA-Z ]+$/;
        return regex.test(value); 
    });
    document.formvalidator.setHandler('screen', function(value) {
        var nm =/^[پچجحخهعغفقثصضشسیبلاتنمکگوئدذرزطظژؤإأءًA-Za-z0-9 ]+$/;
        return nm.test(value);
    });
    document.formvalidator.setHandler('phone', function(value=0) {
        var mob =/^[+\-\(\) 0-9]{5,20}$/;
        return mob.test(value);
    });
    document.formvalidator.setHandler('company', function(value) {
        var nm =/^[پچجحخهعغفقثصضشسیبلاتنمکگوئدذرزطظژؤإأءًA-Za-z0-9 _]{3,40}$/;
        return nm.test(value);
    });
    document.formvalidator.setHandler('zip', function(value) {
        var nm =/^[پچجحخهعغفقثصضشسیبلاتنمکگوئدذرزطظژؤإأءًA-Za-z0-9 ]{3,40}$/;
        return nm.test(value);
    });
});
function paymentMode(){
    var em=XRegExp("^[\\p{L}\\p{N}\\.\\#\\$\\&\\*\\-\\+\\/\\=\\?\\^\\_\\`\\']+@[\\p{L}\\p{N}\\-]+[.][\\p{L}\\p{N}]+$");
    var pm_chk=true;
    <?php echo $payment_script; ?>
    return pm_chk;
}
function socialCheck(){
    var sub_chk = true;
    if(jQuery("#wk_facebook").val() === "FACEBOOK_CHECK" && jQuery('#fb_id').val().trim()===""){
        jQuery('#fb_id').css('border','1px solid black');
        jQuery('#fb_id').css('background','#f2dede');
        jQuery('#fb_id').focus();
        sub_chk = false;
    } else {
        jQuery('#fb_id').css('border','1px solid #ccc');
        jQuery('#fb_id').css('background','#FFFFFF');
    }

    if(jQuery("#wk_twitter").val() === "TWITTER_CHECK" && jQuery('#tw_id').val().trim()===""){
        jQuery('#tw_id').css('border','1px solid black');
        jQuery('#tw_id').css('background','#f2dede');
        jQuery('#tw_id').focus();
        sub_chk = false;
    } else {
        jQuery('#tw_id').css('border','1px solid #ccc');
        jQuery('#tw_id').css('background','#FFFFFF');
    }

    if(jQuery("#wk_google").val() === "GOOGLE_CHECK" && jQuery('#goo_id').val().trim()===""){
        jQuery('#goo_id').css('border','1px solid black');
        jQuery('#goo_id').css('background','#f2dede');
        jQuery('#goo_id').focus();
        sub_chk = false;
    } else {
        jQuery('#goo_id').css('border','1px solid #ccc');
        jQuery('#goo_id').css('background','#FFFFFF');
    }

    if(jQuery("#wk_linkedin").val() === "LINKEDIN_CHECK" && jQuery('#in_id').val().trim()===""){
        jQuery('#in_id').css('border','1px solid black');
        jQuery('#in_id').css('background','#f2dede');
        jQuery('#in_id').focus();
        sub_chk = false;
    } else {
        jQuery('#in_id').css('border','1px solid #ccc');
        jQuery('#in_id').css('background','#FFFFFF');
    }
    return sub_chk;
}
jQuery(document).ready(function(){
    
    jQuery(".profile_submit").click(function(e) {
        var sub_chk = pm_chk = true;
        // validate social profile data pratyush
        sub_chk = socialCheck();
        // social profile check ends
        pm_chk=paymentMode();
        if (sub_chk && pm_chk) {
            var fields, invalid = [], valid = true, label, error, i, l;
            fields = jQuery('form.form-validate').find('input, textarea, select');
            if (!document.formvalidator.isValid(jQuery('form'))) {
                for (i = 0, l = fields.length; i < l; i++) {
                    if (document.formvalidator.validate(fields[i]) === false) {
                        valid = false;
                        invalid.push(fields[i]);
                    }
                }

                if (!valid && invalid.length > 0) {
                    error = {"error": []};
                    for (i = invalid.length - 1; i >= 0; i--) {
                        if (jQuery(invalid[i]).attr("data-field") !== undefined)
                            error.error.push("<b>"+jQuery(invalid[i]).attr("data-field")+"</b>- "+jQuery(invalid[i]).attr("placeholder"));
                        else {
                            if (jQuery(invalid[i]).attr('id') === "sell_gender") {
                                var ele = jQuery(invalid[i]).closest(".wk_input_wrapper");
                            } else {
                                var ele = jQuery(invalid[i]).closest(".wk_country");
                            }
                            error.error.push("<b>"+ele.find("label").text()+"</b>- "+ele.find("label").attr("data-error"));
                        }
                    }
                    error.error.push("<?php echo JText::_('INVALID_FIELD')?>");
                    Joomla.renderMessages(error);
                    jQuery(invalid[0]).focus();
                    e.preventDefault();
                }
            } 
        } else {
            if(!pm_chk)
                jQuery('#p_m').click();
            if(!sub_chk)
                jQuery('#s_p').click();
            e.preventDefault();
        }
    });
    jQuery(".remove_cover_").click(function() {
        jQuery.ajax({
            type:"post",
            url:"<?php echo JRoute::_('index.php?option=com_marketplace&view=profile&task=profile.remove', false);?>",
            data: {seller_id_for_cover : <?php echo $item->seller_id; ?>, wkurl : "<?php echo juri::root(); ?>" },
            success:function(data){
                jQuery('.wk_banner').attr(
                    'src',
                    '<?php echo juri::root(); ?>/components/com_marketplace/images/defaultcover.png'
                );
                jQuery('.wk_banner img').attr(
                    'src',
                    '<?php echo juri::root(); ?>/components/com_marketplace/images/defaultcover.png'
                );
                jQuery('#change_mpcover').val("");
            }
        });
    });
    jQuery(".remove_pic_").click(function() {
        jQuery.ajax({
            type:"post",
            url:"<?php echo JRoute::_('index.php?option=com_marketplace&view=profile&task=profile.remove', false);?>",
            data: {seller_id : <?php echo $item->seller_id; ?>, wkurl : "<?php echo juri::root(); ?>"},
            success:function(data){
                jQuery('.wk_mplogo').attr('src','<?php echo juri::root(); ?>/components/com_marketplace/images/generic-pic.png');
                jQuery('.wk_mplogo img').attr('src','<?php echo juri::root(); ?>/components/com_marketplace/images/generic-pic.png');
                jQuery('#upload_pic_').val("");
            }
        });
    });

    jQuery("body").on("click",'#upload_pic_cover', function(e){
        var dataUrl = canvas.toDataURL();
        jQuery.ajax({
            type: "post",
            url: "<?php echo JRoute::_('index.php?option=com_marketplace&view=profile&task=profile.uploadCover', false);?>",
            data: {
            imgBase64: dataUrl,seller_id:<?php echo $item->seller_id;?>},
            success: function(data){
                var name=data;
                jQuery(".wk_banner").attr('src',name);
                jQuery('#video').show('slow');
                jQuery('#canvas').hide('slow');
                jQuery('#cam_snap').show('slow');
                jQuery('#new').hide();
                jQuery('#upload_pic').hide();
                jQuery('#camera').hide();
            }
        });
        e.preventDefault();
    });
});
</script>
<div class="marketplace_position2"><?php echo JHTML::_('content.prepare', '{loadposition wk_marketplace-right}'); ?></div>
<div class="marketplace_position-bottom" style="clear:both;"><?php echo JHTML::_('content.prepare', '{loadposition wk_marketplace-bottom}'); ?></div>
</div>
</div>