<?php

session_start();

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

// session_start();

include "connection.php";
// include "fetch_data.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, AD_APP.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' AND PAYMENT_STATUS = 'P'";
$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 * from ad_payment where  APP_ROLL_NO =(select APP_ROLL_NO from ad_app where APP_ID='$APP_ID')";
// $sql1 = "select * from ad_payment where  APP_ROLL_NO ='68'";
$sql1 = "select * from ad_payment where  APP_ROLL_NO ='$APP_ID'";

// print_r($sql1);
$parse = ociparse($conn, $sql1);
oci_execute($parse);

// print_r($sql1);
while ($row = oci_fetch_assoc($parse)) {
	$sleep[] = $row;
}

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










?>




<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Payment Slip</title>
    <!-- using online links -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">

    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">

    <link rel="stylesheet" href="//malihu.github.io/custom-scrollbar/jquery.mCustomScrollbar.min.css">

    <!-- CSS only -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">


    <style type="text/css">
        body {
            background: #f2f2f2;
        }

        .payment {
            border: 1px solid #f2f2f2;
            /* height: 280px; */
            border-radius: 20px;
            background: #fff;
        }

        .payment_header {
            background: rgba(255, 102, 0, 1);
            padding: 20px;
            border-radius: 20px 20px 0px 0px;

        }

        .check {
            margin: 0px auto;
            width: 50px;
            height: 50px;
            border-radius: 100%;
            background: #fff;
            text-align: center;
        }

        .check i {
            vertical-align: middle;
            line-height: 50px;
            font-size: 30px;
        }

        .content {
            text-align: center;
        }

        .content h1 {
            font-size: 25px;
            /* padding-top: 25px; */
        }

        .content a {
            width: 200px;
            height: 35px;
            color: #fff;
            border-radius: 30px;
            padding: 5px 10px;
            background: rgba(255, 102, 0, 1);
            transition: all ease-in-out 0.3s;
        }

        .content a:hover {
            text-decoration: none;
            background: #000;
        }
    </style>



         <!-- print div scripts starts -->
         <script type="text/javascript">
         function printContent(el){
           
         	 var divToPrint=document.getElementById(el);
         
         	  var newWin=window.open('','Print-Window');
         
         	  newWin.document.open();
         
         	  newWin.document.write('<html> <link rel="stylesheet"href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"crossorigin="anonymous"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">');
         	  newWin.document.write('<style> .body{background: #f2f2f2;} .payment{border: 1px solid #f2f2f2; border-radius: 20px;background: #fff;} .payment_header {background: rgba(255, 102, 0, 1);padding: 20px;border-radius: 20px 20px 0px 0px;} .check {margin: 0px auto;width: 50px;height: 50px;border-radius: 100%;background: #fff;text-align: center;} .check i {vertical-align: middle;line-height: 50px;font-size: 30px;} .content {text-align: center;} .content h1 {font-size: 25px;} .content a {width: 200px;height: 35px;color: #fff;border-radius: 30px;padding: 5px 10px;background: rgba(255, 102, 0, 1);transition: all ease-in-out 0.3s;}  .content a:hover {text-decoration: none;background: #000;}</style>'); 
         	  newWin.document.write('<body onload="window.print()"> ');
         	  
         	  
         	  
         	  newWin.document.write(divToPrint.innerHTML);
         	  
         	  newWin.document.write('</body></html>');
         
         	  newWin.document.close();
         
         	  setTimeout(function(){newWin.close();},1000);
         }
         
      </script>
      <!-- print div script ends -->
</head>

<body>




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

    <div class="mt-2">
                   
                   <div class="ml-2 offset-5">
                         <a href="#" class="btn" style="background-color: rgba(255, 102, 0, 1); color: white;" onclick="printContent('print_doc')">Print</a>
                   </div>
                </div>






    <div class="container" id="print_doc">

           <header class="col-lg-12 col-md-12 col-sm-12 text-center mt-2">
                   <h2>Admission Application Fee 2023</h2>
                   <h4>Notre Dame College, Dhaka</h4>
                </header>
  
        
            
                <div class="row" >
                    <div class="col-md-6 mx-auto mt-5">
                        <div class="payment">
                            <div class="payment_header">
                                <div class="check"><i class="fa fa-check" aria-hidden="true"></i></div>
                            </div>
                            <div class="content">
                                <h1>Payment Success !</h1>
                                <h4 style="background: rgba(255, 102, 0, 1);color: white;">Result</h4>
                                <!-- <p style="font-size: 20px; font-weight: bold;">Application Roll Number :   <span style="font-weight:normal"><?php echo $sleep[0]['APP_ROLL_NO']; ?></span></p>  <hr> -->
                                <p style="font-size: 20px; font-weight: bold;">Invoice No :   <span style="font-weight:normal"><?php echo $sleep[0]['INV_NO']; ?></span></p>  <hr>
                                <p style="font-size: 20px; font-weight: bold;" hidden>Result code :   <span style="font-weight:normal"><?php echo $sleep[0]['RESULT_CODE']; ?></span></p> 
                                <p style="font-size: 20px; font-weight: bold;" hidden>Result :   <span style="font-weight:normal"><?php echo $sleep[0]['RESULT']; ?></span></p> 
                                <p style="font-size: 20px; font-weight: bold;">Payment Status :   <span style="font-weight:normal">Successful</span></p> <hr>
                                <p style="font-size: 20px; font-weight: bold;">Payment Amount:   <span style="font-weight:normal"><?php echo $sleep[0]['AMOUNT']; ?></span></p> <hr>
                                <p style="font-size: 20px; font-weight: bold;">Payment Method :   <span style="font-weight:normal">bKash</span></p> <hr>
                                <p style="font-size: 20px; font-weight: bold;">bKash Wallet Number : :   <span style="font-weight:normal"><?php echo $sleep[0]['MSISDN']; ?></span></p> <hr>
                                <p style="font-size: 20px; font-weight: bold;">TRX Id :   <span style="font-weight:normal"><?php echo $sleep[0]['TRX_ID']; ?></span></p> <hr>
                                <p style="font-size: 20px; font-weight: bold;">Payment Date: <br>  <span style="font-weight:normal"><?php echo $sleep[0]['TRX_DATE']; ?></span></p> <hr>
                                <!-- <p style="font-size: 20px; font-weight: bold;" hidden>RRN :   <span style="font-weight:normal"><?php echo $sleep[0]['RRN']; ?></span></p> 
                                <p style="font-size: 20px; font-weight: bold;" hidden>Approve Code : <span style="font-weight:normal"><?php echo $sleep[0]['APPROVAL_CODE']; ?></span></p> -->
                                
                            </div>

                        </div>
                    </div>





                    
                </div>



                <footer class="footer mt-4  " style="font-weight: bold; text-shadow: 3px 3px 5px rgba(150, 150, 150, 1); ">

                    <div class="container text-center">
                          <div class="row">
                              <div class="col-md-4"><img src="assets/img/logo.jpg" alt="logo" width="100" height="100"></div>
                              <div class="col-md-4"><img src="assets/img/itbl_icon.png" alt="logo" width="100" height="100"></div>
                              <div class="col-md-4"><img src="assets/img/bkash.png" alt="logo" width="130" height="100"></div>
                          </div>
                        
                        
                        
                        
                    </div>


                   


                </footer>





                


            
        
    </div>




   


   


    







</body>

</html>