GIF89a php
Current File : /home/viralhoga/public_html/referral-income.php
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<head>
<meta charset="utf-8">
<meta name="description"
    content="" />
<meta name="keywords"
    content="" />
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- title -->
<title>Viralhoga.com | Referral Income History</title>
<!-- favicon -->
<link rel="icon" type="image/x-icon" href="img/logo/favicon.png">
<!-- bootstrap css -->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<!-- magnific-popup css -->
<link rel="stylesheet" type="text/css" href="css/magnific-popup.css">
<!-- animate css -->
<link rel="stylesheet" type="text/css" href="css/animate.min.css">
<!-- bootstrap icon -->
<link rel="stylesheet" type="text/css" href="css/bootstrap-icons.css">
<!-- font-awesome css -->
<link rel="stylesheet" type="text/css" href="css/all.min.css">
<!--fether css -->
<link rel="stylesheet" type="text/css" href="css/feather.css">
<!-- owl css -->
<link rel="stylesheet" type="text/css" href="css/owl.carousel.min.css">
<link rel="stylesheet" type="text/css" href="css/owl.theme.default.min.css">
<!-- swiper-bundle css -->
<link rel="stylesheet" type="text/css" href="css/swiper-bundle.min.css">
<!-- slick slider css -->
<link rel="stylesheet" type="text/css" href="css/slick.css">
<!-- style css -->
<link rel="stylesheet" type="text/css" href="css/style.css">
<!-- account css -->
<link rel="stylesheet" type="text/css" href="css/account.css">
<link rel="stylesheet" href="css/ourstyle.css">
</head>
<body>
<!-- header start -->
<?php include('includes/navbar.php');
    //get my booking
	if(!isset($_SESSION['reg_id']) || empty($_SESSION['reg_id']))echo "<script>window.location='login.php'</script>";
	 //get referral income histroty if customer order first time only
	 $my_income_history = $obj->select_all('register',"where referralId='$_SESSION[reg_id]' and incomefirst='1'");
   ?>
<!-- header end -->
<!-- main section start-->
<main>
  <!-- breadcrumb start-->
  <section class="breadcrumb-area">
    <div class="container">
      <div class="col">
        <div class="row">
          <div class="breadcrumb-index">
            <!-- breadcrumb main-title start-->
            <div class="breadcrumb-title">
              <h2>My Referral Income History</h2>
            </div>
            <!-- breadcrumb main-title end-->
            <!-- breadcrumb-list start -->
            <ul class="breadcrumb-list">
              <li class="breadcrumb-item-link"> <a href="index.php">Home</a> </li>
              <li class="breadcrumb-item-link"> <span>My Referral Income</span> </li>
            </ul>
            <!-- breadcrumb-list end -->
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- breadcrumb start-->
  <section class="customer-page section-ptb">
    <div class="container">
      <div class="row">
        <div class="col">
          <div class="wishlist-page">
            <div class="wishlist-grid is_visible">
              <div class="wish-wrap">
                <!-- wishlist-title start -->
                <h6><font color="red">Wallet Balance:</font> <span id="totalWlt"></span></h6>
                <div style="background: aliceblue;padding: 15px;margin: 20px 0px 20px 0px;">
                  <p style="color: red;font-size: 14px;">My Referral Link</p>    
<b><small style="font-size: 8px;">https://viralhoga.com/refid/?<?php echo $_SESSION['reg_id']?></small></b>        
<button onclick="copyReferral()">
<samll>&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-copy"></i> Copy</samll>
                  </button>
                  </div>     
                  <script>
function copyReferral() {
  const referralId = '<?php echo $_SESSION['reg_id']?>'; // dynamic from backend
  const link = `https://viralhoga.com/refid/?${referralId}`;

  navigator.clipboard.writeText(link)
    .then(() => {
      alert("Link copied");
    })
    .catch(err => {
      console.error("Failed to copy", err);
    });
}
</script>
                   <div class="wishlist-title" style="margin-top:15">
                   <h6><font color="red">Referral Buy History:</font></h6>
                   <span class="wish-count"> <span class="wishlist-counter">
                      <?php echo mysqli_num_rows($my_booking)?></span> 
                      <span class="wish-item-title">Items</span> </span> 
                  </div>
                    <?php $totalWallet=0;
                     while($customerDtl=mysqli_fetch_array($my_income_history)){
					  //sel order details
			          $row = mysqli_fetch_array($obj->select_all("cart","where reg_id='$customerDtl[reg_id]'"));
					  
					  $sel_d=mysqli_query($con,"select * from `product` where id='$row[product_id]'") or die(mysqli_error());
					  $row_data=mysqli_fetch_array($sel_d);
					  $dcd_img=json_decode($row_data['img']);
					  $income=100;
					  $totalWallet+=$income;
					?>
                <ul class="wishlist-tile-container">
                  <li class="wishlist-info">
                    <div class="item-img"> 
                     <img src="adminpanel/img/<?php echo $dcd_img[0]; ?>" class="img-fluid" alt="p-1"> 
                    </div>
                    <div class="item-title ps-lg-4">
                      <div class="row">
                        <div class="col-6 col-lg-3 mt-3">
                          <div class="booking_date">
                            <p class="text-black">
                             <?php 
				              if(!empty($row['Color']))echo "<strong>Song Type: </strong>".$row['Color']."<br>";
				              if(!empty($row_data['brand']))echo "<strong>Song Name: </strong>".$row_data['brand']."<br>";
				              if(!empty($row_data['name']))echo "<strong>Singer Name: </strong>".$row_data['name']."<br>";
			               	 ?>
                            </p>
                          </div>
                        </div>
                         <div class="col-6 col-lg-2 mt-3">
                          <div class="booking_date text-lg-center"> <span>Customer Info</span>
                            <p class="text-black"><?php echo $customerDtl['reg_id']?><br><?php echo $customerDtl['cfname']?></p>
                          </div>
                        </div>
                        <div class="col-6 col-lg-2 mt-3">
                          <div class="booking_date text-lg-center"> <span>Booking Date</span>
                            <p class="text-black"><?php echo date('d/m/Y',$row['order_date']);?></p>
                          </div>
                        </div>
                        <div class="col-6 col-lg-2 mt-3">
                          <div class="booking_date text-lg-center"> <span>Income</span>
                            <p class="text-black">₹ <?php echo number_format($income,2)?></p>
                          </div>
                        </div>
                      </div>
                    </div>
                  </li>
                </ul>
                <?php }?>
                <script>
                    document.getElementById('totalWlt').innerHTML='<?php echo $totalWallet?>';
                </script>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
</main>
<!-- main section end-->
<!-- footer start -->
<?php include('includes/footer.php')?>
<!-- screen-bg start -->
<div class="screen-bg"></div>
<!-- screen-bg end -->
<!-- back-to-top start -->
<a href="javascript:void(0)" id="top" class="scroll"> <span><i class="feather-arrow-up"></i></span> </a>
<!-- back-to-top end -->
<!-- jquery -->
<script src="js/jquery-3.6.3.min.js"></script>
<!-- bootstrap js -->
<script src="js/bootstrap.min.js"></script>
<script src="js/popper.min.js"></script>
<!-- magnific-popup js -->
<script src="js/jquery.magnific-popup.min.js"></script>
<!-- owl js -->
<script src="js/owl.carousel.min.js"></script>
<!-- swiper-bundle js -->
<script src="js/swiper-bundle.min.js"></script>
<!-- slick js -->
<script src="js/slick.min.js"></script>
<!-- waypoints js -->
<script src="js/waypoints.min.js"></script>
<!-- counter js -->
<script src="js/counter.js"></script>
<!-- main js -->
<script src="js/main.js"></script>
</body>
</html>