Your IP : 216.73.216.11


Current Path : /home/digilove/public_html/components/com_marketplace/views/mypayments/tmpl/
Upload File :
Current File : /home/digilove/public_html/components/com_marketplace/views/mypayments/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');
JHTML::_("jQuery.framework");
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root().'components/com_marketplace/css/newdesign/payment.css');
$document->addStyleSheet('https://fonts.googleapis.com/css?family=Roboto');
$user = JFactory::getUser();
$params = JComponentHelper::getParams('com_marketplace');
$lazy_limit=trim($params->get('wk_lazy_load_limit'));
$id = $user->id;
/*********Calculated Modules******************/
$obj=new JDocumentHTML();
$mod="";
$model=$this->getModel();
$totalRecords=$model->getTotalPayment($id);
$totalRecords=count($totalRecords);
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";
}
/*********Calculated Modules End******************/
$param  = JComponentHelper::getParams('com_marketplace');
$bgcolor=trim($param->get('head_bg_color'));
$textcolor=trim($param->get('head_txt_color'));
$jdate=JFactory::getDate(JFactory::getUser($id)->registerDate);
$currentdate=JFactory::getDate();
$newDate  = new JDate($currentdate . ' +1 day'); 
$curr='';
$initial_records=$model->getMpPayment($id, $jdate->format('Y-m-d'), $newDate->format('Y-m-d'), $lazy_limit, 1);
?>
<style type="text/css">
    .order_history{
        background-color:<?php echo $bgcolor;?>;
    }
    .detail_text{
        color:<?php echo $textcolor;?>;
    }

</style>
<style type="text/css">
    .mypayment_main,.marketplace_position1,.marketplace_position2 {
        margin: 5px;
        display:block;
        vertical-align: top;
    }
        .wk_main_loader{
        position: relative;
    }
    .wk_main_loader_overlay{
        position: absolute;
        background-color: #FFF ! important; 
        z-index: 999; 
        width:101%;
        height:100%;
        border: 1px solid #CCCCCC;
        border-radius: 10px;
    }
</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 JURI::root()."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********************************* -->	
<div class="mypayment_main">
    <div class="tabs-data">
        <div class="block">
            <div class="order_history">
                <span class="detail_design"></span>
                <span class="detail_text"><?php echo JText::_('MY_PAY')?></span>
            </div>
            <div class="tab-pane" id="payment">
                <div class="block-cont">
                    <div class="heading"><strong><?php echo JText::_('PAY_SUMM'); ?></strong></div>
                    <div class="no-more-tables" >
                        <div class="table-responsive" style="margin:0px 1%">
                            <table width="100%"class="table table-bordered table-striped">
                                <thead>
                                    <tr>
                                        <th class="center"><?php echo JText::_('TOTAL_AMOUNT'); ?></th>
                                        <th class="center "><?php echo JText::_('COMMISION_RATE'); ?></th>
                                        <th class="center "><?php echo JText::_('COMMISION_AMOUNT'); ?></th>
                                        <th class="center "><?php echo JText::_('RECIEVED_AMOUNT'); ?></th>
                                        <th class="center "><?php echo JText::_('REMAIN_AMOUNT'); ?></th>
                                        <th class="center "><?php echo JText::_('LAST_GET_AMOUNT'); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php 
                                    $rate=0;;
                                    $comm=0;
                                    $cm_amt=0;;
                                    $comm=$this->model->getCurrencyDetails($id);
                                    
                                    $data_c=count($comm);
                                    $total_order=$this->model->getTotalOrder();
                                    $total_count=count($total_order);
                                    if (isset($comm) && $total_count) {
                                        $comm->total_sales1=0.0;
                                        foreach ($total_order as $key => $value) {
                                            if ($value->virtuemart_real_order_id=='r') {
                                                $comm->total_sales1+=$value->virtuemart_product_total_amount;
                                                $rate=$value->virtuemart_seller_commision_rate;
                                                $cm_amt+=($value->virtuemart_product_total_amount*$rate)/100;
                                                $cm_amt=number_format((float)$cm_amt, 2, '.', '');
                                            } else {
                                                $comm->total_sales1+=$value->virtuemart_product_total_amount;
                                                $rate=$value->virtuemart_seller_commision_rate;
                                                $cm_amt+=$rate*$value->virtuemart_product_quantity;
                                                $cm_amt=number_format((float)$cm_amt, 2, '.', '');
                                            }
                                        }
                                        $cm_amt=$comm->total_sales-$comm->amount_remain-$comm->amount_recieved;
                                        $cm_amt=number_format((float)$cm_amt, 2, '.', '');
                                        if ($comm->commision_type=='f') {
                                            $sign=$comm->currency_symbol;
                                        } else {
                                            $sign='%';
                                        }
                                        $curr=$comm->currency_symbol;
                                    ?>
                                    <tr class="mprow">
                                        <td data-title="<?php echo JText::_('TOTAL_AMOUNT'); ?>">
                                            <?php echo $curr.' '.$comm->total_sales; ?>
                                        </td>
                                        <td data-title="<?php echo JText::_('COMMISION_RATE'); ?>">
                                            <?php echo $comm->commision.' '.$sign; ?>
                                        </td>
                                        <td data-title="<?php echo JText::_('COMMISION_AMOUNT'); ?>">
                                            <?php echo $curr.' '.$cm_amt; ?>
                                        </td>
                                        <td data-title="<?php echo JText::_('RECIEVED_AMOUNT'); ?>">
                                            <?php echo $curr.' '.$comm->amount_recieved; ?>
                                        </td>
                                        <td data-title="<?php echo JText::_('REMAIN_AMOUNT'); ?>">
                                            <?php echo $curr.' '.$comm->amount_remain; ?>
                                        </td>
                                        <td data-title="<?php echo JText::_('LAST_GET_AMOUNT'); ?>">
                                            <?php echo $curr.' '.$comm->amount_paid; ?>
                                        </td>
                                    </tr>
                                    <?php  } else {   ?>
                                        <tr class="mprow">
                                            <td colspan="10">
                                                <?php echo JText::_('DETAIL_NOT_AVAILABLE'); ?>
                                            </td>
                                        </tr>
                                    <?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="heading"><strong><?php echo JText::_('TRAN_HIS'); ?></strong></div>
                    <span class="st-en-date">
                        <?php 
                        
                        echo JText::_("START_DATE_").JHTML::calendar($jdate->format('Y-m-d'), 'startdate', 'startdate', '%Y-%m-%d', array( 'class' => 'inputbox', 'onChange' => 'changeTrHistory()' )); ?>
                    </span>
                    <span class="st-en-date">
                        <?php echo JText::_("END_DATE_").JHTML::calendar($newDate->format('Y-m-d'), 'enddate', 'enddate', '%Y-%m-%d', array( 'class' => 'inputbox', 'onChange' => 'changeTrHistory()' )); ?>
                    </span>
                    <div class="no-more-tables" >
                        <div class="table-responsive tb" style="margin:0px 1%">
                            <table width="100%" class="table table-bordered table-striped pay_hs">
                                <thead>
                                    <tr>
                                        <th><?php echo JText::_('S_NO'); ?></th>
                                        <th><?php echo JText::_('RECIEVED_AMOUNT'); ?></th>
                                        <th><?php echo JText::_('REMAIN_AMOUNT'); ?></th>
                                        <th><?php echo JText::_('RCD_DATE'); ?></th>
                                        <th><?php echo JText::_('PAY_MODE'); ?></th>
                                    </tr>
                                </thead>
                                <tbody class="payment_hs">
                                    <?php
                                    foreach ($initial_records as $key=>$value) {
                                        $formatdate=JFactory::getDate($value->date);
                                    ?>
                                    <tr>
                                        <td data-title="<?php echo JText::_('S_NO'); ?>"><?php echo $key+1;?></td>
                                        <td data-title="<?php echo JText::_('RECIEVED_AMOUNT'); ?>"><?php echo $value->currency_symbol." ".$value->amount;?></td>
                                        <td data-title="<?php echo JText::_('REMAIN_AMOUNT'); ?>"><?php echo $value->currency_symbol." ".$value->remain_amount;?></td>
                                        <td data-title="<?php echo JText::_('RCD_DATE'); ?>"><?php echo $value->date;// $date->format('Y-F-d H:M:S');?></td>
                                        <td data-title="<?php echo JText::_('PAY_MODE'); ?>"><?php echo $value->payment_mode;?></td>
                                    </tr>
                                    <?php
                                    }
                                    ?>
                                </tbody>
                                <tfoot>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
var element=document.getElementsByClassName("wk_main_loader_overlay");

window.addEventListener('load', function() {
  element[0].style.display ="none";
});

/*jQuery(window).load(function(){
        jQuery('.wk_main_loader_overlay').css('display','none');
    })*/;
totalRecords='<?php echo $totalRecords;?>';
var both="<?php echo $both;?>";
var mod="<?php echo $mod;?>";
jQuery(function(){
    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('.mypayment_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('.mypayment_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('.mypayment_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('.mypayment_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('.mypayment_main').css("width","99.5%");
            }
        }
        else{
            jQuery('.mypayment_main').css("width","99.5%");
        }
    });
});
function changeTrHistory()
{
    var startdate = jQuery('#startdate').attr('value');
    var enddate = jQuery('#enddate').attr('value');
    jQuery.ajax({
        url:"<?php echo JRoute::_('index.php?option=com_marketplace&view=mypayments&task=mypayments.getMpPayment', false)?>",
        datatype:"json",
        data: {startdate, enddate,startlimit:'0',lmt:<?php echo $lazy_limit?>,id:<?php echo $id?>},
        success:function(data){
            jQuery(".payment_hs").html('');
            data = jQuery.parseJSON(data);
            var count=0;
            if(data.length==0){
                jQuery('.nodata-notice').remove();
                jQuery(".pay_hs").after("<div class='nodata-notice'><?php echo JText::_('HISTORY_NO_DATA_FOUND'); ?></div>");
            }
            else{
                jQuery('.nodata-notice').remove();
                jQuery.each(data,function(){
                    jQuery("<tr class='rw_pg  mprow'>").appendTo('.payment_hs');
                    jQuery("<td data-title=<?php echo JText::_('S_NO'); ?>>"+(count+1)+"</td>").appendTo('.payment_hs');
                    jQuery("<td data-title=<?php echo JText::_('RECIEVED_AMOUNT'); ?>>"+"<?php echo $curr." ";?>" +data[count].amount+"</td>").appendTo('.payment_hs');
                    jQuery("<td data-title=<?php echo JText::_('REMAIN_AMOUNT'); ?>>"+"<?php echo $curr." ";?>" +data[count].remain_amount+"</td>").appendTo('.payment_hs');
                    jQuery("<td data-title=<?php echo JText::_('RCD_DATE'); ?>>"+data[count].date+"</td>").appendTo('.payment_hs');
                    jQuery("<td data-title=<?php echo JText::_('PAY_MODE'); ?>>"+data[count].payment_mode+"</td>").appendTo('.payment_hs');
                    jQuery('<tr/>').appendTo('.payment_hs');
                    count++;
                });
            }
        }
        });
    }

/****************************************************/
</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>