<?php 

// Include main file
include_once('../libs/main.php');

// Check admin Login
include_once('checkLogin.php');

$successMsg = '';

if(isset($_REQUEST['successMsg'])){
	$successMsg = $_REQUEST['successMsg'];
}

if(isset($_REQUEST['failedMsg'])){
	$failedMsg = $_REQUEST['failedMsg'];
}

// Logical section of page
$settingObj =  new  setting();

if(isset($_POST['submit'])){
	
	if(isset($_POST['settings']) && count($_POST['settings']) > 0 ){
		foreach ($_POST['settings'] as $key => $val){
			$settingObj->updateRecords($key,$val);
		}
	}
	$successMsg ="setting updated successfully";			
}

$settingDetail = $settingObj->getAllRecords();

// Include Template 
include_once('../libs/routs.php')

?>