<div class=" pb-5 page-title d-block">
    <div class="container-fluid">
        <div class="row">
            <div class="col-12">
                <p class="h5 text-primary fw-bold">
                    Hi, <span class="text-gray"><?php echo $this->session->userdata("name");?></span>
                </p>
            </div>
        </div>
    </div>
</div>
<section class="pb-5">
		<style>
		.btn-default{background:#CCC;}
		</style>
        <div class="container-fluid">
            <div class="row g-4 mb-4">
                <div class="col-12 col-lg-4 col-xl-3">
                    <div class="card border-0">
                        <div class="card-body p-0">
                            
                            <ul class="list-unstyled">
                                <li class="d-flex justify-content-between align-items-center p-3 mb-3 rounded-5" style="background:#8efbb4;">
                                    <div class="d-flex align-items-center">
                                        <i class="cc BTC me-3 fs-3"></i>
                                        <h5 class="h6 fw-semi-bold">Wallet Balance</h5>
                                    </div>
                                    <div class="text-end">
                                        <h5 class="h6 fw-semi-bold">
                                            <?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();

                   echo $wallet=$l->left_amt;}else{echo $wallet=0;}?>
                                        </h5>
                                    </div>
                                </li>
                                <li class="d-flex justify-content-between align-items-center p-3 mb-3 rounded-5" style="background:#ffbb55;">
                                    <div class="d-flex align-items-center">
                                        <i class="cc LTC me-3 fs-3"></i>
                                        <h5 class="h6 fw-semi-bold">
                                            Pending Deposite
                                        </h5>
                                    </div>
                                    <div class="text-end">
                                        <h5 class="h6 fw-semi-bold">
                                             <?php $this->db->select_sum('dep_amt');  

					  $this->db->where("dep_status","Pending"); 

					  $this->db->where("userid",$this->session->userdata("user"));

					  $chk= $this->db->get('deposites');

					 // echo $chk->num_rows();

					  $pending=$chk->row();if($this->db->get_where("deposites",array("userid"=>$this->session->userdata("user")))->num_rows()>0){echo $pending->dep_amt;}else{echo 0;}?>
                                        </h5>
                                    </div>
                                </li>
                                
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="col-12 col-lg-12 col-xl-9">
                	<table class="table table-striped table-bordered" id="example-2">



        	<thead>



												<tr>



													<th>S.No.</th>



                                                    <th>Date</th>



                                                    <th>Trans.Type</th>



                                                    <th>Limit</th>



                                                    <th>Stoploss</th>



                                                    <th>Target</th>



                                                    <th>Sq.Off</th>



                                                    <th>Amount</th>



                                                    <th>Credit/Debit</th>




                                                    <th>Balance</th>






												</tr>



											</thead>



			<tbody>



                                            <?php  $i=1;foreach($report as $r){?>



                                            <tr>



                                            	<td><?php echo $i;?></td>



                                            	<td><?php echo $r->tr_date;?></td>



                                            	<td><?php if($r->buysell_id!=""){echo $r->metal.' '.$r->type;}else{echo $r->tr_desc;}?></td>



                                            	<td><?php echo $r->setlimit;?></td>



                                                <td><?php echo $r->stoploss;?></td>



                                                <td><?php echo $r->target;?></td>



                                                <td><?php echo $r->last_live;?></td>



                                                <td><?php echo $r->tr_amt;?></td>



                                                



                                            	<td><?php if($r->tr_type=='Credit'){echo '<label class="badge badge-success">Credit</label>';}else{echo '<label class="badge badge-danger">Debit</label>';}?></td>



                                            	<td><?php echo $r->left_amt;?></td>



                                            	



                                            </tr>



                                            <?php $i++;}?>



                                            </tbody>



        </table>
                </div>

                
            </div>

            
        </div>
    </section>
    
<div class="copyrights bg-light-200 border-gray-light py-4">
    <div class="container-fluid">
        <div class="row">
            <div class="col-12 col-sm-9 col-md-8">
                <p class="mb-0 text-center text-sm-start text-gray fs-6">
                    © Copyright 2021
                    <a href="3" target="_blank" class="copyright-links fw-bold text-gray ms-1 text-hover-primary">
                        Ample Commodity
                    </a>
                    I All Rights Reserved.
                </p>
            </div>
        </div>
    </div>
</div>
</div>


        </div>
        
    <script src="<?php echo base_url();?>newsite/dashboard.js.download"></script>
<script src="<?php echo base_url();?>newsite/validator-init.js.download"></script>
<script src="<?php echo base_url();?>newsite/waves.min.js.download"></script>
<script src="<?php echo base_url();?>newsite/scrollIt.js.download"></script>
<script src="<?php echo base_url();?>newsite/scrollit-init.js.download"></script>
<script src="<?php echo base_url();?>newsite/helpscout-init.js.download"></script>
<script src="<?php echo base_url();?>newsite/scripts.js.download"></script>
    

</body></html>