<?php 
require 'dao/Site_Setting.php';
$get_site_setting = $site_setting->get_site_setting();

if (isset($_POST['set_site_setting'])) {
	$school_name = $_POST['school_name'];
	$school_addr = $_POST['school_addr'];
	$school_tel = $_POST['school_tel'];
	$school_email = $_POST['school_email'];
	$data = array("school_name"=>$school_name,
				  "school_addr"=>$school_addr,
				  "school_tel"=>$school_tel,
				  "school_email"=>$school_email);
	$success = $site_setting->set_site_setting($data);
	if (isset($success)) {
		echo 0;
	}else{
		echo 1;
	}
}

if (isset($_POST['update_setting'])) {
	$school_name = $_POST['school_name'];
	$school_addr = $_POST['school_addr'];
	$school_tel = $_POST['school_tel'];
	$school_email = $_POST['school_email'];
	$site_settings_id = $_POST['site_settings_id'];
	$data = array("school_name"=>$school_name,
				  "school_addr"=>$school_addr,
				  "school_tel"=>$school_tel,
				  "school_email"=>$school_email);
	$success = $site_setting->edit_setting($data,$site_settings_id);
	if (isset($success)) {
		echo 0;
	}else{
		echo 1;
	}
}

$edit_site_setting = "";
if (isset($_GET['s::'])) {
	$site_settings_id = $_GET['s::'];
	$edit_site_setting = $site_setting->edit_setting($site_settings_id);
}


