* @author EasySCP Team */ require '../../include/easyscp-lib.php'; check_login(__FILE__); $cfg = EasySCP_Registry::get('Config'); $tpl = EasySCP_TemplateEngine::getInstance(); $template = 'reseller/hosting_plan_edit.tpl'; global $hpid; /** * Dynamic page process */ if (isset($_POST['uaction']) && 'edit_plan' === $_POST['uaction']) { // Process data if (check_data_iscorrect($tpl)) { // Save data to db save_data_to_db(); } else { restore_form($tpl, $sql); } } else { // Get hosting plan id that comes for edit if (isset($_GET['hpid'])) { $hpid = $_GET['hpid']; } gen_load_ehp_page($tpl, $sql, $hpid, $_SESSION['user_id']); } // static page messages gen_logged_from($tpl); $tpl->assign(array('TR_PAGE_TITLE' => tr('EasySCP - Reseller/Edit hosting plan'), 'TR_HOSTING PLAN PROPS' => tr('Hosting plan properties'), 'TR_TEMPLATE_NAME' => tr('Template name'), 'TR_MAX_SUBDOMAINS' => tr('Max subdomains<br /><em>(-1 disabled, 0 unlimited)</em>'), 'TR_MAX_ALIASES' => tr('Max aliases<br /><em>(-1 disabled, 0 unlimited)</em>'), 'TR_MAX_MAILACCOUNTS' => tr('Mail accounts limit<br /><em>(-1 disabled, 0 unlimited)</em>'), 'TR_MAX_FTP' => tr('FTP accounts limit<br /><em>(-1 disabled, 0 unlimited)</em>'), 'TR_MAX_SQL' => tr('SQL databases limit<br /><em>(-1 disabled, 0 unlimited)</em>'), 'TR_MAX_SQL_USERS' => tr('SQL users limit<br /><em>(-1 disabled, 0 unlimited)</em>'), 'TR_MAX_TRAFFIC' => tr('Traffic limit [MB]<br /><em>(0 unlimited)</em>'), 'TR_DISK_LIMIT' => tr('Disk limit [MB]<br /><em>(0 unlimited)</em>'), 'TR_PHP' => tr('PHP'), 'TR_PHP_EDIT' => tr('PHP editor'), 'TR_CGI' => tr('CGI / Perl'), 'TR_SSL' => tr('SSL support'), 'TR_DNS' => tr('Allow adding records to DNS zone'), 'TR_BACKUP' => tr('Backup'), 'TR_BACKUP_DOMAIN' => tr('Domain'), 'TR_BACKUP_SQL' => tr('SQL'), 'TR_BACKUP_FULL' => tr('Full'), 'TR_BACKUP_NO' => tr('No'), 'TR_BACKUP_COUNT' => tr('Count backups to disk usage'), 'TR_APACHE_LOGS' => tr('Apache logfiles'), 'TR_AWSTATS' => tr('AwStats'), 'TR_YES' => tr('Yes'), 'TR_NO' => tr('No'), 'TR_BILLING_PROPS' => tr('Billing Settings'), 'TR_PRICE' => tr('Price'), 'TR_SETUP_FEE' => tr('Setup fee'), 'TR_VALUE' => tr('Currency'), 'TR_PAYMENT' => tr('Payment period'), 'TR_STATUS' => tr('Available for purchasing'), 'TR_TEMPLATE_DESCRIPTON' => tr('Description'), 'TR_EXAMPLE' => tr('(e.g. EUR)'), 'TR_TOS_PROPS' => tr('Term Of Service'), 'TR_TOS_NOTE' => tr('<strong>Optional:</strong> Leave this field empty if you do not want term of service for this hosting plan.'), 'TR_TOS_DESCRIPTION' => tr('Text'), 'TR_EDIT_HOSTING_PLAN' => tr('Update plan'), 'TR_UPDATE_PLAN' => tr('Update plan'))); gen_reseller_mainmenu($tpl, 'reseller/main_menu_hosting_plan.tpl'); gen_reseller_menu($tpl, 'reseller/menu_hosting_plan.tpl');
$tpl->define_dynamic('page', $cfg['ADMIN_TEMPLATE_PATH'] . '/ahp.tpl'); $tpl->define_dynamic('page_message', 'page'); global $cfg; $theme_color = $cfg['USER_INITIAL_THEME']; $tpl->assign(array('TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('VHCS - Administrator/Add hosting plan'), 'THEME_COLOR_PATH' => "../themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'VHCS_LICENSE' => $cfg['VHCS_LICENSE'], 'ISP_LOGO' => get_logo($_SESSION['user_id']))); /* * * static page messages. * */ gen_admin_menu($tpl); $tpl->assign(array('TR_ADD_HOSTING_PLAN' => tr('Add hosting plan'), 'TR_HOSTING PLAN PROPS' => tr('Hosting plan properties'), 'TR_TEMPLATE_NAME' => tr('Template name'), 'TR_MAX_SUBDOMAINS' => tr('Max subdomains<br><i>(-1 disabled, 0 unlimited)'), 'TR_MAX_ALIASES' => tr('Max aliases<br><i>(-1 disabled, 0 unlimited)'), 'TR_MAX_MAILACCOUNTS' => tr('Mail account limit<br><i>(0 unlimited)</i>'), 'TR_MAX_FTP' => tr('FTP account limit<br><i>(0 unlimited)</i>'), 'TR_MAX_SQL' => tr('SQL databases limit<br><i>(-1 disabled, 0 unlimited)</i>'), 'TR_MAX_SQL_USERS' => tr('SQL users limit<br><i>(-1 disabled, 0 unlimited)</i>'), 'TR_MAX_TRAFFIC' => tr('Traffic limit [Mb]<br><i>(0 unlimited)</i>'), 'TR_DISK_LIMIT' => tr('Disk limit [Mb]<br><i>(0 unlimited)</i>'), 'TR_PHP' => tr('PHP'), 'TR_CGI' => tr('CGI / Perl'), 'TR_BACKUP_RESTORE' => tr('Backup and restore'), 'TR_APACHE_LOGS' => tr('Apache logfiles'), 'TR_AWSTATS' => tr('AwStats'), 'TR_YES' => tr('yes'), 'TR_NO' => tr('no'), 'TR_BILLING_PROPS' => tr('Billing Settings'), 'TR_PRICE' => tr('Price'), 'TR_SETUP_FEE' => tr('Setup fee'), 'TR_VALUE' => tr('Currency'), 'TR_PAYMENT' => tr('Payment period'), 'TR_STATUS' => tr('Available for purchasing'), 'TR_TEMPLATE_DESCRIPTON' => tr('Description'), 'TR_EXAMPEL' => tr('(Ex. EUR)'), 'TR_ADD_PLAN' => tr('Add plan'))); if (isset($_POST['uaction']) && 'add_plan' === $_POST['uaction']) { // Process data if (check_data_correction($tpl)) { save_data_to_db($tpl, $_SESSION['user_id']); } gen_data_ahp_page($tpl); } else { gen_empty_ahp_page($tpl); } gen_page_message($tpl); $tpl->parse('PAGE', 'page'); $tpl->prnt(); if (isset($cfg['DUMP_GUI_DEBUG'])) { dump_gui_debug(); } // // Function definitions // // Generate empty form