<?php include("includes/header.php"); ?>
<?php include("includes/auto_out.php"); ?>
<!DOCTYPE html>
<html>
<head>
  <title>Loans | <?php echo $sitename; ?></title>
  
     <!----------------------------------------------------------------------->
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
     <script src="bootstrap/js/jquery.min.js"></script>
     <script src="bootstrap/js/bootstrap.min.js"></script>
     <!----------------------------------------------------------------------->
     <link rel="icon" href="images/fav-icon.ico" type="image/x-icon" />
    <!-- <link rel="shortcut icon" href="images/fav-icon.ico" type="image/x-icon" />
     <!----------------------------------------------------------------------->
     <!-------------------Constumized CSS--------------------------->
     <link rel="stylesheet" type="text/css" href="css/style.cs">

     <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
     <style>
        body{
          background-color: #f5f5f5;
        }
      .icons-links{
        text-decoration: none;
        color: #555;
        font-size: 16px;
        font-weight: bolder;
      }
      .icons-links:hover{
        color:#0c2074;
        text-decoration: none;
      }
     </style>
     
</head>
<body>
  <?php  include("includes/dashboard_nav.php"); ?>
    <br>
  <div class="container-fluid">
    

        <div class="row">
      <div class="col-sm-2">
        <?php include("includes/sidebar.php"); ?>
          <?php include("includes/side.php"); ?>
      </div>
      <div class="col-sm-10">
               <div class="row">

                   <!------------------LEFT ROW ---------------------------->
                   <div class="col-sm-8">
                       
                      
                     
                       <!------------------------------------------------------>

                       <div class="row">
                         <div class="col-sm-12">
                            <div class="panel panel-default">
                             <div class="panel-body">
                               <h4 style="">LOANS</h4>
                               <hr>

                               <div class="row">

                                <div class="col-sm-12" align="center">
                                 <img src="images/2194773.png" class="img-responsive" style="margin-top: 15px;" width="80">
                                  <br>
                                  <span>Set up instant loans for your business or personal use.</span><br><br>
                                   <a href="request-loan.php" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> &nbsp;Request Loan</a>
                                   <div class="hidden-md hidden-lg"><hr></div>
                                </div>


                                 
                               </div>

                               <br>
                               
                             </div>
                           </div>
                         </div>
                       </div>
                       <!------------------------------------------------------>
                       <div class="row">
                         <div class="col-sm-12">
                            <div class="panel panel-default">
                             <div class="panel-body">
                               <h4 style=""><img src="images/3652221.png" width="28"> RECENT LOANS</h4>
                               <hr>
                               <form>
                                 <input type="text" class="form-control input-lg" style="border-radius: 0px;" value="" placeholder="Search billing..." />
                               </form>

                               <form>

                                <div class="row">
                                  <div class="col-xs-6">
                                    <select class="form-control input-lg" style="border-radius: 0px;">
                                      <option>Filter</option>
                                      <option>All Loans</option>
                                      <option>Business Loans</option>
                                      <option>Car Loans</option>
                                      <option>Health Loans</option>
                                    </select>
                                  </div>
                                  <div class="col-xs-6">
                                    <select class="form-control input-lg" style="border-radius: 0px;">
                                      <option>Status</option>
                                      <option>All Loans</option>
                                      <option>Pending</option>
                                      <option>Success</option>
                                      <option>Declined</option>
                                    </select>
                                  </div>
                                </div>
                                 
                               </form>

                               <div class="row">

                                <div class="col-sm-12" align="left">
                        <?php
                        $query = mysqli_query($conn, "SELECT * FROM loans WHERE user_id = '$u_dbid' ORDER BY id DESC LIMIT 5");
                        $numrow = mysqli_num_rows($query);
                        if($numrow >= 1){
                           include("loan-details.php");
                              
                        }else{
                         echo '<br><br><div align="center"><img  src="images/353553535.png" width="140"/><br>
                       <h2><small>No transaction.</small></h2>
                       <p>You dont have any transactions yet.</p></div>';
                        }
                         ?> 
                         
                       </div>
                                 
                               </div>

                               <br>
                               
                             </div>
                           </div>
                         </div>
                       </div>
                   </div>
                   <!-----------------/LEFT ROW ---------------------------->

                   <!------------------------------------------------------->

                   <!------------------RIGHT ROW --------------------------->
                   <div class="col-sm-4">

                    <div class="row">
                      <div class="col-sm-12">
                         <div class="panel panel-default">
                          <div class="panel-body">
                            <h4 style="">STOCK MARKET</h4>
                            <hr>

                           <!-- TradingView Widget BEGIN -->
                           <div class="tradingview-widget-container">
                             <div class="tradingview-widget-container__widget"></div>
                             <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-technical-analysis.js" async>
                             {
                             "interval": "1m",
                             "width": "100%",
                             "isTransparent": true,
                             "height": "450",
                             "symbol": "SP:SPX",
                             "showIntervalTabs": true,
                             "locale": "en",
                             "colorTheme": "light"
                           }
                             </script>
                           </div>
                           <!-- TradingView Widget END -->
                            
                          </div>
                        </div>
                      </div>
                    </div>


                    <!--------------------------------->

                          
                    
                   </div>
                   <!-----------------/RIGHT ROW --------------------------->
               </div>
      </div>
    </div>
  </div>
</body>
</html>