<?php

//////////////////////////////////////////////////////////////
//===========================================================
// editdnsplan_theme.php
//===========================================================
// SOFTACULOUS VIRTUALIZOR
// Version : 2.1.7
// Inspired by the DESIRE to be the BEST OF ALL
// ----------------------------------------------------------
// Started by: Julien
// Date:       9th July 2012
// Time:       00:51 hrs
// Site:       https://www.virtualizor.com/ (SOFTACULOUS VIRTUALIZOR)
// ----------------------------------------------------------
// Please Read the Terms of use at https://www.virtualizor.com
// ----------------------------------------------------------
//===========================================================
// (c)Softaculous Ltd.
//===========================================================
//////////////////////////////////////////////////////////////

if(!defined('VIRTUALIZOR')){

	die('Hacking Attempt');

}

function editdnsplan_theme(){

global $theme, $globals, $kernel, $user, $l, $error, $done, $dns_servers, $dnsplan;

softheader($l['<title>']);

$GLOBALS['breadcrumbs'] = array( 'dashboard', 'lm_dnsplans', 'lms_edit_dns_plan');

echo page_header(__('Edit DNS Plan'), 'icon icon-pdns', '', 0, 0, '');

error_handle($error);

if(!empty($done)){
	show_alert(__('The DNS Plan has been edited. Return to <a href="index.php?act=dnsplans">Plans Overview</a>'),"0","dnsplans");
}

echo '<script language="javascript" type="text/javascript"></script>
<div class="card p-2 mx-3">
	<form accept-charset="'.$globals['charset'].'" name="editdnsplan" method="post" action="" class="form-horizontal">

		<div class="row mx-auto w-100 my-3">
			<div class="col-md-6 mb-2">
				<label class="control-label">'.__('Plan Name').'&nbsp;<a class="info" data-placement="right" tooltip="'.__('The name of this plan').'"><i class="fas text-primary fa-info-circle"></i></a></label><br>

				<input type="text" class="form-control" name="plan_name" id="plan_name" size="30" value="'.POSTval('plan_name', $dnsplan['plan_name']).'" />
			</div>

			<div class="col-md-6 mb-2">
				<label class="control-label">'.__('DNS Server').'&nbsp;<a class="info" data-placement="right" tooltip="'.__('The DNS server to be used').'"><i class="fas text-primary fa-info-circle"></i></a></label><br>
			
				<div class="col-sm-12 m-0 p-0">	
					<select class="custom-select" name="dnsserverid">';
					foreach($dns_servers as $k => $v){
						echo '<option value="'.$v['id'].'" '.ex_POSTselect('dnsserverid', $v['id'], $dnsplan['pdnsid']).' >'.$v['name'].'</option>';
					}
			echo   '</select>
				</div>
			</div>
		</div>	

		<div class="row mx-auto w-100 my-3">
			<div class="col-md-6 mb-2">
				<label class="control-label">'.__('Max Domains').'</label><br/>
			
				<input type="number" class="form-control" name="maxdomains" id="maxdomains" size="10" value="'.POSTval('maxdomains', $dnsplan['max_domains']).'" />
			</div>	
	
			<div class="col-6 mb-2">
				<label class="control-label">'.__('Max Domain Records').'</label><br/>	
		
				<input type="number" class="form-control" name="maxdomainsrec" id="maxdomainsrec" size="10" value="'.POSTval('maxdomainsrec', $dnsplan['max_domain_records']).'" />
			</div>	
		</div>

		<div class="row mx-auto w-100 my-3">
			<div class="col-md-6 mb-2">
				<label class="control-label">'.__('Default TTL').'</label><br/>
		
				<input type="number" class="form-control" name="ttl" id="ttl" size="10" value="'.POSTval('ttl', $dnsplan['def_ttl']).'" />
			</div>	
		</div>

		<div class="text-center my-4">
			<input type="submit" name="editdnsplan" value="'.__('Edit DNS Plan').'" class="go_btn">
		</div>

	</form>
</div>';

softfooter();

}

?>