<?php 
include ('../ro_head.php'); 
//include 'methodlist.php';

if($newarr[3]=="NO") {	   
   header('location:dashboard.php');  
}
?>


<!-- BEGIN PAGE LEVEL STYLES -->
<link rel="stylesheet" type="text/css" href="../assets/global/plugins/select2/select2.css"/>
<link rel="stylesheet" type="text/css" href="../assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css"/>

<script type="text/javascript">
function myFunction(str) {
            
            if (confirm("Do you want to delete this Ip ?") == true) {
                window.location = 'ip_crud.php?actionid=remove&id='+str;
            }
            
        }


</script>

<style type="text/css">
	h3{
		background-color: #c6deef;
		padding: 10px 0px 10px 20px;
		font-size: 18px;
	}
</style>
<!-- END PAGE LEVEL STYLES -->

<!-- BEGIN CONTAINER -->
<div class="page-container">
<?php include_once("../ro_sidebar.php"); ?>
    <!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			
			
			<!-- BEGIN PAGE HEADER-->
		
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN EXAMPLE TABLE PORTLET-->
					<div class="portlet box grey-cascade">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-globe"></i>IP List
							</div>
						
						</div>
						<div class="portlet-body">
							<div class="table-toolbar">
								<div class="row">
									<div class="col-md-6">
										<div class="btn-group">
											<a href="ip_add.php"><button id="sample_editable_1_new" class="btn green">
											Add New <i class="fa fa-plus"></i>
											</button></a>
										</div>
									</div>
									<div class="col-md-6">
										
									</div>
								</div>
							</div>
							<table class="table table-striped table-bordered table-hover" id="sample_2">
							<thead>
							<tr>
								<!--<th class="table-checkbox">
									<input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>
								</th>-->
								 
                                            <th style="width:20%">IP Address</th>
                                            <th style="width:10%">Status</th>
                                            <th style="width:15%">Action</th>
							</tr>
							</thead>
							<tbody>
							 <?php

         
								$rs = mysqli_query($con, "select * from ip_table");
                                while($row=mysqli_fetch_array($rs)){

                                    echo "<tr class='odd gradeX'>";
                                 
                                    echo "<td>".$row["ip_address"]."</td>";

                                    echo "<td>";
                                    if($row["ip_status"]==1) echo "Active";
                                    if($row["ip_status"]==0) echo "Inactive";
                                    echo "</td>";
                                     																	
                                    echo "<td>                                                      
                                    
                                    <a href='ip_edit.php?id=".$row['ip_id']."' class='btn btn-success btn-xs'  title='Edit' data-toggle='tooltip' data-placement='top' data-original-title='Edit'><i class='fa fa-list-alt'></i></a>
                                    <a href='#' class='btn btn-danger btn-xs' onclick='myFunction(".$row["ip_id"].")' title='Delete' data-toggle='tooltip' data-placement='top' data-original-title='Delete'><i class='fa fa-list-alt'></i></a>
                                    </td>";
                                    echo "</tr>";
                                }
                                ?>	
								</tbody>
							</table>
						</div>
					</div>
					<!-- END EXAMPLE TABLE PORTLET-->
				</div>
			</div>
				</div>
			</div>
			<!-- END PAGE CONTENT-->
		</div>
	</div>
	<!-- END CONTENT -->
	
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php include_once("../ro_footer.php"); ?>

<!-- END FOOTER -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<?php include_once("../ro_js.php"); ?>
<script src="../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
<!-- IMPORTANT! Load jquery-ui.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
<script src="../assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script type="text/javascript" src="../assets/global/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="../assets/global/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->

<script src="../assets/admin/layout/scripts/table-managed.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function() {       
   Metronic.init(); // init metronic core components
Layout.init(); // init current layout
QuickSidebar.init(); // init quick sidebar
Demo.init(); // init demo features
   TableManaged.init();
});
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>