<?php
	session_start();
	// ============
	include("../../asset/theme/css/myfunc.php");
	include("../../php_crud/my_class.php");
	$obj=new my_class();
?>
<div class="row-fluid">
	<div class="table-header">
		<i class="fa fa-desktop"></i> All Well Information 	
	</div>
    <table id="well_info_file_datatble" class="table table-striped table-bordered table-hover">		      
		<thead>
			<td style="text-align: center;font-size:13px;" class="table-header">Sl</td>
			<td style="text-align: center;font-size:13px;" class="table-header">File Description</td>
			<td style="text-align: center;font-size:13px;" class="table-header">File</td>
			  
			<td style="text-align: center;font-size:13px;" class="table-header">Upload Date</td>
			<td style="text-align: center;font-size:13px;" class="table-header">Action</td>
		</thead>
		<tbody>
		<?php
			$sl=0;
			foreach($obj->View_All_By_Cond("AQUATIC.TBLGWH_FILE_DIRECTORY@AQUATIC227","UPLOADORIGIN='well' ORDER BY CREATEDATE DESC") as $value){
				$sl++;
				$create_date = date("d-M-Y",strtotime($value['CREATEDATE']));
				echo "<tr>";
					echo "<td style='text-align: center;'>".$sl."</td>";
					echo "<td>".$value['CONTENTDESCRIPTION']."</td>";
					echo "<td style='text-align:center;'><a target='_blank' class='label label-primary label-xs' href='asset/custom/upload/documents/docs/".$value['CONTENTTYPE']."'><i class='fa fa-download'></i> Download</label></td>";
					echo "<td>".date("j F, Y",strtotime($create_date))."</td>";
					echo '<td style="text-align: right;">';
					// if($_SESSION['edit']=='Y'){
						echo '<a class="label label-success" href="#well_info_file_edit_modal" data-toggle="modal" onclick="show_edit_view('.$value['ID'].')"> <i class="icon-edit"></i> Edit</a>';	
					// }
					echo '</td>';	
				echo "</tr>";
			}
					?>
		</tbody>
	</table>
</div>

<script type="text/javascript">
	var oTable2 = $('#well_info_file_datatble').dataTable( {
	"aoColumns": [
	  { "bSortable": true },
	  null, null,null,
	  { "bSortable": true }
	],
		"iDisplayLength": 50 } );	
</script>