PK

ADDRLIN : /proc/self/root/home/bw2hgtn172qm/www/jeffharrismusic.com/admin/
FLL :
Current File : //proc/self/root/home/bw2hgtn172qm/www/jeffharrismusic.com/admin/news_management.php

<?php 
include("header.php");
if($_SESSION["aid"]=='')
{
	 "<script>window.location='index.php';</script>";
}
@extract($_POST);
		// ======Status Update query==========		
if(isset($_GET['status'])) 
 {	
			if($_GET['status']=='1')
			{
				
				$sql="UPDATE jeff_news SET status='0' where id='".$_GET['id']."'";
				mysqli_query($conn,$sql);
			}
			if($_GET['status']=='0'){
				$sql="UPDATE jeff_news SET status='1' where id='".$_GET['id']."'";
				mysqli_query($conn,$sql);
			}
 }
         ?>
<html>									
<body>
<style>
#header_hover:hover{
	background-color:#000 ! important;
}
</style>
	<div id="wrapper">
	<?php
		include('sidebar.php');
	?>
		<div id="page-wrapper" class="gray-bg">
         <?php include('afterlog_top.php'); ?>
		 <!--------- Title ------------>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>News Management</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a href="dashboard.php">Home</a>
                        </li>
                        
                        <li class="active">
                            <strong>News Management</strong>
                        </li>
                    </ol>
                </div>
                <div class="col-lg-2">
                </div>
            </div>
			<!--------- End Title ------------>
			<div class="wrapper wrapper-content">
				<div class="row animated fadeInRight">
					<div class="col-md-12">
						<div class="ibox float-e-margins">
							<div class="ibox-title">
								<a href="" class="btn btn-danger btn-xs" id="header_hover" ><h5 >News Management</h5></a>
								<a href="add_news.php" class="btn btn-primary btn-xs" id="header_hover" ><h5 >Add</h5></a>
							
									<div class="pull-right tooltip-demo ibox-tools">
										<a class="collapse-link">
											<i class="fa fa-chevron-up"></i>
										</a>
										<a class="close-link">
											<i class="fa fa-times"></i>
										</a>
									</div>
							</div>
							
						<!---------------- Form ---------------->
						
						<div class="ibox-content">
						<center>
								      <?php 
									  if(isset($flag)=="success")
										{
										echo "<font style='text-align:center;color:green;font-size: 15px;'>News Added Successfully </font>";
										}
										
										if(isset($flag)=="delete")
										{
										echo "<font style='text-align:center;color:green;font-size: 15px;'>News Deleted Successfully </font>";
										}
										if(isset($flag)=="update")
										{
										echo "<font style='text-align:center;color:green;font-size: 15px;'>News Update Successfully </font>";
										}
										?>
									</center>
								
								<div class="table-responsive">
									<table class="table table-striped table-bordered table-hover dataTables-example">
										<thead> 
										<tr> 
										<th>S.NO</th>
										<th>News Title</th> 
										<th>News Description</th>
										<th>News Image</th>
										<th>Current Time</th>
										<th>Status</th>
										<th>Edit</th>
										<th>Delete</th></tr> 
										</thead> 
										<tbody> 
						
																	<?php
									
												 $act=mysqli_query($conn,"select * from jeff_news ORDER BY id DESC");			
												$i=0;
												while($tb=mysqli_fetch_array($act))
							                          {	
													  $i++;
														
																?>
						
														<tr>
														<td style="text-align:center;"><?php echo $i+1;?></td>
														<td><?php echo $tb['news_title'];?></td>
														<td><?php echo $tb['news_description'];?></td>
														<td><img src="./uploads/news_img/<?php echo $tb['news_image'];?>"alt="" height="75" width="75"></td>
														<td><?php echo $tb['current_time'];?></td>
														
															<?php
																$status_res=$tb['status'];
																if($status_res == "0"){
																$status = "Activate";
																}
																else
																{
																$status = "InActivate";
																}
																
																?>
																
																<td><a href="news_management.php?id=<?php echo $tb['id']; ?>&&status=<?php echo $status_res?>"><?php echo $status;?> </a></td>
														
														<td style="text-align:center;">
														 <a href="edit_news.php?id=<?php echo $tb['id']; ?>"><img src="img/copy.png" alt="icon"/></a></td>
															<td style="text-align:center;">
														 <a href="delete_news.php?id=<?php echo $tb['id']; ?>"><img src="img/delete.png" alt="icon"/></a></td>
													 </tr> 
														<?php	
													}
														?>	
													
									</table>	
								</div>
							
											 <?php
											 //}
											?>	
										
							</div>
				        </div>
					</div>
				</div>
	        </div>		
		<!-------=======================----Footer----------===================------->
		<?php include('footer.php');?>
		<!----------===================---------- End Footer -----==================------->
		</div>
	</div>				
	
</body>
</html>		
 <script>
        $(document).ready(function(){
            $('.dataTables-example').DataTable({
                pageLength: 25,
                responsive: true,
                dom: '<"html5buttons"B>lTfgitp',
                buttons: [
                    { extend: 'copy'},
                    {extend: 'csv'},
                    {extend: 'excel', title: 'ExampleFile'},
                    {extend: 'pdf', title: 'ExampleFile'},

                    {extend: 'print',
                     customize: function (win){
                            $(win.document.body).addClass('white-bg');
                            $(win.document.body).css('font-size', '10px');

                            $(win.document.body).find('table')
                                    .addClass('compact')
                                    .css('font-size', 'inherit');
                    }
                    }
                ]

            });

        });

    </script>
												
						


PK 99