<?php session_start();
include("./../../config/config.php");
require_once("./validated_admin.php");

for($k==1;$k<7;$k++){ 
$banner =$_REQUEST[SESS_MASTER.'banner'.$k];
$type =$_REQUEST[SESS_MASTER.'type'];

if($type=='slider'){

if($banner==''){
	 $olgaquery="UPDATE banner_master SET activestatus='0' WHERE banner='$k' AND slider_type='banner'"; 
    $stmt = $conn->prepare($olgaquery);
    $stmt->execute();
}else{

$olgaquery="UPDATE banner_master SET activestatus='1' WHERE banner='$banner' AND slider_type='banner'"; 
    $stmt = $conn->prepare($olgaquery);
    $stmt->execute();
}

} 
if($type=='discount'){
	if($banner==''){
	 $olgaquery="UPDATE banner_master SET activestatus='0' WHERE banner='$k' AND slider_type='discount_banner'"; 
    $stmt = $conn->prepare($olgaquery);
    $stmt->execute();
}else{

$olgaquery="UPDATE banner_master SET activestatus='1' WHERE banner='$banner' AND slider_type='discount_banner'"; 
    $stmt = $conn->prepare($olgaquery);
    $stmt->execute();
}

	}
}   

 echo "<script>window.location='../banner-slider.php';</script>";

 ?>