Your IP : 18.220.43.27


Current Path : /home/lentoinv/finationglobal.com/account/
Upload File :
Current File : //home/lentoinv/finationglobal.com/account/revpropertyinfo2.php

<?php
session_start(); ob_start();

?>
<!doctype html>
<html lang="en" dir="ltr">

    <head>

        <!-- META DATA -->
        <meta charset="UTF-8">
        <meta name='viewport' content='width=device-width, initial-scale=1.0, user-scalable=0'>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="description" content="Fination Global Services">
        <meta name="author" content="Fination Global Services">
        <meta name="keywords" content="">

        <!-- FAVICON -->
        <link rel="shortcut icon" type="image/x-icon" href="../assets/images/brand/favicon.ico" />

        <!-- TITLE -->
        <title>Available Properties</title>

        <!-- BOOTSTRAP CSS -->
        <link id="style" href="../assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />

        <!-- STYLE CSS -->
        <link href="../assets/css/style.css" rel="stylesheet" />
        <link href="../assets/css/plugins.css" rel="stylesheet" />

        <!--- FONT-ICONS CSS -->
        <link href="../assets/css/icons.css" rel="stylesheet" />

    </head>

    <body class="app sidebar-mini ltr light-mode">

        <!-- GLOBAL-LOADER 
        <div id="global-loader">
            <img src="../assets/images/loader.svg" class="loader-img" alt="Loader">
        </div>-->
        <!-- /GLOBAL-LOADER -->

        <!-- PAGE -->
        <div class="page">
            <div class="page-main">

                <!-- app-Header -->
                <?php include('header.php');
                
    $ref = $_GET['ref']??'';
if(sqL1('ginvest','ref',$ref)==0){
    header('location: listedproperties.php'); exit();
}

if(isset($_POST['CancelOpt'])){
$db->query("DELETE FROM optin WHERE ref='$ref' AND id='$uid' ");
$report = 'Operation successful';
}
 ?>
                <!--/APP-SIDEBAR-->

                <!--app-content open-->
                <div class="main-content app-content mt-0">
                    <div class="side-app">

                        <!-- CONTAINER -->
                        <div class="main-container container-fluid">

                            <!-- PAGE-HEADER -->
                            <div class="page-header">
                                <div>
                                    <h1 class="page-title">Available Properties</h1>
                                    <ol class="breadcrumb">
                                        <li class="breadcrumb-item"><a href="javascript:void(0);">Home</a></li>
                                        <li class="breadcrumb-item active" aria-current="page">Available Properties</li>
                                    </ol>
                                </div>
                                <?php include('pagebtn.php') ?>
                            </div>
                            <!-- PAGE-HEADER END -->






                            <div class="row">
                                
                                        <?php
                                        $i=1;
                                        $sql = $db->query("SELECT * FROM ginvest WHERE ref='$ref' "); 
                                        $row = $sql->fetch_assoc();
                                         
                                            ?>
                                            <div class="col-lg-8">
                                            <div class="card">
                                                <div class="card-body p-0">

                                           <img src="uploads/<?= $row['photo'] ?>" width="100%">
                                     <div class="p-3">
                                              <h3><?php echo $row['title']; ?></h3>
                                              <p> <?php echo $row['note']; ?></p>
                                               </div>
                                           </div>
                                           </div>
                                       </div>


<?php if($row['slot']==1){ ?>
                                            <div class="col-lg-4">
                                            <div class="card">
                                                <div class="card-body">
<h3>Purchase Summary</h3>
 <?php if($stage==0){?>
<h4>Price: NGN<?php echo number_format($row['amount'],2) ?></h4>
<?php } else{ ?>
<h4>Price: NGN<?php echo number_format($row['amount'],2) ?></h4>
<?php } ?>
<form method="post">
<label>Payment Structure</label>
<select class="form-select" name="plan" onchange="getPlan(this.value)">
   
    <option value="">Select Option...</option>
    <option value="a">Outright Purchase</option>
    <option value="b">3 months Instalment</option>
    <option value="c">6 Months Instalment</option>
    <option value="d">12 Months Instalment</option>
    <option value="e">18 Months Instalment</option>
    <option value="f">24 Months Instalment</option>
</select>                                              
                              <br>  <br>          
                                                <span id="pinfo"></span>
                                                

                                                <button id="btns" type="submit" value="<?= $row['ref'] ?>" class="btn btn-primary btn-lg btn-block" onclick="return confirm('Are you sure you want to proceed?')" name="BuyProperty4" disabled>Buy Now</button></form> 
                                               </div>
                                           </div>
                                           </div>
<?php } else{  ?>
                   <div class="col-lg-4">
                                            <div class="card">
                                                <div class="card-body">
<h3>Purchase Summary</h3>
<table>
<tr><th>Property Price: </th><td>NGN<?php echo number_format($row['amount'],2) ?></td></tr>
<tr><th>Price/Slot:</th><td> NGN<?php echo number_format($row['amount']/$row['slot'],2) ?></td></tr>
<tr><th>Available Slots:</th><td> <?php echo sqL1('optin','ref',$row['ref']) ?>/<?php echo $row['slot'] ?> Units</td></tr>
<tr><th>Commitment:</th><td> Pay NGN<?php echo number_format($row['amount']/$row['slot'],2) ?> Monthly for <?php echo $row['slot'] ?> Months</td></tr>
</table>


<form method="post" >
                            <input type="hidden" name="ref" value="<?= $row['ref'] ?>">
                            <div id="buysl">
<?php if(sqL2('optin','id',$uid,'ref',$ref)>0){ ?>
                                                    <button type="button" class="btn btn-primary btn-lg btn-block" >Already Opt In</button>
<!-- <button type="submit" name="CancelOpt"  onclick="return confirm('Are you sure you want to cancel?')" class="btn btn-danger btn-block mt-2">Cancel Opt In</button> -->
<?php if($row['slot']==sqL1('optin','ref',$ref)){ ?>
<!-- <button type="submit" name="PayOpt"  onclick="return confirm('Are you sure you want to make payment now?')" class="btn btn-success btn-block mt-2">Make Monthly Payment</button> -->
<?php } ?>
                                                <?php } 
                     elseif($row['slot']>sqL1('optin','ref',$row['ref'])){ ?>
                                                    <button type="button" class="btn btn-primary btn-lg btn-block" onclick="buySlot('buysl')">Opt In</button>
                                                <?php }
                                                elseif($row['slot']==sqL1('optin','ref',$row['ref'])){ ?>
 <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Sold Out</button>

                                             <?php   } ?>
</div>
                                                </form>


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


<?php } ?>

                                       </div>
                                           
                                        
                                </div>
                            </div><!--end row-->

                            
                       
<!-- ROW -->

                </div>
                <!--app-content end-->
            </div>


            <!-- FOOTER -->
<?php include('footer.php'); ?>
            <!-- FOOTER END -->
        </div>

        <!-- BACK-TO-TOP -->
        <a href="#top" id="back-to-top"><i class="fa fa-angle-up"></i></a>

        <!-- JQUERY JS -->
        <script src="../assets/js/jquery.min.js"></script>

        <!-- BOOTSTRAP JS -->
        <script src="../assets/plugins/bootstrap/js/popper.min.js"></script>
        <script src="../assets/plugins/bootstrap/js/bootstrap.min.js"></script>

        <!-- SPARKLINE JS-->
        <script src="../assets/js/jquery.sparkline.min.js"></script>

        <!-- CHART-CIRCLE JS-->
        <script src="../assets/js/circle-progress.min.js"></script>

        <!-- CHARTJS CHART JS-->
        <script src="../assets/plugins/chart/Chart.bundle.js"></script>
        <script src="../assets/plugins/chart/utils.js"></script>

        <!-- PIETY CHART JS-->
        <script src="../assets/plugins/peitychart/jquery.peity.min.js"></script>
        <script src="../assets/plugins/peitychart/peitychart.init.js"></script>

        <!-- INTERNAL SELECT2 JS -->
        <script src="../assets/plugins/select2/select2.full.min.js"></script>

        <!-- INTERNAL Data tables js-->
        <script src="../assets/plugins/datatable/js/jquery.dataTables.min.js"></script>
        <script src="../assets/plugins/datatable/js/dataTables.bootstrap5.js"></script>
        <script src="../assets/plugins/datatable/dataTables.responsive.min.js"></script>

        <!-- ECHART JS-->
        <script src="../assets/plugins/echarts/echarts.js"></script>

        <!-- SIDE-MENU JS-->
        <script src="../assets/plugins/sidemenu/sidemenu.js"></script>

        <!-- Sticky js -->
        <script src="../assets/js/sticky.js"></script>

        <!-- SIDEBAR JS -->
        <script src="../assets/plugins/sidebar/sidebar.js"></script>

        <!-- Perfect SCROLLBAR JS-->
        <script src="../assets/plugins/p-scroll/perfect-scrollbar.js"></script>
        <script src="../assets/plugins/p-scroll/pscroll.js"></script>
        <script src="../assets/plugins/p-scroll/pscroll-1.js"></script>

        <!-- APEXCHART JS -->
        <script src="../assets/js/apexcharts.js"></script>

        <!-- INDEX JS -->
        <script src="../assets/js/index1.js"></script>

        <!-- Color Theme js -->
        <script src="../assets/js/themeColors.js"></script>

        <!-- swither styles js -->
        <script src="../assets/js/swither-styles.js"></script>

        <!-- CUSTOM JS -->
        <script src="../assets/js/custom.js"></script>
          <script>
 


                function  getPlan(v){
            if(v==''){
                 $('#pinfo').html('');
                 $('#btns').attr('disabled',true); 
                 return; }
                  var x = <?= $_GET['ref'] ?>;
                //  alert(x);
                    $.ajax({
                        type: 'get',
                        url : 'control.php?plan='+v+'&ref='+x
                    }).done(function(data){
                      $('#pinfo').html(data); 
                     $('#btns').attr('disabled',false);  
                    }) 
                }
       

        function getPlanx(v){
       
        var x = "<?= $row['amount'] ?>";
        if(v==''){$('#inpay').html('');$('#mpay').html(''); $('#btns').attr('disabled',true); return; }
      if(v>1){
            var a = x/10;
            var b = x-a;
            var c = b/v;
            $('#inpay').html('Deposit: USD'+com(a));
       $('#mpay').html('Monthly: USD'+com(c)); 
       $('#btns').attr('disabled',false);
         }
         else{
        $('#inpay').html('Outright: USD'+x);
        $('#mpay').html(''); 
        $('#btns').attr('disabled',false);
         }
     //   alert(v);
        }

        function buySlot(v){

var btn = '<p>Note that your first payment will be deducted at this point</p><input type="hidden"  name="slot" value="1"><br><button type="submit" class="btn btn-danger btn-lg btn-block" name="BuyProperty4">Proceed to Pay 1st Instalment</button>'
            $('#'+v).html(btn);
        }

        function getSav(){
        var v = document.getElementsByClassName('asav');
     
        var a = v[1].value;
        var b = v[2].value;
        var c = v[3].value;
        if(a=='' || b=='' || c==''){return; }

        var d = b/c;
       $('#savRes').html('USD'+com(d)+' Per Slots');
         
        }
        function getSav2(){
        var v = document.getElementsByClassName('bsav');
     
        var a = v[1].value;
        var b = v[2].value;
        var c = v[3].value;
        if(a=='' || b=='' || c==''){return; }

        var d = b/c;
       $('#savRes2').html('USD'+com(d)+' Per Slots');
         
        }


function com(v){
    return (v).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
}

    </script>

    </body>

</html>

?>