 <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">Data Center</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 datacenter where id='$id'";
							$r=$this->db->query($sql);
							$rr=$r->result_array();
						//	print_r($rr);
								$name=$rr[0]['name'];
								$location=$rr[0]['location'];
								$no_of_ip=$rr[0]['no_of_ip'];
							?>

						   <div class="sparkline8-hd">
                                <div class="main-sparkline8-hd">
                                    <h1>Edit Data Center</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();?>Datacenter/update_Datacenter" method="post" role="form" class="form-horizontal">
												<input type="hidden" name="id" value="<?=$id?>">
                                                    <div class="form-group-inner">
                                                        <label>Data Center </label>
                                                        <input type="text" name="name" value="<?=$name?>" class="form-control" placeholder="Enter Name of data center" />
                                                    </div>
                                                    <div class="form-group-inner">
                                                        <label>Location</label>
                                                        <input type="text" name="location" value="<?=$location?>" class="form-control" placeholder="location" />
                                                    </div>
													<div class="form-group-inner">
                                                        <label>IP Address Number</label>
                                                        <input type="number" name="no_of_ip" value="<?=$no_of_ip?>" class="form-control" placeholder="Number" />
                                                    </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 Data Center</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();?>Datacenter/save_Datacenter" method="post" role="form" class="form-horizontal">
                                                    <div class="form-group-inner">
                                                        <label>Data Center </label>
                                                        <input type="text" name="name" class="form-control" placeholder="Enter Name of data center" />
                                                    	 <span style="color: red;"><?php echo form_error('name'); ?></span>
                                                    </div>
                                                    <div class="form-group-inner">
                                                        <label>Location</label>
                                                        <input type="text" name="location" class="form-control" placeholder="location" />
                                                    </div>
													<div class="form-group-inner">
                                                        <label>IP Address Number</label>
                                                        <input type="number" name="no_of_ip" class="form-control" placeholder="location" />
                                                    </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>
								<?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>Data Center 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>Data Center</th>
				<th>Location</th>
				<th>No.Of IP Address</th>
				<th>Edit</th>                
				<th>Delete</th>                
            </tr>
        </thead>
        <tbody>
<?php
foreach($datacenter as $r)
{
?>				
					<tr class="gradeX">
					<td><?=$r['name']?></td>
					<td><?=$r['location']?></td>
					<td><?=$r['no_of_ip']?></td>
					<td><a href="<?php echo site_url();?>Datacenter/Datacenter?id=<?php echo $r['id']?>" title="Edit Product" class=""><i class="fa fa-pencil " aria-hidden="true"></i></td>
					<td><a href="<?php echo site_url();?>Datacenter/delete_Datacenter/<?php echo $r['id']?>" title="Delete Product" 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>  
		
			
	

