<?php 	
    include_once('../../config.php');   	
    include_once(ABS_PATH.'/admin/login_check.php');     
    include ABS_PATH.'/admin/header.php';	
    ?>  

<script>
function del_record(val,name)
{

	var r = confirm("Do you really want to delete record !");
	if (r == true) {    
	$.ajax({
	type: 'POST',
	url: "../ajax/default.php",
	//async: false,			 
	data: {deletBar:1,val:val,name:name},	  
	success: function(ajaxresult){	     
		location.reload();	 	
	},
	error: function(XMLHttpRequest, textStatus, errorThrown) { 
	alert('Error');
	}
	});
	
	}	
	
}

</script>
		 
		<div class="col-md-10">  
  			<div class="content-box-large">
  				<div class="panel-heading">
					<div class="panel-title"><h3>Banners </h3></div>
					
					<div align="right">  <input type="button"    class="btn btn-warning" name="btnback" id="btnback" value=" Add New Banner " onClick="javascript:location.href='newBanners1.php';" />
					</div>
					
				</div>
				
  				<div class="panel-body">
  					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr>
								<th>Sr</th>
								<th>Banner</th>  	  
								<th>Date</th>  
								<th>Status</th>    
								<th>Action</th> 
							</tr>
						</thead>
						<tbody>
							<?php
                                    $stmt=$conn->prepare("select  * from   UI__Banners  where type=1 order by id");  
                                    //$stmt->bindValue(':Ttime', $InTime , PDO::PARAM_STR);
                                    $stmt->execute(); 
                                    $AllUsers = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                    $sr = 1;
                                    
								  foreach($AllUsers as $users)
								  {    
							             
                                       
							?>
							<tr class="odd gradeX">
								<td><?php echo $sr++;?> </td>
								<td> <img src="<?php echo ROOTPATH;?>//uploads/banners/<?php echo $users->name;?>" width="200" ></td>
								<td><?php echo $users->Tdate;?></td>
								<td><?php if($users->status==1) echo "Active"; else echo "Inactive";?></td> 
								<td><a href="javascript:void(0);" onclick="del_record(<?php echo $users->id;?>,'<?php echo $users->name;?>')">  Delete Banner </a></td> 
								
							</tr>  
							<?php } ?>
						</tbody>
					</table>
  				</div>
  			</div>



		  </div>
		</div>
    </div>

<?php  include ABS_PATH.'/admin/footer.php';	?>    