Separate scripts from html & New rendering function

This commit is contained in:
Flat 2016-07-02 19:51:56 +09:00
commit e16e92278b
84 changed files with 848 additions and 1280 deletions

View file

@ -1,10 +1,9 @@
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
$TAB = 'DNS';
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check POST request for dns domain
@ -138,12 +137,6 @@ if (!empty($_POST['ok_rec'])) {
}
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
$v_ns1 = str_replace("'", "", $v_ns1);
$v_ns2 = str_replace("'", "", $v_ns2);
$v_ns3 = str_replace("'", "", $v_ns3);
@ -154,8 +147,9 @@ $v_ns7 = str_replace("'", "", $v_ns7);
$v_ns8 = str_replace("'", "", $v_ns8);
// Display body for dns domain
if (empty($_GET['domain'])) {
// Display body for dns domain
if (empty($v_ttl)) $v_ttl = 14400;
if (empty($v_exp)) $v_exp = date('Y-m-d', strtotime('+1 year'));
if (empty($v_ns1)) {
@ -171,18 +165,16 @@ if (empty($_GET['domain'])) {
$v_ns8 = str_replace("'", "", $nameservers[7]);
unset($output);
}
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns.html');
render_page($user, $TAB, 'admin/add_dns');
} else {
// Display body for dns record
$v_domain = $_GET['domain'];
render_page($user, $TAB, 'admin/add_dns_rec');
}
// Display body for dns record
if (!empty($_GET['domain'])) {
$v_domain = $_GET['domain'];
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns_rec.html');
}
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');