Your IP : 3.15.15.91


Current Path : /home/lentoinv/finationglobal.com/account/
Upload File :
Current File : /home/lentoinv/finationglobal.com/account/listedproperties2.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');
                //$pro->DeductAutomated(); ?>
                <!--/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 type=5 AND status=1 ORDER BY sn DESC LIMIT 200 "); 
                                        while($row = $sql->fetch_assoc()) { $e = $i++;
                                         
                                            ?>
                                            <div class="col-lg-4">
                                            <div class="card">
                                                <div class="card-body p-0">

                                           <img src="uploads/<?= $row['photo'] ?>" width="100%">
                                     <div class="p-3">
                                               <?php echo $row['title']; ?>
<p>                                              
 <?php if($stage==0){?> 
    <big style="font-weight: bolder;"><strike>N</strike><?php echo number_format($row['amount'],2) ?></big>  <?php }else{?>                                         
<strike>N<?php echo number_format($row['amount'],2) ?></strike> <big style="font-weight: bolder;"><strike>N</strike><?php echo number_format($row['amount'],2) ?></big> <?php } ?>
</p>
                                                <p><a href="propertyinfo2?ref=<?= $row['ref'] ?>" class="btn btn-primary btn-lg btn-block" >More Information</a></p> 
                                               </div>
                                           </div>
                                           </div>
                                       </div>
                                            <?php } ?>
                                        
                                </div>
</div>






<div class="row">
                                    <div class="card">
                                        <div class="card-header">
                                            <h3 class="card-title">My Purchased Properties</h3>
                                        </div>
                                        <div class="card-body p-2">
                                            <div class="table-responsive">
                                                <table id="examplex" class="table table-bordered table-striped">
                                <thead>
                                    <tr>
                                        <th>Date</th>
                                        <th>Title</th>
                                        <th>Price</th>
                                       
                                        <th>Initial Deposit</th> 
                                        <th>Monthly Payments</th>
                                        <th>Total Paid</th>
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    $i=1;
                                    $sql = $db->query("SELECT * FROM walletnaira WHERE id='$uid' AND type=8 ORDER BY sn DESC LIMIT 10 "); 
                                    while($row = $sql->fetch_assoc()) { $e = $i++;
                                      $opt = explode('-', $row['opt']);
                                        ?>
                                        <tr >
                                            <td><?php echo date('d/m/y', $row['ctime']); ?></td>
                                            <td><a href="?ref=<?= $row['trno'] ?>"><?php echo sqLx('ginvest','ref',$opt[0],'title'); ?> </a></td>
                                            <td><strike>N</strike><?php echo number_format(abs($pro->proPrice($row['opt'],'naira')),2) ?></td>
                                            <td><strike>N</strike><?php echo number_format(abs($row['cos']),2) ?></td>
                                            <td><strike>N</strike><?php echo number_format($opt[2],2); ?> </td>
                                            <td><strike>N</strike><?php echo number_format(abs($pro->proPaid($opt[1],'naira')),2) ?></td>
                                            
                                         
                                            
                                            <td><a href="?ref=<?= $row['trno'] ?>">Payment Breakdown</a></td> 
                                            </tr>
                                        <?php } ?>
                                    </tbody>
                                </table> 

                            <?php
function remark($inst,$amt,$paid=0){
    if($paid > $amt){$x=1;}
    else{$x = 1 - ($amt-$paid)/$inst; }

 $y = $x>0 ? $x : 0;
 return number_format($y*100).'%';
}

                             if(isset($_GET['ref'])){
$detail = $_GET['ref']; 
$ref = sqLx('walletnaira','trno',$detail,'opt');
 $opt = explode('-', $ref);
 $ref1 = $opt[0];
 $inst = $opt[2];
  $optx = $opt[1];
 $paid = abs($pro->proPaid($optx,'naira'));
echo '<br><h4>Payment Breakdown: '.sqLx('ginvest','ref',$ref1,'title').'</h4>
<table class="table-bordered table">
<tr><th>Instalment</th><th>Amount</th><th>Due Date</th><th>Remark</th></tr>';
$type = sqLx('walletnaira','trno',$detail,'stage');

$date = strtotime(sqLx('walletnaira','trno',$detail,'created'));
    $map = ['a'=>1,'b'=>3,'c'=>6,'d'=>12,'e'=>18,'f'=>24,'fl'=>1];

$n = $map[$type]; $instotal=0;
$i=1; while($i<=$n){$e = $i++; $due = $date+$e*30.5*86400;  $instotal += $inst;
echo '<tr><td> Instalment '.$e.'</td><td><strike>N</strike>'.number_format($inst,2).'</td><td>'.date('jS M Y',$due).'</td><td>'.remark($inst,$instotal,$paid).'</td></tr>'; 
}
echo '</table>';

echo $type=='fl' ? '<form method="post"><div class="row">
<div class="col-lg-6">
    <label>Amount to Pay (NGN)</label>
    <input type="text" name="amount" class="form-control" placeholder="Enter any Amount">
</div>
<div class="col-lg-6 mt-2 mb-5">
    <br>
    <button type="submit" class="btn btn-primary btn-block" value="'.$ref.'" name="MakeProPayment2">Make Payment</button>
</div>  </div></form>' : '<form method="post"><div class="row">
<div class="col-lg-6">
    <label>Amount to Pay (NGN)</label>
    <input type="number" min="'.$inst.'" max="'.$inst.'" value="'.$inst.'" name="amount" class="form-control" placeholder="Enter '.$inst.'">
</div>
<div class="col-lg-6 mt-2 mb-5">
    <br>
    <button type="submit" class="btn btn-primary btn-block" value="'.$ref.'" name="MakeProPayment2">Make Payment</button>
</div>  </div></form>';

}

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

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


<div class="row">
<?php
$m='Payment History';
$sql = $db->query("SELECT * FROM walletnaira WHERE id='$uid' AND (type=8 OR type=10) ORDER BY sn DESC LIMIT 100 "); 
?>

                    <div class="card">
                        <div class="card-body">
                            <div class="card-title">
                            <h5 class="mb-0"><?=$m?></h5>

                        </div>
                    

                        <div class="table-responsive mt-3">
                            <table id="data-table" class="table table-bordered table-striped">
                                <thead>
                                    <tr>
                                        <th>S/N  </th>

                                        <th>User</th>
                                        <th>Date</th>
                                        <th>Amount</th>
                                        <th>Remark</th>
                                        <th>Receipt</th> 
                                    
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    $i=1;
                                    
                                    while($row = $sql->fetch_assoc()) { $e = $i++;
                                        $type = $row['cos']>0 ? 'Credit' : 'Debit';
                                        ?>
                                        <tr>
                                            <td><?php echo $e; ?></td>

                                            <td><?php  echo userName($row['id']) ?> (<?php  echo userName($row['id'],'user') ?>)</td>
                                            <td><?php echo date('d/m/y', $row['ctime']); ?></td>
                                            <td>NGN<?php echo number_format(abs($row['cos']),2) ?></td>
                                            <td><?php echo $row['remark'] ?></td>
                                            <td><a href="receipt?receipt=<?=$row['trno']?>&type=2">Receipt</a></td></tr>
                                            
                                        <?php } ?>
                                    </tbody>
                                </table>


                            </div>

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

                    </div>
                            <!-- ROW-5 END -->






                </div>
                <!--app-content end-->
            </div>
            </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  getPlanDetail(v){
alert(v);
                //   var x = <?php // $_GET['ref'] ?>;
                // //  alert(x);
                //     $.ajax({
                //         type: 'get',
                //         url : 'control.php?detail='+v
                //     }).done(function(data){
                //       $('#pinfo').html(data);  
                //     }) 
                }
           


    </script>
    </body>

</html>

?>