<?php  session_start(); error_reporting(0); ?>
<?php if(!isset($_SESSION['j_admin'])){ 
    $url = urlencode("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); header('location:../login/?url='.$url.'');  
} ?>
<!doctype html>
<html lang="en"> 
<head>
	<?php
    require_once("../j_conn/url.php");
    require_once("../j_conn/dbc.php");
    require_once("../j_incs/functions.php");
    $page_name="Confirm Transfer";
    $page_desc="$page_name";
    $page_img="".$dir."j_files/j_img/logo/logo-meta.png";
    $page_author="$company";
    $page_keywords="".$company.", $page_name, $page_desc, ".$company_motto.", $company_desc";
    $page_url="".$dir."confirm-transfer/";
    require_once("../j_incs/metas.php");
    require_once("../j_incs/scripts-top.php");
    ?>
</head>
<body>
    
    <div class="app">
        <div class="layout">
            <?php 
            require_once("../j_incs/header.php");
            require_once("../j_incs/nav.php");
            ?>
            <!-- Page Container START -->
            <div class="page-container">
                

                <!-- Content Wrapper START -->
                <div class="main-content">
                    <div class="page-header">
                        <h2 class="header-title"><?php echo $page_name; ?></h2>
                        <div class="header-sub-title">
                            <nav class="breadcrumb breadcrumb-dash">
                                <a href="<?php echo $dir; ?>" class="breadcrumb-item"><i class="anticon anticon-dashboard m-r-5"></i>Dashboard</a>
                                <!--<a class="breadcrumb-item" href="#"> </a>-->
                                <span class="breadcrumb-item active"><?php echo $page_name; ?></span>
                            </nav>
                        </div>
                    </div>
                     
                    <div class="container">
                        <div class="tab-content m-t-15">
                            <div class="tab-pane fade show active" id="tab-account">
                                
                                
                                <div class="card">
                                    <div class="card-header">
                                         <p>
                                             Once you have manually sent money to the recipient's bank account details, kindly confirm it here.
                                        </p>
                                    </div>
                                    <div class="card-body">
                                        <form action="" method="post" id="form">
                                            <div class="row mb-50 ">
                                             <div class="form-group mb-50 col-lg-4" style="margin-bottom:15px;">
                                                <label class="text-bold-600" for="ref"> Payment Reference ID </label>
                                                <input value="<?php echo $_GET['r']; ?>" type="text" class="form-control rMe" name="ref" placeholder="Reference ID">
                                            </div>
                                                
                                            <div class="form-group mb-50 col-lg-4" style="margin-bottom:15px;">
                                                <label class="text-bold-600" for="ref"> Status </label>
                                                <select type="text" class="form-control rMe" name="status">
                                                    <option>Pending</option>
                                                    <option>Paid</option>
                                                </select>
                                            </div>

                                           

                                            </div>

                                            <div class="row mb-50 ">
                                                <div class="col-lg-4 mb-50 ">
                                                    <button type="submit" id="submit" class="btn btn-primary glow w-100 position-relative"> Confirm Transfer Now <i id="icon-arrow" class="fa fa-arrow-right"></i></button>
                                                </div>
                                            </div>

                                        </form>
                                        <br/>
                                        <div id="formresult"></div>
                                        
                                        
                                        
                                    </div>
                                </div>
                             
                            </div>
                            
                        </div>
                    </div>
                </div>
                <!-- Content Wrapper END -->

                <?php
                require_once("../j_incs/footer.php");
                ?>

            </div>
            <!-- Page Container END -->
        </div>
    </div>
    
    
    <?php
    require_once("../j_incs/scripts-bottom.php");
    ?>
    <script>
        var form = "#form";
        var button = "#submit";
        var button_val = $(button).html();
        var result = "#formresult";
        $(form).on('submit',(function(e) {
        e.preventDefault();
        $(button).attr('disabled', '');
        $(button).html("<i class='anticon anticon-loading'></i> Processing");
        $(result).html("<div class='alert alert-warning'> Taking too long? <a href=''>Reload </a></div>");
         $.ajax({
        url: "save.php",
        type: "POST",
        data: new FormData(this),
        contentType: false,
        cache: false,
        processData:false,
        success: function(data)
        {
        if(data){
         $(button).removeAttr('disabled');
        $(button).html(button_val);
        $(result).html(data);
        }else{
        $(result).html("Error occurred.");
        $(button).removeAttr('disabled');
        $(button).html(button_val);
        }
        }
        });
        }));
        </script>
   
</body>
</html>