<?php
	/* require '../db.php'; */ 
	include("../../php_crud/my_class.php");
	$obj = new my_class();
	session_start();
	echo '<script src="module/ground_water/js/station.js" type="text/javascript"></script>';
?>
<table id="device_tbl" class="table table-striped table-bordered table-hover">
    <thead>
        <tr style="font-family: 'Open Sans';">
            <th>SL.</th>
			<th>New Id</th>
			<th>Old Id</th>
            <th>Station Name</th>
			<th>Status</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
    <?php
		$table_name =  "TBLGWH_BASICINFOMST";
		$where_cond = "1=1 ORDER BY  ID ASC";
		
		$row=$obj->View_all_data_row_column_By_Cond($table_name,' * ',$where_cond);
		$i = 1;
		foreach($row AS $index=>$val){
			echo "<tr>";  
				$id=$val['ID'];
				?>              
				<td><?php echo $i;?></td>
				<td><?php echo $val['NEW_ID'];?></td>
				<td><?php echo $val['OLD_ID'];?></td>
				<td><?php echo $val['STATIONNAME'];?></td>
				<td><?php if($val['FLAG']=='A') echo "<label class='label label-success'><i class='fa fa-check-circle'></i> Active</label> "; else echo "<label class='label label-danger' style=' background-color: #d15b47 !important'><i class='fa fa-times-circle'></i> Inactive</span>";?></td>
				<td>
				<?Php
					if($_SESSION['edit']=='Y'){
						echo '<button type="button" class="label label-warning" onclick="load_edit_form('.$id.')"><i class="fas fa-edit"></i> Edit </button>';
					}
					if($_SESSION['delete']=='Y'){
						echo '<button type="button" class="label label-danger" style="margin-left: 10px; background-color: #d15b47 !important" onclick="delete_problem_type('.$id.')"><i class="fa fa-trash"></i> Delete </button>';
					} 
				?>
					<!--<input type="button" id="brand_edits" value="edit" />-->
					<!--<button type="button" class="btn btn-primary btn_update" data-toggle="modal" data-target="#btn_update" id="<?php echo $id ;?>"><i class="fa fa-edit"></i>Edit</button>
					<button type="button" class="btn btn-success btn-sm btn_view" data-toggle="modal" data-target="#btn_views" id="<?php echo $id ;?>">View</button>
					<button class="btn btn-danger btn-sm btn_delete" id="<?php echo $id ;?>">Delete</button>-->
				</td>
				<?php           
			echo " </tr>";
			$i++;
		}
	?>
    </tbody>
</table>
<script type="text/javascript">			
	var oTable2 = $('#device_tbl').dataTable( {
	"aoColumns": [
	  { "bSortable": true },
	  null, null,
	  { "bSortable": true }
	] } );
</script>