<?php 
	require_once('Connections/conn_ama.php');
	
	if(!isset($_SESSION)){
        session_start();
    }
    	

    	//Retrieve ALLReports Articles
    	$query_rsALLReports = "CALL cf_all_reports()";
	    $rsALLReports = mysqli_query($conn_ama, $query_rsALLReports ) or die(mysqli_error($conn_ama));
	    $row_rsALLReports = mysqli_fetch_assoc($rsALLReports);
	    $totalRows_rsALLReports = mysqli_num_rows($rsALLReports);/**/
 ?>
<div class="col-lg-12 cf-data-area">
	<div class="cf-data-area-wrap">
		<div class="form-wrapper">
			<table id="cf-reports" class="table" cellspacing="0" width="100%">
		        <thead>
		            <tr>
		                <th>Name</th>
		                <th>Phone</th>
		                <th>Report Category</th>
		                <th nowrap="nowrap">Date Submitted</th>
		                <!-- <th>Country</th> -->
		                <th>Status</th>
		                <th>&nbsp;</th>
		            </tr>
		        </thead>
		        <!-- <tfoot>
		            <tr>
		                <th>Player</th>
		                <th>Image</th>
		                <th>Postion</th>
		                <th>Jersey Number</th>
		                <th>Country</th>
		                <th>Edit</th>
		                <th>Delete</th>
		            </tr>
		        </tfoot> -->
		        <tbody>
		        <?php do { ?>
		            <tr>
		                <td><?php echo ucwords($row_rsALLReports['fname'])." ".ucwords($row_rsALLReports['lname']); ?></td>
						<td ><?php echo ucwords($row_rsALLReports['phone']); ?></td>
						<td ><?php echo ucwords($row_rsALLReports['category']); ?></td>
	                  	<td ><?php $actual_time = date('D, jS M Y   g:i a', strtotime($row_rsALLReports['feedbackdate'])); echo $actual_time; ?></td>
						<td class="<?php if($row_rsALLReports['status']=='pending'){ echo 'table-warning';}elseif($row_rsALLReports['status']=='responded'){ echo 'table-success';} ?>" >
							<?php echo ucwords($row_rsALLReports['status']); ?>
						</td>
		                <td ><a href="manage-citizens-feedback-details.php?cfh=<?php echo $row_rsALLReports['cfharsh']; ?>" class="btn btn-info">View</a></td>
		            </tr>
		        <?php } while($row_rsALLReports = mysqli_fetch_assoc($rsALLReports));?>
		            
		    	</tbody>
		    </table>
		</div><!-- End .form-wrapper-->
	</div><!-- End .data-area-wrap-->	
</div>

<script>

   /*  $(document).ready( function() {
        $('#example').dataTable({
        	"pageLength": 10,
        	"order": []
        });
    }); */
</script>