<?php
$sql = "SELECT title, value FROM settings_options";
$result = $conn->prepare($sql);
$result->execute();
while ($arr = $result->fetch()){
	$title_settings = str_replace('_'.$content, '', $arr['title']);
	$admin_settings['module'][$title_settings] = $arr['value'];
	if ($arr['value']) $$title_settings = str_replace('[DOMAIN]', str_replace('www.', '', $_SERVER['SERVER_NAME']), $arr['value']);
	else $$title_settings = $arr['value'];
}


$sql = "SELECT title, value FROM content_options";
$result = $conn->prepare($sql);
$result->execute();
while ($arr = $result->fetch()){
	$title_settings = str_replace('_'.$content, '', $arr['title']);
	$admin_settings['content'][$title_settings] = $arr['value'];
	if ($arr['value']) $$title_settings = str_replace('[DOMAIN]', str_replace('www.', '', $_SERVER['SERVER_NAME']), $arr['value']);
	else $$title_settings = $arr['value'];
}

if (check_table($content.'_options')){
	$sql = "SELECT title, value FROM ".$content."_options";
	$result = $conn->prepare($sql);
	$result->execute();
	while ($arr = $result->fetch()){
		$title_settings = str_replace('_'.$content, '', $arr['title']);
		$admin_settings['module'][$title_settings] = $arr['value'];
		if ($arr['value']) $$title_settings = str_replace('[DOMAIN]', str_replace('www.', '', $_SERVER['SERVER_NAME']), $arr['value']);
		else $$title_settings = $arr['value'];
	}
}