<?php

session_start();


$uploaderid = $_SESSION["id"];

include('database_connection.php');
$query = "SELECT * FROM tbl_image WHERE uploaderid = '$uploaderid' ORDER BY image_id ASC";
if($uploaderid == 3){
$query = "SELECT * FROM tbl_image WHERE 1 ORDER BY image_id ASC";
}
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
$number_of_rows = $statement->rowCount();
$output = '';
$output .= '
<!-- <table class="table table-bordered table-striped" > //-->
<!--  <tr> //-->
<!--   <th>Sr. No</th> //-->
<!--   <td>Image</td> //-->
   <!-- <th>Name</th> //-->
<!--   <th>Remarks</th> //-->
<!--   <th>Edit</th> //-->
<!--   <th>Delete</th> //-->
<!--  </tr> //-->
';
if($number_of_rows > 0)
{
 $count = 0;
 foreach($result as $row)
 {
  $count ++; 
  $output .= '
<!--  <tr> //-->
<!--   <td width="200" height="200">'.$count.'</td> //-->
<!--   <br> //-->
<div width="200" height="200" style="display: inline-block;">
<img src="files/'.$row["image_name"].'" class="imgg-thumbnail" width="200" height="200" />
<br>
<!-- <button type="button" style="width:10px; height:10px;" class="bbtn bbtn-danger bbtn-xs delete" id="'.$row["image_id"].'" data-image_name="'.$row["image_name"].'">Delete</button> //-->
<span class="delete" id="'.$row["image_id"].'" data-image_name="'.$row["image_name"].'"><a href="#">X</a></span>
</div>


<!--   <td>'.$row["image_name"].'</td> //-->
   
<!-- <div style="font-size:14px;">'.$row["image_description"].'</div> //-->
<!--   <td width="200"><button type="button" class="btn btn-warning btn-xs edit" id="'.$row["image_id"].'">Edit</button></td> //-->

<!--   <div width="200" style="display: inline-block;"> //-->
<!-- </div> //-->
<!--  </tr> //-->
  ';
 }
}
else
{
 $output .= '
  <tr>
   <td colspan="6" align="center">No Data Found</td>
  </tr>
 ';
}
$output .= '</div>';
echo $output;

echo "<br><br>";



?>
</div>
<div style="width:100px; height:100px; display: inline-block; font-size:14px; vertical-align:middle;">Remarks:</div><div style="width:700px; height:100px; display: inline-block;"><textarea style="width:700px; height: 100px;"></textarea></div>
