<main class="margin mt-0">
				<div class="dash-balance">
					<div class="dash-content relative">
						<h3 class="w-text">Dashboard</h3>
						<div class="notification">
							<a href="#"><i class="fa fa-plus"></i></a>
						</div>
					</div>
				</div>
				<?php $this->db->order_by("trid","desc");
                $chk=$this->db->get_where("transaction",array("userid"=>$this->session->userdata("user")));
                if($chk->num_rows()>0){
                    $l=$chk->row();
                    //print_r($l);
                    $wallet=$l->left_amt;}else{$wallet=0;}
					if($this->db->get_where("deposites",array("userid"=>$this->session->userdata("user")))->num_rows()>0){
				      $this->db->select_sum('dep_amt');  
					  $this->db->where("dep_status",""); 
					  $this->db->where("userid",$this->session->userdata("user")); 
					  $pending=$this->db->get('deposites')->row();
					  $pending=$pending->dep_amt;
					}else{
					$pending=0;	
					}?>
				<section class="bal-section container">
                	<div class="col-6 pull-left">
					<div class="balance-card mb-15">
						<div class="d-flex align-items-center">
	                        <div class="d-flex flex-grow">
	                          <div class="mr-auto">
	                            <h1 class="b-val"> <i class="fa fa-inr"></i><?php echo $wallet;?> </h1>
	                            <p class="g-text mb-10">Wallet Balance</p>
                                <a href="#" class="btn btn-success btn-sm" id="refresh"><i class="fa fa-refresh"></i> Refresh</a>
	                          </div>
	                        </div>
	                     </div>
					</div>
                    </div>
                    <div class=" col-6 pull-right">
                    <div class="balance-card mb-15">
						<div class="d-flex align-items-center">
	                        <div class="d-flex flex-grow">
	                          <div class="mr-auto">
	                            <h1 class="b-val"> <i class="fa fa-inr"></i><?php echo $pending;?> </h1>
	                            <p class="g-text mb-10">Pending Balance</p>
                                <button class="btn btn-sm btn-warning">Add Funds</button>
	                          </div>
	                        </div>
	                     </div>
					</div>
                    </div>
				</section>
				<script>
				socket.on("tr_emit",function(data){
				//console.log(data.trid);
					//$("tr#"+data.trid).html(data.trdata);
				console.log(data);
				//	$("tr#"+data.trid+" td:nth-child(2)").css("background-color",data.color);
					//setTimeout(function(){ $("tr#"+data.trid+" td:nth-child(2)").css("background","none"); }, 2000);
				});
				</script>
				<section class="container">
					<h4 class="title-main">Recent Transactions</h4>
					<ul class="transaction-list list-unstyled">
						<?php $metals=$this->db->get("metals")->result();
                        foreach($metals as $d){?>
                        <li>
							<div class="d-flex align-items-center justify-content-between">
	                          <div class="d-flex align-items-center">
	                            <img class="img-xs" src="<?php echo base_url();?>assets/img/content/coin1.png" alt="coin image">
	                            <div class="ml-10">
	                              <h4 class="coin-name"><?php echo $d->metal;?></h4>
	                              <small class="text-muted">08-24 <span class="ml-10">20.04PM</span></small>
	                            </div>
	                          </div>
	                          <div>
	                            <h3 class="d-block mb-0 txt-green">+0.94853</h3>
	                          </div>
	                        </div>
						</li>
                        <?php }?>
					</ul>
				</section>

				