     <link rel="stylesheet" href="<?php echo base_url();?>newadminassets/plugins/datatables/dataTables.bootstrap.min.css">
    <link rel="stylesheet" href="<?php echo base_url();?>newadminassets/plugins/datatables/responsive.bootstrap.min.css">
<div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                   Deposite
                </h1>
              <ol class="breadcrumb">
                    <li><a href="<?php echo base_url();?>admin"><i class="fa fa-home"></i>Home</a></li>
                    <li class="active">Manage Users</li><li class="active"><?php echo $this->uri->segment(3);?> Deposite</li>
                </ol>
            </section>
            <!-- Main content -->
            <div class="content">
           
                <div class="container-fluid">
                 
                    <!-- Tabs -->
                    <!-- third row  -->
                    <div class="row"> 
                       <div class="col-md-12 col-sm-12">
                       <?php if($this->session->flashdata("msg")!==""){?>
                          <!--<div class="alert alert-info">
                                            <strong><?php echo $this->session->flashdata("msg");?>!</strong> 
                                        </div>--><?php }?>
                            <div class="panel panel-primary">
      <div class="panel-heading">Listing <?php echo $this->uri->segment(3);?> Deposites</div>
      <div class="panel-body">
        <table class="table table-striped table-responsive table-bordered dataTable" id="example-2">
                    <thead bgcolor="#666666" style="color:#FFF;"><tr><th>S.No.</th><th>Date</th><th>Amount</th><th>User</th><th>Receit</th><th>Status</th><th>Remark</th><th>Action</th></tr></thead>
                    <tbody>
                        <?php $i=1;foreach($deposites as $dep){?>
                        <tr><td><?php echo $i;?></td>
                            <td><?php echo date("d M'y",strtotime($dep->dep_submit_date));?></td>
                            <td><?php echo $dep->dep_amt.'-$'.$dep->wusd_amt;?></td>
                            <td><?php echo $dep->email.' '.$dep->last_name;?></td>
                            <td><?php 
                            if($dep->rect_copy!=''){?>
    <a href="<?php echo $dep->rect_copy;?>" target="_blank"><img class="img img-responsive" width="100px" src="<?php echo $dep->rect_copy;?>"/></a>
                            <?php };?></td>
                            <td><?php if($dep->dep_status==""){?>
                            <span class="label label-warning">Pending</span><?php }
							if($dep->dep_status=="Reject"){?>
                            <span class="label label-danger">Reject</span><?php }
							if($dep->dep_status=="Approved"){?>
                            <span class="label label-success">Approved</span><?php }?></td>
                            <td><form action="" method="post" class="approve_form">
                            	<input type="hidden" name="depid" value="<?php echo $dep->depid;?>" />
                            	<input type="hidden" name="amt" value="<?php echo $dep->wusd_amt;?>" />
                            	<input type="hidden" name="uid" value="<?php echo $dep->userid;?>" />
                            		<select name="status" class="appr_form">
                                    	<option value="">Pending</option>
                                    <option value="Reject" <?php if($dep->dep_status=="Reject"){echo "selected";}?>>Reject</option>
                                    <option value="Approved" <?php if($dep->dep_status=="Approved"){echo "selected";}?>>Approved</option>
                                        </select><br/>
                                        <textarea name="remarks" class="remarks" rows="2"><?php echo $dep->dep_remarks;?></textarea>
                                </form></td>
                            <td><a class="btn btn-xs btn-danger depdelete" title="delete"  href="#" id="<?php echo $dep->depid;?>"><i class="fa fa-trash"></i></a></td></tr>
                        <?php $i++;}?>
                    </tbody>
                </table>
                <script>
				$(document).ready(function(){
					$(".approve_form").submit(function(e){e.preventDefault();
						var formdata=$(this).serialize();
						//alert(formdata);
						$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/approve_form_submit',
							 data: {formdata:formdata},
							 success: function(response){alert(response);
								//$("#quick_view").html(response);
								}
							 });
						});
					$(".appr_form").change(function(){
						$(this).closest("form").trigger("submit");
					});
					//$(".remarks").keyup(function(){
//						$(this).closest("form").trigger("submit");
//					});
				});
				</script>
      </div>
    </div>
                        </div>
                        
                        
                    </div>
                    
                    
                </div>
            </div>
            <!-- /.content -->
        </div>
  <footer class="main-footer">
            <!-- To the right -->
           <!-- <div class="pull-right hidden-xs">
                Developed by <i class="fa fa-heart"></i> Floatin
            </div>-->
            <!-- Default to the left -->
            <strong>Copyright &copy; 2022 <a href="#">Money Forex </a>.</strong> All rights reserved.
        </footer>
    </div>
   <script>
	$(document).ready(function(){
		$(".depdelete").click(function(e){e.preventDefault();
		if (!confirm("Sure you want to delete?")){
				  return false;
				}
			var id=$(this).attr("id");
			$(this).closest("tr").remove();
			$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/depdelete',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
							 }
							 });
		});
	});
</script>
   <!-- <script>
	$(document).ready(function(){
   function readURL(input,id) {
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            
            reader.onload = function (e) {alert("asfda");
                $('#i'+id).attr('src', e.target.result);
            }
            
            reader.readAsDataURL(input.files[0]);
        }
    }
	$("#imgInp").change(function(){
        readURL(this,"front");
    });
	});
</script>-->
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery-3.1.1.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/bootstrap.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/material.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/ripples.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery.slimscroll.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/dataTables.responsive.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/dataTables.bootstrap.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/jszip.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/pdfmake.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/vfs_fonts.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/buttons.html5.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/buttons.print.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/buttons.colVis.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/datatables.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/app.js"></script>
</body>

