<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Programmer<programmer@armia.com>        		              |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com � 2005                |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | This script may not be distributed, sold, given away for free to     |
// | third party, or used as a part of any internet services such as      |
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
?>
<?php
include "includes/config.php";
include "includes/session.php";
include "includes/functions.php";
include_once "classes/cls_user.php";
include_once "classes/cls_utils.php";
include_once "classes/cls_store.php";
if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE); 
} 


if(isset( $_SESSION["sess_userid"]) and $_SESSION["sess_userid"]!= ""){
	$userid = $_SESSION["sess_userid"];
}else{
	header("Location:login.php");
	exit;
}


  if(getSettingsValue('enable_membership')=='Y')
        {
                $planObj    =   Utils::getsellerPlans('Paid');

                //echo $planObj->status ;
                if($planObj->status==SUCCESS)
                 {
                       $sellerPlanRows      =   $planObj->data;
                 }

        }
 



if($userid!='')
    {
            $obj        =   User::getUserInfo($userid);

            if($obj->status==SUCCESS)
                    {
                        $row    =   $obj->data;
                        $txtFirstName = $row->first_name;
                        $txtLastName = $row->last_name;
                        $txtAddress1 = $row->address1;
                        $txtAddress2 = $row->address2;
                        $txtCity = $row->city;
                        $txtState = $row->state;
                        $ddlCountry = $row->country;
                        $txtPhone = $row->phone;
                        $txtFAX =  $row->fax;
                        $txtZIP = $row->zip;
                        $txtEmail =  $row->email;
                    }
    }

//echopre($_SESSION['SELLER_PLAN_OBJ']);
    
  
$countrylist = makeCountryList();

/*display the active template*/

$active_template = displayTemplate();

$txtEnableAuthorize 	= getSettingsValue('vauthorize_enable');
$txtEnableBluepay       = getSettingsValue('vbluepay_enable');
$txtEnableFirstData	= getSettingsValue('vyourpay_enable');
$enable_buyerToseller	= getSettingsValue('enable_buyerToseller');
$chkPaypal              = getSettingsValue('enablepaypal');
$chkDwolla              = getSettingsValue('dwolla_payment_enable');
$txtEnableStripe	= getSettingsValue('stripe_payment_enable');

include "includes/htmltop.php";

/* Top File Name */
include_once ("includes/".$active_template[0]);
$ddlCountry = $ddlCountry == ""?"US":$ddlCountry;
?>

<script>
    $(document).ready(function(){
          $('#subOption').change(function(){
              var val  = $('#subOption').val();
               $.ajax({url: "<?php echo SITE_URL?>/plan_ajax_info.php?planid="+val, success: function(result){
                    $("#jqTarget").html(result);
                }});
                $.ajax({url: "<?php echo SITE_URL?>/plan_ajax_dwolla.php?planid="+val, success: function(result){
                    $("#dwollaPayment").html(result);
                }});
                
          });

          var planId = $('#subOption').val();

          if(planId!='')
          {
                $.ajax({url: "<?php echo SITE_URL?>/plan_ajax_info.php?planid="+planId, success: function(result){
                    $("#jqTarget").html(result);
                }});
             $.ajax({url: "<?php echo SITE_URL?>/plan_ajax_dwolla.php?planid="+planId, success: function(result){
                    $("#dwollaPayment").html(result);
                }});
            
          }

});

</script>


<!--mainbody area start -->
<div class="main_body">
	<div class="container">
		<div class="row">

			
		<!--center content area start-->		
		<form name="frmProfile" action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST" onSubmit="return checkUserRegisterForm();">
		<input type="hidden" name="userid" value="<?php echo htmlentities($userid);?>">
		
		<div align="left" id="item_details">
	
		
		<div class="col-sm-12 col-lg-4 col-md-4"></div>
                    <div class="col-sm-12 col-lg-4 col-md-4">
                        <div align="left" id="items_top_area">
                            <div align="center" id="items_top_area_ttl">
                                <?php echo CHOOSE_PAYMENT_TYPE; ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                        <div class="<?php echo $msg_class;?>" align="center"><?php echo $message ?></div>
                        <div class="clear"></div>
                       
                            <div class="form_wrapper">
                                <div class="register_form_outer">
                                    <div class="registrationform_container">                                        
                             <?php  if(getSettingsValue('enable_membership')=='Y' && $planObj->status==SUCCESS )
                                        {
                                 ?>
                                        <div class="field_wrapper formfield_row">
                                            <select name="subOption" id="subOption" class="form-control" style="font-size:12px; font-weight:bold;" >

                                               				
                                                                <?php

                                                                foreach($sellerPlanRows as $data_plan) {
                                                                    $subCharge=number_format($data_plan->plan_SubscriptionCharge,2,".","");
                                                                    echo '<option value="'.$data_plan->plan_Id.'"';
                                                                    if($_SESSION['SELLER_PLAN_OBJ']->sellerPlanID==$data_plan->plan_Id) {  echo "selected" ; } 
                                                                    echo	'>'.$data_plan->plan_Title.'['.$adminCurrency['currency_symbol'] .'&nbsp;'.$subCharge.']</option>';
                                                                }//end while loop
                                            ?>
                                            </select>
                                        </div>
                                  <?php } ?>

                                        <div  id="jqTarget"> </div>
                                       <?php 
                                       // Paypal Payment settings
                                       if($chkPaypal == "Y")
                                        { ?>
                                        <div class="field_wrapper formfield_row">
                                          <?php echo  PAYPAL_CLICK_TEXT;?>
                                            <br><br>
                                            <a href="seller_pay.php?paymentMethod=PP"><img src="images/pp.jpg" alt="<?php echo PAYPAL_TOOLTIP_TEXT;?>" border="0" title="<?php echo PAYPAL_TOOLTIP_HELP_TEXT ;?>" ></a>
                                            
                                        
                                        </div>   
                                        <?php } ?> 
                                        <div  id="jqTargetDwolla"> </div>
                                       <?php 
                                       // Paypal Payment settings
                                       if($chkDwolla == "Y"  && $adminCurrency['currency_code']=='USD')
                                        { ?>
                                        <div class="field_wrapper formfield_row">
                                          <?php echo  CLICK_DWOLLA_PAYPAL_TEXT;?>
                                            <br><br>
                                            <div id="dwollaPayment">
                                                 <?php echo generateDwollaPaymentScript($totaltopay,'sellers/product-listing-payment-success-dwolla.php?&pid='. $pids); ?> 
		   
                                            </div>
                                           
                                        
                                        </div>   
                                        <?php } ?> 
                                        <?php if($chkPaypal == "Y"  || $chkDwolla == "Y") ?>
                                            [<?php echo PAYPAL_RETURN_HELP_TEXT ;?> ] 
                                        
                                         <?php 
                                       // Credit Card  settings
                                       if((($txtEnableAuthorize == "Y" || $txtEnableBluepay == "Y" || $txtEnableFirstData == "Y")  && $adminCurrency['currency_code']=='USD') || $txtEnableStripe=="Y")
                                         { 
                                           $secureurl = SECURE_SITE_URL."/seller_plan_payment.php";
                                           ?>
                                        <div class="field_wrapper formfield_row">
                                          <?php echo  CREDITCARD_CLICK_TEXT;?>
                                            <br><br>
                                            <a href="<?php echo $secureurl?>"><img src="images/cc.gif" valign="top" title="<?php echo CREDITCARD_TOOLTIP_TEXT;?>" border="0" ></a>
                                            <br>
                                          
                                        </div>   
                                        <?php } ?>    
                                   
                                    <div class="clear"></div>
                                </div>
                            </div>
                           

                    </div>
                    <div class="col-sm-12 col-lg-4 col-md-4"></div>

                    <div class="clear"></div>		
	
	
		<div align="left" class="float_clear1"></div>
					
					
		 <!--items display area end -->
		  </div>
		
			
		<!--center content area end-->	


		<div align="left" class="clear"></div>
                </form>
		</div>
	</div>
</div>		
<!--mainbody area end -->
<div class="clear"></div>




				

<?php
include "includes/".$active_template[2];	/* Bottom File Name */
?>																
