     <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>
                   Manage Enquiries
                </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 Enquiries</li><li class="active">All Enquiries</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 All Enquiries</div>
      <div class="panel-body">
        <table class="table table-striped table-responsive table-bordered dataTable" id="example-2">
        	<thead>
												<tr>
													<th>S.No.</th>
                                                    <th>Date</th>
													<th>Name</th>
                  									<th>Subject</th>
                  									<th>Message</th>
													<th>Action</th>
												</tr>
											</thead>
			<tbody>
                                            <?php  $i=1;foreach($contacts as $user){?>
                                            <tr>
                                            	<td><?php echo $i;?></td>
                                                <td><?php echo date("d M Y",strtotime($user->cn_date));?></td>
                                                <td><?php echo $user->cn_name.'<br/>'.$user->cn_phone.'<br/>'.$user->cn_email;?></td>
                                                <td><?php echo $user->cn_subject;?></td>
                                                <td><?php echo $user->cn_msg;?></td>
                                                <td><button type="button" id="<?php echo $user->cn_id;?>" class="btn btn-danger btn-sm enq_delete"><i class="fa fa-trash"></i></button></td> 
                                            </tr>
                                            <?php $i++;}?>
                                            </tbody>
        </table>
      </div>
    </div>
                        </div>
                        
                        
                    </div>
                    
                    
                </div>
            </div>
            <!-- /.content -->
        </div>
        
        <div class="modal fade" id="newclient" role="dialog">
                    <div class="modal-dialog">
                      <div class="modal-content">
                        <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal">&times;</button>
                          <h4 class="modal-title">Add New Client</h4>
                        </div>
                        <div class="modal-body">
                          <form  method="post" action="<?php echo base_url().'admin/add_user';?>" enctype="multipart/form-data">
                          	<div class="form-group">
                            	<label>Name</label>
                                <input type="text" class="form-control" name="name" required />
                            </div>
                            <div class="form-group">
                            	<label>Mobile</label>
                                <input type="text" class="form-control" name="mobile" required />
                            </div>
                            <div class="form-group">
                            	<label>Email</label>
                                <input type="text" class="form-control" name="email" required />
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label>Username</label>
                                    <input type="text" class="form-control" name="username" required />
                                </div>
                                <div class="form-group col-md-6">
                                    <label>Password</label>
                                    <input type="text" class="form-control" name="password" required />
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label>Aadhar Number</label>
                                    <input type="text" class="form-control" name="aadhar_number" />
                                </div>
                                <div class="form-group col-md-6">
                                    <label>PAN Number</label>
                                    <input type="text" class="form-control" name="pan_number" />
                                </div>
                                <div class="col-md-6">
                                    <label>Aadhar Doc</label>
                                    <input type="file" class="btn btn-success" name="aadhar" />
                                </div>
                                <div class="col-md-6">
                                    <label>Pan Doc</label>
                                    <input type="file" class="btn btn-success" name="pan" />
                                </div>
                            </div>
                            <button type="submit" class="btn btn-primary">Create Account</button>
                          </form>
                        </div>
                      </div>
                    </div>
                  </div>
        <div class="modal fade" id="myModalp" role="dialog">
                    <div class="modal-dialog modal-sm">
                      <div class="modal-content">
                        <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal">&times;</button>
                          <h4 class="modal-title"><b id="agentname" class="text-success"></b> Password</h4>
                        </div>
                        <div class="modal-body">
                          <form class="form" action="" method="post" id="changepass">
                          <input type="hidden" name="agentid" id="agentid" value="" />
                          
                          	<div class="form-group label-floating">
                            <label class="control-label">Password</label>
                                <input type="password" name="npass" required id="edit_pass" class="form-control" >
                            </div>
                            <div class="form-group label-floating">
                            <label class="control-label">Password Confirm </label>
                                <input type="password" name="cpass" required id="edit_pass_change" class="form-control">
                            </div>
                            <b class="text-danger" id="passch"></b>
                            <button type="submit" class="btn btn-warning">Change Password</button>
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                          </form>
                        </div>
                      </div>
                    </div>
                  </div>
        <div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog modal-md">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Customer Account</h4>
      </div>
      <div class="modal-body">
      <div class="row">
      	<div class="col-md-6" id="bankdetails">
        	
        </div>
        <div class="col-md-6">
        	<form action="" method="post" id="addmoney">
        	<input type="hidden" name="user" value="" id="userid" />
        	<input type="hidden" name="usdamt" value="" id="usdamt" />
        	<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">
                <?php $admin=$this->db->get("admin")->row();
				?>
                <b class="pull-right text-danger" id="usd"></b>
            	<label>Amount In Rs (USD <?php echo $admin->exchg_rate;?>)</label>
                <input type="text" required value="" id="amount" 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>
      </div>
      </div>
    </div>

  </div>
</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; 2026 <a href="#">Money Forex </a>.</strong> All rights reserved.
        </footer>
    </div>
   <script>
	$(document).ready(function(){
		$("#amount").keyup(function(){
			var amt=$(this).val();
			var rate=<?php echo  $admin->exchg_rate;?>;
			var usd=parseFloat(amt/rate).toFixed(2);
			$("#usd").text(usd);
			$("#usdamt").val(usd);
			
		});
		$(".enable").click(function(e){e.preventDefault();

			var st=$(this).text();

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

			if(st=="Enable"){

			$(this).text("Disable");

			}else{

			$(this).text("Enable");	

			}

			$.ajax({
				 type: "POST",
				 url: '<?php echo base_url();?>admin/userenable',
				 data: {id:id,st:st},
				 success: function(response){
					 //alert(response);
				 }
			});
		});
		$(".in_feat").click(function(){
							var id=$(this).val();
							var v="";
							if ($(this).is(':checked')) {
								var v='yes';
							}
							//alert(v);
							$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/mega_trade',
							 data: {v:v,id:id},
							 success: function(response){
								// alert(response);
							 }
							 });
						});
		$(".open_popup").click(function(e){e.preventDefault();
			var name=$(this).attr("title");//alert(name);
			var id=$(this).attr("id");
			$("#agentid").val(id);
			$("#agentname").text(name);
		});
	$("#changepass").submit(function(e){e.preventDefault();//alert("Asdf"); 
								var formdata=$(this).serialize();
								$.ajax({
								 type: "POST",
								 url: '<?php echo base_url();?>admin/agent_change_pass',
								 data: {formdata:formdata},
								 success: function(res){
								//alert(res);
								$("#passch").html(res);
								}
								 }); 
							});
	    $(".addmoney").click(function(e){e.preventDefault();
			var id=$(this).attr("id");
			$("#userid").val(id);
			 $("#bankdetails").html("Loading Details...");
			$.ajax({
					 type: "POST",
					 url: '<?php echo base_url();?>admin/bankdetails',
					 data: {id:id},
					 success: function(response){
						 $("#bankdetails").html(response);
						}
					 });
		});
		$("#addmoney").submit(function(e){e.preventDefault();
			var formdata=$(this).serialize();
			$.ajax({
					 type: "POST",
					 url: '<?php echo base_url();?>admin/add_money_submit',
					 data: {formdata:formdata},
					 success: function(response){
						 alert(response);
						}
					 });
				});
		$(".trade_limit_form").submit(function(e){e.preventDefault();
						var formdata=$(this).serialize();
						//alert(formdata);
						$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/trade_limit_form_submit',
							 data: {formdata:formdata},
							 success: function(response){//alert(response);
								//$("#quick_view").html(response);
								}
							 });
						});
					$(".trade_limit").change(function(){
						$(this).closest("form").trigger("submit");
					});
	$(".enq_delete").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/deletecon',
							 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>

