
<?php
include("../db.php");
if(isset($_GET['opp'])){

	if($_GET['opp']=='active'){
		$id=$_GET['id'];
		$sql=mysqli_query($conn,"UPDATE `product` SET `status`='2' WHERE id='$id'");
		?>
		<script>window.location.href = "slider_select.php?main=9&cat=1";</script>
		<?php
	}
	if($_GET['opp']=='deactive'){
		$id=$_GET['id'];
		$sql=mysqli_query($conn,"UPDATE `product` SET `status`='1' WHERE id='$id'");
		?>
		<script>window.location.href = "slider_select.php?main=9&cat=1";</script>
		<?php
	}

}


if(isset($_GET['op'])){

	if($_GET['op']=='active'){
		$id=$_GET['id'];
		$sql=mysqli_query($conn,"UPDATE `product` SET `status`='1' WHERE id='$id'");
		?>
		<script>window.location.href = "products.php?main=7&cat=1";</script>
		<?php
	}
	if($_GET['op']=='deactive'){
		$id=$_GET['id'];
		$sql=mysqli_query($conn,"UPDATE `product` SET `status`='0' WHERE id='$id'");
		?>
		<script>window.location.href = "products.php?main=7&cat=1";</script>
		<?php
	}

}


if(isset($_GET['opo'])){

	if($_GET['opo']=='active'){
		$id=$_GET['id'];
		$sql=mysqli_query($conn,"UPDATE `offer` SET `status`='1' WHERE id='$id'");
		?>
		<script>window.location.href = "offers.php?main=8&cat=1";</script>
		<?php
	}
	if($_GET['opo']=='deactive'){
		$id=$_GET['id'];
		$sql=mysqli_query($conn,"UPDATE `offer` SET `status`='0' WHERE id='$id'");
		?>
		<script>window.location.href = "offers.php?main=8&cat=1";</script>
		<?php
	}

}

?>