<?php 
 

include ('../ro_head.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 location?") == true) {
                window.location = 'delivery_location_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>Delivery Location List
							</div>
							<!-- <div class="tools"> -->
								<!-- <a href="javascript:;" class="collapse">
								</a> -->
								<!-- <a href="#portlet-config" data-toggle="modal" class="config">
								</a> -->
								<!-- <a href="javascript:;" class="reload">
								</a> -->
								<!-- <a href="javascript:;" class="remove">
								</a> -->
							<!-- </div> -->
						</div>
						<div class="portlet-body">
							<div class="table-toolbar">
								<div class="row">
									<div class="col-md-6">
										<div class="btn-group">
											<a href="add_delivery_location.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:10%">Delivery Location</th>
                                            <th style="width:10%">Keyword</th>
                                            <th style="width:10%">Status</th>
                                            <th style="width:15%">Action</th>
							</tr>
							</thead>
							<tbody>
							 <?php

         
								$rs = mysqli_query($con,"SELECT * FROM `deli_location_table`");
                                while($row=mysqli_fetch_array($rs)){

                                    echo "<tr class='odd gradeX'>";
                                    //echo "<td><input type='checkbox' id='id[]' name='id[]' value='".$row["id"]."'></td>";

                                    echo "<td>".$row["deliloc_name"]."</td>";
                                     echo "<td>".$row["deliloc_kword"]."</td>";
                                    echo "<td>";

                                    ?>

                                    <?php 

                                    if($row["status"]== 1){

                                    	echo "Active";

                                    }else{
                                    	echo "inactive";
                                    }

                                    ?>

                                    <?php

                                    echo "</td>";
                                                                                                           																	
                                    echo "<td>                                                      
                                 
                                  <a href='edit_delivery_location.php?id=".$row['deliloc_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>";
                                 // if ($row['deliloc_id']!=1)
                                 echo "<a href='#' class='btn btn-danger btn-xs' onclick='myFunction(".$row["deliloc_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>