<section role="main" class="content-body">
					<header class="page-header">
						<h2>Manage KYCs</h2>
					
						<div class="right-wrapper pull-right">
							<ol class="breadcrumbs">
								<li>
									<a href="<?php echo base_url();?>admin">
										<i class="fa fa-home"></i>
									</a>
								</li>
								<li><span>Manage KYCs</span></li>
							</ol>
					
						</div>
					</header>
						<section class="panel">
							<header class="panel-heading">
								<h2 class="panel-title">List of All KYCs Uploads</h2>
							</header>
							<div class="panel-body">
								<table class="table table-bordered table-striped mb-none" id="datatable-tabletools" data-swf-path="assets/vendor/jquery-datatables/extras/TableTools/swf/copy_csv_xls_pdf.swf">
       		 <thead>
												<tr>
													<th>S.No.</th>
													<th>Name/Username</th>
													<th>Document</th>
                                                    <th>Status</th>
                                                    <th>Remark</th>
													<!--<th>Action</th>-->
												</tr>
											</thead>
			<tbody>
                                            <?php  $i=1;foreach($docs as $user){?>
                                            <tr>
                                            	<td><?php echo $i;?></td>
                                                <td><i class="fa fa-user"></i> <?php echo $user->first_name.' '.$user->last_name;?><br/>
                                                <label class="label label-default"><?php echo $user->username;?></label></td>
                                                <td><?php echo $user->doc_type.' <br/>ID Number <b>['.$user->doc_number.']</b>';?><br/><a href="<?php echo base_url().'assets/images/products/'.$user->doc;?>" download class="btn btn-xs btn-default"><i class="fa fa-download"> Download</i></a></td>
                                                <td><?php if($user->doc_status==""){?>
                            <span class="label label-warning">Pending</span><?php }
							if($user->doc_status=="Reject"){?>
                            <span class="label label-danger">Reject</span><?php }
							if($user->doc_status=="Approved"){?>
                            <span class="label label-success">Approved</span><?php }?></td>
                            <td><form action="" method="post" class="approve_form">
                            	<input type="hidden" name="uid" value="<?php echo $user->id;?>" />
                            		<select name="status" class="appr_form" style="    height: 30px;
    padding: 0px;">
                                    	<option value="">Pending</option>
                                    <option value="Reject" <?php if($user->doc_status=="Reject"){echo "selected";}?>>Reject</option>
                                    <option value="Approved" <?php if($user->doc_status=="Approved"){echo "selected";}?>>Approved</option>
                                        </select><br/>
                                        <textarea name="remarks" class="remarks" rows="2"><?php echo $user->doc_remarks;?></textarea>
                                </form></td>
                            <!--<td><a class="btn btn-xs btn-danger docdelete" title="delete"  href="#" id="<?php echo $user->id;?>"><i class="fa fa-trash"></i></a></td>--></tr>
                                            </tr>
                                            <?php $i++;}?>
                                            </tbody>
        </table>
							</div>
						</section>
				</section>
                
			</div>

			
		</section>

		<!-- Vendor -->
        <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");
					});
					
					$(".docdelete").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/docdelete',
										 data: {id:id},
										 success: function(response){
											 //alert(response);
										 }
										 });
					});
		
		$('#data-tables').dataTable();
		$(".in_feat").click(function(){
							var id=$(this).val();
							var v="";
							if ($(this).is(':checked')) {
								var v=$(this).val();
							}
							//alert(v);
							$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/in_feat',
							 data: {v:v,id:id},
							 success: function(response){
								// alert(response);
							 }
							 });
						});
		$(".userdel").click(function(e){e.preventDefault();
		if (!confirm("Sure you want to delete?")){
				  return false;
				}
			var id=$(this).attr("href");$(this).closest("tr").remove();
			$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/userdel',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
							 }
							 });
		});
	});
</script>
	<script src="<?php echo base_url();?>admin_assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/bootstrap/js/bootstrap.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/nanoscroller/nanoscroller.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/magnific-popup/magnific-popup.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-placeholder/jquery.placeholder.js"></script>
		
		<!-- Specific Page Vendor -->
		<script src="<?php echo base_url();?>admin_assets/vendor/select2/select2.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-datatables/media/js/jquery.dataTables.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-datatables/extras/TableTools/js/dataTables.tableTools.min.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-datatables-bs3/assets/js/datatables.js"></script>
		
		<!-- Theme Base, Components and Settings -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.js"></script>
		
		<!-- Theme Custom -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.custom.js"></script>
		
		<!-- Theme Initialization Files -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.init.js"></script>


		<!-- Examples -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/tables/examples.datatables.default.js"></script>
		<script src="<?php echo base_url();?>admin_assets/javascripts/tables/examples.datatables.row.with.details.js"></script>
		<script src="<?php echo base_url();?>admin_assets/javascripts/tables/examples.datatables.tabletools.js"></script>
</body>
</html>