<?php $__env->startSection('content'); ?>


<?php
$ip = \App\UserLogin::whereUser_id(Auth::user()->id)->latest()->take(1)->first();
 $ncount = \App\Message::whereUser_id(Auth::user()->id)->whereAdmin(1)->whereStatus(0)->count();

 $ipcount = \App\UserLogin::whereUser_id(Auth::user()->id)->count();
  $depocount = \App\Deposit::whereUser_id(Auth::user()->id)->whereStatus(1)->count();
  $ref = \App\User::whereReference(Auth::user()->id)->count();
  $lastref = \App\User::whereReference(Auth::user()->id)->first();
  $depodate = \App\Deposit::whereUser_id(Auth::user()->id)->whereStatus(1)->latest()->first();


        $airtime =  App\Bill::whereUser_id(Auth::user()->id)->whereStatus(1)->whereType(1)->sum('amount');
        $internet =  App\Bill::whereUser_id(Auth::user()->id)->whereStatus(1)->whereType(2)->sum('amount');
        $power =  App\Bill::whereUser_id(Auth::user()->id)->whereStatus(1)->whereType(4)->sum('amount');
        $cable =  App\Bill::whereUser_id(Auth::user()->id)->whereStatus(1)->whereType(3)->sum('amount');
        $swap =  App\Bill::whereUser_id(Auth::user()->id)->whereStatus(1)->whereType(5)->sum('amount');
?>
<?php if($ncount > 0): ?>

<?php endif; ?>

 <div class="nk-content nk-content-fluid">




                        <div class="container-xl wide-lg">





                        <?php if($ncount > 0): ?>
                        <div class="alert alert-primary">
                                        <div class="alert-cta flex-wrap flex-md-nowrap">
                                            <div class="alert-text"><p> <?php echo e(Auth::User()->username); ?>!, You have <a href="#" class="link link-primary"> <?php echo e($ncount); ?></a>  unread message(s)</p> </div>
                                            <ul class="alert-actions gx-3 mt-3 mb-1 my-md-0">
                                                <li class="order-md-last"><a href="#" class="btn btn-sm btn-warning" type="button" class="close" data-dismiss="alert" aria-label="Close">Close</a></li>
                                                <li class="order-md-last"><a href="<?php echo e(route('inbox')); ?>" class="btn btn-sm btn-primary" type="button"   aria-label="Close">View</a></li>

                                            </ul>

                                        </div>
                                    </div>
                        <?php endif; ?>



  <div class="nk-block-head nk-block-head-sm">
			<div class="nk-block-between">
				<div class="nk-block-head-content">
					<div class="nk-block-des text-soft">
						<h5>
<?php
    /* This sets the $time variable to the current hour in the 24 hour clock format */
    $time = date("H");
    /* Set the $timezone variable to become the current timezone */
    $timezone = date("e");
    /* If the time is less than 1200 hours, show good morning */
    if ($time < "12") {
        echo "Good Morning,";
    } else
    /* If the time is grater than or equal to 1200 hours, but less than 1700 hours, so good afternoon */
    if ($time >= "12" && $time < "17") {
        echo "Good Afternoon,";
    } else
    /* Should the time be between or equal to 1700 and 1900 hours, show good evening */
    if ($time >= "17" && $time < "19") {
        echo "Good Evening,";
    } else
    /* Finally, show good night if the time is greater than or equal to 1900 hours */
    if ($time >= "19") {
        echo "Night Trade,";
    }
    ?> <?php echo e(Auth::User()->fname); ?> <?php echo e(Auth::User()->lname); ?></h5></div>
                                            </div>
                                                </div>

                                 </div>

<style>
			
    .alert-primary {
    color: #000;
    background-color: #f5f6fa;
    border-color: #1ee0ac;
   }
   
   .btn-primary {
    color: #fff;
    background-color: #b6ebcd;
    border-color: #b6ebcd;
    }

    .btn-warning {
    color: #fff;
    background-color: #101924;
    border-color: #101924;
   }

    .cards {
      background-color: #046e2a;
      border-radius: 16px;
      padding: 24px;
      width: 100%;
      max-width: 400px;
      text-align: center;
    }
    
    .bg-primary {
    background-color: #1c2b4617 !important;
    }
    
    .bg-primarys {
    background-color: #fff !important;
    }
    
    .cardss {
      background: linear-gradient(135deg, #365240, #050122);
      border-radius: 16px;
    }
    
    .card {
      background-color: #b6ebcddb !important;
      border-radius: 10px;
    }

    .currency-select {
      background-color: rgba(255, 255, 255, 0.15);
      padding: 8px 16px;
      border-radius: 10px;
      display: inline-flex;
      align-items: center;
      font-weight: bold;
      margin-bottom: 20px;
      margin-right: 10px;
    }

    .currency-select span {
      margin-left: 8px;
      color: green;
    }

    .balance {
    font-size: 25px;
    margin: -25px 0;
    position: relative;
    display: inline-block;
}

    .balance .naira {
      font-weight: bold;
      color: #ffffff;
      margin-right: 4px;
    }

    .eye-icon {
      font-size: 16px;
      position: absolute;
      right: -30px;
      top: 10px;
      opacity: 0.6;
    }

    .actions {
      display: flex;
      justify-content: space-between;
      margin-top: 32px;
    }

    .action-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex: 1;
    }

    .action-icon {
      background-color: rgba(255, 255, 255, 0.15);
      width: 60px;
      height: 60px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 8px;
    }

    .action-label {
      font-size: 14px;
      font-weight: 500;
      color: #fff;
    }

    svg {
      fill: white;
      width: 24px;
      height: 24px;
    }
    
    .btn-outline-primary {
    color: #fff;
    border-color: #6576ff;
    background-color: #6576ff;
   }
   
   .nk-wgw-title {
       color: black;
   }
   
   .nk-wgw-inner {
       color: black;
   }
   
   .btn-primarys {
    color: #fff;
    background: linear-gradient(135deg, #000, #365240);
    border-color: #ebeef2;
    
   }
   
   .big-bal {
    font-weight: 800;
    color: #fff;
    font-family: monospace;
   }
   .space {
       margin-bottom: -10px;
   }
   .ngn-circle {
      border-radius: 9999px;
      border: 1.5px #fff solid;
   }
   
   .rounded-full {
       border-radius: 9999px;
   }
   
   .balance2 {
    font-size: 15px;
    color: #b7c2d0;
    line-height: 1.2;
    margin-bottom: 0px;
}

.container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  background: #fff;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  max-width: 600px;
  margin-left: 10px;
  margin-right: 10px;
}

.icon-box {
  text-align: center;
}

.icons {
    position: relative;
    background: #b6ebcddb;
    border-radius: 15%;
    width: 38px;
    height: 38px;
    margin: auto;
    display: flex
;
    align-items: center;
    justify-content: center;
}

.icon img {
  width: 28px;
  height: 28px;
}

.badge {
  position: absolute;
  top: -8px;
  left: -8px;
  background-color: #ff5c75;
  color: #fff;
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 12px;
}

.icon-box p {
  margin-top: 8px;
  font-size: 14px;
  color: #444;
}

.img-icon {
    
    max-width: 60%;
}
   
  </style>

                     <div class="nk-content-body">
                                <div class="nk-block">
                                    <div class="row gy-gs">
                                         <div class="col-lg-5 col-xl-6">
                                            <div class="nk-block">
                                                <div class="nk-block-head-xs">
                                                <div class="nk-block">
                                                    <div class="cards">
    <h6 class="balance2" style="text-align: left">Available Balance</h6><br>
    <div class="balance">
      <span class="naira">₦</span>
      <span class="big-bal"><?php echo e(number_format(Auth()->user()->balance,2) ?? "0.00"); ?></span>
        </div>
    <div class="actions">
      <div class="action-item"><a href="<?php echo e(route('sellgift')); ?>" style="color: #fff;">
        <div class="action-icon">
          <i class="fa-solid fa-credit-card" "icon-style"></i>
        </div>
        <div class="action-label">Sell Gift Card</a></div>
      </div>
      <div class="action-item"><a href="/user/withdraw" style="color: #fff;">
        <div class="action-icon">
          <i class="fa-solid fa-paper-plane" "icon-style"></i>
        </div>
        <div class="action-label">Withdraw</a></div>
      </div>
      <div class="action-item"><a href="<?php echo e(route('sell')); ?>" style="color: #fff;">
        <div class="action-icon">
          <i class="fa-solid fa-bitcoin-sign" "icon-style"></i>
          </div>
        <div class="action-label">Sell Crypto</a></div>
      </div>
    </div>
  </div>
                                            </div>
                                         </div>
                                    </div>
                                </div>

<div class="container">
    <div class="icon-box">
        <a href="<?php echo e(route('mobilerecharge')); ?>" style="color: #fff;">
      <div class="icons">
        <img src="<?php echo e(asset('assets/images/icon/airtime.png')); ?>" alt="Airtime" class="img-icon" />
      </div>
      <p style="font-size: 13px;">Airtime</p></a>
    </div>
    <div class="icon-box">
        <a href="<?php echo e(route('internetdata')); ?>" style="color: #fff;">
      <div class="icons">
          <span class="badge">Cheap Data</span>
        <img src="<?php echo e(asset('assets/images/icon/data.png')); ?>" alt="Data" class="img-icon" />
      </div>
      <p style="font-size: 13px;">Data</p></a>
    </div>
    <div class="icon-box">
        <a href="<?php echo e(route('sms')); ?>" style="color: #fff;">
      <div class="icons">
        <img src="<?php echo e(asset('assets/images/icon/smssend.png')); ?>" alt="Betting" class="img-icon" />
      </div>
      <p style="font-size: 13px;">Send SMS</p></a>
    </div>
    <div class="icon-box">
        <a href="<?php echo e(route('cabletv')); ?>" style="color: #fff;">
      <div class="icons">
        <img src="<?php echo e(asset('assets/images/icon/tv-icon.png')); ?>" alt="TV" class="img-icon" />
      </div>
      <p style="font-size: 13px;">TV</p></a>
    </div>
    <div class="icon-box">
        <a href="/user/convert-airtime" style="color: #fff;">
      <div class="icons">
        <img src="<?php echo e(asset('assets/images/icon/atc.png')); ?>" alt="Safebox" class="img-icon" />
      </div>
      <p style="font-size: 13px;">ATC</p></a>
    </div>
    <div class="icon-box">
        <a href="<?php echo e(route('electricity')); ?>" style="color: #fff;">
      <div class="icons">
        <img src="<?php echo e(asset('assets/images/icon/electricity.png')); ?>" alt="Electricity" class="img-icon" />
      </div>
      <p style="font-size: 13px;">Electricity</p></a>
    </div>
    <div class="icon-box">
        <a href="<?php echo e(route('referral')); ?>" style="color: #fff;">
      <div class="icons">
        <img src="<?php echo e(asset('assets/images/icon/invitation.png')); ?>" alt="Invitation" class="img-icon" />
      </div>
      <p style="font-size: 13px;">Invitation</p></a>
    </div>
    <div class="icon-box">
        <a href="<?php echo e(route('sell')); ?>" style="color: #fff;">
      <div class="icons">
        <img src="<?php echo e(asset('assets/images/icon/more.png')); ?>" alt="More" class="img-icon" />
      </div>
      <p style="font-size: 13px;">More</p></a>
    </div>
  </div>

												<div class="col-lg-7 col-xl-12">
							<div class="nk-block">
								<div class="nk-block-head-xs">
									<div class="nk-block-between-md g-2">
										<div class="nk-block-head-content">
											<h6 class="nk-block-title title">
												Giftcard Exchange Summary
											</h6>
										</div>
									</div>
								</div>
								<div class="row g-2">
									<div class="col-sm-4 col-6">
									                       <div class="card bg-primary-dim">
                                                            <div class="nk-wgw sm">
                                                                <a class="nk-wgw-inner" href="/user/giftcard-log">
                                                                    <div class="nk-wgw-name">
                                                                        <div class="nk-wgw-icon bg-primary "><em class="icon ni ni-mobile"></em></div>
                                                                        <h5 class="nk-wgw-title title">Total Exchange</h5>
                                                                        <?php
                                                 $count = \App\Giftcardsale::whereUser_id(Auth::user()->id)->count();
                                                 ?>
                                                                    </div>
												<div class="nk-wgw-balance">
												<div class="amousnt">
														<span class="currency currency-nio text-black"><?php echo e($count); ?> Sale(s)
													</div>
												</div>
												</a>
											</div>
										</div>
									</div>
									<div class="col-sm-4 col-6">
									                       <div class="card bg-primary-dim">
                                                            <div class="nk-wgw sm">
                                                                <a class="nk-wgw-inner" href="/user/giftcard-log">
                                                                    <div class="nk-wgw-name">
                                                                        <div class="nk-wgw-icon bg-primary "><em class="icon ni ni-mobile"></em></div>
                                                                        <h5 class="nk-wgw-title title">	Pending Exchange
													</h5>
												</div>
												<div class="nk-wgw-balance">
													<div class="amounst">
														<span class="currency currency-nio text-black"><?php echo e(number_format(App\Giftcardsale::whereUser_id(Auth()->user()->id)->where('status','==', '0')->orderBy('id','desc')->sum('amount'),2) ?? "0.00"); ?><?php echo e($basic->currency); ?>

													</div>
												</div>
												</a>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<br>
			<div class="nk-block">
				<div class="nk-block-head-xs">
					<div class="nk-block-between-md g-2">
						<div class="nk-block-head-content">
							<h6 class="nk-block-title title">
								Cryptocurrency Sales Summary
							</h6>
						</div>
					</div>
				</div>
				<div class="row g-2">
					<div class="col-sm-4 col-6">
					                       <div class="card bg-primary-dim">
                                                            <div class="nk-wgw sm">
                                                                <a class="nk-wgw-inner" href="/user/sales-log">
                                                                    <div class="nk-wgw-name">
                                                                        <div class="nk-wgw-icon bg-primary "><em class="icon ni ni-mobile"></em></div>
                                                                        <h5 class="nk-wgw-title title">Total Sales
									</h5>
									 <?php
                                                 $count = \App\Trx::whereType(0)->whereUser_id(Auth::user()->id)->count();
                                                 ?>
								</div>
								<div class="nk-wgw-balance">
									<div class="amosunt">
										<span class="currency currency-nio text-black"> <?php echo e($count); ?> Sale(s)
									</div>
								</div>
								</a>
							</div>
						</div>
					</div>
					<div class="col-sm-4 col-6">
					                       <div class="card bg-primary-dim">
                                                            <div class="nk-wgw sm">
                                                                <a class="nk-wgw-inner" href="/user/purchase-log">
                                                                    <div class="nk-wgw-name">
                                                                        <div class="nk-wgw-icon bg-primary "><em class="icon ni ni-mobile"></em></div>
                                                                        <h5 class="nk-wgw-title title">Pending Sales
									</h5>
								</div>
								<div class="nk-wgw-balance">
									<div class="amosunt">
										<span class="currency currency-nio text-black"><?php echo e($basic->currency_sym); ?> <?php echo e(number_format($spend, $basic->decimal)); ?>

									</div>
								</div>
								</a>
							</div>
						</div>
					</div>
				
					</div>
				</div>
			</div>
                        </div>
                    </div></div></div></div></div></div>

                    <div class="modal fade" tabindex="-1" role="dialog" id="compose-mail"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-header"><h6 class="modal-title">Create New Ticket</h6><a href="#" class="close" data-dismiss="modal"><em class="icon ni ni-cross-sm"></em></a></div><div class="modal-body p-0"><div class="nk-reply-form-header">

<form action="<?php echo e(route('post.ticket')); ?>" method="post" enctype="multipart/form-data">
<?php echo csrf_field(); ?>

 </div><div class="nk-reply-form-editor">



 <div class="nk-reply-form-editor">
 <div class="nk-reply-form-field"><input type="text" required  name="subject" class="form-control form-control-simple" placeholder="Subject"></div><div class="nk-reply-form-field"><textarea name="body" required class="form-control form-control-simple no-resize ex-large" id="temp" placeholder="Hello"></textarea></div></div>


  <select required  class="form-control" placeholder="Hello" required name="desk"><div class="coin-icon" id="icon1"><em class="icon ni ni-sign-usdc-alt" ></em></div>
<option> Select Desk</option>
<option   value="Abuse">Abuse </option>
<option  value="Complaint">Complaint </option>
<option  value="Request">Request </option>
<option  value="Sales">Sales </option>
<option  value="Support">Support </option>

</select>
</div>

 <div class="nk-reply-form-tools"><ul class="nk-reply-form-actions g-1"><li class="mr-2"><button class="btn btn-primary" type="submit">Create/Send</button></li><li><div class="dropdown"><a class="btn btn-icon btn-sm btn-tooltip" data-toggle="dropdown" title="Templates" href="#"><em class="icon ni ni-hash"></em></a><div class="dropdown-menu"><ul class="link-list-opt no-bdr link-list-template"><li class="opt-head"><span>Quick Insert</span></li>
  <script type="text/javascript">

function goDoSomething2(identifier){

                                     document.getElementById("temp").value = $(identifier).data('temp');

                                              }

                                        </script>

  <li><a href="#" onclick="goDoSomething2(this);"  data-temp="Hello admin, please i need assistance from you"><span>Assistance</span></a></li><li><a href="#" onclick="goDoSomething2(this);"  data-temp="Thank you for the response"><span>Thank you message</span></a></li></ul></div></div></li><li><a class="btn btn-icon btn-sm" data-toggle="tooltip" data-placement="top" title="Upload Attachment" href="#"><em class="icon ni ni-clip-v"></em></a></li> </ul> </div></div></div></div></div></div>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('include.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>