
      	<div class="col-md-6">

        	
<?php $user=$this->db->get_where("users",array("id"=>$userid))->row();
		$this->db->order_by("trid","desc");
							  $chk=$this->db->get_where("transaction",array("userid"=>$userid));
								if($chk->num_rows()>0){
									$l=$chk->row();
									//print_r($l);
									// $wallet=$l->left_amt;
									 $this->db->select_sum('ubrok');  
									  $this->db->where("status","EXIT"); 
									  $this->db->where("uid",$userid); 
									  $br=$this->db->get('buysell')->row();
	  
									$wallet=$l->left_amt-$br->ubrok;
									 
									 
									 }else{ $wallet=0;}echo 'Wallet Balance '.$wallet.'<br/>';
		if($user->bank_name!=""){
		?>
        <table class="table table-condensed table-bordered">
        	<tr><th>Bank Name</th><td><?php echo $user->bank_name;?></td></tr>
        	<tr><th>A/c Holder</th><td><?php echo $user->acc_holder;?></td></tr>
        	<tr><th>A/c Number</th><td><?php echo $user->acc_no;?></td></tr>
        	<tr><th>IFSC Code</th><td><?php echo $user->ifsc;?></td></tr>
        	<tr><th>A/c Type</th><td><?php echo $user->acc_type;?></td></tr>
        </table> 
        <?php 	}else{echo '<h3 class="text-danger">Bank Details Not Updated</h3>';}?>
        </div>

        <div class="col-md-6">

        	<form action="" method="post" id="addmoney">

        	<input type="hidden" name="user" value="<?php echo $userid;?>" id="userid" />

        	<div class="form-group">

            	<label>Type</label>

                <select class="form-control" name="type" required>

                	<option value="Credit">Credit</option>

                	<option value="Debit">Debit</option>

                </select>

            </div>

            <div class="form-group">

            	<label>Amount</label>

                <input type="text" required value="" name="amount" class="form-control" />

            </div>

            <button type="submit" name="submit" class="btn btn-success">Submit</button>

        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

        </form>
        
        

      </div>

      <script>
	  
	    $("#addmoney").submit(function(e){e.preventDefault();
		var formdata=$(this).serialize();
		//console.log(formdata);return false;
		$.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>swadmin/add_money_submit',
				 data: {formdata:formdata},
				 success: function(response){
					 alert(response);
					}
			});
		});
	  </script>