 <div class="breadcome-area">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                            <div class="breadcome-list single-page-breadcome">
                                <div class="row">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                                       &nbsp;
                                    </div>
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                                        <ul class="breadcome-menu">
                                            <li><a href="#">Home</a> <span class="bread-slash">/</span>
                                            </li>
                                            <li><span class="bread-blod">Customer</span>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Basic Form Start -->
        <div class="basic-form-area mg-tb-15">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
                        <div class="sparkline8-list mt-b-30">
                           <?php
						   if($_GET['id'])
							{
							$id=$_GET['id'];
							$sql="select * from customer where id='$id'";
							$r=$this->db->query($sql);
							$rr=$r->result_array();
						//	print_r($rr);
								$name=$rr[0]['name'];
								$email=$rr[0]['email'];
								$mobile=$rr[0]['mobile'];
								$address=$rr[0]['address'];
								$public_ip=$rr[0]['public_ip'];
							
							?>

						   <div class="sparkline8-hd">
                                <div class="main-sparkline8-hd">
                                    <h1>Edit Customer</h1>
                                </div>
                            </div>
                            <div class="sparkline8-graph">
                                <div class="basic-login-form-ad">
                      
                                    <div class="row">
                                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                            <div class="basic-login-inner">
                                                <p></p>
                                                <form role="form" action="<?php echo site_url();?>Customer/update_Customer" method="post" role="form" class="form-horizontal">
												<input type="hidden" name="id" value="<?=$id?>">
													<div class="form-group-inner">
                                                        <label>Name</label>
                                                        <input type="text" name="name" value="<?=$name?>" class="form-control" placeholder="Enter name" />
                                                    </div>
                                                    <div class="form-group-inner">
                                                        <label>Email</label>
                                                        <input type="email" name="email" value="<?=$email?>" class="form-control" placeholder="Customer Email" />
                                                    </div> 
												  <div class="form-group-inner">
                                                        <label>Mobile</label>
                                                        <input type="text" name="mobile" value="<?=$mobile?>" class="form-control" placeholder="Customer mobile" />
                                                    </div> 
												  <div class="form-group-inner">
                                                        <label>Address</label>
                                                        <textarea name="address" class="form-control" placeholder="Customer address" /><?php echo $address?></textarea>
                                                    </div>

													<div class="form-group-inner">
                                                        <label>Public Ip</label>
                                                         <input type="text" name="public_ip" value="<?=$public_ip?>" class="form-control" placeholder="Customer public ip" />
                                                    </div> 
                                                    <div class="login-btn-inner">
                                                        <div class="inline-remember-me">
                                                            <button class="btn btn-sm btn-primary pull-right login-submit-cs" type="submit">Update</button>
                                                          
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                     
                                    </div>
                                </div>
                            </div>
							<?php
							}
							else
							{
								?>
								 <div class="sparkline8-hd">
                                <div class="main-sparkline8-hd">
                                    <h1>Add New Customer
                            </div>
                            <div class="sparkline8-graph">
                                <div class="basic-login-form-ad">
                      
                                    <div class="row">
                                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                            <div class="basic-login-inner">
                                                <p></p>
                                                <form role="form" action="<?php echo site_url();?>Customer/save_Customer" method="post" role="form" class="form-horizontal">
                                                    <div class="form-group-inner">
                                                        <label>Name</label>
                                                        <input type="text" name="name" class="form-control" placeholder="Enter name" />
                                                    </div>
                                                    <div class="form-group-inner">
                                                        <label>Email</label>
                                                        <input type="email" name="email" class="form-control" placeholder="Customer Email" />
                                                    </div> 
												  <div class="form-group-inner">
                                                        <label>Mobile</label>
                                                        <input type="text" name="mobile" class="form-control" placeholder="Customer mobile" />
                                                    </div> 
												  <div class="form-group-inner">
                                                        <label>Address</label>
                                                        <textarea name="address" class="form-control" placeholder="Customer address" /></textarea>
                                                    </div>

													<div class="form-group-inner">
                                                        <label>Public Ip</label>
                                                         <input type="text" name="public_ip" class="form-control" placeholder="Customer public ip" />
                                                    </div> 
												
                                                    <div class="login-btn-inner">
                                                        <div class="inline-remember-me">
                                                            <button class="btn btn-sm btn-primary pull-right login-submit-cs" type="submit">Submit</button>
                                                          
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                     
                                    </div>
                                </div>
                            </div>
							</div>
								<?php
							}
							?>
							
                        
                    </div>
                    </div>
                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12">
                        <div class="sparkline9-list responsive-mg-b-30">
                            <div class="sparkline9-hd">
                                <div class="main-sparkline9-hd">
                                    <h1>Customer List</h1>
                                </div>
                            </div>
                            <div class="sparkline9-graph">
                                <div class="basic-login-form-ad">
                 
                                    <div class="row">
                                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                            <div class="basic-login-inner">
                                                <p></p>
            <div style="overflow-x:auto;">
              
     <table id="example1" class="table table-striped table-bordered responsive">
        <thead>
            <tr>
				<th>Name</th>
				<th>Email</th>
				<th>Mobile</th>
				<th>Public Ip</th>
				<th>Address</th>
				<th>Edit</th>                
				<th>Delete</th>                
            </tr>
        </thead>
        <tbody>
<?php
foreach($Customer as $r)
{
								
							
?>				
					<tr class="gradeX">
					<td><?=$r['name']?></td>
					<td><?=$r['email']?></td>
					<td><?=$r['mobile']?></td>
					<td><?=$r['address']?></td>
					<td><?=$r['public_ip']?></td>
					<td><a href="<?php echo site_url();?>Customer/Customer?id=<?php echo $r['id']?>" title="Edit Customer" class=""><i class="fa fa-pencil " aria-hidden="true"></i></td>
					<td><a href="<?php echo site_url();?>Customer/delete_Customer/<?php echo $r['id']?>" title="Delete Customer" class=""><i class="fa fa-trash" aria-hidden="true"></i></td>
					</tr>
			
<?php
}
?>
        </tbody>
    </table>
	</div>

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
        </div>
		
			
      <link href="<?php echo site_url();?>assets/css/jquery.dataTables.min.css" rel="stylesheet">
	    <link href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css" rel="stylesheet">
    
	<script src="//code.jquery.com/jquery-1.12.4.js"></script> 
	<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> 
	<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script> 
	<script src="//cdn.datatables.net/buttons/1.4.2/js/buttons.flash.min.js"></script> 
	<script src="//cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script> 
	<script src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script> 
	<script src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script> 
	<script src="//cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script> 
	<script src="//cdn.datatables.net/buttons/1.4.2/js/buttons.print.min.js"></script> 
<!-- for datatable csv,pdf.... -->

	<script>
$(document).ready(function() {
    $('#example1').DataTable( {
        dom: 'Bfrtip',
		"pageLength": 10,
        buttons: [
             'csv', 'excel'
        ]
    } );
} );			
	</script>  
		
			
	

