<?php session_start();
require_once 'config.php';
require_once 'auth.php';
$PageName = "Subscribe";
$UserId = $_SESSION['User']['id'];
 ?>
<!doctype html>
<html lang="en" class="h-100">


<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="generator" content="">
    <title><?php echo $Proj_Title; ?></title>

    <!-- manifest meta -->
    <meta name="apple-mobile-web-app-capable" content="yes">

    <!-- Favicons -->
    <link rel="apple-touch-icon" href="img/favicon180.png" sizes="180x180">
    <link rel="icon" href="img/favicon32.png" sizes="32x32" type="image/png">
    <link rel="icon" href="img/favicon16.png" sizes="16x16" type="image/png">

    <!-- Material icons-->
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    <!-- Google fonts-->
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&amp;display=swap" rel="stylesheet">

    <!-- swiper CSS -->
    <link href="vendor/swiper/css/swiper.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/style.css" rel="stylesheet" id="style">
</head>

<body class="body-scroll d-flex flex-column h-100 menu-overlay">
   


    <!-- Begin page content -->
    <main class="flex-shrink-0 main">
        <!-- Fixed navbar -->
        <?php include_once 'back-header.php'; ?> 
 
    <?php 
    $sql22 = "SELECT td.Name As Department,tc.* FROM tbl_courses tc 
          LEFT JOIN tbl_departments td ON tc.DeptId = td.id 
          WHERE tc.Status=1 AND tc.DeptId='".$_GET['deptid']."' 
          AND tc.id='".$_GET['id']."'";
$row22 = getRecord($sql22);

if(isset($_POST['submit'])){
    $BatchId = $_POST['BatchId'];
    $Fees = $_POST['Fees'];
?>
<script type="text/javascript">
    window.location.href="razorpay/pay.php?userid=<?php echo $UserId;?>&name=<?php echo $CustName;?>&phone=<?php echo $CustPhone;?>&email=<?php echo $CustEmail;?>&id=<?php echo $_GET['id'];?>&deptid=<?php echo $_GET['deptid'];?>&amount=<?php echo $Fees;?>&BatchId=<?php echo $BatchId;?>";
</script>
    
 <?php    
}
?>    
        <div class="main-container">
            <div class="container">
                <div class="card mb-4">
                  
                   <!--  <div class="card-header">
                        <h6 class="subtitle mb-0">
                            <div class="avatar avatar-40 bg-default-light text-default rounded mr-2"><span class="material-icons vm">lock</span></div>
                            Change Password
                        </h6>
                    </div> -->

                       <form id="validation-form" method="post" autocomplete="off">
                    <div class="card-body">
                         <div id="alert_message"></div>
                        <div class="form-group float-label active">
                            <input type="text" class="form-control" autofocus readonly value="<?php echo $row22['Department'];?>">
                            <label class="form-control-label">Department</label>
                        </div>
                        <div class="form-group float-label active">
                            <input type="text" class="form-control" readonly value="<?php echo $row22['Name'];?>">
                            <label class="form-control-label">Course</label>
                        </div>
                        <div class="form-group float-label active">
                            <input type="text" class="form-control" readonly value="<?php echo $row22['Duration'];?>">
                            <label class="form-control-label">Duration</label>
                        </div>
                        <div class="form-group float-label active">
                            <input type="text" name="Fees" id="Fees" class="form-control" readonly value="<?php echo $row22['CourseFees'];?>">
                            <label class="form-control-label">Course Fees</label>
                        </div>
                        <div class="form-group float-label position-relative active">
                          
    <select class="form-control" name="BatchId" id="BatchId" required="">
<option selected="" disabled="" value="">Select Batch</option>
    <?php 
      $q = "select * from tbl_batches WHERE Status=1 AND DeptId='".$_GET['deptid']."' 
          AND CourseId='".$_GET['id']."'";
      $r = getList($q);
      foreach($r as $rw)
      {
    ?>
      <option value="<?php echo $rw['id']; ?>"><?php echo $rw['BatchName']; ?></option>
    <?php } ?>
</select>
<label class="form-control-label text-white active">Batch <span class="text-danger">*</span></label>
</div>
                    </div>
                    
                    
                    <div class="card-footer">
                        <button class="btn btn-block btn-default rounded" type="submit" name="submit">Pay & Subscribe</button>
                    </div>
                </form>
                </div>
                
            </div>
        </div>
    </main>

    <!-- footer-->
    

 <!-- Required jquery and libraries -->
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.min.js"></script>

    <!-- cookie js -->
    <script src="js/jquery.cookie.js"></script>

    <!-- Swiper slider  js-->
    <script src="vendor/swiper/js/swiper.min.js"></script>

    <!-- Customized jquery file  -->
    <script src="js/main.js"></script>
    <script src="js/color-scheme-demo.js"></script>


    <!-- page level custom script -->
    <script src="js/app.js"></script>
   
</body>

</html>
