<div class="breadcrumb-oitila db-breadcrumb">
                <div class="container">
                    <div class="row justify-content-lg-around">
                        <div class="col-xl-6 col-lg-7 col-md-5 col-sm-6 col-8">
                            <div class="part-txt">
                                <h1>Deposite</h1>
                                <ul>
                                    <li>home</li>
                                    <li>Add Funds to Account</li>
                                </ul>
                            </div>
                        </div>
                        <div class="col-xl-6 col-lg-5 col-md-7 col-sm-6 col-4 d-flex align-items-center">
                            <div class="db-user-profile">
                                <div class="part-data">
                                    <span class="name"><?php echo $this->session->userdata("name");?></span>
                                    <ul>
                                        <li>
                                            <span class="text">ClientID</span>
                                            <span class="number"><?php echo 'CL00'.$this->session->userdata("user");?></span>
                                        </li>
                                        <li>
                                            <span class="text">Balance</span>
                                            <span class="number"><?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;}?></span>
                                        </li>
                                    </ul>
                                </div>
                                <div class="part-img">
                                    <img src="<?php echo base_url();?>frontend/assets/img/member-1.jpg" alt="">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- breadcrumb end -->

            <!-- account begin -->
            <div class="user-dashboard">
                <div class="container">

                    <div class="dashboard-menu">
                        <nav>
                            <ul>
                                <li class="nav-item">
                                    <a class="nav-link" href="<?php echo base_url();?>dashboard">Dashboard</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link active" href="#">Deposite</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="<?php echo base_url();?>withdrawls">Withdrawl</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="<?php echo base_url();?>transactions">Transactions</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="<?php echo base_url();?>account">My Profile</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="<?php echo base_url();?>logout">Logout</a>
                                </li>
                            </ul>
                        </nav>
                    </div>

                    <div class="user-statics">
                        <div class="row">
                            <div class="col-xl-3 col-lg-4 col-md-6 col-sm-6">
                                <div class="single-statics">
                                    <div class="part-icon">
                                        <img src="<?php echo base_url();?>frontend/assets/img/icon/002-cash.png" alt="">
                                    </div>
                                    <div class="part-info">
                                        <span class="number">₹<?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;}?></span>
                                        <span class="text">Wallet Balance</span>
                                    </div>
                                </div>
                                <div class="single-statics">
                                    <div class="part-icon">
                                        <img src="<?php echo base_url();?>frontend/assets/img/icon/004-hourglass.png" alt="">
                                    </div>
                                    <div class="part-info">
                                     <?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();?>
                                        <span class="number">₹<?php if($this->db->get_where("deposites",array("userid"=>$this->session->userdata("user")))->num_rows()>0){echo $pending->dep_amt;}else{echo 0;}?></span>
                                        <span class="text">Pending Deposite</span>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-9">
                            <div class="row">
                            <div class="col-xl-4 col-lg-4 col-md-4">
                                <h3 class="title">Add to Wallet</h3>
                                <div class="last-step">
                                    <div>
                                    <label>Enter Your Amount</label>
                                    <form action="" method="post" id="depo_form">
                                        <span class="currency-symbol" id="basic-addon1">₹</span>
                                        <input type="text" class="inputted-amount" name="amount" required value="5000">
                                        <textarea name="depo_remarks" placeholder="Deposite Remarks" style="margin-top:5px;" class="form-control" rows="2"></textarea>
                                        <br/>
                                        <button type="submit" class="btn btn-info">Add Funds</button>
                                    </form>
                                </div>
                            </div>
                            
                        </div>
                            <div class="col-xl-4 col-lg-4 col-md-4">
                                            <table class="table table-condensed table-bordered" style="background:#d4cbff;">
                <tbody>
				<?php $bank=$this->db->get("banks")->result();
					  foreach($bank as $b){?>
                      <tr><th bgcolor="#7f5be9" style="color:#fff;"><?php echo $b->bank_name;?></th></tr>
                      <tr><td><small>Account Name</small><br/><b class="text-primary"><?php echo $b->acc_name;?></b></td></tr>
                      <tr><td><small>Account Number</small><br/><b class="text-primary"><?php echo $b->acc_number;?></b></td></tr>
                      <tr><td><small>IFSC Code</small><br/><b class="text-primary"><?php echo $b->ifsc_code;?></b></td></tr>
                      <tr><td><small>Account Type</small><br/><b class="text-primary"><?php echo $b->acc_type;?></b></td></tr>
                      <?php }?>
                      </tbody>
                      </table>
                                            </div>
                            <div class="col-xl-4 col-lg-4 col-md-4">
                            <table class="table table-condensed table-bordered" style="background:#d4cbff;">
                            <tr><th bgcolor="#7f5be9" style="color:#fff;">Scan & Pay with QR</th></tr>
                            <tr><td>
			<img class="img img-responsive" src="<?php echo base_url().'assets/qr.jpg';?>" width="100%" /></td></tr>
                            </table>
                                            </div>
                                            <div class="col-xl-12 col-lg-12 col-md-12">
                                <h3 class="title">Deposites</h3>
                                    <table id="fullMcxPriceTable" class="display misco-data-table" style="width:100%">
            <thead><tr bgcolor="#d4cbff"><th>S.No.</th><th>Date</th><th>Amount</th><th>Status</th><th>Remarks</th><th>Action</th></tr></thead>
            <tbody>
          	<?php $this->db->order_by("depid","desc");$this->db->limit(100);
				  $data=$this->db->get_where("deposites",array("userid"=>$this->session->userdata("user")))->result();
				  $i=1;foreach($data as $d){?>
                  <tr><td><?php echo $i;?></td>
                  	  <td><?php echo date("d-m-Y",strtotime($d->dep_submit_date));?></td>
                      <td><?php echo $d->dep_amt;?><br/><span class="badge badge-info"><?php echo $d->dep_remarks;?></span></td>
                      <td><?php if($d->dep_status=='Pending'){echo '<span class="badge badge-warning">Pending</span>';}else
					  if($d->dep_status=='Reject'){echo '<span class="badge badge-danger">Rejected</span>';}else{
					  echo '<span class="badge badge-success">Approved</span>';}?></td>
                      <td><?php echo $d->admin_remarks;?></td>
                      <td>
                      <?php if($d->dep_status=="Pending"){?>
                      <a class="btn btn-sm btn-danger depdelete" title="delete"  href="#" id="<?php echo $d->depid;?>"><i class="fa fa-times"></i> Cancel</a>
                      <?php }?></td></tr>
                  <?php $i++;}?></tbody>
                  </table>
                            </div>
                            </div>
                            </div>
                    </div>
                </div>
            </div>
			<script>



	$(document).ready(function(){
		//alert("adsf");
		$("#depo_form").submit(function(e){e.preventDefault();
			var formdata=$(this).serialize();
			//alert(formdata);
			$.ajax({
			 type: "POST",//dataType:'json',
			 url: '<?php echo base_url();?>home/ajax_depo_submit',
			 data: {formdata:formdata},
			 success: function(res){//alert(res.target);
					alert(res);
				 }
			 });
		});
		
		
		$(".depdelete").click(function(e){e.preventDefault();



		if (!confirm("Sure you want to cancel deposite request?")){



				  return false;



				}



			var id=$(this).attr("id");



			$(this).closest("tr").remove();



			$.ajax({



							 type: "POST",



							 url: '<?php echo base_url();?>home/depdelete',



							 data: {id:id},



							 success: function(response){



								 //alert(response);



							 }



							 });



		});

		$(".wdelete").click(function(e){e.preventDefault();



		if (!confirm("Sure you want to cancel withdrawal request?")){



				  return false;



				}



			var id=$(this).attr("id");



			$(this).closest("tr").remove();



			$.ajax({



							 type: "POST",



							 url: '<?php echo base_url();?>home/wdelete',



							 data: {id:id},



							 success: function(response){



								 //alert(response);



							 }



							 });



		});

	});



</script>
            