<?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('api/pemfile/iphonepush.php');
include_once "classes/cls_store.php";
include_once "classes/cls_utils.php";
include_once "classes/cls_user.php";
$currency_attributes=displayCurrencyType();
$adminCurrency	= GetAdminCurrency();

if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
	$_SESSION = array_map('stripslashes_deep', $_SESSION);
}

if(isset( $_SESSION["sess_userid"]) and $_SESSION["sess_userid"]!= ""){
	$userid = $_SESSION["sess_userid"];
}


$txtCCNumber = $_POST["txtCCNumber"];
$txtCVV2 = $_POST["txtCVV2"];
$txtMM = $_POST["txtMM"];
$txtYY = $_POST["txtYY"];
$objVo        =     $_SESSION['SELLER_PLAN_OBJ'];
$txtFirstName   =   $objVo->first_name;
$txtLastName    =   $objVo->last_name;
$txtAddress1    =   $objVo->address1;
$txtAddress2    =   $objVo->address2;
$txtCity        =   $objVo->city;
$txtState       =   $objVo->state;
$txtZIP         =   $objVo->zip;
$txtEmail       =   $objVo->email;
$ddlCountry     =   $objVo->country;
$txtPhone       =   $objVo->phone;

if($_SESSION['SELLER_PLAN_OBJ']->sellerPlanID!='') {
                 $planObj                =   Utils::getsellerPlansByPlanId($_SESSION['SELLER_PLAN_OBJ']->sellerPlanID);

                 if($planObj->status==SUCCESS)
                 {
                     $planObjVal =   $planObj->data;

                      $planAmount       = generalMethods::numberFormat($planObjVal->plan_SubscriptionCharge);
                      $planName         = Utils::html_entity($planObjVal->plan_Title);
                      $planPeriod       = $planObjVal->plan_Period; 
                 }

                 $totaltopay     =   $planAmount;

                 if($totaltopay<=0)
                 {
                         $redirecturl    =   SITE_URL."/choosesellerplan.php";
                         generalMethods::redirect($redirecturl);
                 }
         }



//getting payment info
$sql = "SELECT * FROM ".$tableprefix."settings ";
$res = mysql_query($sql);
$row = mysql_fetch_array($res);

$txtEnableStripe	= $row['stripe_payment_enable'];
if($txtEnableStripe=="Y"){
$txtStripePublishKey = $row['stripe_publish_key'];
$txtStripeSecretKey = $row['stripe_secretkey'];
$stripeMode  = $row['stripe_payment_test_mode'];
}

$gift_coupon_flag = 0;

if (isset($_POST["cart_total"]) && $_POST["cart_total"]!='')
 {
    $message = "";

    $paymentsuccessful = false;
    $paymenterror = "";

    $txtEnableAuthorize 	= getSettingsValue('vauthorize_enable');

    // Check Bluepay  payment is Enabled 

    $txtEnableBluepay = getSettingsValue('vbluepay_enable');


        $txtCCNumber = $_POST["txtCCNumber"];
        $txtCVV2 = $_POST["txtCVV2"];
        $txtMM = $_POST["txtMM"];
        $txtYY = $_POST["txtYY"];

        $paymentsuccessful = false;
        $paymenterror = "";


        // Check Bluepay  payment is Enabled

        if($txtEnableBluepay=='Y') {

                $order_total_amount     =   number_format($totaltopay,2,".","");
                
		$txtBluepayAccountId = getSettingsValue('bluepay_accountid');

		$txtBluepaySecretKey = getSettingsValue('bluepay_secretkey');

		 $mode  = getSettingsValue('bluepay_test_mode');
                
		
		$card_expiry    = $txtMM.substr($txtYY,-2);
		include "includes/Bluepay.php";
		$bp = new Services_Bluepay();
		$bp->setValue("ACCOUNT_ID", $txtBluepayAccountId);
		$bp->setValue("SECRET_KEY", $txtBluepaySecretKey);
		$bp->setValue("TRANS_TYPE", 'SALE');
		$bp->setValue("MODE", $mode);		# Default is TEST --> Set to LIVE for live tx
		$bp->setValue("AMOUNT", $order_total_amount);	# ODD returns Approved, EVEN returns Declined in TEST mode
		$bp->setValue("PAYMENT_ACCOUNT", $txtCCNumber);	# Card Number
		$bp->setValue("CARD_EXPIRE", $card_expiry);
		$bp->setValue("NAME1", $txtFirstName);
		$bp->setValue("NAME2", $txtLastName);
		$bp->setValue("PHONE", $txtPhone);
		$bp->setValue("EMAIL", $txtEmail);
		$bp->setValue("COMPANY_NAME", SITE_NAME);
		$tamperProofSeal=md5($txtBluepaySecretKey.$txtBluepayAccountId.$order_total_amount.$mode);
		$bp->setValue("TAMPER_PROOF_SEAL", $tamperProofSeal);
		$bp->setValue("ADDR1", $txtAddress1);
		$bp->setValue("CITY", $txtCity);
		$bp->setValue("STATE", $txtState);
		$bp->setValue("ZIP", $txtZIP);
		$bp->setValue("COUNTRY", $ddlCountry);
		$bp->bp20post();
		$transactionid = $bp->getValue("TRANS_ID");
		$paymentsuccessful = false;
		if($transactionid != "" && $bp->getValue("MESSAGE")	== "Approved Sale" && $bp->getValue("STATUS")== "1") {
		$paymentsuccessful = true;
		}
		else {

	 $paymenterror = CANNOT_PROCESS_TEXT;
                  }
        }


   // Check Authorise payment Enabled

        if($txtEnableAuthorize == 'Y') {

                $txtAuthorizeLoginId        =     getSettingsValue("authorize_loginid");
                $txtAuthorizeTransKey       =     getSettingsValue("authorize_transkey");
                $txtCurrency                =     $adminCurrency['currency_code'];
                $txtAuthorizeEmail          =     getSettingsValue("authorize_email");
                $txtAuthorizeTestMode       =     getSettingsValue("authorize_test_mode");

             
               
                if($txtAuthorizeTestMode == "Y"){
                        $txtAuthorizeTestMode = "on";
                }else{
                        $txtAuthorizeTestMode = "off";
                }


                $referrer =  $_SERVER["HTTP_REFERER"];
                
                $Inv_id=    rand();
                $Cust_id = $_SESSION["sess_userid"];
                $Cust_ip = getClientIP();
                $Company = "-NA-";
                $Phone=$txtPhone;
                if($txtLastName=="")
                  $txtLastName="-NA-";

                require "authorize.php";//process the card and return result. Comment this line and uncomment the two lines below to make payment test mode

                if($txtAuthorizeTestMode == "on"){
                    $paymentsuccessful = true;
                    $paymenterror   =   '';
                }
        }


        // First Data Payment Integration  Done By Asha 
		$txtEnableFirstData	= getSettingsValue('vyourpay_enable');
		if($txtEnableFirstData=='Y')
		{
			include_once "includes/firstData.php";


			$mylphp=new firstData;



		if(getSettingsValue('vyourpay_mode')=='TEST')
		{
			//$myorder["host"]       = "208.72.248.102";   //secure.linkpt.net for Live
			$myorder["host"]       = "staging.linkpt.net";

                        $myorder["result"]     = "LIVE";

		}
		else
		{
			$myorder["host"]       = "secure.linkpt.net";   //secure.linkpt.net for Live
			$myorder["result"]     = "LIVE";
		}
			$myorder["port"]       = "1129";

			//##Merchantinfo
			$myorder["keyfile"]    = "pem/".getSettingsValue('vyourpay_certificate_file'); # Change this to the name and location of your certificate file
			$myorder["configfile"] =trim(getSettingsValue('vyourpay_storeid')); # Change this to your store number
			//## Orderoptions
                        
			 $myorder["ordertype"]    = "SALE" ; //The type of transaction. The possible values are SALE,PREAUTH,VOID,POSTAUTH,CREDIT, CALCSHIPPING

			$yearlen=strlen($txtYY);

			if($yearlen>2)
			{
				$CardYear= substr($txtYY,-2);
			}
			# card info
			$myorder["cardnumber"]   = $txtCCNumber ;
			$myorder["cardexpmonth"] = $txtMM;
			$myorder["cardexpyear"]  = $CardYear;
			$myorder["cvmindicator"] = "provided";
			$myorder["cvmvalue"]     =  $txtCVV2;
			//## Payment
			//$myorder["subtotal"]    = $totaltopay;
			//$myorder["tax"]         = number_format($totaltaxrate,2,".","");
			//$myorder["shipping"]    = number_format($shipping_cost,2,".","");
			//$myorder["vattax"]      = "0.00";
			$myorder["chargetotal"] = number_format($totaltopay,2,".","");
			// ## Billing
			$myorder["name"]      = $txtFirstName;
			$myorder["address1"]  = $txtAddress1;
			$myorder["address2"]  = $txtAddress2;
			$myorder["city"]      = $txtCity;
			$myorder["state"]     = $txtState;
			$myorder["country"]   = $ddlCountry;
			$myorder["phone"]     = $txtPhone;
			$myorder["email"]     = $txtEmail;
			$myorder["fax"]    	  = $txtFAX;
			$myorder["addrnum"]   = '';   # Required for AVS. The numeric portion of the street address If not provided, transactions will downgrade.
			$myorder["zip"]       = $txtZIP; # Required for AVS. Billing zip or postal code If not provided, transactions will downgrade.
			//$items = array();
			//$myorder["items"][0] = $items; # put array of items into hash

			$myorder["comments"] = str_replace("{SITE_NAME}", SITE_NAME, MSG_PAYMENT_ITEM_SUBJECT);
                        

			$result = $mylphp->curl_process($myorder);  # use curl methods

			$transactionid		=	$result["r_ordernum"];
                       

			if($transactionid != "" && $result["r_approved"] == "APPROVED") {
				$paymentsuccessful = true;
			}
			if ($result["r_approved"] != "APPROVED")	// transaction failed, print the reason
			{
				if($result["r_error"]=='<')
                                {
                                   $paymenterror = PROCESS_TRY_LATER_TEXT;
                                }
                                  else
                                  {
                                    $paymenterror=$result["r_error"];
                                  }

				$msg_error=$paymenterror;
				$_SESSION['PAYMENT_ERROR']=$result["r_error"];
			}


            }
        if($txtEnableStripe=="Y"){

            include_once "library/stripe/Stripe.php";
            Stripe::setApiKey($txtStripeSecretKey);
            try {
                if (!isset($_POST['stripeToken'])){
                   //throw new Exception("The Stripe Token was not generated correctly");
                    $paymenterror = $error;
                }
                    $order_total  = $totaltopay;
                    $orderTotal   = round($order_total);
                  
                    $txtCurrency                =     $adminCurrency['currency_code'];
                    Stripe_Charge::create(array("amount" => $orderTotal * 100,
                                    "currency" => $txtCurrency,
                                    "card" => $_POST['stripeToken'],
                                    "description" => $txtEmail));
                        $success = '<div class="alert alert-success">
                                    <strong>Success!</strong> Your payment was successful.
                                                    </div>';
                        
                    $paymentsuccessful = true;
                }
                catch (Exception $e) {
                      $error = '<div class="alert alert-danger">
                                        <strong>Error!</strong> '.$e->getMessage().'
                                        </div>';
                      
                      $paymenterror = $error;
                }
                 
                 

        }
	
	//$paymentsuccessful = true;
	// = "TEST1234444";
     
        if($paymentsuccessful)
        { // check if credit card payment is success
                 //Create Seller Account with user details
                $objVo        = $_SESSION['SELLER_PLAN_OBJ'];
                
                $accObj       =   Store::createsellerAccount($objVo);
                if($accObj->status==SUCCESS)
                        {
                             $sellerid              = $accObj->data;
                            //Update Seller Account Activation in User side
                             $userObjVo             =   new stdclass();
                             $userObjVo->userid     =   $userid;
                             $userObjVo->sellerid   =  $sellerid;
                             $userObj               =   User::updateSellerAccountActivation($userObjVo);
                             //Get Seller Approval Status And Re-direction
                             $sellerStatusObj       =   Store::get_seller_account_info($sellerid);
                             if($sellerStatusObj->status==SUCCESS)
                                        {
                                            //echo "herre";
                                            // Save Seller Plan Details
                                  $sellerobjDataVal   =  $sellerStatusObj->data;
                                            if($planPeriod=="M")
                                            $noOfDays=30;
                                            if($planPeriod=="Y")
                                            $noOfDays=365;
                                            $fromDate= date("Y-m-d");
                                            $endDate= date("Y-m-d",strtotime("+".$noOfDays." day"));
                                            
                                            $objPlanVo                      = new stdClass();
                
                                            $objPlanVo->artist_id                   =   $sellerid;
                                            $objPlanVo->artist_memStartDate         =   $fromDate;
                                            $objPlanVo->artist_memEndDate           =   $endDate;
                                            $objPlanVo->plan_Id                     =   $_SESSION['SELLER_PLAN_OBJ']->sellerPlanID;
                                            $objPlanVo->plan_SubscriptionCharge     =   $totaltopay;

                                            $objVo->seller_id         =     $sellerid;
                                            
                                            $saveSellerPlanInfo =  Store::savesellerPlanDetails($objPlanVo);
                                            
                                            

                                             //Unset User Session Data
                                             $_SESSION['SELLER_PLAN_OBJ'] = new stdClass();
                                             unset($_SESSION['SELLER_PLAN_OBJ']);
                                            // Send Mail Alert to Admin And seller
                                           $malFlag             = Store::sendSellerAccountActivationMail($objVo);
                                          
                                            // End 
                                          // End Plan details 
                                            $approvalStatus    = $sellerobjDataVal->vapproved;
                                                //header("Location:activateselelraccount")
                                                      if($approvalStatus=='NN')
                                                          {
                                                                $activation_msg = MSG_SELLER_ACCOUNT_ACTIVATION;
                                                          }else{
                                                                $activation_msg = MSG_SELLER_ACCOUNT_ACTIVATED;
                                                          }

                                                          $_SESSION['SELLER_ACCOUNT_ACTIVATED_MSG'] = $activation_msg;
                                                          
                                                                $active_template = displayTemplate();
                                                                include_once "includes/htmltop.php";
                                                                $var_alert= '<link href="'.SITE_URL.'/themes/'.$active_template[5].'/jquery-confirm.css" rel="stylesheet" type="text/css">';
                                                                $var_alert.='<script src="'.SITE_URL.'/js/jquery-confirm.js"></script><script type="text/javascript">$.alert({
                                                        title: "",
                                                        content: "'.$activation_msg.'",
                                                        confirmButton: "okay",
                                                        confirmButtonClass: "btn-info",
                                                        animation: "bottom",
                                                        icon: "fa fa-check",
                                                        backgroundDismiss: true
                                                    }); window.location.href = "myaccount.php"';
                                                       //  $var_alert.='window.location.href = "myaccount.php" ';
                                                        $var_alert.='</script>';
                                                        echo $var_alert;
                                                        exit;
                                       
                                        }
                                
                         }
        } // end if credit card check
	
}

if (isset($_POST["btnCancelOrder"])) {
	$message = "";
	$redirecturl    =   SITE_URL."/activateselleraccount.php";
	header("Location:$redirecturl");
	exit;
}

/*display the active template*/

$active_template = displayTemplate();


include "includes/htmltop.php";

/* Top File Name */

include_once ("includes/".$active_template[0]);

?>
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<script language="javascript" src="includes/function.js"></script>
<script language="javascript" >
$(document).ready(function() {
    
});
function validateForm(){
   
	document.getElementById("btnCompleteOrder").disabled = true;
	$("#btnCompleteOrder").addClass("disable_btn");
	var frm = window.document.frmPayment;
        var yearVal = frm.txtYY.value;
        var month = frm.txtMM.value;
        currentMonth = new Date().getMonth() + 1,
        currentYear  = new Date().getFullYear();
        
      if (frm.txtCCNumber.value.length == 0 ) {
		alert('<?php echo INVALID_CARD_TEXT;?>');
		document.getElementById("btnCompleteOrder").disabled = false;
		$("#btnCompleteOrder").removeClass("disable_btn");
		return false;
	}else if (frm.txtCVV2.value.length == 0 ) {
		alert('<?php echo INVALID_CVV_TEXT;?>');
		document.getElementById("btnCompleteOrder").disabled = false;
		$("#btnCompleteOrder").removeClass("disable_btn");
		return false;
	}else if ((frm.txtMM.value.length == 0 || frm.txtMM.value > 12 ) || (yearVal < currentYear || yearVal > currentYear + 100)   ) {
		alert('<?php echo INVALID_CARD_EXPIRY_DATE_TEXT?>');
		document.getElementById("btnCompleteOrder").disabled = false;
		$("#btnCompleteOrder").removeClass("disable_btn");
                return false;
                
           
	}else if(yearVal < currentYear || (yearVal == currentYear && month < currentMonth)) {
                alert('<?php echo INVALID_CARD_EXPIRY_DATE_TEXT?>');
		document.getElementById("btnCompleteOrder").disabled = false;
		$("#btnCompleteOrder").removeClass("disable_btn");
                return false;
        } else{
		var txtEnableStripe = '<?php echo $txtEnableStripe; ?>';
                if(txtEnableStripe=="Y"){
                    Stripe.card.createToken({
                            number: $('#txtCCNumber').val(),
                            cvc: $('#txtCVV2').val(),
                            exp_month: $('#txtMM').val(),
                            exp_year: $('#txtYY').val(),
                            name: '<?php echo $txtFirstName; ?>',
                            address_line1: '<?php echo $txtAddress1; ?>',
                            address_city: '<?php echo $txtCity; ?>',
                            address_zip: '<?php echo $txtZIP; ?>',
                            address_state: '<?php echo $txtState; ?>',
                            address_country: '<?php echo $ddlCountry; ?>'
                        }, stripeResponseHandler);
                        return false;

                    }else{

                        return true;
                    }
    
               
	}
}
Stripe.setPublishableKey('<?php echo $txtStripePublishKey; ?>');
 
  function stripeResponseHandler(status, response) {
        if (response.error) {
            // re-enable the submit button
            $('#btnCompleteOrder').removeAttr("disabled");
                                // show hidden div
                               document.getElementById('a_x200').style.display = 'block';
            // show the errors on the form
            $(".payment-errors").html(response.error.message);
        } else {
            var form$ = $("#frmPayment");
            // token contains id, last4, and card type
            var token = response['id'];
            // insert the token into the form so it gets submitted to the server
            form$.append("<input type='hidden' name='stripeToken' value='" + token + "' />");
            // and submit
            form$.get(0).submit();
        }
}


function onlyNumeric(){
         if (event.keyCode<48||event.keyCode>57)
         return false;
}

function checkNumber(t) {
        if(t.value.length == 0 ||  isNaN(t.value) || t.value.substr(0,1) == " " || parseInt(t.value) < 0) {
                t.value="";
        }
}

</script>

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

		<!--center content area start-->		
		
		<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" id="frmPayment" name="frmPayment" >
		<input type="hidden" name="userid" value="<?php echo $userid ?>">
		<input type="hidden" name="totaltopay" value="<?php echo $totaltopay?>">
		<input type="hidden" name="paymentMethod" value="<?php echo $paymentMethod?>">
		
		<div align="left" id="item_details">
	
	
		<!--items display area start -->
	
		<div align="left" id="items_top_area">
				<div align="center" id="items_top_area_ttl"><?php echo CREDIT_CARD_PAY_TEXT; ?></div>
		</div>
		<br>
		
		<div class="text_information" align="center"><?php echo $paymenterror?></div>
                <div class="alert alert-danger" id="a_x200" style="display: none;"><strong>Error!</strong> <span class="payment-errors"></span> </div>
                 
		<div class="col-sm-12 col-lg-2 col-md-2 "></div>
		<div class="col-sm-12 col-lg-8 col-md-8 ">
		<div class="payments_styles">
		<table width="100%" border="0" cellspacing="3" cellpadding="3">
<?php

if(!$paymentsuccessful)
{
   
 ?>   
     	 
		  <tr>
				<td><?php echo TOTAL_PAY_TEXT;?></td>
				<td align="left" colspan="2">
				<input type="hidden" name="cart_total" value="<?php echo $totaltopay;?>">
	<?php 				
						
                                                
                                                $amount_to_pay	= $totaltopay;
						echo $adminCurrency['currency_symbol'];
   						echo "&nbsp;";
						
						echo number_format($amount_to_pay,2,".","");
						
			
?>
	
		  
		  <tr>
			<td width="25%"><?php echo CARD_NUM_TEXT;?></td>
			<td width="28%" align="left"><input type=text name="txtCCNumber" id="txtCCNumber" autocomplete="off" maxlength=16 class=textarea value="<?php echo $txtCCNumber?>" size="30" tabindex="1"></td>
		  </tr>
		  <tr>
			<td><?php echo CARD_VALIDATE_CODE;?></td>
			<td><input type="text" name="txtCVV2" id="txtCVV2" autocomplete="off" maxlength="10" class="textarea" value="<?php echo $txtCVV2?>" size="15" tabindex="2">&nbsp;
			<a style="cursor:pointer" onClick="Javascript:window.open('credit_card_validation_image.php', 'CardValidationImage','menubar=0,resizable=0,width=300,height=220')"><img src="<?php echo SITE_URL."/images/question_mark.jpg"?>" title="<?php echo WHAT_THIS_TEXT;?>" height="25"></a>
			</td>
			<td width="47%"></td>
		  </tr>
		  <tr>
			<td><?php echo EXP_DATE_TEXT;?></td>
			<td colspan="2">
			<select name="txtMM" id="txtMM" onBlur="javascript:checkNumber(this);" tabindex="3">
			<?php 
			for($i=1;$i<13;$i++)
			{
			if($i<10)
			$val = "0".$i;
			else
			$val = $i;
			?>
			<option value="<?php echo $val;?>" <?php if($val==$txtMM || $i==$txtMM) echo "selected";?>><?php echo $val;?></option>
			<?php
			}
			?>
			</select>
			<select name="txtYY" id="txtYY" onBlur="javascript:checkNumber(this);" tabindex="4">
			<?php 
			for($j=date("Y");$j<(date("Y")+35);$j++)
			{
j
			?>
			<option value="<?php echo $j;?>" <?php if($j==$txtYY) echo "selected";?>><?php echo $j;?></option>
			<?php
			}
			?>
			</select>
			</td>
		  </tr>

		  <tr>
			<td colspan="3">&nbsp;</td>
		  </tr>
		  
		  <tr>
			 <td colspan="3" align="center">				   &nbsp;&nbsp;
				   <input   type="submit" name="btnCancelOrder" value="<?php echo CANCEL_PAYMENT;?>" class="buttongrey" onclick="" tabindex="6">
				   <input type="submit"  name="btnCompleteOrder" id="btnCompleteOrder" value="<?php echo MAKE_PAYMENT;?>" class="button" onClick="return validateForm();" tabindex="5">
			</td>
		  </tr>
		<?php
		 }
		 else
		 {
		 
				
		 ?>

		<tr>
			<td colspan="3" align="center"  style="background-color: ">
					<div class="thanku_msg"><?php echo PAYMENT_COMPLETED_TEXT; ?></div>
			</td>
		</tr>
		<tr>
		  <td height="8" colspan="3" align="center" ></td>
		  </tr>


		<tr>
			<td colspan="3">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="3" align="center">
				<input type='button' value='<?php echo HOME_LINK; ?>'  class='button' onClick="window.location.href='<?php echo SITE_URL?>/index.php'">
				&nbsp;&nbsp;<input type='button' value='<?php echo BACK_MYACCOUNT; ?>'  class='button' onClick="window.location.href='<?php echo SITE_URL?>/myaccount.php'">
			</td>
		</tr>

<?php

 }
 
?>
   		</table>
		<div class="clear"></div>
				
	
		</div>	
		</div>
		<div class="col-sm-12 col-lg-2 col-md-2 "></div>
	
		<div align="left" class="float_clear1"></div>
					
					
		 <!--items display area end -->
		  </div>
		
			</form>
		<!--center content area end-->	


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




				

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



