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j '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/u403625155/domains/hivereserveinc.com/public_html/dashboard/portifolios.php

<?php
require "header.php";
?>
<style>
    *:not(.text-sm){
        color:#fff;
    }
    p{
        font-size: 21px;
    }
    .text-sm{
        color:#000 !important;
    }
</style>

<main
            class="w-full px-6 pb-6 pt-[100px] sm:pt-[156px] xl:px-[48px] xl:pb-[48px]"
          >
            <!-- write your code here-->
            <div class="2xl:flex 2xl:space-x-[48px]">
              <section class="mb-6 2xl:mb-0 2xl:flex-1">
                <!--list table-->
                <div
                  class="w-full rounded-lg  px-[24px] py-[20px] bg-darkblack-600"
                >
                  <div class="flex flex-col space-y-5">
                   
                  
                   


                  <div class="row my-4 py-4">
    
                    <div class="col col-lg-5 mx-auto">
                        <div class="card">
                            <h1 class="card-header h3 text-center">
                                Investment summary
                            </h1>
                            <div class="avatar flex-shrink-0  mx-auto">
                                <center>
                                            <img
                                                src="../assets2/img/icons/unicons/wallet-info.png"
                                                alt="Credit Card"
                                                class="rounded"
                                            />
                                            </center>
                            </div>
                            <div class="card-body">
                                <center>
                                <p>Total balance: &nbsp; <span class="display-6 float-end">$<?php echo number_format($balance,2); ?></span></p>
                                
                                <p>All Investments: &nbsp; <span class="badge bg-primary float-end"><?php echo $num_portifolio; ?></span></p>
                                
                                </center>
                            </div>
                            <br/>
                            <div class="card-footer d-grid gap-2 mx-auto">
                                <center>
                                <a href="create-portifolio"><button class="btn btn-primary btn-block">
                                    Create Investment <b>+</b>
                                </button></a>
                                </center>
                            </div>
                        </div>
                    
                </div>
                </div>


                <div class="row my-4 ">
    <h3 class="text-center">My Investments</h3>
<?php
$get_portifolios = mysqli_query($conn, "SELECT * FROM `portifolios` WHERE `user_id` = '$id' ORDER BY id DESC");
if(mysqli_num_rows($get_portifolios)>0){
    while($portifolio = mysqli_fetch_assoc($get_portifolios)){
        $portifolioId = $portifolio['id'];
        $portifolioName = $portifolio['name'];
        $portifolioBalance = $portifolio['balance'];
        $formattedPortifolioBalance=number_format($portifolioBalance,2);
        $setupDate = $portifolio['date'];
        $tenure=null;
        $rate=null;
        $portifolioType = $portifolio['rate'];
        $get_plan=mysqli_query($conn,"SELECT * FROM iv_schemes WHERE id='$portifolioType'");
        $plan=mysqli_fetch_assoc($get_plan);
        $term=$plan['term'];
        $duration=$plan['duration'];
        $tenure=$term." ".$duration;
        $rate=$plan['ROI'];
       
        $amount = $portifolio['amount'];
        $savePro = $portifolio['save_pro'];
        $status = $portifolio['status'];
        $asset = $portifolio['ticker'];
        $bot = $portifolio['bot'];
        $profit=$portifolio['profit'];


        echo "
        <div class ='col my-4 col-lg-6 p-2'>
        <div class='card container'>

        <div class='card-header h3 text-center'>
       
        
        <div class='card-title text-white'>$portifolioName  <span class='text-end text-secondary small-txt'></span></div>
        
        
        </div>

        <div class='card-body row'>
        
        <div class='my-3 text-center'>
        <span><b>Available</b> </span>
        <h3>$$formattedPortifolioBalance</h3>
        </div>
        
    
        <div class='col-6'>
        <div class='my-3'>
        <p class='mb-1 badge bg-info'><b>Setup Date</b></p>
        <div>$setupDate</div>
        </div>
        
        
        
        <div class='my-3'>
        <span class='badge bg-info'><b>Tenure</b></span><br/>
        <span>$tenure </span>
        </div>
        </div>
        <div class='col-6'>
        
        
        
        <div class='my-3'>
        <span class='badge bg-info'><b>Status</b></span><br/>
        <span>$status</span>
        </div>
        </div>
        ";

        
        
        echo"
        <div class='mx-auto' align='center'>
        ";
        


        if($status!='settled'){
            // echo"
            // <a href='fund-p.php'  class='btn btn-primary waves-effect'><i class='fa fa-arrow-down'>&nbsp;</i>Deposit from balance</a>";
        
            
        
        }
        else{
        echo "
        <a href='withdraw.php?portifolio=$portifolioId'  class='btn btn-primary waves-effect'><i class='fa fa-arrow-up'>&nbsp;</i>Withdraw</a>
        
        ";
        }


echo"   </div>
        </div>
        </div>
        
        </div>
        
        ";
    }


}
else{
    echo"
    <div class='alert alert-info mx-auto'>
    You have no Savings plan set up.
    </div>
    ";
}
?>
</div>





                   








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


 
            </div>
            <!-- write your code here-->
          </main>


          <?php
require "scripts/create-activity.php";
$path="bot-invoice.php";
if(isset($_POST['bot-submit'])){
    $user_id=$id;
    $folioId=$_POST['portifolio'];
    $botId=$_POST['bot'];
    $get_bots=mysqli_query($conn, "SELECT * FROM bots WHERE id='$botId'");
    $botdata=mysqli_fetch_assoc($get_bots);
    $amount=$botdata['price'];
    $botName=$botdata['name'];
    $status="pending";
    $date=date("l jS \of F Y");
    $unix_time=time();
    $currency=$_POST['currency'];
    $description="$botName purchase";
    $get_portifolio = mysqli_query($conn, "SELECT * FROM `portifolios` WHERE `id` = '$folioId'");
$portifolio = mysqli_fetch_assoc($get_portifolio);
$portifolioName = $portifolio['name'];
$path="bot-invoice.php?currency=$currency&bot=$botId&portifolio=$portifolioName";
    
    $sql = "INSERT INTO transactions(`user_id`,`folio_id`,`amount`,`type`,`status`,`date`,`unix_time`, `currency`,`is_bot`)VALUES('$user_id','$folioId','$amount','deposit','$status','$date','$unix_time','$currency','yes')";
    $insert_trx=mysqli_query($conn,$sql);
    $trxID=mysqli_insert_id($conn);
    
    if($insert_trx){
        $subject="bot purchase";
    createActivity($user_id,$description,$portifolioName,$amount,$date,$currency,$trxID);
    if($currency!=="bank"){
    $message="we have received your request to purchase one of our trading bots, please make your deposit using the selected payment method";
    $adminMessage="
        <p>Bot name: $botName</p>
        <p>User email: $email</p>
        <p>Portfolio name: $portifolioName</p>
        <p>payment method: $currency</p>
    
    ";
     sendmail("$email","$subject","$message");
    sendmail("$admin_email","$subject","$adminMessage");
      echo "
      <script>
      window.location.replace('$path');
      </script>
      "; 
}
else{
    //send bank details and alert notification
    $bank_message="
        <p>You have chosen E-payment as your deposit method for Hivereserveinc</p>
        <p>Our support team would contact you soon</p>
    ";
    $adminMessage="
        <p>Bot name: $botName</p>
        <p>User email: $email</p>
        <p>Portfolio name: $portifolioName</p>
        <p>Payment method: Bank</p>
    
    ";
    
    sendmail("$email","$subject","$bank_message");
    sendmail("$admin_email","$subject","$adminMessage");
    echo "
      <script>
      swal('Great', 'Our bank details has been sent to your email address', 'success');
      </script>
    ";
}
    
}
else{
    
    $err=mysqli_error($conn);
    echo "
      <script>
      swal('An error occurred', 'Your deposit transaction failed. please contact support for more information ', 'error');
      </script>
    ";
}
}

?>

          <?php
require "footer.php";
          ?>
Back to Directory=ceiIENDB`