<?php
	
	include("../config/mysql_connect.php");
	//include("check_admin.php"); ใส่ไม่ได้เพราะไม่มีการเรียก session

	$template_id = $_REQUEST['id'];

	$sql_update_off = "update setting_templates set tem_status='off'";
	$Query = mysqli_query($link,$sql_update_off);

	$sql_update = "update setting_templates set tem_status='on' where tem_id='$template_id'";
	$objQuery = mysqli_query($link,$sql_update);

		if($objQuery){
			echo "<meta http-equiv=refresh content=0;url=setting.php>";
		}
		else{
			echo "<div class='alert alert-danger'>
			<button type='button' class='close' data-dismiss='alert'>&times;</button>
			<strong>Alerts!</strong> ล้มเหลว </div>";
		}
?>