<?php
session_start();
    if(!isset($_SESSION['id'])) {
        header("location: index.php");
    }
?>


<?php



include "fetch_data.php";
include "connection.php";


$APP_ID = $_SESSION['id'];
// $APP_ROLL_NO = $_SESSION['APP_ROLL_NO'];


$sql = "SELECT AD_APP.STD_NAME, AD_APP.STD_MOBILE_NO, AD_APP.RG_SECT, AD_APP.F_NAME, 
(SELECT AD_CAT.CAT_NAME FROM AD_CAT WHERE AD_APP.APP_CAT = AD_CAT.CAT_ID ) AS APP_CAT, 
AD_APP.F_MOBILE_NO, AD_APP.M_NAME, AD_APP.M_MOBILE_NO,  AD_APP.SCHOOL_NAME, 
AD_APP.EXAM_ROLL_NO, (SELECT AD_RELIGION_MST.RG_NAME FROM AD_RELIGION_MST WHERE AD_APP.RG_CODE=AD_RELIGION_MST.RG_CODE ) AS RG_CODE, 
(SELECT AD_BOARD.BOARD_NAME FROM AD_BOARD WHERE AD_APP.BOARD_CODE=AD_BOARD.BOARD_CODE ) AS BOARD_CODE, AD_APP.REG_NO,
AD_APP.SESSION_NO, AD_APP.EXAM_YEAR, AD_APP.GP_BANG, AD_APP.GP_ENG, AD_APP.GP_RELI, AD_APP.GP_MATH, AD_APP.GP_PHY, 
AD_APP.GP_CHE, AD_APP.GP_BIO, AD_APP.GP_HMATH, AD_APP.GP_SCI, AD_APP.GP_ACC, AD_APP.ADD_SUB_NAME, AD_APP.SSC_GPA,
AD_APP.TOTAL_APLUS,AD_APP.GP_ADD_SUB,AD_APP.SSC_MARKS, (SELECT AD_VERSION.VAR_NAME FROM AD_VERSION 
 WHERE AD_APP.SSC_VERSION=AD_VERSION.VAR_CODE) AS SSC_VERSION, AD_APP.SMS_MOBILE_NO, (SELECT AD_SCHOOL_LOC.LOC_NAME FROM AD_SCHOOL_LOC 
 WHERE AD_APP.LOC_CODE=AD_SCHOOL_LOC.LOC_CODE) AS LOC_CODE, (SELECT AD_SSC_GR.GR_NAME FROM AD_SSC_GR 
 WHERE AD_APP.SSC_GR_CODE=AD_SSC_GR.GR_CODE) AS SSC_GR_CODE  FROM AD_APP 
 WHERE APP_ID = '$APP_ID' ";
$parse = ociparse($conn, $sql);
oci_execute($parse);

// print_r($sql);
while ($row = oci_fetch_assoc($parse)) {
	$user_row[] = $row;
}

// var_dump($division);
// echo count($division);
oci_free_statement($parse);


// $sql1 = "select count(*) ispay from ad_payment where RESULT_CODE='000' and APP_ROLL_NO =(select APP_ROLL_NO from ad_app where APP_ID='$APP_ID')";


// $sql1 = "select count(*) ispay from ad_payment where   APP_ROLL_NO =(select APP_ROLL_NO from ad_app where APP_ID='$APP_ID' AND PAYMENT_STATUS = 'P')";

// $sql1 = "select count(*) ispay from ad_payment where APP_ROLL_NO = '$APP_ROLL_NO'";
$sql1 = "select count(*) ispay from AD_APP WHERE APP_ID = '$APP_ID' AND PAYMENT_STATUS = 'P'";
// print_r($sql1);
$parse = ociparse($conn, $sql1);
oci_execute($parse);


while ($row = oci_fetch_assoc($parse)) {
	$button[] = $row;
}

// var_dump($division);
// echo count($division);
oci_free_statement($parse);







// require_once("qrcode.php");



// $qr = new QRCode();
// // QR_ERROR_CORRECT_LEVEL_L : 7%
// // QR_ERROR_CORRECT_LEVEL_M : 15%
// // QR_ERROR_CORRECT_LEVEL_Q : 25%
// // QR_ERROR_CORRECT_LEVEL_H : 30%
// $qr->setErrorCorrectLevel(QR_ERROR_CORRECT_LEVEL_H);

// $qr->setTypeNumber(10);

// $qr->addData("Test");
// $qr->make();
// //$qr->printHTML();


?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Payment</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">


    <style>
        .header img {
            float: left;
            width: 100px;
            height: 100px;
            /* background: #555; */
        }

        .header h1,
        h3,
        h4,
        h5,
        h6 {
            position: relative;
            top: 18px;
            left: 10px;
        }
    </style>
</head>

<body>



  <!-- dashboard start -->
  <?php include 'dashboard.php'; ?>
    <!-- dashboard end -->


    <div class="container">
        <div class="card">
            <div class="card-body">
                




                <!-- Payment starts  -->

                <!-- <div class="row" >
                    <div class="col-md-12" style="color: red;">
                        <h5 >Pending Payment</h5>
                        <h6>Registration Fees</h6>
                    
                    </div>
                    
                    
                </div> -->


                 <!-- header starts  -->

                 <div class="row" style="margin-top: 30px;">
                    <div class="col-md-3">
                    
                    </div>
                    <div class="col-md-7">
                       



                        <div class="header">
                            <img src="assets/img/logo.jpg" alt="logo" width="60px" height="60px" />
                            <h4 style="font-weight: bold;">Admission Application Form 2023 </h4>
                            <h5>Notre Dame College,Dhaka</h5>
                            <!-- <h6>Applied For Admission to Study : <label for="">Science(bangla)</label></h6> -->
                        </div>
                    </div>
                    <div class="col-md-2">
                    
                    <img src="data:image/jpeg;base64,<?php echo $photoout; ?>" id="output_image" width="130px" height="130px" ></img>                    </div>
                </div>



                <!-- edit start  -->

                <div class="row" style="margin-top: 20px;">
                    <!-- <div class="col-md-2">
                    <button type="button" class="btn btn-danger">Edit</button>
                    <hr>
                   
                    </div> -->
                    <!-- <div class="col-md-12">
                    <button type="button" class="btn btn-danger">Edit</button> 
                    <hr>
                    </div> -->
                    
                </div>


                <!-- name starts  -->
                <div class="row" >
                    
                    <div class="col-md-6"> <p>1. Apply for admission to study: <br> <label style="font-weight: bold;" for=""><?php echo $user_row[0]['APP_CAT']; ?></label></p>  </div>
                    <div class="col-md-6"> <p>2. Full name of Student(According to SSC Admit Card) : <br>  <label style="font-weight: bold;" for=""> <?php echo $user_row[0]['STD_NAME']; ?></label></p> </div>


                    <div class="col-md-6"> <p>3. Student Mobile Number : <label style="font-weight: bold;" for=""> <?php echo $user_row[0]['STD_MOBILE_NO']; ?></label></p> </div>
                    <div class="col-md-6">  <p>4. Religion : <label style="font-weight: bold;" for=""> <?php echo $user_row[0]['RG_CODE']; ?></label></p>  </div>


                    <div class="col-md-6">  <p>5. Sect./Caste : <label style="font-weight: bold;" for=""> <?php echo $user_row[0]['RG_SECT']; ?></label></p>  </div>
                    <div class="col-md-6">  <p>6. Fathers Name : <label style="font-weight: bold;" for=""> <?php echo $user_row[0]['F_NAME']; ?></label></p> </div>


                    <div class="col-md-12">  <p>*Number of A+ and GPA obtained in SSC (don't count Physical Education, Health and Sports & Career Education) </p> </div>
                        
                    <div class="col-md-6"> <p>7. Number Of A+ : <label style="font-weight: bold;" for=""> <?php echo $user_row[0]['TOTAL_APLUS']; ?></label></p> </div> 
                    <div class="col-md-6"> <p>8. result GPA : <label style="font-weight: bold;" for=""> <?php echo $user_row[0]['SSC_GPA']; ?></label></p> </div>


                    <div class="col-md-6"> <p>9. Version of SSC Exam : <label style="font-weight: bold;" for=""> <?php echo $user_row[0]['SSC_VERSION']; ?></label></p> </div>
                    
                    <div class="col-md-12">
                        <hr>
                    </div>
                  
                   
                </div>


                



                <!-- false starts  -->
                <div class="row">
                   
                    <div class="col-md-12">

                        

                        
                      <?php

                       if($button[0]['ISPAY']==0){
                        ?>
                        <h5 style="text-align: center; color: red">Any False declarations will automatically disqualify a candidate for admission at Notre Dame College.</h5>
                        <h3>registration Fees 350 Taka</h3>
                        <h2 style="font-weight: bold; margin-top: 20px ">Click Payment Method :</h2>

                        <a href="bkash2_pay/payment.php"">
                        <img src="assets/img/bkash.png" height="100px" width="200px" alt="">
                        </a>


                           <!-- <a href="RAW_PHP_Bkash_july_2023/payment.php"">
                        <img src="assets/img/bkash.png" height="100px" width="200px" alt="">
                        </a> -->
                        <?php
                       }else if($button[0]['ISPAY']>0){
                        ?>

          <h5 style="text-align: center; color: red">Your Payment Successfully Completed. Now You can Download Your Admit Card</h5>

                          
                          <!-- <a href="pay_sleep.php" style="margin-top: 20px " class="btn btn-outline-primary">Print Invoice</a> -->
                          <a href="admit_card1.php?id=<?php echo $APP_ID?>" style="margin-top: 20px " class="btn btn-outline-primary" id="download"><i class="fa fa-download"></i> Download Admit Card</a>
                          <!-- <a href="admit_card.php" style="margin-top: 20px " class="btn btn-outline-primary" id="download"><i class="fa fa-download"></i> Download Mark Sheet</a> -->
                          
                            
                        <?php
                       }
									
                     ?>



                      
                      

                    </div>

              
                   
                </div>



            </div>
        </div>
    </div>



    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>

</html>