Your IP : 18.226.187.224


Current Path : /home/lentoinv/blossomfoodint.com/account/
Upload File :
Current File : /home/lentoinv/blossomfoodint.com/account/searchuser.php

<?php
session_start(); ob_start();
?>
<!doctype html>
	<html lang="en">

	<head>
		<!-- Required meta tags -->
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--favicon-->
		<link rel="icon" href="assets/images/favicon-32x32.png" type="image/png" />
		<!--plugins-->
		<link href="assets/plugins/simplebar/css/simplebar.css" rel="stylesheet" />
		<link href="assets/plugins/perfect-scrollbar/css/perfect-scrollbar.css" rel="stylesheet" />
		<link href="assets/plugins/highcharts/css/highcharts.css" rel="stylesheet" />
		<link href="assets/plugins/vectormap/jquery-jvectormap-2.0.2.css" rel="stylesheet" />
		<link href="assets/plugins/metismenu/css/metisMenu.min.css" rel="stylesheet" />
		<link href="assets/plugins/datatable/css/dataTables.bootstrap5.min.css" rel="stylesheet" />
		<!-- loader-->
		<link href="assets/css/pace.min.css" rel="stylesheet" />
		<script src="assets/js/pace.min.js"></script>
		<!-- Bootstrap CSS -->
		<link href="assets/css/bootstrap.min.css" rel="stylesheet">
		<link href="assets/css/bootstrap-extended.css" rel="stylesheet">
		<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
		<link href="assets/css/app.css" rel="stylesheet">
		<link href="assets/css/icons.css" rel="stylesheet">
		<!-- Theme Style CSS -->
		<link rel="stylesheet" href="assets/css/dark-theme.css" />
		<link rel="stylesheet" href="assets/css/semi-dark.css" />
		<link rel="stylesheet" href="assets/css/header-colors.css" />
			<link href="treestyle.css" rel="stylesheet">
		<title>Search User</title>
			<style type="text/css">
			.col .card{border: solid 3px green; }
			.borders td{
				border-right: solid thin #CCC; border-bottom: none;
				padding: 10px 15px;
				 }

		</style>
	</head>

	<body>
		<!--wrapper-->
		<div class="wrapper">

			<?php include('nav.php') ; if(isset($_SESSION['fid'])){ $fid = $_SESSION['fid'];  $uid = $fid; $uidx = userName($uid,'sn');
			$stage = userName($uid,'stage'); }
			else{header('location: ./'); } ?>
			<!--start page wrapper -->
			<div class="page-wrapper">
				<div class="page-content">

					<div class="page-breadcrumb d-sm-flex align-items-center mb-3">
						<div class="breadcrumb-title pe-3">SEARCH USER</div>
						<div class="ps-3">
							<nav aria-label="breadcrumb">
								<ol class="breadcrumb mb-0 p-0">
									<li class="breadcrumb-item"><a href="javascript:;"><i class="bx bx-home-alt"></i></a>
									</li>
									<li class="breadcrumb-item active" aria-current="page"><?= userName($uid) ?> (<?= userName($uid,'user') ?>)</li>
								</ol>
							</nav>
						</div>

						<div class="ms-auto">
							<div class="btn-group">
								<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModalPass">Update Profile</button>
								<!--<button type="button" class="btn btn-primary split-bg-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown">	<span class="visually-hidden">Toggle Dropdown</span>-->
								<!--</button>-->
								<!--<div class="dropdown-menu dropdown-menu-right dropdown-menu-lg-end">	<a class="dropdown-item" href="javascript:;">Update Bank Account</a>-->
								<!--	<a class="dropdown-item" href="javascript:;" -->
								<!--	data-bs-toggle="modal" data-bs-target="#myModal">Update Photograph</a>-->

								<!--	<div class="dropdown-divider"></div>	<a class="dropdown-item" href="javascript:;">Update Profile Data</a>-->
								<!--</div>-->
							</div>
						</div>

					</div>	

			  <div class="row row-cols-1 row-cols-lg-2 row-cols-xl-4">
			  
					<div class="col">
						<div class="card radius-10 bg-light-success bg-gradient">
							<div class="card-body">
								<div class="d-flex align-items-center">
									<div>
										<p class="mb-0 text-dark">Leadership Stage</p>
										<h4 class="my-1"><?= $pro->stageTitle($stage) ?></h4>
									</div>
									<div class="text-white ms-auto font-35"><i class='bx bx-user-pin'></i>
									</div>
								</div>
							</div>
						</div>
					</div>
						<div class="col">
						<div class="card radius-10 bg-light-danger bg-gradient">
							<div class="card-body">
								<div class="d-flex align-items-center">
									<div>
										<p class="mb-0 text-dark">Stage Progress</p>
										<h4 class="my-1 "><?php $team = $pro->stageTeam($uidx); $max = 6;   echo number_format(100*$team/$max,2) ?>%</h4>
									</div>
									<div class="text-white ms-auto font-35"><i class='bx bx-user-pin'></i>
									</div>
								</div>
							</div>
						</div>
					</div>
						<div class="col">
						<div class="card radius-10 bg-warning">
							<div class="card-body">
								<div class="d-flex align-items-center">
									<div>
										<p class="mb-0 text-dark">Total Earning</p>
										<h4 class="my-1"><?php echo money($pro->walletEarning($uid,11,14)); ?></h4>
									</div>
									<div class="text-white ms-auto font-35"><i class='bx bx-dollar'></i>
									</div>
								</div>
							</div>
						</div>
					</div>
<div class="col">
						<div class="card radius-10 bg-light-primary bg-gradient">
							<div class="card-body">
								<div class="d-flex align-items-center">
									<div>
										<p class="mb-0 text-dark">Account Balance</p>
										<h4 class="text-dark my-1"><?= money($pro->wallet($uid)) ?></h4>
									</div>
									<div class="text-white ms-auto font-35"><i class='bx bx-dollar'></i>
									</div>
								</div>
							</div>
						</div>
					</div>
				
			  </div><!--end row-->
			  

	

			   <div class="row">

				 <div class="col-12 d-flex"><h4>Account Statistics</h4>
				 </div>
				 <div class="table-responsive">
				 <table class="table borders text-center">
				 	<tr>
				 		<?php $i=1;  while($i<=20){$e=$i++; if($pro->walletRemark($e)!=''){  ?>
				 		<td>
				 			<div>
											<p class="mb-0 text-secondary"><?= $pro->walletRemark($e) ?></p>
											<h4 class="mb-0"><?= money(abs($pro->wallet($uid,$e))) ?></h4>
										</div>
				 		</td>
				 	<?php } } ?>
				 		<td>
				 			<div>
											<p class="mb-0 text-secondary">Total  Referral</p>
											<h4 class="mb-0"><?= number_format($pro->userTeam($uidx)) ?></h4>
										</div>
				 		</td>
				 		<td>
				 			<div>
											<p class="mb-0 text-secondary">Stage Team</p>
											<h4 class="mb-0"><?php echo $team ?></h4>
										</div>
				 		</td>

				 	</tr>
				 </table>
</div>

</div>
			

				
				
<div class="card">
					<div class="card-body">
						<div class="card-title">
							<h5 class="mb-0">REFERRAL LINK</h5>
						</div>
						<hr/>
	<!--https://blossomfoodintl.com/home/ref/<?= userName($uid,"user") ?>-->
https://cloudtestservers.site/home/ref/<?= strtolower(userName($uid,"user")) ?>
						<span style="float:right">  USER ID: <b><?= $uidx ?></b></span>
</div>
</div>						


<div class="card">
					<div class="card-body">
						<div class="card-title">
							<h5 class="mb-0">Recent Transactions</h5>
						</div>
						<hr/>

                               <div class="table-responsive mt-3">
								  <table id="example" class="table table-bordered table-striped table-sm">
                                    <thead>
                                        <tr>
                                          <th>S/N</th>
                                         
                                          <th>Date</th>
                                          <th>Amount</th>
                                      
                                          <th>Type</th>
                                          <th>Remark</th>
                                         <th>Status</th> 
                                         <th>Reference</th> 
                                        </tr>
                                    </thead>
                                    <tbody>
                                   <?php
                                          $i=1;
                                          $sql = $db->query("SELECT * FROM wallet WHERE id='$uid' ORDER BY sn DESC LIMIT 200 "); 
                                          while($row = $sql->fetch_assoc()) { $e = $i++;
                                          $type = $row['cos']>0 ? 'Credit' : 'Debit';
                                      ?>
                                        <tr>
                                          <td><?php echo $e; ?></td>
                                          
                                       
                                          <td><?php echo date('d/m/y', $row['ctime']); ?></td>
                                          <td><?php echo money(abs($row['cos']),2) ?></td>
                                     
                                          <td><?php echo $type; ?></td>
                                          <td><?php echo $row['remark']; ?> </td>
                                     <td><?php echo $pro->walletStatus($row['status']); ?></td> 
                                        <td><?php  echo $row['trno'] ?></td></tr>
                                   <?php } ?>
                                      </tbody>
                                </table>
					</div>
				</div><!--end row-->
</div>


								<div class="card">
									<div class="card-body">
										<div class="card-title"><div class="ms-auto" style="float: right;">


											<div class="btn-group">
												<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal"></button>
												<button type="button" class="btn btn-primary split-bg-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown">	<span class="visually-hidden">Toggle Dropdown</span>
												</button>
												<div class="dropdown-menu dropdown-menu-right dropdown-menu-lg-end">	<a class="dropdown-item" href="?type=active">Active PINs</a>

													<div class="dropdown-divider"></div>	<a class="dropdown-item" href="?type=used">Used PINs</a>
												</div>
											</div>
										</div>
										<h5 class="mb-0">PIN Ledger</h5>

									</div>
									<hr/>

									<div class="table-responsive mt-3">
										<table id="example" class="table table-bordered table-striped">
											<thead>
												<tr>
													<th>S/N</th>
													<th>PIN</th>
													<th>Status</th>
													<th>Used By</th>
													<th>Purchased On</th>

													<th>Used On</th>
												</tr>
											</thead>
											<tbody>
												<?php  $i=1; $status = $_GET['type']??'active';
												$type = $status=='active' ? 0 : 1;
												$sql = isset($_GET['type']) ? $db->query("SELECT * FROM pin WHERE rep='$uid' AND status='$type' ORDER BY sn ") : $db->query("SELECT * FROM pin WHERE rep='$uid' ORDER BY sn "); 
												while($row = $sql->fetch_assoc()){ $e = $i++;
													$status = ($row['status']==0)?'Active':'Used';

													?>
													<tr>
														<td><?php echo $e ?></td>
														<td><?php echo $row['pin']; ?></td>
														<td><?php echo $status; ?></td> 
														<td><?php echo userName($row['id']) ; ?> (<?php echo userName($row['id'],'user') ; ?>)</td>
														<td><?php echo date("d-M-Y",strtotime($row['created'])) ?></td>                                              
														<td><?php echo $row['used']>0 ? date("d-M-Y",$row['used']) : '' ?></td>

													</tr>
												<?php } ?>
											</tbody>

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






							<div class="card">
								<div class="card-body">
									<div class="card-title">
									<h5 class="mb-0">Others</h5>

								</div>
								<hr/>

								<form method="POST" >
									<input type="hidden" name="fid" value="<?= $uid ?>">
									<div class="d-flex justify-content-start">
										<?php  if(userName($uid,'status') == 1) { ?>
										<button class="btn btn-danger" name="Deactivate" value=0>Deactivate User  </button>
									<?php }else { ?>
										<button class="btn btn-success" name="Deactivate" value=1>Activate User</button>
									<?php } ?>
									</div>
								</form>
							</div><!--end row-->
						</div>
						
						
						<div class="card">
					<div class="card-body">
						<div class="card-title">
							<h5 class="mb-0">Geneology</h5>
						</div>
						<hr/>

  <?php     $user = $uidx; $stage=userName2($user,'stage'); 

    ?>

<form method="post">
    <?php $i = 1; while($i<=$stage){$e=$i++;
    if($e==1){$color='danger';}elseif($e==2){$color='warning';}elseif($e==3){$color='primary';}elseif($e==4){$color='success';}else{$color='info';}
     ?>
        <button type="submit" class="btn btn-<?= $color ?>" name="StageSk" value="<?= $e ?>">Stage <?= $e ?></button>

    <?php } ?>
</form>                       
		
<?php $st = $_SESSION['stage']??$stage;  if($st==1){$color='danger';}elseif($st==2){$color='warning';}elseif($st==3){$color='primary';}elseif($st==4){$color='success';}else{$color='info';} ?>

<figure class="table-responsive mt-3" > 
<?php if($st<$stage){
 $leg = json_decode(sqLx2('stageteam','sponsor',$user,'stage',$st,'team'));  ?>

	<ul class="tree">
    <li><span class="btn btn-<?= $color ?>"><?= userName2($uidx,'user') ?></span>
        <ul>
            <li><?= genMember($leg,0) ?>
            	<ul>
            		<?= genMember($leg,2) ?>
            		<?= genMember($leg,3) ?>  
        		</ul> 
            </li>
            <li><?= genMember($leg,1) ?>
            	<ul>
            		<?= genMember($leg,4) ?>
            		<?= genMember($leg,5) ?>   
        		</ul> 
            </li>   
        </ul>
    </li>
</ul>

<?php }else{ $leg = json_decode($pro->stageLeg($uidx)); $n = count($leg); 


?>
	<ul class="tree">
    <li><span class="btn btn-<?= $color ?>"><?= userName2($uidx,'user') ?></span>
        <ul>
            <li><?= genMember($leg,0) ?>
            <?php if($n>2){ ?>
            	<ul>
            		<?= genMember($leg,2) ?>
            		<?= genMember($leg,3) ?>  
        		</ul> 
        	<?php } ?>
            </li>
            <li><?= genMember($leg,1) ?>
            <?php if($n>4){ ?>
            	<ul>
            		<?= genMember($leg,4) ?>
            		<?= genMember($leg,5) ?>   
        		</ul> 
        	<?php } ?>
            </li>   
        </ul>
    </li>
</ul>
<?php } ?>
</figure>
								
						
		
			
			</div>
		</div>




					</div>


					<!--end page wrapper -->
					<?php include('foot.php') ?>

				</div>
				<!--end wrapper-->
				<form method="POST" enctype="multipart/form-data">
					<div class="modal" id="myModalPass">
						<div class="modal-dialog">
							<div class="modal-content">
								<!-- Modal Header -->
								<div class="modal-header">
									<h5 class="modal-title">Update User Profile Data: <?= userName($fid,"user") ?> (<?= userName($fid,"sn") ?>)</h5>
									<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
								</div>
								<!-- Modal body -->
								<div class="modal-body">
									<label>Firstname</label>
									<input type="text" name="firstname" class="form-control" value="<?= userName($fid,"firstname") ?>" required> 
									<label>Lastname</label>
									<input type="text" name="lastname" class="form-control" value="<?= userName($fid,"lastname") ?>"  required>  
									<label>Username</label>
									<input type="text" name="user" class="form-control" value="<?= userName($fid,"user") ?>"  required> 
									<label>E-mail</label>
									<input type="email" name="email" class="form-control" value="<?= userName($fid,"email") ?>"  required> 
									<label>Phone Number</label>
									<input type="text" name="phone" class="form-control" value="<?= userName($fid,"phone") ?>"  required> 
								</div>
								<!-- Modal footer -->
								<div class="modal-footer">
									<button type="submit" name="UpdateUserData" class="btn btn-primary">Update User Data</button>
									<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button>
								</div>
							</div>
						</div>
					</div>
				</form>


				<!-- Bootstrap JS -->
				<script src="assets/js/bootstrap.bundle.min.js"></script>
				<!--plugins-->
				<script src="assets/js/jquery.min.js"></script>
				<script src="assets/plugins/simplebar/js/simplebar.min.js"></script>
				<script src="assets/plugins/metismenu/js/metisMenu.min.js"></script>
				<script src="assets/plugins/perfect-scrollbar/js/perfect-scrollbar.js"></script>
				<script src="assets/plugins/vectormap/jquery-jvectormap-2.0.2.min.js"></script>
				<script src="assets/plugins/vectormap/jquery-jvectormap-world-mill-en.js"></script>
				<script src="assets/plugins/highcharts/js/highcharts.js"></script>
				<script src="assets/plugins/highcharts/js/exporting.js"></script>
				<script src="assets/plugins/highcharts/js/variable-pie.js"></script>
				<script src="assets/plugins/highcharts/js/export-data.js"></script>
				<script src="assets/plugins/highcharts/js/accessibility.js"></script>
				<script src="assets/plugins/apexcharts-bundle/js/apexcharts.min.js"></script>
				<script src="assets/plugins/datatable/js/jquery.dataTables.min.js"></script>
				<script src="assets/plugins/datatable/js/dataTables.bootstrap5.min.js"></script>
				<script>
					$(document).ready(function() {
						$('#example').DataTable();
					} );
				</script>
				<script src="assets/js/index2.js"></script>
				<!--app JS-->
				<script src="assets/js/app.js"></script>
				<script>
					new PerfectScrollbar('.customers-list');
					new PerfectScrollbar('.store-metrics');
					new PerfectScrollbar('.product-list');
				</script>
			</body>

			</html>

?>