<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2010 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts VistaCart                     |
// +----------------------------------------------------------------------+
// | Authors: Jipson<jipson.thomas@armiasystems.com>             		  |
// +----------------------------------------------------------------------+
//home_tooltip.js
//tooltip.css
?>
<?php echo $javascript->link('jquery.js'); ?>
<?php echo $javascript->link('home_tooltip.js'); ?>
<?php echo $html->css('tooltip.css'); ?>
<?php echo $javascript->link('hint.js'); ?> 
<script>
function chkForm(thisform)
{
   var flag=0;
   $('#gift_msg').html('');	
   
   if($.trim($('#giftcode').val())=='')
   {
     alert("Please enter your gift card code");
	 $('#giftcode').focus()
	 return false;   
   }
   
   if($.trim($('#giftcode').val())!='')
   {
       var code=$.trim($('#giftcode').val());
      
	   var dest_url='<?php echo $base_url.$cnfg["sitebasefolder"];?>/carts/checkgiftcard/'+code;
	   $('#gift_img').show();
       var res = $.ajax({ url: dest_url, cache: false,async: false }).responseText;
           
	   res=res.split('*~*');
       if(res[0] == 'invalid') {
	     //$('#gift_msg').html('<font color=red>Sorry,You have entered an Invalid Gift Card Code.</font>'); 
	     //$('#gift_img').hide();	
             thisform.submit();
	     //return false;
	   }
	   else {	    
		 var tot_amnt=$.trim($('#cart_total').val());
		 var bal_amnt=res[0];
		 tot_amnt=parseFloat(tot_amnt);
                 bal_amnt=parseFloat(bal_amnt);
		 var bal_str='<?php echo $curlogo;?>'+bal_amnt;
		 if(bal_amnt < tot_amnt)
		    {				
				  $('#gift_img').hide();
				  $('#gift_msg').show();
				 // $('#gift_msg').html("<font color=red>Sorry,You you don\'t have sufficient balance.Your balance is "+bal_str+"</font>"); 
				  $('#gift_msg').html("<font color=red>Sorry,You don\'t have sufficient balance to make this purchase.</font>");
				  $('#giftcode').val('');
				  return false;
		    }
			else
			{
			  thisform.giftcard.value="yes";
			  flag=1;$('#gift_msg').hide('');	
			}	  
	     }	   	   
   } 

   if(flag==1)
   {
     thisform.submit();
   }   
   else
   return false;  
}

	function showGiftdiv()
	{
	 $('#giftcard_div').show();
	 return false;
	} 

function payByCredit(thisform) {
    $('#credits').val('yes');
    thisform.submit();
} // End Function


function confirmOrder()
{
	if(confirm("Do you want to proceed with complete payment ??"))
	{
		return true;
	}
	else
	{
		return false;
	}
}


</script>

<?php


	$pmeth	=	explode("-*-",$cnfg["payment_method"]);
        //print '<pre />';print_r($pmeth);exit;
        $ppal	=	false;
        $auth	=	false;
        $goog	=	false;
        $worldp	=	false;
        $yourp	=	false;
        $twoco  =       false;
        $moneybrokers   =       false;
        $paypalpro  =       false;
        $paypalflow  =       false;
        $paypallink  =       false;
        $paypaladvanced  =       false;
        $ogone  =       false;
        $braintree  =       false;
        $bluep = false;
        $quickbook = false;
        $paymentEnableFlage = 0;
        
        foreach($pmeth as $meth){
		if($meth == "paypal"){
			$ppal	=	true;$paymentEnableFlage = 1;
		}elseif($meth == 'authorize'){
			$auth	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'googlechk'){
			$goog	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'worldpay'){
			$worldp	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'yourpay'){
			$yourp	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'bluepay'){
			$bluep	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'twocheckout'){
			$twoco	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'moneybrokers'){
			$moneybrokers	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'paypalpro'){
			$paypalpro	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'paypalflow'){
			$paypalflow	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'paypallink'){
			$paypallink	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'paypal_express'){
			$paypal_exp	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'paypaladvanced'){
			$paypaladvanced	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'paypaladvanced'){
			$paypaladvanced	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'ogone'){
			$ogone	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'braintree'){
			$braintree	=	true;$paymentEnableFlage = 1;
		}elseif($meth	==	'quickbook'){
			$quickbook	=	true;$paymentEnableFlage = 1;
		}
	}
        
         $paymentEnableOfflineFlage = 0;
        if($cnfg['offline_creditpay']=='Y'){
            $paymentEnableOfflineFlage = 1;
            $paymentEnableFlage  =  0;
        }

        if($cnfg['secureURL'] != "")
            $secureURL = $cnfg['secureURL'];
        else
            $secureURL = "http://".$_SERVER["HTTP_HOST"];
       $secureURL = str_replace($cnfg['sitebasefolder'],"",$secureURL);
?>
 <div align="center">
    <h2 class="title text-center mainhd">Checkout</h2>
            </div>
            <br />
            <div align="left" id="item_details_admin">
              <!--items display area start -->
              <div align="center" id="items_display_area_admin">
                <div align="left" class="inner_content_area_admin">

<?php if($session->check('Message.flash')) { ?>
<?php if($session->read('Gstatus')==0) { ?>
<div id="errorbox"><font color="#FF0000">
<?php }else { ?>
    <div id="okbox"><font color="#446423">
<?php } ?>
    <?php $session->flash(); ?></font></div><?php } ?>
               
				   <div id="admin_heading">Select A Payment Option </div>
				   
				   
				   <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner">Total to Pay</p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						
                       <p class="maintext_inner">
					    <?php			
						$display_total = number_format($totaltopay,2,".","");
						echo $curlogo;echo "&nbsp;";echo  $totaltopay; ?>	
							</p>
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  
				  
				  
				    <?php if($taxamnt > 0 ) { ?>
				    <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner">Tax</p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						
                       <p class="maintext_inner">
					  <?php			
						$taxamnt = number_format($taxamnt,2,".","");
						echo $curlogo;echo "&nbsp;";echo  $taxamnt; ?>
							</p>
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <?php } ?>
				  
				   <?php if($discount > 0 ) { ?>
				    <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner">Promo Code Discount</p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						
                       <p class="maintext_inner">
					   <?php			
			                $discount = number_format($discount,2,".","");
						  	echo $curlogo;echo "&nbsp;";echo  $discount; ?>	
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <?php } ?>
				  
				  
				    <?php
                                   if($prodtype!='Digital') { 
                                    if($shipping_cost > 0 ) { ?>
				    <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner">Total Shipping Cost</p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						
                       <p class="maintext_inner">
					  <?php	echo $curlogo;echo "&nbsp;".number_format($shipping_cost,2,".",""); ?>		
							</p>
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <?php } ?>
                   <?php } ?>
                   <?php 
                   if($session->check('GiftCardDiscount')) { ?>
                   
				    <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner">Gift Card Discount</p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						
                       <p class="maintext_inner">
					   <?php
                                        $giftcardamtdetails =   $session->read('GiftCardDiscount');
                                        $giftcardamt       = $giftcardamtdetails['GiftcardDetail']['balance'];
			                $giftcardamt = number_format($giftcardamt,2,".","");
						  	echo $curlogo;echo "&nbsp;";echo  $giftcardamt; 
                                           //echo   $gtotal;exit;           
                                       $gtotal = $gtotal-  $giftcardamt;               
                                     ?>	
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
		<?php  } ?>
				  
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner">Grand Total</p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						 <p class="maintext_inner">
                          <input type="hidden" name="cart_total" id="cart_total" value="<?php echo number_format($gtotal,2,".","");?>">
						<?php 				
						echo $curlogo;echo "&nbsp;";
						echo number_format($gtotal,2,".","");
						?>															
						 </p>                      
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div id="grid_admin">
                    <form name="paymentCredits" method="post" action="<?php echo $html->url();?>">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner">Balance Credits</p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						 <p class="maintext_inner">
                          <input type="hidden" name="balanceCredits" id="balanceCredits" value="<?php echo $creditBalance; ?>" />
                          <input type="hidden" name="credits" id="credits" value="" />
						<?php
						echo $curlogo;echo "&nbsp;";
						echo $creditBalance;
						?>
                          <?php
                          if($creditBalance >= $gtotal) {
                          ?>
                          &nbsp;&nbsp;<span class="toplinks"><a href="#" onclick="payByCredit(document.paymentCredits)">Use Credits</a></span>
                          <?php
                          }
                          ?>
						 </p>
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </form>
                  </div>
				  
				  <?php if($cnfg["allow_giftcard"] == 'Y') { ?>
				   <div id="grid_admin">
                    <div align="right" id="inner_leftcontent" class="lft-cell01">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <span class="toplinks"><a href="#" class="tooltip" title="Please Purchase a gift card and use the gift card code" onclick="return showGiftdiv()";>Use Gift Card</a></span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				
				 
			    <div id="giftcard_div" style="display:none;">
				    <div id="grid_admin">
                    <div align="right" id="inner_leftcontent" class="lft-cell01">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
					 <form name="payment" method="post" action="<?php echo $html->url();?>"> 
                     <span class="toplinks">
						<label class="maintext_inner">Enter Gift Card Code</label>
						<input  type="text" class="box2_admin"  name="giftcode"  id="giftcode" /><br />	<br />					
						<lable style="padding-left:100px;">
						<input  type="button" class="buttn_user" value="Pay using Giftcard" onClick="return chkForm(document.payment);"/>	
						</label>		
                        </span>
						<label id="gift_img" style="display:none;">
						<font color="green">checking</font><?php echo $html->image('/img/load.gif');?>
						</label>
				        <br /><label id="gift_msg"></label>			
						  <br />
						 <input type="hidden" name="giftcard" id="giftcard" value="">		
						 <input type="hidden" name="ship_method" id="ship_method" value="<?php echo $ship;?>">
						  </form>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>				  
		     </div>  
				  <?php } ?>  
                                 <?php if($paymentEnableOfflineFlage=='0') { ?>
				  <?php if(isset($ppal) && $ppal ==	true){?>
				  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						
                       <p class="maintext_inner"><a href="<?php echo $html->url('/carts/paypal'); ?>"><?php echo $html->image('/img/pp.jpg',array('border' => '0'));?></a></p>
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <?php } ?>
				  
  <?php if(isset($auth) && $auth == true){?>
  <?php
  $lnk= $html->url('/carts/ccard');
  /*$lnk = str_replace("http://","https://",$lnk);
	 $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
      $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                     <p class="maintext_inner"> </p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                      <span class="toplinks">
						<p class="maintext_inner"><a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/cc.gif',array('border' => '0','valign' => 'top', 'title' => 'Pay with Credit Card'));?></a></p>
                        </span>
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>
  <?php if(isset($yourp) && $yourp == true){?>
  <?php $lnk= $html->url('/carts/yourpay');
	/* $lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
         $lnk = $secureURL. $lnk;
         ?>

                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						 <p class="maintext_inner"><a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/yourpay.jpg',array('border' => '0','valign' => 'top', 'title' => 'Pay with YourPay Payment Gateway'));?></a></p>
                      
                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                <?php }?>
  <?php if(isset($worldp) && $worldp == true){?>
  <?php $lnk= $html->url('/carts/worldpay/');
	/* $lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
        $lnk = $secureURL. $lnk;
         ?>

                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/worldpay.gif',array('border' => '0','valign' => 'top', 'title' => "Make payments with WorldPay - it's fast, free and secure"));?></a>
                      
                        </span>
					
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <?php }?>
				   <?php if(isset($bluep) && $bluep == true){?>
  <?php $lnk= $html->url('/carts/bluepay/');
	/* $lnk = str_replace("http://","https://",$lnk);
                  $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
             $lnk = $secureURL. $lnk;
                  ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                     <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/bluepay.jpg',array('border' => '0','valign' => 'top', 'title' => "Make payments with WorldPay - it's fast, free and secure"));?></a>
                      
                        </span>
					
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <?php }?>
  <?php if(isset($goog) && $goog == true){?>
  <?php $lnk= $html->url('/carts/googlechk/');
	/* $lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
  $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                      
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/google_checkout.gif',array('border' => '0','valign' => 'top', 'title' => 'Google Checkout Payment Gateway'));?></a>
                      
                        </span>
						
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>
 
  <!--Ak payment integration starts-->

                  <?php if(isset($twoco) && $twoco == true){?>
  <?php $lnk= $html->url('/carts/twocopayment/');
	/* $lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
         $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <br>
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/2co_logo_payment.png',array('border' => '0','valign' => 'top', 'title' => '2Checkout Payment Gateway', 'height'=> 50 ));?></a>

                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>
               
                   <?php if(isset($moneybrokers) && $moneybrokers == true){?>
  <?php $lnk= $html->url('/carts/moneybookers/');
	/* $lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
            $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <br>
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/money_brooker_logo.png',array('border' => '0','valign' => 'top', 'title' => 'Money Bookers Payment Gateway', 'height'=> 50 ));?></a>

                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>

                  <?php
                 if(isset($paypalpro) && $paypalpro == true && $gtotal < $paypalpropaylimit){?>


  <?php $lnk= $html->url('/carts/paypalpropayment/');
	/* $lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
        $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <br>
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/paypalpro.jpg',array('border' => '0','valign' => 'top', 'title' => 'Paypalpro Payment Gateway', 'height'=> 50 ));?></a>

                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>


                  <?php
                 if(isset($paypalflow) && $paypalflow == true){?>


  <?php $lnk= $html->url('/carts/paypalflowpayment/');
	/* $lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
         $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <br>
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/icon-paypal-payflow.jpg',array('border' => '0','valign' => 'top', 'title' => 'Paypalflow Payment Gateway', 'height'=> 80, 'width'=>120 ));?></a>

                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>


                   <?php
                 if(isset($paypallink) && $paypallink == true){?>


  <?php $lnk= $html->url('/carts/paypalflowlinkpayment/');
	/* $lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
        $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <br>
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/paylinkicon.jpg',array('border' => '0','valign' => 'top', 'title' => 'Paypalflow Link Payment Gateway', 'height'=> 80, 'width'=>120 ));?></a>

                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>

                   <?php
                 if(isset($paypaladvanced) && $paypaladvanced == true){?>


  <?php $lnk= $html->url('/carts/paypaladvanced/');
	 /*$lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
        $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <br>
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/paypaladvance.png',array('border' => '0','valign' => 'top', 'title' => 'Paypal Advance Payment Gateway', 'height'=> 80, 'width'=>120 ));?></a>

                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>


                   <?php
                 if(isset($ogone) && $ogone == true){?>


  <?php $lnk= $html->url('/carts/ogonepayment/');
	 /*$lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
          $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <br>
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/logo_ogone.jpg',array('border' => '0','valign' => 'top', 'title' => 'Ogone Payment Gateway', 'height'=> 80, 'width'=>120 ));?></a>

                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>


                  <?php
                 if(isset($braintree) && $braintree == true){?>


  <?php $lnk= $html->url('/carts/braintreepayment/');
	 //$lnk = str_replace("http://","https://",$lnk);
          //$lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;
         $lnk = $secureURL. $lnk;
          
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <br>
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/braintree_logo.png',array('border' => '0','valign' => 'top', 'title' => 'Braintree Payment Gateway', 'height'=> 46, 'width'=>140 ));?></a>

                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>
                  
                  <?php
                  if(isset($paypal_exp) && $paypal_exp == true){
                  $lnk= $html->url('/carts/paypalexpress/');
                 /* $lnk = str_replace("http://","https://",$lnk);
                  $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
                  $lnk = $secureURL. $lnk;
                  ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                      
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>">
                                                    <?php echo $html->image('/img/btn_xpressCheckout.gif',array('border' => '0','valign' => 'top', 'title' => 'Pay using PayPal Express'));?>
                                                </a>
                      
                        </span>
						
                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  <?php
                  }
                  ?>

                   <?php
                 if(isset($quickbook) && $quickbook == true){?>


  <?php $lnk= $html->url('/carts/quickbookpayment/');
	/* $lnk = str_replace("http://","https://",$lnk);
          $lnk = "https://".$_SERVER["HTTP_HOST"]. $lnk;*/
         $lnk = $secureURL. $lnk;
         ?>
                  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <br>
					  <span class="toplinks">
						<a href="<?php echo $lnk; ?>"><?php echo $html->image('/img/quickbook.jpg',array('border' => '0','valign' => 'top', 'title' => 'Quickbook Payment Gateway', 'height'=> 80, 'width'=>120 ));?></a>

                        </span>

                    </div>
                    <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				   <?php }?>

              
                 <!--Ak payment integration ends-->
          <?php } else {
              
              $lnk_offline= $html->url('/carts/offlinepay/');
              ?>
                 
                 <form name="payment" method="post" action="<?php echo $lnk_offline?>"> 
                     <br />
                     <span class="toplinks">
						
											
						<lable style="padding-left:100px;">
						<input type="submit" class="buttn_user" name="offline_payment" id="offline_payment" value="Make Offline Payment" onClick="return confirmOrder()">
                                                </label>
                                                <br /><br />
                                                </span>
						
			
		</form>
                 
           <?php } ?>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  
  <?php //if ($ppal == false && $auth == false &&  $goog == false && $worldp == false && $yourp == false &&  $bluep == false &&  $twoco == false && $paypalpro ==  false)
      if($paymentEnableFlage == 0 && $paymentEnableOfflineFlage == 0)
      {
      ?>
				  <div id="grid_admin">
                    <div class="col-sm-6 col-md-4 tblinr_hd">
                      <p class="maintext_inner"></p>
                    </div>
					 
                    <div class="col-sm-6 col-md-8">
                      <span class="toplinks">
					  			<p class="maintext_inner">The site administrator has to enable a payment method!</p>
                        </span>
                    </div>
                 
					
			   <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
                  </div>
                  <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
				  <?php } ?>



                 
				  				  
				  
                 <div id="admin_bottom">
				<div align="left" id="inner_leftcontent" class="lft-cel01">
				  <p class="maintext_inner">&nbsp;</p>
				</div>
				<div class="col-sm-6 col-md-8">
					<span class="toplinks">		
					
					
					
					</span>
				</div>
				<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
			</div>
                </div>
				
                <!--form area end -->
				
              </div>
              <div align="left" class="float_clear1"></div>
            </div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
			