<?php
ob_start();
error_reporting(0);
include("connect.php");
session_start(); 
$ver = $_SESSION["admin_id"];
$admin_id = $_SESSION["admin_id"];
$dis_id = $_SESSION["manager_id"];
$user_type = $_SESSION["user_type"];
$user_session = $_SESSION["user_session"];

$id1 = base64_decode($_GET['id']);
if(!isset($_SESSION["admin_id"])){
   header('location:http://www.btcover.appexperts.net');
}
date_default_timezone_set('Asia/Calcutta');
	$cdate  = date("Y-m-d");
?>
<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="viewport" content="width=device-width">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon.png">
    <title>BTCOVER : Admin Dashboard</title>
    <!-- Custom CSS -->
    <link rel="stylesheet" type="text/css" href="assets/libs/select2/dist/css/select2.min.css">
    <link rel="stylesheet" type="text/css" href="assets/libs/jquery-minicolors/jquery.minicolors.css">
    <link rel="stylesheet" type="text/css" href="assets/libs/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
    <link rel="stylesheet" type="text/css" href="assets/libs/quill/dist/quill.snow.css">
    <link href="dist/css/style.min.css" rel="stylesheet">
	<style>
		.razorpay-payment-button{
			color:white !important;
			background-color:#28B779;
			border-color:#28B779;
			font-size:14px;
			padding:10px;
			padding-top:-100px;
			
		}
		</style>
   <script>
	
		function myFunction() {
			var txt;
		
			var r = confirm("Are you sure to reset!");
			if (r == true) {
				window.location.href="subscription.php";
			} 
		}
		</script>
		<script>
		function pay(term_value)
		{
			
			
			var total_charge1=document.getElementById('total_amt').value;
			
			var total_amt=parseInt(term_value)*parseFloat(total_charge1);
			var total_amt1=parseFloat(total_amt)*100;
			document.getElementById('total_charge2').value=total_amt.toFixed(2);
			//document.getElementById('total_charge').value=total_amt1.toFixed(2);
			 document.getElementById('charge').style.display="block";	
			
		}
		</script>
		
		
</head>

<body>
    <!-- ============================================================== -->
    <!-- Preloader - style you can find in spinners.css -->
    <!-- ============================================================== -->
  
	 <div id="main-wrapper">
   <?php include("header.php"); ?>
    
     <?php include("menu.php"); ?>
	
        <div class="page-wrapper">
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <div class="page-breadcrumb">
                <div class="row">
                    <div class="col-12 d-flex no-block align-items-center">
                        <h4 class="page-title">Subscription Comfirmation</h4>
                        <div class="ml-auto text-right">
                            <nav aria-label="breadcrumb">
                                <ol class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>
									<li class="breadcrumb-item active" aria-current="page">Subscription</li>
                                </ol>
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Container fluid  -->
            <!-- ============================================================== -->
            <div class="container-fluid">
                <!-- ============================================================== -->
                <!-- Start Page Content -->
                <!-- ============================================================== -->
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
						 <?php  
						
								  $select_payment = mysqli_query($con,"SELECT * FROM `tbl_bt_payment_plan`,tbl_admin_panel where  tbl_admin_panel.admin_id='$admin_id' and tbl_admin_panel.plan_id=tbl_bt_payment_plan.plan_id ");
									$fetch_payment=mysqli_fetch_assoc($select_payment);	
									?>
									
                            </table>
                            <form class="form-horizontal"  method="post" name="form"  action="subscription-confirmation.php"  enctype="multipart/form-data">
							
													
                                <div class="card-body">
                                
												
                                   <div class="form-group row">
                                   <div class="col-md-4"  >	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b> Plan Name</b></label>
                                         <input type="text" class="form-control" id="plan_name" name="plan_name" placeholder=" Plan Name"  value="<?php echo $fetch_payment['plan_name'];?>" readonly >
									</div>
                                </div>
								<div class="col-md-4"  >	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Total Amount</b></label>
                                         <input type="text" class="form-control" id="total_amt" name="total_amt" placeholder="Total Amount" value="<?php echo $fetch_payment['total_charge'];?>" readonly >
									</div>
                                </div>
								<div class="col-md-4"  >	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Plan Type</b></label>
                                         <input type="text" class="form-control" id="plan_type" name="plan_type" placeholder="Plan Type" value="<?php echo $fetch_payment['plan_type'];?>" readonly >
									</div>
                                </div>
								<div class="col-md-4"  >	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Next Renew Date</b></label>
                                         <input type="text" class="form-control" id="next_renew_date" name="next_renew_date" placeholder="Next Renew Date" value="<?php echo date("d-M-Y", strtotime(substr($fetch_payment['next_renew_date'], 0, 11)) ); ?>" readonly >
									</div>
                                </div>
                             
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="fname" class="text-left control-label col-form-label"><b>Plan Validity (in Months)</b></label>
                                            <select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="term_value" onchange="pay(this.value)" required>
                                            
											<option value="3" selected="selected">3 Months</option>	
											<option value="6">6 Months</option>	
											<option value="9">9 Months</option>	
											<option value="12" >12 Months</option>	
										</select>
                                    </div>
                                </div>
								<div class="col-md-4" id="charge"  >	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Total Charge</b></label>
                                         <input type="text" class="form-control" id="total_charge2" name="total_charge2" placeholder="Total Charge" value="<?php echo $fetch_payment['total_charge']*3;?>" readonly >
									</div>
                                </div>
								<!--<input type="hidden" class="form-control" id="total_charge1"  name="total_charge1"  value="<?php// echo $fetch_payment['total_charge']; ?>" >
								<input type="hidden" class="form-control" id="total_charge"  name="total_charge"   >-->
								
								
								
                               
								
                                </div>
								<div class="form-group row">
                                 <div class="col-md-4">   
                                <div class="border-top">
                                    <div class="card-body">
                                       <div class="card-body">
                                    <button type="submit" name="sub" class="btn btn-success">Pay</button>
                                    <button type="button" onclick="myFunction()" name="subcancel" class="btn btn-primary">Reset</button>
                                    
                                </div>
                                    </div>
                                </div>
                                </div>
                                </div>
                            </form>
							<?php 
							/* if(isset($_POST['sub']))
								{
									$next_renew_date=$_POST['next_renew_date'];
									$plan_name=$_POST['plan_name'];
									$plan_type=$_POST['plan_type'];
									$total_charge1=$_POST['total_amt'];
									$term_value=$_POST['term_value'];
									$total_charge=$term_value*$total_charge1;
									$ver = $_SESSION["admin_id"];
									//include('config.php');
									//include('razorpay-php/Razorpay.php'); */
							?>		
								
                        </div>
                    
          

                    </div>
              
                </div>
                <!-- editor -->
               
                <!-- ============================================================== -->
                <!-- End PAge Content -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- Right sidebar -->
                <!-- ============================================================== -->
                <!-- .right-sidebar -->
                <!-- ============================================================== -->
                <!-- End Right sidebar -->
                <!-- ============================================================== -->
            </div>
            </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Container fluid  -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- footer -->
            <!-- ============================================================== -->
             <footer class="footer text-center">
                  2019 &copy; All Rights Reserved by BTCOVER. Designed and Developed by <a href="http://www.belltechnology.in/">Bell Technology</a>.
            </footer>
          
            <!-- ============================================================== -->
            <!-- End footer -->
            <!-- ============================================================== -->
        </div>
        <!-- ============================================================== -->
        <!-- End Page wrapper  -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- End Wrapper -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- All Jquery -->
    <!-- ============================================================== -->
    <script src="assets/libs/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="assets/libs/popper.js/dist/umd/popper.min.js"></script>
    <script src="assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- slimscrollbar scrollbar JavaScript -->
    <script src="assets/libs/perfect-scrollbar/dist/perfect-scrollbar.jquery.min.js"></script>
    <script src="assets/extra-libs/sparkline/sparkline.js"></script>
    <!--Wave Effects -->
    <script src="dist/js/waves.js"></script>
    <!--Menu sidebar -->
    <script src="dist/js/sidebarmenu.js"></script>
    <!--Custom JavaScript -->
    <script src="dist/js/custom.min.js"></script>
    <!-- This Page JS -->
    <script src="assets/libs/inputmask/dist/min/jquery.inputmask.bundle.min.js"></script>
    <script src="dist/js/pages/mask/mask.init.js"></script>
    <script src="assets/libs/select2/dist/js/select2.full.min.js"></script>
    <script src="assets/libs/select2/dist/js/select2.min.js"></script>
    <script src="assets/libs/jquery-asColor/dist/jquery-asColor.min.js"></script>
    <script src="assets/libs/jquery-asGradient/dist/jquery-asGradient.js"></script>
    <script src="assets/libs/jquery-asColorPicker/dist/jquery-asColorPicker.min.js"></script>
    <script src="assets/libs/jquery-minicolors/jquery.minicolors.min.js"></script>
    <script src="assets/libs/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
    <script src="assets/libs/quill/dist/quill.min.js"></script>
    <script>
        //***********************************//
        // For select 2
        //***********************************//
        $(".select2").select2();

        /*colorpicker*/
        $('.demo').each(function() {
        //
        // Dear reader, it's actually very easy to initialize MiniColors. For example:
        //
        //  $(selector).minicolors();
        //
        // The way I've done it below is just for the demo, so don't get confused
        // by it. Also, data- attributes aren't supported at this time...they're
        // only used for this demo.
        //
        $(this).minicolors({
                control: $(this).attr('data-control') || 'hue',
                position: $(this).attr('data-position') || 'bottom left',

                change: function(value, opacity) {
                    if (!value) return;
                    if (opacity) value += ', ' + opacity;
                    if (typeof console === 'object') {
                        console.log(value);
                    }
                },
                theme: 'bootstrap'
            });

        });
        /*datwpicker*/
        jQuery('.mydatepicker').datepicker();
        jQuery('#datepicker-autoclose').datepicker({
            autoclose: true,
            todayHighlight: true
        });
        var quill = new Quill('#editor', {
            theme: 'snow'
        });

    </script>
</body>

</html>