Exemple #1
0
function updates_theme()
{
    global $theme, $globals, $user, $l, $error, $updated, $info, $report;
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">' . $l['update_softaculous'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br /><br />';
    error_handle($error);
    if (!empty($updated)) {
        echo '<br /><div class="sai_success"><img src="' . $theme['images'] . 'success.gif" /> ' . $l['updated_successfully'] . '</div><br />';
    }
    if (!empty($report)) {
        echo '<table width="100%" cellpadding="1" cellspacing="0" border="0" class="sai_divroundshad" style="padding:10px;">
	<tr>
		<td colspan="2" class="sai_head">' . $l['update_logs'] . '</td>
	</tr>
	<tr>
		<td valign="top">' . implode('<br />', $report['log']) . '</td>
		<td width="20%"><img src="' . $theme['images'] . 'admin/' . (empty($report['status']) ? 'softerror.gif' : 'softok.gif') . '" /></td>
	</tr>
	</table>
	<br />';
    }
    $curr_version = asperapp($globals['version'], @$globals['webuzo_version'], @$globals['ampps_version']);
    $latest_version = empty($info['version']) ? $l['not_connect_soft'] : $info['version'];
    echo '<form accept-charset="' . $globals['charset'] . '" name="updatesoftaculous" method="post" action="">
<table width="97%" cellpadding="5" cellspacing="0" border="0" style="margin:0px auto;" >
<tr>
<td>
<table width="100%" cellpadding="5" cellspacing="0" border="0" class="sai_divroundshad" style="padding:10px;">
<tr>
	<td class="sai_head" width="50%" align="right">' . $l['cur_ver'] . '</td>
	<td>' . $curr_version . '</td>
</tr>
<tr>
	<td class="sai_head" align="right">' . $l['latest_ver'] . '&nbsp;&nbsp;</td>
	<td>' . ($curr_version != $latest_version ? '<font color="#FF0033">' : '<font>') . '' . $latest_version . '</font></td>
</tr>
</table>
</td>
</tr>
<tr>
	<td colspan="2"><font class="bboxtxt">' . $info['message'] . '</font></td>
</tr>
</table>

<p align="center"><input type="submit" name="update" value="' . $l['updatesoftaculous'] . '" ' . (empty($info['link']) ? 'disabled="disabled"' : '') . ' class="sai_graybluebut" /></p>
</form>';
    softfooter();
}
Exemple #2
0
/**
 * Backup a MySQL Database
 *
 * @package      database
 * @author       Pulkit Gupta
 * @param        string $host The MySQL Host
 * @param        string $user The MySQL User
 * @param        string $pass The MySQL User password
 * @param        string $db The Database Name
 * @param        string $file The path of the file where the data is to be saved.
 * @return       bool true on success. false on failure
 * @since     	 1.0
 */
function backup_mysql($host, $user, $pass, $db, $file)
{
    global $softpanel;
    // If the softpanel defines its way, then pass it
    if (method_exists($softpanel, 'backup_mysql')) {
        return $softpanel->backup_mysql($host, $user, $pass, $db, $file);
    }
    // AMPPS works on a different method
    if (asperapp(0, 0, 1) && !empty($softpanel->path)) {
        $mybin = '"' . $softpanel->path . '/mysql/bin/mysqldump.exe"';
        // Webuzo needs full path
    } elseif (asperapp(0, 1, 0)) {
        $mybin = '/usr/bin/mysqldump';
    } else {
        $mybin = 'mysqldump';
    }
    // Lets try shell exec
    if (@shell_exec($mybin . ' -h ' . $host . ' -u ' . $user . ' -p"' . $pass . '" ' . $db . ' > "' . $file . '"')) {
        return true;
    }
    return false;
}
Exemple #3
0
function settings_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $softpanel, $protocols;
    //Is suPHP installed ?
    $apache_modules = function_exists('apache_get_modules') ? apache_get_modules() : '';
    if (is_array($apache_modules)) {
        foreach ($apache_modules as $av) {
            if (strtolower($av) == 'mod_suphp') {
                $suphp = true;
            }
        }
    }
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">&nbsp;&nbsp;&nbsp;' . $l['settings'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" />
<br /><br /><br />';
    error_handle($error);
    echo '<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/spectrum.css?' . $globals['version'] . '" />
<script language="javascript" src="' . $theme['url'] . '/js/combined.js" type="text/javascript"></script>
<script src="' . $theme['url'] . '/js/spectrum.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function show_ud(id){
	var val = id.value;
	if(val == "user_defined"){
		$("#admin_prefix_ud").css("display", "");
	}else{
		$("#admin_prefix_ud").css("display", "none");
	}
}

function showtip(txt, el){	
	
	$_("stooltip").innerHTML = txt;
	
	var pos = findelpos(el);
	$_("stooltip").style.display = "";
	var tipheight = parseInt($_("stooltip").offsetHeight);
	var tipwidth = parseInt($_("stooltip").offsetWidth);
	//alert(tipheight+" "+tipwidth);
	
	var abody = findelpos($_("abody"));
	var bodyWidth = abody[0] + $_("abody").offsetWidth
	
	if((pos[0] + tipwidth) > bodyWidth){
		pos[0] = pos[0] - (pos[0] + tipwidth - bodyWidth) + 15;
	}
	
	$_("stooltip").style.left = pos[0]+"px";
	$_("stooltip").style.top = (pos[1]-5-tipheight)+"px";
	
	el.onmouseout = function(){
		hidetip();
	};

};

function hidetip(){
	$_("stooltip").style.display = "none";
}

function isNumber(n) {
	if(isNaN(n.value)){
		alert(n.value+\' is not a valid Number\');
		return false;
		return false;
	}
}

// ]]></script>';
    if (!empty($saved)) {
        echo '<br /><div class="sai_success"><img src="' . $theme['images'] . 'success.gif" /> ' . $l['settings_saved'] . '</div><br />';
    }
    echo '<div id="stooltip" style="display:none; position:absolute; top: 0px; left: 0px; border: 1px solid #CCC; padding: 8px; background: #FFF; z-index:1000;"></div>
<form accept-charset="' . $globals['charset'] . '" name="editsettings" method="post" action="">
<table width="732" cellpadding="5" cellspacing="1" border="0" style="margin:0px auto;">';
    if (!defined('SOFTRESELLER')) {
        echo '
<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;">' . $l['pathhead'] . '</font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['softpath'] . '</span><br />
<span class="sai_exp2">' . $l['softpath_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="path" size="30" value="' . aPOSTval('path', $globals['path']) . '" />
</td>
</tr>


<tr>
<td>
<span class="sai_head">' . $l['softscripts'] . '</span><br />
<span class="sai_exp2">' . $l['softscripts_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="softscripts" size="30" value="' . aPOSTval('softscripts', $globals['softscripts']) . '" />
</td>
</tr>
</table>
</td>
</tr>';
    }
    echo '
<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['gen_set'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['sitename'] . '</span><br />
<span class="sai_exp2">' . $l['sitename_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="sn" size="30" value="' . aPOSTval('sn', $globals['sn']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['logo_url'] . '</span><br />
<span class="sai_exp2">' . $l['logo_url_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="logo_url" size="30" value="' . aPOSTval('logo_url', $globals['logo_url']) . '" />
</td>
</tr>';
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['is_vps'] . '</span><br />
<span class="sai_exp2">' . $l['is_vps_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="is_vps" ' . POSTchecked('is_vps', $globals['is_vps']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['cook_name'] . '</span><br />
<span class="sai_exp2">' . $l['cook_name_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="cookie_name" size="30" value="' . aPOSTval('cookie_name', $globals['cookie_name']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['chmod_files'] . '</span><br />
<span class="sai_exp2">' . $l['chmod_files_exp'] . ' ' . (empty($suphp) ? '' : '<b>(' . $l['suphp_detected'] . ')</b>') . '</span>
</td>
<td valign="top">
<input type="text" name="chmod_files" size="20" value="' . aPOSTval('chmod_files', $globals['chmod_files']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['chmod_dir'] . '</span><br />
<span class="sai_exp2">' . $l['chmod_dir_exp'] . ' ' . (empty($suphp) ? '' : '<b>(' . $l['suphp_detected'] . ')</b>') . '</span>
</td>
<td valign="top">
<input type="text" name="chmod_dir" size="20" value="' . aPOSTval('chmod_dir', $globals['chmod_dir']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['chmod_conf_file'] . '</span><br />
<span class="sai_exp2">' . $l['chmod_conf_file_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="chmod_conf_file" size="20" value="' . aPOSTval('chmod_conf_file', @$globals['chmod_conf_file']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['footer_link'] . '</span><br />
<span class="sai_exp2">' . $l['footer_link_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="footer_link" size="20" value="' . aPOSTval('footer_link', @$globals['footer_link']) . '" />
</td>
</tr>';
    }
    if ($globals['softpanel'] == 'directadmin' && !defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['remote_mysql'] . '</span><br />
<span class="sai_exp2">' . $l['remote_mysql_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="remote_mysql" size="20" value="' . aPOSTval('remote_mysql', @$globals['remote_mysql']) . '" />
</td>
</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['soft_email'] . '</span><br />
<span class="sai_exp2">' . $l['soft_email_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="soft_email" size="30" value="' . aPOSTval('soft_email', $globals['soft_email']) . '" />
</td>
</tr>';
    }
    echo '<tr>
<td>
<span class="sai_head">' . $l['from_email'] . '</span><br />
<span class="sai_exp2">' . $l['from_email_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="from_email" size="30" value="' . aPOSTval('from_email', $globals['from_email']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['choose_lang'] . '</span><br />
<span class="sai_exp2">' . $l['choose_lang_exp'] . '</span>
</td>
<td valign="top">
<select name="language">';
    foreach ($langs as $k => $v) {
        echo '<option value="' . $v . '" ' . (empty($_POST['language']) && $globals['language'] == $v ? 'selected="selected"' : (@trim($_POST['language']) == $v ? 'selected="selected"' : '')) . '>' . _ucfirst($v) . '</option>';
    }
    echo '</select>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['choose_protocol'] . '</span><br />
<span class="sai_exp2">' . $l['choose_protocol_exp'] . '</span>
</td>
<td>
<select name="default_protocol">';
    foreach ($protocols as $pk => $pv) {
        echo '<option value="' . $pk . '" ' . ($globals['default_protocol'] == $pk ? 'selected="selected"' : '') . '>' . $pv . '</option>';
    }
    echo '</select>
</td>
</tr>';
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['choose_theme'] . '</span><br />
<span class="sai_exp2">' . $l['choose_theme_exp'] . '</span>
</td>
<td valign="top">
<select name="theme_folder">';
        foreach ($skins as $k => $v) {
            echo '<option value="' . $v . '" ' . (empty($_POST['theme_folder']) && $globals['theme_folder'] == $v ? 'selected="selected"' : (trim($_POST['theme_folder']) == $v ? 'selected="selected"' : '')) . '>' . _ucfirst($v) . '</option>';
        }
        echo '</select>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['default_hf_bg'] . '</span><br />
<span class="sai_exp2">' . $l['default_hf_bg_exp'] . '</span>
</td>
<td valign="top">
<input type="color" name="color" id="default_hf_bg" class="changecolor"/>&nbsp;&nbsp;
<input type="hidden" name="default_hf_bg" value="' . aPOSTval('default_hf_bg', $globals['default_hf_bg']) . '" id="hidden_default_hf_bg">
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['default_cat_hover'] . '</span><br />
<span class="sai_exp2">' . $l['default_cat_hover_exp'] . '</span>
</td>
<td valign="top">
<input type="color" name="color" id="default_cat_hover" class="changecolor"/>&nbsp;&nbsp;
<input type="hidden" name="default_cat_hover" value="' . aPOSTval('default_cat_hover', $globals['default_cat_hover']) . '" id="hidden_default_cat_hover">
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['default_hf_text'] . '</span><br />
<span class="sai_exp2">' . $l['default_hf_text_exp'] . '</span>
</td>
<td valign="top">
<input type="color" name="color" id="default_hf_text" class="changecolor"/>&nbsp;&nbsp;
<input type="hidden" name="default_hf_text" value="' . aPOSTval('default_hf_text', $globals['default_hf_text']) . '" id="hidden_default_hf_text">
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['default_scriptname_text'] . '</span><br />
<span class="sai_exp2">' . $l['default_scriptname_text_exp'] . '</span>
</td>
<td valign="top">
<input type="color" name="color" id="default_scriptname_text" class="changecolor"/>&nbsp;&nbsp;
<input type="hidden" name="default_scriptname_text" value="' . aPOSTval('default_scriptname_text', $globals['default_scriptname_text']) . '" id="hidden_default_scriptname_text">
</td>
</tr>';
        if ($globals['softpanel'] == 'webuzo') {
            $disable_sysapps = $softpanel->getconf('DISABLE_SYSAPPS');
            echo '<tr>
<td>
<span class="sai_head">' . $l['network_interface'] . '</span><br />
<span class="sai_exp2">' . $l['network_interface_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="network_interface" size="30" value="' . aPOSTval('network_interface', $globals['network_interface']) . '" />
</td>
</tr>';
            if (empty($disable_sysapps)) {
                echo '<tr>
<td>
<span class="sai_head">' . $l['webuzo_disable_username'] . '</span><br />
<span class="sai_exp2">' . $l['webuzo_disable_username_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="webuzo_disable_username" ' . POSTchecked('webuzo_disable_username', @$globals['webuzo_disable_username']) . ' />
</td>
</tr>';
            }
        }
        echo '<tr>
<td>
<span class="sai_head">' . $l['time_format'] . '</span><br />
<span class="sai_exp2">' . $l['time_format_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="time_format" size="30" value="' . aPOSTval('time_format', $globals['time_format']) . '" />
</td>
</tr>

<tr>
<td colspan="2" align="center"><span class="sai_head">' . $l['timezone'] . ' : </span>&nbsp; &nbsp; 
	<select name="timezone" style="font-size:11px">
		<option value="-12" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-12' ? 'selected="selected"' : ($globals['timezone'] == -12 ? 'selected="selected"' : '')) . ' >(GMT -12:00) Eniwetok, Kwajalein</option>
		<option value="-11" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-11' ? 'selected="selected"' : ($globals['timezone'] == -11 ? 'selected="selected"' : '')) . ' >(GMT -11:00) Midway Island, Samoa</option>
		<option value="-10" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-10' ? 'selected="selected"' : ($globals['timezone'] == -10 ? 'selected="selected"' : '')) . ' >(GMT -10:00) Hawaii</option>
		<option value="-9" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-9' ? 'selected="selected"' : ($globals['timezone'] == -9 ? 'selected="selected"' : '')) . ' >(GMT -9:00) Alaska</option>
		<option value="-8" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-8' ? 'selected="selected"' : ($globals['timezone'] == -8 ? 'selected="selected"' : '')) . ' >(GMT -8:00) Pacific Time (US &amp; Canada)</option>
		<option value="-7" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-7' ? 'selected="selected"' : ($globals['timezone'] == -7 ? 'selected="selected"' : '')) . ' >(GMT -7:00) Mountain Time (US &amp; Canada)</option>
		<option value="-6" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-6' ? 'selected="selected"' : ($globals['timezone'] == -6 ? 'selected="selected"' : '')) . ' >(GMT -6:00) Central Time (US &amp; Canada), Mexico City</option>
		<option value="-5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-5' ? 'selected="selected"' : ($globals['timezone'] == -5 ? 'selected="selected"' : '')) . ' >(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima</option>
		<option value="-4" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-4' ? 'selected="selected"' : ($globals['timezone'] == -4 ? 'selected="selected"' : '')) . ' >(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option>
		<option value="-3.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-3.5' ? 'selected="selected"' : ($globals['timezone'] == -3.5 ? 'selected="selected"' : '')) . ' >(GMT -3:30) Newfoundland</option>
		<option value="-3" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-3' ? 'selected="selected"' : ($globals['timezone'] == -3 ? 'selected="selected"' : '')) . ' >(GMT -3:00) Brazil, Buenos Aires, Georgetown</option>
		<option value="-2" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-2' ? 'selected="selected"' : ($globals['timezone'] == -2 ? 'selected="selected"' : '')) . ' >(GMT -2:00) Mid-Atlantic</option>
		<option value="-1" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-1' ? 'selected="selected"' : ($globals['timezone'] == -1 ? 'selected="selected"' : '')) . ' >(GMT -1:00 hour) Azores, Cape Verde Islands</option>
		<option value="0" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '0' ? 'selected="selected"' : ($globals['timezone'] == 0 ? 'selected="selected"' : '')) . ' >(GMT) Western Europe Time, London, Lisbon, Casablanca</option>
		<option value="1" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '1' ? 'selected="selected"' : ($globals['timezone'] == 1 ? 'selected="selected"' : '')) . ' >(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris</option>
		<option value="2" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '2' ? 'selected="selected"' : ($globals['timezone'] == 2 ? 'selected="selected"' : '')) . ' >(GMT +2:00) Kaliningrad, South Africa</option>
		<option value="3" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '3' ? 'selected="selected"' : ($globals['timezone'] == 3 ? 'selected="selected"' : '')) . ' >(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option>
		<option value="3.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '3.5' ? 'selected="selected"' : ($globals['timezone'] == 3.5 ? 'selected="selected"' : '')) . ' >(GMT +3:30) Tehran</option>
		<option value="4" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '4' ? 'selected="selected"' : ($globals['timezone'] == 4 ? 'selected="selected"' : '')) . ' >(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi</option>
		<option value="4.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '4.5' ? 'selected="selected"' : ($globals['timezone'] == 4.5 ? 'selected="selected"' : '')) . ' >(GMT +4:30) Kabul</option>
		<option value="5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '5' ? 'selected="selected"' : ($globals['timezone'] == 5 ? 'selected="selected"' : '')) . ' >(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option>
		<option value="5.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '5.5' ? 'selected="selected"' : ($globals['timezone'] == 5.5 ? 'selected="selected"' : '')) . ' >(GMT +5:30) Bombay, Calcutta, Madras, New Delhi</option>
		<option value="6" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '6' ? 'selected="selected"' : ($globals['timezone'] == 6 ? 'selected="selected"' : '')) . ' >(GMT +6:00) Almaty, Dhaka, Colombo</option>
		<option value="6.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '6.5' ? 'selected="selected"' : ($globals['timezone'] == 6.5 ? 'selected="selected"' : '')) . ' >(GMT +6:30) Yangon, Myanmar</option>
		<option value="7" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '7' ? 'selected="selected"' : ($globals['timezone'] == 7 ? 'selected="selected"' : '')) . ' >(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
		<option value="8" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '8' ? 'selected="selected"' : ($globals['timezone'] == 8 ? 'selected="selected"' : '')) . ' >(GMT +8:00) Beijing, Perth, Singapore, Hong Kong, Taiwan</option>
		<option value="9" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '9' ? 'selected="selected"' : ($globals['timezone'] == 9 ? 'selected="selected"' : '')) . ' >(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option>
		<option value="9.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '9.5' ? 'selected="selected"' : ($globals['timezone'] == 9.5 ? 'selected="selected"' : '')) . ' >(GMT +9:30) Adelaide, Darwin</option>
		<option value="10" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '10' ? 'selected="selected"' : ($globals['timezone'] == 10 ? 'selected="selected"' : '')) . ' >(GMT +10:00) Eastern Australia, Guam, Vladivostok</option>
		<option value="11" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '11' ? 'selected="selected"' : ($globals['timezone'] == 11 ? 'selected="selected"' : '')) . ' >(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option>
		<option value="12" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '12' ? 'selected="selected"' : ($globals['timezone'] == 12 ? 'selected="selected"' : '')) . ' >(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option>
	</select>
</td>
</tr>';
    }
    echo '
</table>
</td>
</tr>

<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['end_user_set'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['eu_news_off'] . '</span><br />
<span class="sai_exp2">' . $l['eu_news_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="eu_news_off" ' . POSTchecked('eu_news_off', @$globals['eu_news_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['no_prefill'] . '</span><br />
<span class="sai_exp2">' . $l['no_prefill_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="no_prefill" ' . POSTchecked('no_prefill', @$globals['no_prefill']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['random_username'] . '</span><br />
<span class="sai_exp2">' . $l['random_username_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="random_username" ' . POSTchecked('random_username', @$globals['random_username']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['random_pass'] . '</span><br />
<span class="sai_exp2">' . $l['random_pass_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="random_pass" ' . POSTchecked('random_pass', @$globals['random_pass']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['random_dbprefix'] . '</span><br />
<span class="sai_exp2">' . $l['random_dbprefix_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="random_dbprefix" ' . POSTchecked('random_dbprefix', @$globals['random_dbprefix']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_demo_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_demo_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_demo_link" ' . POSTchecked('off_demo_link', @$globals['off_demo_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_screenshot_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_screenshot_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_screenshot_link" ' . POSTchecked('off_screenshot_link', @$globals['off_screenshot_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_rating_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_rating_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_rating_link" ' . POSTchecked('off_rating_link', @$globals['off_rating_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_review_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_review_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_review_link" ' . POSTchecked('off_review_link', @$globals['off_review_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_email_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_email_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_email_link" ' . POSTchecked('off_email_link', $globals['off_email_link']) . ' />
</td>
</tr>';
    if (!defined('SOFTRESELLER')) {
        echo '
<tr>
<td width="55%">
<span class="sai_head">' . $l['eu_email_off'] . '</span><br />
<span class="sai_exp2">' . $l['eu_email_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="eu_email_off" ' . POSTchecked('eu_email_off', @$globals['eu_email_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['empty_username'] . '</span><br />
<span class="sai_exp2">' . $l['empty_username_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="empty_username" ' . POSTchecked('empty_username', @$globals['empty_username']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['empty_pass'] . '</span><br />
<span class="sai_exp2">' . $l['empty_pass_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="empty_pass" ' . POSTchecked('empty_pass', @$globals['empty_pass']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['comp_output'] . '</span><br />
<span class="sai_exp2">' . $l['comp_output_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="gzip" ' . POSTchecked('gzip', $globals['gzip']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_remove_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_remove_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_remove_mail" ' . POSTchecked('off_remove_mail', $globals['off_remove_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_backup_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_backup_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_backup_mail" ' . POSTchecked('off_backup_mail', $globals['off_backup_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_install_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_install_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_install_mail" ' . POSTchecked('off_install_mail', $globals['off_install_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_edit_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_edit_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_edit_mail" ' . POSTchecked('off_edit_mail', $globals['off_edit_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_clone_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_clone_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_clone_mail" ' . POSTchecked('off_clone_mail', $globals['off_clone_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_restore_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_restore_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_restore_mail" ' . POSTchecked('off_restore_mail', $globals['off_restore_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_customize_theme'] . '</span><br />
<span class="sai_exp2">' . $l['off_customize_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_customize_theme" ' . POSTchecked('off_customize_theme', $globals['off_customize_theme']) . ' />
</td>
</tr>';
    }
    if (!empty($softpanel->native_ui)) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['panel_hf'] . '</span><br />
<span class="sai_exp2">' . $l['panel_hf_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="panel_hf" size="30" ' . POSTchecked('panel_hf', @$globals['panel_hf']) . ' />
</td>
</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['off_sync_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_sync_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_sync_link" ' . POSTchecked('off_sync_link', @$globals['off_sync_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_panel_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_panel_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_panel_link" ' . POSTchecked('off_panel_link', @$globals['off_panel_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['perl_scripts'] . '</span><br />
<span class="sai_exp2">' . $l['perl_scripts_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="perl_scripts" ' . POSTchecked('perl_scripts', @$globals['perl_scripts']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['nolabels'] . '</span><br />
<span class="sai_exp2">' . $l['nolabels_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="nolabels" size="30" ' . POSTchecked('nolabels', $globals['nolabels']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['show_cscript_in_top'] . '</span><br />
<span class="sai_exp2">' . $l['show_cscript_in_top_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="show_cscript_in_top" ' . POSTchecked('show_cscript_in_top', @$globals['show_cscript_in_top']) . ' />
</td>
</tr>';
        // Classes are only avaialable to Premium License
        if (!empty($globals['lictype'])) {
            echo '<tr>
<td>
<span class="sai_head">' . $l['disable_classes'] . '</span><br />
<span class="sai_exp2">' . $l['disable_classes_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_classes" size="30" ' . POSTchecked('disable_classes', @$globals['disable_classes']) . ' />
</td>
</tr>';
        }
        if (!empty($softpanel->user_mod_dir)) {
            echo '<tr>
<td>
<span class="sai_head">' . $l['user_mod_dir'] . '</span><br />
<span class="sai_exp2">' . $l['user_mod_dir_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="user_mod_dir" ' . POSTchecked('user_mod_dir', $globals['user_mod_dir']) . ' />
</td>
</tr>';
        }
        echo '<tr>
<td>
<span class="sai_head">' . $l['disable_reseller_panel'] . '</span><br />
<span class="sai_exp2">' . $l['disable_reseller_panel_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_reseller_panel" size="30" ' . POSTchecked('disable_reseller_panel', @$globals['disable_reseller_panel']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['pass_strength'] . '</span><br />
<span class="sai_exp2">' . $l['pass_strength_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="pass_strength" size="30" value="' . aPOSTval('pass_strength', $globals['pass_strength']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['admin_prefix'] . '</span><br />
<span class="sai_exp2">' . $l['admin_prefix_exp'] . '</span>
</td>
<td valign="top">
<select id="admin_prefix" name="admin_prefix" onchange="show_ud(this);">

	<option value="" ' . (isset($_POST['admin_prefix']) && $_POST['admin_prefix'] == "" ? 'selected="selected"' : (!isset($_POST['admin_prefix']) && $globals['admin_prefix'] == "" ? 'selected="selected"' : '')) . '>' . $l['ap_none'] . '</option>
	
	<option value="username" ' . (isset($_POST['admin_prefix']) && $_POST['admin_prefix'] == "username" ? 'selected="selected"' : (!isset($_POST['admin_prefix']) && $globals['admin_prefix'] == "username" ? 'selected="selected"' : '')) . '>' . $l['ap_username'] . '</option>
	
	<option value="domain" ' . (isset($_POST['admin_prefix']) && $_POST['admin_prefix'] == "domain" ? 'selected="selected"' : (!isset($_POST['admin_prefix']) && $globals['admin_prefix'] == "domain" ? 'selected="selected"' : '')) . '>' . $l['ap_domain'] . '</option>
	
	<option value="user_defined" ' . (isset($_POST['admin_prefix']) && $_POST['admin_prefix'] == "user_defined" ? 'selected="selected"' : (!isset($_POST['admin_prefix']) && $globals['admin_prefix'] != "username" && $globals['admin_prefix'] != "domain" && $globals['admin_prefix'] != "" ? 'selected="selected"' : '')) . '>' . $l['ap_admin_defined'] . '</option>
	
</select>&nbsp;&nbsp;&nbsp;
<input type="text" id="admin_prefix_ud" name="admin_prefix_ud" ' . (!empty($_POST['admin_prefix_ud']) && $_POST['admin_prefix'] != "" && $_POST['admin_prefix'] != "username" && $_POST['admin_prefix'] != "domain" ? 'value="' . $_POST['admin_prefix_ud'] . '" style=""' : (!isset($_POST['admin_prefix']) && ($globals['admin_prefix'] != "username" && $globals['admin_prefix'] != "domain" && $globals['admin_prefix'] != "") ? 'value="' . $globals['admin_prefix'] . '" style=""' : 'style="display:none"')) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['disable_clone'] . '</span><br />
<span class="sai_exp2">' . $l['disable_clone_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_clone" ' . POSTchecked('disable_clone', @$globals['disable_clone']) . ' />
</td>
</tr>';
        // At the moment only for H-Sphere we are providing this option
        if ($globals['softpanel'] == 'hsphere') {
            echo '<tr>
<td>
<span class="sai_head">' . $l['ephp_bin'] . '</span><br />
<span class="sai_exp2">' . $l['ephp_bin_exp'] . sphpbin() . '</span>
</td>
<td valign="top">
<input type="text" name="ephp_bin" value="' . aPOSTval('ephp_bin', $globals['ephp_bin']) . '" size="30" />
</td>
</tr>
';
        }
    }
    if ($globals['softpanel'] == 'ampps') {
        echo '<tr>
<td>
<span class="sai_head">' . $l['default_domain_path'] . '</span><br />
<span class="sai_exp2">' . $l['default_domain_path_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="adomain_path" size="30" value="' . aPOSTval('adomain_path', $globals['adomain_path']) . '" />
</td>
</tr>';
    }
    if ($globals['softpanel'] != 'ampps' && !empty($globals['ampps_enabled']) && !empty($globals['lictype'])) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['no_ampps_download'] . '</span><br />
<span class="sai_exp2">' . $l['no_ampps_download_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="no_ampps" ' . POSTchecked('no_ampps', @$globals['no_ampps']) . ' />
</td>
</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['no_strong_mysql_pass'] . '</span><br />
<span class="sai_exp2">' . $l['no_strong_mysql_pass_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="no_strong_mysql_pass" ' . POSTchecked('no_strong_mysql_pass', @$globals['no_strong_mysql_pass']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['pre_download_all'] . '</span><br />
<span class="sai_exp2">' . $l['pre_download_all_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="pre_download_all" ' . POSTchecked('pre_download_all', @$globals['pre_download_all']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['disable_backup_restore'] . '</span><br />
<span class="sai_exp2">' . $l['disable_backup_restore_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_backup_restore" size="30" ' . POSTchecked('disable_backup_restore', @$globals['disable_backup_restore']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['disable_backup_upgrade'] . '</span><br />
<span class="sai_exp2">' . $l['disable_backup_upgrade_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_backup_upgrade" ' . POSTchecked('disable_backup_upgrade', @$globals['disable_backup_upgrade']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['disable_auto_backup'] . '</span><br />
<span class="sai_exp2">' . $l['disable_auto_backup_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_auto_backup" ' . POSTchecked('disable_auto_backup', @$globals['disable_auto_backup']) . ' />' . $l['auto_backup_all'] . '<br />
<input type="checkbox" name="disable_auto_backup_daily" ' . POSTchecked('disable_auto_backup_daily', @$globals['disable_auto_backup_daily']) . ' />' . $l['auto_backup_daily'] . '<br />
<input type="checkbox" name="disable_auto_backup_weekly" ' . POSTchecked('disable_auto_backup_weekly', @$globals['disable_auto_backup_weekly']) . ' />' . $l['auto_backup_weekly'] . '<br />
<input type="checkbox" name="disable_auto_backup_monthly" ' . POSTchecked('disable_auto_backup_monthly', @$globals['disable_auto_backup_monthly']) . ' />' . $l['auto_backup_monthly'] . '
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['auto_backup_limit'] . '</span><br />
<span class="sai_exp2">' . $l['auto_backup_limit_exp'] . '</span>
</td>
<td valign="top">
<select name="auto_backup_limit">';
        for ($i = 0; $i <= 10; $i++) {
            echo '<option value="' . $i . '" ' . (empty($_POST['auto_backup_limit']) && $globals['auto_backup_limit'] == $i ? 'selected="selected"' : (trim($_POST['auto_backup_limit']) == $i ? 'selected="selected"' : '')) . '>' . (empty($i) ? $l['auto_backup_unlimited'] : $i) . '</option>';
        }
        echo '</select>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['max_backups'] . '</span><br />
<span class="sai_exp2">' . $l['max_backups_exp'] . '</span>
</td>
<td valign="top">
<select name="max_backups">';
        for ($i = 0; $i <= 10; $i++) {
            echo '<option value="' . $i . '" ' . (empty($_POST['max_backups']) && $globals['max_backups'] == $i ? 'selected="selected"' : (trim($_POST['max_backups']) == $i ? 'selected="selected"' : '')) . '>' . (empty($i) ? $l['max_backups_unlimited'] : $i) . '</option>';
        }
        echo '</select>
</td>
</tr>';
        if (!aefer() && !ent()) {
            echo '<tr>
<td>
<span class="sai_head">' . $l['backups_expire'] . '</span><br />
<span class="sai_exp2">' . $l['backups_expire_exp'] . '</span>
</td>
<td valign="top">
<input type="text" id="backups_expire" name="backups_expire" value="' . aPOSTval('backups_expire', @$globals['backups_expire']) . '" onblur="isNumber(this)"/>&nbsp; days
</td>
</tr>';
        }
        echo '<tr>
<td>
<span class="sai_head">' . $l['off_upgrade_plugins'] . '</span><br />
<span class="sai_exp2">' . $l['off_upgrade_plugins_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_upgrade_plugins" ' . POSTchecked('off_upgrade_plugins', @$globals['off_upgrade_plugins']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_upgrade_themes'] . '</span><br />
<span class="sai_exp2">' . $l['off_upgrade_themes_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_upgrade_themes" ' . POSTchecked('off_upgrade_themes', @$globals['off_upgrade_themes']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['enable_auto_upgrade'] . '</span><br />
<span class="sai_exp2">' . $l['enable_auto_upgrade_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="enable_auto_upgrade" ' . POSTchecked('enable_auto_upgrade', @$globals['enable_auto_upgrade']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['force_auto_upgrade'] . '</span><br />
<span class="sai_exp2">' . $l['force_auto_upgrade_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="force_auto_upgrade" ' . POSTchecked('force_auto_upgrade', @$globals['force_auto_upgrade']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['enc_db_pass'] . '</span><br />
<span class="sai_exp2">' . $l['enc_db_pass_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="enc_db_pass" ' . POSTchecked('enc_db_pass', @$globals['enc_db_pass']) . ' />
</td>
</tr>

<td>
<span class="sai_head">' . $l['set_backup_dir'] . '</span><br />
<span class="sai_exp2">' . $l['set_backup_dir_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="set_backup_dir" size="20" value="' . aPOSTval('set_backup_dir', @$globals['set_backup_dir']) . '" />
</td>
</tr>';
        if (asperapp(1, 0, 0)) {
            // Only for Softaculous
            echo '
<tr>
<td>
<span class="sai_head">' . $l['default_landing'] . '</span><br />
<span class="sai_exp2">' . $l['default_landing_exp'] . '</span>
</td>
<td valign="top">
<select name="default_landing">
<option value="" ' . (!isset($_POST['default_landing']) && empty($globals['default_landing']) ? 'selected="selected"' : '') . '>' . $l['top_scripts'] . '</option>
<option value="installations" ' . (isset($_POST['default_landing']) && $_POST['default_landing'] == 'installations' ? 'selected="selected"' : ($globals['default_landing'] == 'installations' ? 'selected="selected"' : '')) . '>' . $l['all_ins'] . '</option>
<option value="outdated_ins" ' . (isset($_POST['default_landing']) && $_POST['default_landing'] == 'outdated_ins' ? 'selected="selected"' : ($globals['default_landing'] == 'outdated_ins' ? 'selected="selected"' : '')) . '>' . $l['outdated_ins'] . '</option>
</select>
</td>
</tr>';
        }
        if (aefer()) {
            echo '<tr>
	<td>
	<span class="sai_head">' . $l['no_ftp_encrypted'] . '</span><br />
	<span class="sai_exp2">' . $l['no_ftp_encrypted_exp'] . '</span>
	</td>
	<td valign="top">
	<input type="checkbox" name="no_ftp_encrypted" ' . POSTchecked('no_ftp_encrypted', @$globals['no_ftp_encrypted']) . ' />
	</td>
	</tr>
	
	<tr>
	<td>
	<span class="sai_head">' . $l['no_add_domain'] . '</span><br />
	<span class="sai_exp2">' . $l['no_add_domain_exp'] . '</span>
	</td>
	<td valign="top">
	<input type="checkbox" name="no_add_domain" ' . POSTchecked('no_add_domain', @$globals['no_add_domain']) . ' />
	</td>
	</tr>
	
	<tr>
	<td>
	<span class="sai_head">' . $l['no_prefill_db'] . '</span><br />
	<span class="sai_exp2">' . $l['no_prefill_db_exp'] . '</span>
	</td>
	<td valign="top">
	<input type="checkbox" name="no_prefill_db" ' . POSTchecked('no_prefill_db', @$globals['no_prefill_db']) . ' />
	</td>
	</tr>';
        }
        if (aefer() || ent()) {
            echo '<tr>
	<td>
	<span class="sai_head">' . $l['session_timeout'] . '</span><br />
	<span class="sai_exp2">' . $l['session_timeout_exp'] . '</span>
	</td>
	<td valign="top">
	<input type="text" id="session_timeout" name="session_timeout" value="' . aPOSTval('session_timeout', @$globals['session_timeout']) . '" onblur="isNumber(this)"/>
	</td>
	</tr>';
        }
    }
    echo '</table>
</td>
</tr>';
    if (!defined('SOFTRESELLER')) {
        // PFX Settings will be here
        if (!empty($globals['lictype'])) {
            echo '<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['pfx_settings'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['eu_enable_themes'] . '</span><br />
<span class="sai_exp2">' . $l['eu_enable_themes_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="eu_enable_themes" ' . POSTchecked('eu_enable_themes', @$globals['eu_enable_themes']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['eu_themes_premium'] . '</span><br />
<span class="sai_exp2">' . $l['eu_themes_premium_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="eu_themes_premium" ' . POSTchecked('eu_themes_premium', @$globals['eu_themes_premium']) . ' />
</td>
</tr>

</table>
</td>
</tr>';
        }
        echo '
<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['update_settings'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td valign="top" <td width="55%">
<span class="sai_head">' . $l['auto_upd_softac'] . '</span><br />
<span class="sai_exp2">' . $l['auto_upd_softac_exp'] . '</span>
</td>
<td valign="top">
<input type="radio" name="update" value="0" ' . POSTradio('update', 0, $globals['update']) . ' /> ' . $l['never_update'] . ' <br />
<input type="radio" name="update" value="1" ' . POSTradio('update', 1, $globals['update']) . ' /> ' . $l['stable'] . ' <br />
<input type="radio" name="update" value="2" ' . POSTradio('update', 2, $globals['update']) . ' /> ' . $l['release_cand'] . '
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['auto_upd_soft'] . '</span><br />
<span class="sai_exp2">' . $l['auto_upd_soft_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="update_softs" ' . POSTchecked('update_softs', $globals['update_softs']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['auto_add_soft'] . '</span><br />
<span class="sai_exp2">' . $l['auto_add_soft_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="add_softs" ' . POSTchecked('add_softs', $globals['add_softs']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['email_upd_soft'] . '</span><br />
<span class="sai_exp2">' . $l['email_upd_soft_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="email_update" ' . POSTchecked('email_update', $globals['email_update']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['email_upd_softs'] . '</span><br />
<span class="sai_exp2">' . $l['email_upd_softs_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="email_update_softs" ' . POSTchecked('email_update_softs', $globals['email_update_softs']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['cron_time'] . '</span><br />
<span class="sai_exp2">' . $l['cron_time_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="cron_time" size="30" value="' . aPOSTval('cron_time', $globals['cron_time']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['php_bin'] . '</span><br />
<span class="sai_exp2">' . $l['php_bin_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="php_bin" size="30" value="' . aPOSTval('php_bin', $globals['php_bin']) . '" />
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['remove_options'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width = "55%">
<span class="sai_head">' . $l['remove_dir'] . '</span><br />
<span class="sai_exp2">' . $l['remove_dir_exp'] . '</span><br />
</td>
<td valign="top">
<input type="checkbox" name="remove_dir" ' . POSTchecked('remove_dir', $globals['remove_dir']) . ' />
</td>
</tr>

<tr>
<td width = "55%">
<span class="sai_head">' . $l['remove_db'] . '</span><br />
<span class="sai_exp2">' . $l['remove_db_exp'] . '</span><br />
</td>
<td valign="top">
<input type="checkbox" name="remove_db" ' . POSTchecked('remove_db', $globals['remove_db']) . ' />
</td>
</tr>

<tr>
<td width = "55%">
<span class="sai_head">' . $l['remove_datadir'] . '</span><br />
<span class="sai_exp2">' . $l['remove_datadir_exp'] . '</span><br />
</td>
<td valign="top">
<input type="checkbox" name="remove_datadir" ' . POSTchecked('remove_datadir', $globals['remove_datadir']) . ' />
</td>
</tr>

<tr>
<td width = "55%">
<span class="sai_head">' . $l['remove_wwwdir'] . '</span><br />
<span class="sai_exp2">' . $l['remove_wwwdir_exp'] . '</span><br />
</td>
<td valign="top">
<input type="checkbox" name="remove_wwwdir" ' . POSTchecked('remove_wwwdir', $globals['remove_wwwdir']) . ' />
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['social_media'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['install_tweet_off'] . '</span><br />
<span class="sai_exp2">' . $l['install_tweet_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="install_tweet_off" ' . POSTchecked('install_tweet_off', $globals['install_tweet_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['install_tweet_msg'] . '</span><br />
<span class="sai_exp2">' . $l['install_tweet_msg_exp'] . '</span><br />
<span style="cursor:pointer;" onmouseover="showtip(\'' . $l['tweet_vars'] . '\', this)">' . $l['tweet_vars_link'] . '</span>
</td>
<td valign="top">
<input type="text" name="install_tweet" size="30" value="' . aPOSTval('install_tweet', !empty($globals['install_tweet']) ? $globals['install_tweet'] : $l['install_tweet']) . '" />
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['upgrade_tweet_off'] . '</span><br />
<span class="sai_exp2">' . $l['upgrade_tweet_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="upgrade_tweet_off" ' . POSTchecked('upgrade_tweet_off', $globals['upgrade_tweet_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['upgrade_tweet_msg'] . '</span><br />
<span class="sai_exp2">' . $l['upgrade_tweet_msg_exp'] . '</span><br />
<span style="cursor:pointer;" onmouseover="showtip(\'' . $l['tweet_vars'] . '\', this)">' . $l['tweet_vars_link'] . '</span>
</td>
<td valign="top">
<input type="text" name="upgrade_tweet" size="30" value="' . aPOSTval('upgrade_tweet', !empty($globals['upgrade_tweet']) ? $globals['upgrade_tweet'] : $l['upgrade_tweet']) . '" />
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['clone_tweet_off'] . '</span><br />
<span class="sai_exp2">' . $l['clone_tweet_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="clone_tweet_off" ' . POSTchecked('clone_tweet_off', $globals['clone_tweet_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['clone_tweet_msg'] . '</span><br />
<span class="sai_exp2">' . $l['clone_tweet_msg_exp'] . '</span><br />
<span style="cursor:pointer;" onmouseover="showtip(\'' . $l['tweet_vars'] . '\', this)">' . $l['tweet_vars_link'] . '</span>
</td>
<td valign="top">
<input type="text" name="clone_tweet" size="30" value="' . aPOSTval('clone_tweet', !empty($globals['clone_tweet']) ? $globals['clone_tweet'] : $l['clone_tweet']) . '" />
</td>
</tr>

</table>
</td>
</tr>

<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['disable_soft'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['soft_off'] . '</span><br />
<span class="sai_exp2">' . $l['soft_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off" ' . POSTchecked('off', $globals['off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_sub'] . '</span>
</td>
<td valign="top">
<input type="text" name="off_subject" size="30" value="' . aPOSTval('off_subject', $globals['off_subject']) . '" />
</td>
</tr>

<tr>
<td valign="top">
<span class="sai_head">' . $l['off_message'] . '</span>
</td>
<td valign="top">
<textarea name="off_message" cols="30" rows="6">' . aPOSTval('off_message', $globals['off_message']) . '</textarea>
</td>
</tr>';
    }
    echo '</table>

<p align="center"><input type="submit" name="editsettings" value="' . $l['edit_settings'] . '" class="sai_graybluebut"/></p>


</form>
<script>
function updateColor(color, id) {
	
	var hexColor = "transparent";
	if(color) {
		hexColor = color.toHexString();
	}
	if(hexColor == "transparent") return;
	
	// Set the hidden value so that we can save the settings
	$("#default_hf_bg").val("1");
	
	// For changing text colors of category heading
	if(id == "default_hf_text"){
		$(".soft_cathead a").css("color", hexColor);
		$(".soft_nav a").css("color", hexColor);
		$(".fa").css("color", hexColor);
		
		// set the hidden value so that it can be saved
		$("#hidden_default_hf_text").val(hexColor);
	}
	
	// For changing text colors of category heading hover color
	if(id == "default_cat_hover"){
		try{
			$(".soft_cathead:hover, .soft_cathead_slide:hover").css("background-color", hexColor);
			//$(".soft_cathead_slide:hover").css("background-color", hexColor);
		
			// set the hidden value so that it can be saved
			$("#hidden_default_cat_hover").val(hexColor);
		}catch(e){
			// do nothing
		}
	}
	
	// For changing text colors of script names
	if(id == "default_scriptname_text"){
		$(".softlinks li a").css("color", hexColor);
		
		// set the hidden value so that it can be saved
		$("#hidden_default_scriptname_text").val(hexColor);
	}
	
	// For changing background color
	if(id == "default_hf_bg"){
		$(".left_panel").css("background-image", "none");
		$(".left_panel").css("background-color", hexColor);
		$(".soft_nav").css("background", hexColor);
		
		// set the hidden value so that it can be saved
		$("#hidden_default_hf_bg").val(hexColor);
	}
	
}

var pallete_array = [
		["rgb(0, 0, 0)", "rgb(67, 67, 67)", "rgb(102, 102, 102)", /*"rgb(153, 153, 153)","rgb(183, 183, 183)",*/
		"rgb(204, 204, 204)", "rgb(217, 217, 217)", /*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/ "rgb(255, 255, 255)"],
		["rgb(152, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 153, 0)", "rgb(255, 255, 0)", "rgb(0, 255, 0)",
		"rgb(0, 255, 255)", "rgb(74, 134, 232)", "rgb(0, 0, 255)", "rgb(153, 0, 255)", "rgb(255, 0, 255)"],
		["rgb(230, 184, 175)", "rgb(244, 204, 204)", "rgb(252, 229, 205)", "rgb(255, 242, 204)", "rgb(217, 234, 211)",
		"rgb(208, 224, 227)", "rgb(201, 218, 248)", "rgb(207, 226, 243)", "rgb(217, 210, 233)", "rgb(234, 209, 220)",
		"rgb(221, 126, 107)", "rgb(234, 153, 153)", "rgb(249, 203, 156)", "rgb(255, 229, 153)", "rgb(182, 215, 168)",
		"rgb(162, 196, 201)", "rgb(164, 194, 244)", "rgb(159, 197, 232)", "rgb(180, 167, 214)", "rgb(213, 166, 189)",
		"rgb(204, 65, 37)", "rgb(224, 102, 102)", "rgb(246, 178, 107)", "rgb(255, 217, 102)", "rgb(147, 196, 125)",
		"rgb(118, 165, 175)", "rgb(109, 158, 235)", "rgb(111, 168, 220)", "rgb(142, 124, 195)", "rgb(194, 123, 160)",
		"rgb(166, 28, 0)", "rgb(204, 0, 0)", "rgb(230, 145, 56)", "rgb(241, 194, 50)", "rgb(106, 168, 79)",
		"rgb(69, 129, 142)", "rgb(60, 120, 216)", "rgb(61, 133, 198)", "rgb(103, 78, 167)", "rgb(166, 77, 121)",
		/*"rgb(133, 32, 12)", "rgb(153, 0, 0)", "rgb(180, 95, 6)", "rgb(191, 144, 0)", "rgb(56, 118, 29)",
		"rgb(19, 79, 92)", "rgb(17, 85, 204)", "rgb(11, 83, 148)", "rgb(53, 28, 117)", "rgb(116, 27, 71)",*/
		"rgb(91, 15, 0)", "rgb(102, 0, 0)", "rgb(120, 63, 4)", "rgb(127, 96, 0)", "rgb(39, 78, 19)",
		"rgb(12, 52, 61)", "rgb(28, 69, 135)", "rgb(7, 55, 99)", "rgb(32, 18, 77)", "rgb(76, 17, 48)"]
	];

$(function() {
	$("#default_hf_bg").spectrum({
		allowEmpty:true,
		color : "' . (!empty($globals['default_hf_bg']) ? $globals['default_hf_bg'] : '#333333') . '",
		showInput: true,
		className: "full-spectrum",
		showInitial: true,
		showPalette: true,
		showSelectionPalette: true,
		maxPaletteSize: 10,
		preferredFormat: "hex",
		localStorageKey: "soft.demo",
		move: function (color) {
			updateColor(color, this.id);
		},
		hide: function (color) {
			updateColor(color, this.id);
		},
		palette: pallete_array
	});
});

$(function() {
	$("#default_cat_hover").spectrum({
		allowEmpty:true,
		color : "' . (!empty($globals['default_cat_hover']) ? $globals['default_cat_hover'] : '#4096ee') . '",
		showInput: true,
		className: "full-spectrum",
		showInitial: true,
		showPalette: true,
		showSelectionPalette: true,
		maxPaletteSize: 10,
		preferredFormat: "hex",
		localStorageKey: "soft.demo",
		move: function (color) {
			updateColor(color, this.id);
		},
		hide: function (color) {
			updateColor(color, this.id);
		},
		palette: pallete_array
	});
});

$(function() {
	$("#default_hf_text").spectrum({
		allowEmpty:true,
		color : "' . (!empty($globals['default_hf_text']) ? $globals['default_hf_text'] : '#F2F2F2') . '",
		showInput: true,
		className: "full-spectrum",
		showInitial: true,
		showPalette: true,
		showSelectionPalette: true,
		maxPaletteSize: 10,
		preferredFormat: "hex",
		localStorageKey: "soft.demo",
		move: function (color) {
			updateColor(color, this.id);
		},
		hide: function (color) {
			updateColor(color, this.id);
		},
		palette: pallete_array
	});
});

$(function() {
	$("#default_scriptname_text").spectrum({
		allowEmpty:true,
		color : "' . (!empty($globals['default_scriptname_text']) ? $globals['default_scriptname_text'] : '#FFFFFF') . '",
		showInput: true,
		className: "full-spectrum",
		showInitial: true,
		showPalette: true,
		showSelectionPalette: true,
		maxPaletteSize: 10,
		preferredFormat: "hex",
		localStorageKey: "soft.demo",
		move: function (color) {
			updateColor(color, this.id);
		},
		hide: function (color) {
			updateColor(color, this.id);
		},
		palette: pallete_array
	});
});
</script>';
    softfooter();
}
Exemple #4
0
function perl_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $allcatwise;
    global $software, $soft, $info, $settings, $init_tab, $dbtype, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $cron, $datadir, $ajaxdb, $ajaxdbexists, $overwrite_option, $protocols, $nopackage, $www, $ajaxhttpsexists, $ajaxhttps, $new_insid;
    if (optGET('notify')) {
        get_softaculous_file('http://www.softaculous.com/notifyversion.php?softid="' . $soft . '"');
        echo 1;
        return true;
    }
    if (optGET('ajaxdownload') && !empty($nopackage)) {
        // Try to download the package
        if (method_exists($softpanel, 'updatesoftwares')) {
            $softpanel->updatesoftwares($soft, 0, 0, 1);
            echo 1;
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    if (!empty($ajaxdb)) {
        echo $ajaxdbexists;
        return true;
    }
    if (!empty($ajaxhttps)) {
        echo $ajaxhttpsexists;
        return true;
    }
    // Auto Installation responses
    if (isset($_GET['autoinstall'])) {
        // Installed successfully
        if (!empty($installed)) {
            echo 'installed';
            return true;
        }
        // Are there errors
        if (!empty($error)) {
            echo serialize($error);
            return false;
        }
    }
    //First add the installation info
    if (empty($installed)) {
        $random_username = true;
        // This is to see if a script has predefined username and cannot be changed
        foreach ($settings as $ik => $iv) {
            if ($ik == 'hidden') {
                continue;
            }
            foreach ($iv as $ikk => $ivv) {
                if ($ikk == 'admin_username' && preg_match('/disabled=\\"disabled\\"/ie', $ivv['tag'])) {
                    $random_username = false;
                }
            }
        }
        $info['install'] = '<div id="fadeout_div"><form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware" class="form-horizontal">';
        if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
            $info['install'] .= '
		<div class="alert alert-warning">
			<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
			<center>' . lang_vars($l['not_in_free'], array($software['name'])) . (!webuzo() ? '&nbsp;&nbsp;' . $l['notify_admin'] : '') . '</center>
		</div>';
        }
        $info['install'] .= error_handle($error, "100%", 0, 1) . '

<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
function toggle_advoptions(ele){
	//alert("#"+ele);
	if ($("#"+ele).is(":hidden")){
		$("#"+ele).slideDown("slow");
		$("#advoptions_toggle_plus").attr("src", "' . $theme['images'] . 'minus_new.gif");
	}
	else{
		$("#"+ele).slideUp("slow");
		$("#advoptions_toggle_plus").attr("src", "' . $theme['images'] . 'plus_new.gif");
	}
}

function plus_onmouseover(ele){
	$("#"+ele.id+"_plus").attr("src", "' . $theme['images'] . 'plus_hover.gif");
}

function plus_onmouseout(ele){
	$("#"+ele.id+"_plus").attr("src", "' . $theme['images'] . 'plus.gif");
}

function display_pass_strength(score, per){
	
	var lang;
	//disp_per = $("#pass-strength-hidden").val();
	
	if(typeof per == "undefined") per = 0;
	
	if(score == "bad") lang = "' . $l['bad'] . '";
	if(score == "good") lang = "' . $l['good'] . '";
	if(score == "strong") lang = "' . $l['strong'] . '";
	if(score == "short") lang = "' . $l['short'] . '";
	if(score == "strength_indicator") lang = "' . $l['strength_indicator'] . '";
	
	$("#pass-strength-result").addClass(score).html( lang+" ("+per+"/100)" );
}

function checkform(dosubmit){
	
	// If admin has set the password strength than only we will check for it.
	' . (!empty($globals['pass_strength']) ? '
	//alert($("#pass-strength-hidden").val());
	if(parseInt($("#pass-strength-hidden").val()) < ' . $globals['pass_strength'] . '){
		alert("' . $l['err_pass_strength'] . '"+' . $globals['pass_strength'] . ');
		return false;
	}' : '') . '
	
	try{
		if(!formcheck()){
			return false;
		}
	}catch(e){
		//Do nothing
	}
	$_("softsubmitbut").disabled = true;	
	
	if(!get_package()){
		return false;
	}
	
	if(useprog){
		
		// Send a request to check the status
		progressbar.start();
		
		// Return false so that the form is not submitted
		return false;
	
	// This is OLD School !
	}else{		
		if(dosubmit == 1){			
			$_("installsoftware").submit();	
		}
		show_msg("' . $l['installing'] . '");
	}
	
	return true;
	
};

var progressbar = {
	timer: 0,
	total_width: 0,	
	status_key: "",
	synctimer: 0,
	fadeout_div: "#fadeout_div",
	win_div: "#install_win",
	progress_div: "#progress_bar",
	formid: "#installsoftware",
	frequency: 8000,
	
	current: function(){
		try{
			var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
			if(tmp_cur > 100){
				tmp_cur = 99;
			}
			return tmp_cur;
		}catch(e){
			return -1;	
		}
	},
	
	reset: function(){ try{
		clearTimeout(this.timer);
		$_("progress_color").width = 1;
	}catch(e){ }},
	
	move: function(dest, speed, todo){ try{
		var cur = this.current();
		if(cur < 0){
			clearTimeout(this.timer);
			return false;
		}
		var cent = cur + 1;
		var new_width = cent/100*this.total_width;
		if(new_width < 1){
			new_width = 1;
		}
		//alert(new_width+" "+dest+" "+cent);
		$_("progress_color").width = new_width;
		$_("progress_percent").innerHTML = "("+cent+" %)";
		
		if(cent < dest){
			this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
		}else{
			eval(todo);	
		}
	}catch(e){ }},
	
	text: function(txt){ try{
		$_("progress_txt").innerHTML = txt;
	}catch(e){ }},
	
	sync: function(){
		if(progressbar.status_key.length < 2){
			return false;
		}
		$.ajax({
			url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
			type: "GET",
			success: function(data){
				if(data == 0) return false;
				var tmp = data.split("|");
				var cur = progressbar.current();
				tmp[2] = (3000/(tmp[0]-cur));
				//alert(tmp);
				if(tmp[0] > cur){
					if(parseInt(tmp[2]) == 0){
						tmp[2] = 800;
					}
					progressbar.move(tmp[0], tmp[2]);
				}
				progressbar.text(tmp[1]);
				progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
			}
		});
	},
	
	sync_abort: function(){
		clearTimeout(this.synctimer);
	},
	
	start: function(){ try{
		this.post();
		this.reset();
		this.total_width = parseInt($_("table_progress").width);
		this.move(95, 800);
		this.status_key = $("#soft_status_key").attr("value");
		this.sync();
	}catch(e){ }},
	
	post: function(){
		
		// Scroll to the Top and show the progress bar
		goto_top();
		$(progressbar.fadeout_div).fadeOut(500, 
			function(){
				$(progressbar.progress_div).fadeOut(1);
				$(progressbar.progress_div).fadeIn(500);
			}
		);
		
		$.ajax({
			url: window.location+"&jsnohf=1",
			type: "POST",
			data: $(progressbar.formid).serialize(),
			complete: function( jqXHR, status, responseText ) {
				
				progressbar.sync_abort();
				
				// Store the response as specified by the jqXHR object
				responseText = jqXHR.responseText;
				
				try{
					//alert(responseText);
					if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
						progressbar.text("' . addslashes($l['finishing_process']) . '");
						progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
					}else{
						progressbar.reset();
					}
				}catch(e){ }
				
				if ( jqXHR.isResolved() ) {
				
					// #4825: Get the actual response in case
					// a dataFilter is present in ajaxSettings
					jqXHR.done(function( r ) {
						responseText = r;
					});
			
					// Create a dummy div to hold the results
					// inject the contents of the document in, removing the scripts
					// to avoid any "Permission Denied" errors in IE
					var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
					
					$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
						$(progressbar.win_div).html(newhtml);
						show_backup();
						check_pass_strength();
						new_theme_funcs_init();
					}).delay(50).animate({opacity: 1}, 500);
					
					//alert(newhtml);
					
				}else{
					alert("Oops ... the connection was lost");
				}
			}
		});
	}
};

function show_msg(msg){	
	$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
	$_("show_txt").style.display = "";
}

// Is the package there ?
var nopackage = ' . (empty($nopackage) ? 0 : 1) . ';

// Use the Progress Bar ?
var useprog = 1;
try{
	if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
		useprog = 0;
	}
}catch(e){ }

function get_package(){	
	if(nopackage){
		
		show_msg("' . $l['downloading'] . '");
		
		try{		
			AJAX("' . $globals['index'] . 'act=perl&soft=' . $soft . '&ajaxdownload=1&random="+Math.random(), "get_package_handle(re)");
		}catch(e){ }
		
		return false;
	}else{
		$_("show_txt").style.display = "none";
		return true;
	}
};

function get_package_handle(resp){
	nopackage = 0;
	show_msg("' . $l['installing'] . '");
	checkform(1);
};

softemail = new Object();
function softmail(){
	try{
		var sofdom = "softdomain";
		for(x in softemail){
			if(softemail[x] == true) continue;
			var temp = $_(x).value.split("@");
			if($_(sofdom).value.indexOf("/") > 0){
				var dom_value = $_(sofdom).value.substring(0, $_(sofdom).value.indexOf("/"));
			}else{
				var dom_value = $_(sofdom).value;
			}
			$_(x).value = temp[0] + "@" + dom_value;
		}
	}catch(e){
		return false;
	}
};

function checkhttps(proto_id, softdomain_id, alrt){
	try{
		var id = $_(proto_id);
		var proto = id.options[id.selectedIndex].text;
	
		$("#checkhttps_wait").css("display","inline-block");
		if(proto.indexOf("https") !== -1){
		
			 $.ajax({
				type: "POST",
				url: "' . $globals['index'] . 'act=perl&soft=' . $soft . '&checkhttps="+encodeURIComponent(proto+$_(softdomain_id).value),
				timeout:10000,
				// Checking for error
				success: function(data){
					$("#checkhttps_wait").css("display","none");
					is_https(data);
				},
				error: function(jqXHR, status, e) {
					$("#checkhttps_wait").css("display","none");
					is_https(e);
					return false;
				}
			}); 
			
			//AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&checkhttps="+id.options[id.selectedIndex].text+$_(softdomain_id).value, "is_https(re)");
		}else{
			$("#checkhttps_wait").css("display","none");
			is_https("true");
		}
		if(alrt == true){
			alert(proto+$_(softdomain_id).value);
		}
	}catch(e){
		//
	}
	return true;
};

function is_https(re){
	try{
		httpserror = "";
		
		//Check if it exists
		if(re !== "true"){
			httpserror = "' . $l['no_https'] . '";
		}
		if(httpserror != ""){
			$_("httpserror").style.display = "block";
			$_("httpserror").innerHTML = httpserror;
			return false;
		}else{
			$_("httpserror").style.display = "none";
		}
		
	}catch(e){
		//
	}
	return true;
};

function prepend_prefix(prefix){
	
	// Decide prefix USERNAME, DOMAIN OR USER DEFINED
	if(prefix != "" && prefix == "username") prefix = "' . $softpanel->user['name'] . '";
	if(prefix != "" && prefix == "domain") prefix = "' . current(array_keys($softpanel->domainroots)) . '";
	if(prefix != "" && prefix != "domain" && prefix != "username");
	
	// APPEND OLD USERNAME OR DEFAULT USERNAME
	var old = $_("admin_username").value
	temp = $_("admin_username").value.split("-");
	if (typeof temp[1] == \'string\' || temp[1] instanceof String){
		$_("admin_username").value = prefix+"-"+temp[1];
	}else{
		$_("admin_username").value = prefix+"-"+old;
	}
}

function change_admin_prefix(domain){
	var admin_prefix = \'' . $globals['admin_prefix'] . '\';
	var random_username = \'' . (!empty($random_username) ? 'true' : '') . '\';
	var empty_username = \'' . (empty($globals['empty_username']) ? 'true' : '') . '\';
	var gl_random_username = \'' . (empty($globals['random_username']) ? 'true' : '') . '\';
	if(admin_prefix == "domain" && random_username == "true" && empty_username == "true" && gl_random_username == "true"){
		prepend_prefix(domain);
	}
}
  
// show/hide backup options
function show_backup(){

	var auto_backup = $("#auto_backup").val();
	
	if(auto_backup == 0){
		$("#auto_backup_rotation").attr("disabled", true);
	}else{
		$("#auto_backup_rotation").attr("disabled", false);
	}
	
	return true;
};

' . (!empty($_POST) ? '' : 'addonload(\'softmail();show_backup();\');');
        if (!empty($dbtype)) {
            $info['install'] .= 'function checkdbname(id, alrt){
	try{		
		AJAX("' . $globals['index'] . 'act=perl&soft=' . $soft . '&checkdbexists="+$_(id).value, "dbexists(\'"+id+"\', "+alrt+", re)");	
	}catch(e){
		//
	}
	return true;
};

function dbexists(id, alrt, re){
	try{
		
		dberror = "";
		
		//Is the length fine
		if($_(id).value.length > 7){
			dberror = "' . $l['db_name_long'] . '";
		}
		
		//There should be only alphanumeric characters
		if(/[^a-zA-Z0-9]/.test($_(id).value)){
			dberror = "' . $l['db_alpha_num'] . '";
		}
		
		//Check if it exists
		if(re == "true"){
			dberror = "' . $l['database_exists'] . '";
		}
		
		if(dberror != ""){
			$_(id+"error").style.display = "block";
			$_(id+"error").innerHTML = dberror;
			if(alrt == true){
				alert(dberror);
			}
			return false;
		}else{
			$_(id+"error").style.display = "none";
		}
		
	}catch(e){
		//
	}
	return true;
};';
        }
        //End of if($dbtype)
        $info['install'] .= '// ]]></script>';
        $info['install'] .= '
<div class="bg">
	<div class="sai_sub_head">' . $l['setup'] . '</div><hr>';
        if (empty($softpanel->noprotocol) && empty($globals['hide_protocol'])) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="softproto" class="sai_head">' . $l['choose_protocol'] . '</label><br />
				<span class="sai_exp2">' . $l['choose_protocol_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="softproto" class="form-control" id="softproto" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
            foreach ($protocols as $k => $v) {
                $info['install'] .= '<option value="' . $k . '" ' . (optPOST('softproto') == $k || $globals['default_protocol'] == $k && empty($_POST['softproto']) ? 'selected="selected"' : '') . '>' . $v . '</option>';
            }
            $info['install'] .= '</select><div style="display:none;" id="checkhttps_wait">&nbsp;&nbsp;<img src="' . $theme['images'] . 'progress.gif" alt="please wait.."></div><br />
				<div class="row">
					<span id="httpserror" style="display:none; padding:10px;" class="alert alert-danger"></span>
				</div>
			</div>
		</div>';
        }
        $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">';
        $info['install'] .= '
				<label for="softdomain" class="sai_head">' . $l['choose_domain'] . '</label><br />
				<span class="sai_exp2">' . $l['choose_domain_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="softdomain" class="form-control" id="softdomain" onchange="softmail();change_admin_prefix(this.value);" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
        if (!empty($globals['blank_domain'])) {
            $info['install'] .= '<option value="" ' . (empty($_POST['softdomain']) ? 'selected="selected"' : '') . '>(' . $l['select_domain'] . ')</option>';
        }
        foreach ($softpanel->domainroots as $domain => $dompath) {
            $info['install'] .= '<option value="' . $domain . '" ' . (!empty($_POST['softdomain']) && $_POST['softdomain'] == $domain ? 'selected="selected"' : '') . '>' . $domain . '</option>';
        }
        $info['install'] .= '
				</select>
			</div>
		</div><br />
	
		<div class="row">
			<div class="col-sm-5">
				<label for="softdirectory" class="sai_head">' . $l['in_directory'] . '</label><br />
				<span class="sai_exp2">' . $l['in_directory_exp'] . '</span>
			</div>
			<div class="col-sm-7">	
				<input type="text" name="softdirectory" class="form-control" id="softdirectory" size="30" value="' . POSTval('softdirectory', !empty($globals['no_prefill']) ? '' : $software['softname']) . '" />
			</div>
		</div><br />';
        // A www Directory ?
        if (!empty($www)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="wwwdir" class="sai_head">' . $l['wwwdir'] . '</label><br />
				<span class="sai_exp2">' . $l['wwwdir_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="text" name="wwwdir" id="wwwdir" class="form-control" size="30" value="' . POSTval('wwwdir', $www) . '" />		
			</div>
		</div><br />';
        }
        if (!empty($datadir)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="datadir" class="sai_head">' . $l['datadir'] . '</label><br />
				<span class="sai_exp2">' . $l['datadir_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="text" name="datadir" class="form-control" id="datadir" size="30" value="' . POSTval('datadir', $datadir) . '" />		
			</div>
		</div><br />';
        }
        if (!empty($dbtype)) {
            $dbname = mysqldbname($software['softname']);
            if (method_exists($softpanel, 'mysqldbname')) {
                $dbname = $softpanel->mysqldbname();
            }
            if (empty($dbtype) || aefer()) {
                $info['install'] .= '
			<div class="row">
				<div class="col-sm-5">
					<label for="softdb" class="sai_head">' . $l['database_name'] . '</label><br />
					<span class="sai_exp2">' . $l['database_name_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="text" name="softdb" id="softdb" class="form-control" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" />
					<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
				</div>
			</div><br />';
            }
        }
        // Are there any cron jobs
        if (!empty($cron)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<span class="sai_head">' . $l['cron_job'] . '</span><br />
				<span class="sai_exp2">' . $l['cron_job_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<div class="row">
					<div class="col-sm-2">
						<span>' . $l['cron_min'] . '</span>	
						<input type="text" class="form-control" name="cron_min" id="cron_min" size="2" value="' . POSTval('cron_min', $cron['min']) . '" />
					</div>
					<div class="col-sm-2">
						<span>' . $l['cron_hour'] . '</span>
						<input type="text" class="form-control" name="cron_hour" id="cron_hour" size="2" value="' . POSTval('cron_hour', $cron['hour']) . '" />
					</div>
					<div class="col-sm-2">
						<span>' . $l['cron_day'] . '</span>
						<input type="text" class="form-control" name="cron_day" id="cron_day" size="2" value="' . POSTval('cron_day', $cron['day']) . '" />
					</div>
					<div class="col-sm-2">
						<span>' . $l['cron_month'] . '</span>
						<input type="text" class="form-control" name="cron_month" id="cron_month" size="2" value="' . POSTval('cron_month', $cron['month']) . '" />
					</div>
					<div class="col-sm-2">
						<span>' . $l['cron_weekday'] . '</span>
						<input type="text" class="form-control" name="cron_weekday" id="cron_weekday" size="2" value="' . POSTval('cron_weekday', $cron['weekday']) . '" />
					</div>
				</div>
			</div>
		</div><br />';
        }
        if (!empty($overwrite_option)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<span class="sai_head">' . $l['overwrite'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="checkbox" name="overwrite_existing" id="overwrite_existing" />
			</div>
		</div>';
        }
        $info['install'] .= '
</div><br /><!--end of bg class-->';
        if (!empty($settings)) {
            if (file_exists($software['path'] . '/install.js')) {
                $info['install'] .= '<script language="javascript" type="text/javascript"><!--// --><![CDATA[';
                $info['install'] .= @parselanguages(str_replace('$(', '$_(', implode('', file($software['path'] . '/install.js'))));
                $info['install'] .= '// ]]></script>';
            }
            foreach ($settings as $group => $sets) {
                if ($group == 'hidden' || empty($sets)) {
                    continue;
                }
                $info['install'] .= '
			<div class="bg">
				<div class="sai_sub_head">' . $group . '</div><hr>';
                foreach ($sets as $sk => $sv) {
                    //Adding class to input
                    if (preg_match('/type="text"/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/>/is', ' class="form-control">', $sv['tag']);
                    }
                    if (preg_match('/<select/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/<select/is', '<select class="form-control"', $sv['tag']);
                    }
                    $info['install'] .= '
				<div class="row">
					<div class="col-sm-5">
						<label for=' . $sk . ' class="sai_head" id="sai_head">' . $sv['head'] . '</label>
							' . (empty($sv['exp']) ? '' : '<span class="sai_exp">' . $sv['exp'] . '</span>') . '	
					</div>
					' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? preg_replace('/>|\\/>/is', ' onkeyup="check_pass_strength();" >', '
						<div class="col-sm-6">' . $sv['tag'] . '<div id="pass-strength-result" style="border-radius:3px;">' . $l['strength_indicator'] . '</div></div>') : '<div class="col-sm-7 ">' . $sv['tag'] . '</div>') . '
						' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						softemail["' . $sk . '"] = false;
						//Add an event handler
						$_("' . $sk . '").onkeydown = function(){
							softemail["' . $sk . '"] = true;
						}
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? '
						<div class="col-sm-1">
							<a href="javascript: void(0);"  onclick="$_(\'' . $sk . '\').value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');check_pass_strength();return false;" title="' . $l['randpass'] . '"><img src="' . $theme['images'] . 'randpass.gif" /></a>
						</div>
						<div class="clearfix"></div>
						' : '') . '
						
						' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && (!empty($softpanel->securepass) || !empty($globals['random_pass'])) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');check_pass_strength();\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && !empty($globals['empty_pass']) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value="";check_pass_strength();\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/dbprefix/is', $sv['tag']) && !empty($globals['random_dbprefix']) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value=randstr(3)+"_";\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['random_username']) && !empty($random_username) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value=randstr(5);\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['empty_username']) && !empty($random_username) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value="";\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['admin_prefix']) && empty($globals['empty_username']) && empty($globals['random_username']) && !empty($random_username) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'prepend_prefix("' . $globals['admin_prefix'] . '");\');
							// ]]></script>
						' : '') . '
				</div><br />';
                }
                $info['install'] .= '</div><br /><!--end of bg class-->';
            }
            //The Hidden groups
            if (!empty($settings['hidden'])) {
                foreach ($settings['hidden'] as $sk => $sv) {
                    $info['install'] .= $sv['tag'] . '
				' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
				softemail["' . $sk . '"] = false;
				//Add an event handler
				$_("' . $sk . '").onkeydown = function(){
					softemail["' . $sk . '"] = true;
				}
				// ]]></script>
				' : '');
                }
            }
        }
        //End of if($settings)
        //Is it a SOFTCOPY, then Leave a NOTE
        if (!empty($setupcontinue)) {
            $info['install'] .= '
		' . $l['softcopy_note'] . '
	';
        }
        // Advance option
        $info['install'] .= '
	<div class="bg">
		<div class="sai_sub_head" id="advoptions_toggle" onclick="toggle_advoptions(\'advoptions\');" style="cursor:pointer"><img id="advoptions_toggle_plus"  src="' . $theme['images'] . 'plus_new.gif" style="margin-top:-4px;"/>&nbsp;&nbsp;' . $l['adv_option'] . '</div>
		<div id="advoptions" style="display:none;"><hr>
			' . (aefer() ? "" : '<div class="row">
					<div class="col-sm-5">
						<label for="softdb" class="sai_head">' . $l['database_name'] . '</label><br />
						<span class="sai_exp2">' . $l['database_name_exp'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="text" name="softdb" class="form-control" id="softdb" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" /><br />
						<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
					</div>
				</div>') . '

				<div class="row">
					<div class="col-sm-5">
						<label class="sai_head">' . $l['disable_notify_update'] . '</label>
						<span class="sai_exp">' . $l['exp_disable_notify_update'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="checkbox" name="disable_notify_update" id="disable_notify_update" ' . POSTchecked('disable_notify_update') . ' />
					</div>		
				</div><br />';
        // Auto backups option only if backups is not disabled and panel is not remote
        if (empty($globals['disable_backup_restore']) && empty($globals['disable_auto_backup']) && !aefer() && empty($softpanel->disable_auto_backup)) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label for="auto_backup" class="sai_head">' . $l['auto_backup'] . '</label>
							<span class="sai_exp">' . $l['exp_auto_backup'] . '</span>
						</div>
						<div class="col-sm-7">
							<select name="auto_backup" class="form-control" id="auto_backup" onchange="show_backup();">
								<option value="0" ' . POSTselect('auto_backup', '0', 1) . '>' . $l['no_backup'] . '</option>' . (empty($globals['disable_auto_backup_daily']) ? '<option value="daily" ' . POSTselect('auto_backup', 'daily') . '>' . $l['daily'] . '</option>' : '') . (empty($globals['disable_auto_backup_weekly']) ? '<option value="weekly" ' . POSTselect('auto_backup', 'weekly') . '>' . $l['weekly'] . '</option>' : '') . (empty($globals['disable_auto_backup_monthly']) ? '<option value="monthly" ' . POSTselect('auto_backup', 'monthly') . '>' . $l['monthly'] . '</option>' : '') . '
							</select>
						</div>	
					</div><br />
					
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . $l['auto_backup_rotation'] . '</label>
							<span class="sai_exp">' . $l['exp_auto_backup_rotation'] . '</span>
						</div>
						<div class="col-sm-7"> 
							<select name="auto_backup_rotation" class="form-control" id="auto_backup_rotation">';
            for ($i = 0; $i <= 10; $i++) {
                // Do we have a limit from admin ?
                if (!empty($globals['auto_backup_limit']) && ($i > $globals['auto_backup_limit'] || $i == 0) || !empty($globals['max_backups']) && ($i > $globals['max_backups'] || $i == 0)) {
                    continue;
                }
                $info['install'] .= '<option value="' . $i . '" ' . POSTselect('auto_backup_rotation', $i, $i == 4 ? '1' : '0') . '>' . (empty($i) ? $l['unlimited'] : $i) . '</option>';
            }
            $info['install'] .= '</select>
						</div>	
					</div><br />';
        }
        $info['install'] .= '
		</div>
	</div><br /><!--end of bg-->';
        $info['install'] .= '

<p align="center">
	<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
	<input type="hidden" name="pass-strength-hidden" id="pass-strength-hidden" value="" />
	<input type="submit" name="softsubmitbut" id="softsubmitbut" value="' . $l['softsubmit'] . '" class="flat-butt" /><span id="show_txt" style="display:none;"></span>
	<br /><br /><br />
	' . (empty($globals['off_email_link']) && empty($globals['off_install_mail']) ? '<span class="sai_head">' . $l['ins_emailto'] . '</span> : <input type="text" name="emailto" id="emailto" size="20" value="' . POSTval('emailto', '') . '" />' : '') . '
</p>
<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
</form></div>

<div id="progress_bar" style="height:125px; width:100%; display: none;">
	<br />
	<center>
		<font size="4" color="#222222" id="progress_txt" style="width:100%;">' . $l['checking_data'] . '</font>
		<font style="font-size: 18px; font-weight: 400; color: #444444; width:100%;" id="progress_percent">(0 %)</font><br /><br />
	</center>
	<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
	-webkit-border-radius: 5px; border-radius: 5px; width:50%;">
		<tr>
			<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
			<td id="progress_nocolor">&nbsp;</td>
		</tr>
	</table>
<br /><center>' . $l['wait_note'] . '</center>
</div>
<br /><br /><br />';
    } elseif (!empty($installed)) {
        $info['install'] = '
	<div class="bg2">
		<h4>' . $l['congrats'] . '</h4><br />
		' . $software['name'] . ' ' . $l['succesful'] . ' : <br />
		<a href="' . $__settings['softurl'] . '" target="_blank">' . $__settings['softurl'] . '</a>
		' . (!empty($software['adminurl']) ? '<br />' . $l['admin_url'] . ' : <a href="' . $__settings['softurl'] . '/' . $software['adminurl'] . '" target="_blank">' . $__settings['softurl'] . '/' . $software['adminurl'] . '</a>' : '') . '<br /><br />
		' . (!empty($setupcontinue) ? $l['setup_continue'] . ' : <br />
		<a href="' . $__settings['softurl'] . '/' . $setupcontinue . '" target="_blank">' . $__settings['softurl'] . '/' . $setupcontinue . '</a><br /><br />' : '') . '
		' . $l['enjoy'] . '<br /><br />
		' . (!empty($notes) ? $l['install_notes'] . ' : <br />
		<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
		' . $l['please_note'] . '<br /><br />
		' . (!empty($globals['ampps_enabled']) && empty($globals['no_ampps']) && $globals['softpanel'] != 'ampps' ? lang_vars($l['ampps_download'], array($software['name'])) . '<br /><br />' : '') . '
		' . $l['regards'] . ',<br />
		' . $l['softinstaller'] . '<br /><br />
		<center><b><a href="' . script_link($soft) . '&highlight=' . $new_insid . '&postact=install">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['install_tweet_off']) || empty($globals['lictype'])) {
            $info['install'] .= '<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
				<div class="panel panel-info" style="width:55%; margin:0 auto;">
					<div class="panel-heading" style="padding:5px; font-size:15px;">
						<font><b>' . $l['install_tweet_sub'] . ' :</b></font>
					</div>
					<div class="panel-body">
						<div class="row">
							<div class="col-sm-10">
								<textarea name="text" cols="80" row="3" style="resize:none; width:100%;">' . loadtweetdata('install_tweet', $l['install_tweet']) . '</textarea>
							</div>
							<div class="col-sm-2">
								<input type="submit" value="Tweet!" class="btn btn-info" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/>
							</div>
						</div>
					</div>
				</div>
			</form>';
        }
        $info['install'] .= '
	</div><!--end of bg2 class--><!--PROC_DONE-->
	<br /><br />';
    }
    softheader($l['<title>'] . $software['name']);
    $loadedinfo = array('install', 'overview', 'features', 'reviews', 'screenshots', 'ratings');
    ?>
<script language="JavaScript" src="<?php 
    echo $theme['url'] . '/js/tabber.js';
    ?>
" type="text/javascript">
</script>
<script language="JavaScript" id="ratings_js_file" type="text/javascript"></script>
<script language="JavaScript" id="review_js_file"  type="text/javascript"></script>
<script language="JavaScript" id="reviews_js_file"  type="text/javascript"></script>
<script type="text/javascript">
tabs = new tabber;
tabs.tabs = new Array('<?php 
    echo implode('\', \'', $loadedinfo);
    ?>
');
tabs.tabwindows = new Array('<?php 
    echo implode('_win\', \'', $loadedinfo);
    ?>
_win');
tabs.inittab = <?php 
    echo '\'' . $init_tab . '\';';
    ?>
addonload('tabs.init();loadraterev();check_pass_strength();');

function loadraterev(){
<?php 
    if (empty($globals['off_rating_link']) && $soft < 10000) {
        echo '$_(\'ratings_js_file\').src = "https://www.softaculous.com/ratings.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    if (empty($globals['off_review_link']) && $soft < 10000) {
        echo '$_(\'review_js_file\').src =  "https://www.softaculous.com/review.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
        echo '$_(\'reviews_js_file\').src =  "https://www.softaculous.com/reviews.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    ?>
};

function notifyversion(){
	if(AJAX(window.location+"&notify=true", "notified(re)")){
		return false;
	}else{
		return true;	
	}
};

function notified(re){
	if(re == 1){
		alert('<?php 
    echo $l['notifyversion'];
    ?>
');
	}
};

function loadScreenshots(){
	$_('screenshots_iframe').src = '<?php 
    echo 'https://www.softaculous.com/screenshots/screenshots1.php?sid=' . $soft;
    ?>
';
};

</script>
<?php 
    $url = $theme['images'];
    $ratings = array();
    $deduct = 1;
    $r = $scripts[$soft]['ratings'];
    for ($i_r = 1; $i_r <= 5; $i_r++) {
        if ($r >= 1) {
            $ratings[$i_r] = '<img src="' . $url . 'star.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" />';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" />';
        } else {
            $ratings[$i_r] = '<img src="' . $url . 'nostar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" />';
        }
        $r = $r - $deduct;
    }
    // For custom themes
    if ($soft > 10000) {
        if (file_exists($globals['euthemes'] . '/' . $globals['theme_folder'] . '/images/topscripts/48/' . $iscripts[$soft]['softname'] . '.png')) {
            $custom_48 = $theme['images'] . 'topscripts/48/' . $iscripts[$soft]['softname'] . '.png';
        } else {
            $custom_48 = $theme['images'] . '/custom.png';
        }
    }
    echo '
<div class="bg">
	<div id="currentrating" style="display:none"></div>
	<div class="row" style="margin-left:10px;">
		' . (!empty($custom_48) ? '<img src="' . $custom_48 . '" alt="">' : '<img src="' . $globals['mirror_images'] . 'top15/48/' . $scripts[$soft]['softname'] . '.png" >') . '
		<span class="sai_process_heading" style="margin-left:20px;">' . $software['name'] . '</span>
	</div><br />
	<div class="row">
		<div class="col-sm-2">
			' . ($soft > 10000 ? '' : '<div class="someclass" title="' . $scripts[$soft]['ratings'] . '">' . implode('', $ratings) . '</div>') . '
		</div>
		<div class="col-sm-5 ver_style">
			' . $l['software_ver'] . ' : <font size="2"><b>' . (!empty($tmp_ver) ? $tmp_ver : $software['ver']) . '</b></font> &nbsp; &nbsp; <a href="javascript" onclick="notifyversion(); return false;" ><img src="' . $theme['images'] . 'notify.gif" name="notifyver" title="' . $l['notify_ver'] . '" alt="' . $l['notify_ver'] . '"></a>
		</div>
		<div class="col-sm-3 release_style">
			' . (!empty($info['release_date']) ? $l['release_date'] . ' : <font size="1"><b>' . $info['release_date'] . '</b></font>' : '') . '
		</div>
		<div class="col-sm-2 change_style">
			' . (!empty($info['changelog']) ? '&nbsp;&nbsp;<a href="javascript" data-toggle="modal" data-target="#changelog_div" class="sai_changelogbut" style="text-decoration:none;">' . $l['changelog'] . '</a>' : '') . '
		</div>
	</div><br />
	
	<script type=text/javascript>';
    if (!empty($softpanel->pheader)) {
        if (substr_count($_SERVER['REQUEST_URI'], 'x3') > 0) {
            echo '
			$(document).ready(function(){
				$(".ver_style").css("margin-left","0px");
				$(".release_style").css("margin-left","0px");
				$(".change_style").css({"margin-left":"0px", "margin-top":"-15px"});
			});';
        } else {
            echo '
			$(document).ready(function(){
				$(".ver_style").css("margin-left","0px");
				$(".release_style").css("margin-left","0px");
				$(".change_style").css({"margin-left":"0px", "margin-top":"-10px"});
			});';
        }
    }
    echo '
	</script>
	
	<div class="old_tab">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="sai_tabs">
			<tr>
				<td><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_insbut">' . $l['install'] . '</a></td>
				<td><a href="javascript:tabs.tab(\'overview\')" class="sai_tab" id="overview">' . $l['overview'] . '</a></td>
				<td><a href="javascript:tabs.tab(\'features\')" class="sai_tab" id="features">' . $l['features'] . '</a></td>
					' . (empty($globals['off_screenshot_link']) ? '<td><a href="javascript:tabs.tab(\'screenshots\'); loadScreenshots();" class="sai_tab" id="screenshots">' . $l['screenshots'] . '</a></td>' : '') . '
					' . (empty($globals['off_demo_link']) ? '<td><a href="' . ($soft >= 10000 && !empty($info['demo']) ? $info['demo'] : $globals['ind'] . 'act=demos&soft=' . $soft) . '" class="sai_tab" id="demo" target="_blank">' . $l['demo'] . '</a></td>' : '') . '
					' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'ratings\')" class="sai_tab" id="ratings">' . $l['ratings'] . '</a></td>' : '') . '
					' . (empty($globals['off_review_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'reviews\')" class="sai_tab" id="reviews">' . $l['reviews'] . '</a></td>' : '') . (empty($info['import']) ? '' : '<td><a href="' . $globals['ind'] . 'act=import&soft=' . $soft . '" class="sai_tab" id="ratings">' . $l['import'] . '</a></td>') . '
			</tr>
		</table><br />
	</div>
	<div class="new_tab">
		<nav class="navbar navbar-default">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>                        
				</button>
				<ul class="nav">
					<li class="active" style="width:80px;"><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_tab2" style="text-decoration:none; height:40px; top:5px;" data-toggle="collapse" data-target="#myNavbar">' . $l['install'] . '</a></li>
				</ul>
			</div>
			<div class="collapse navbar-collapse" id="myNavbar" style="position:absolute; z-index:1000; width:100%; background:#F8F8F8;">
				<ul class="nav navbar-nav">
					<li><a href="javascript:tabs.tab(\'overview\')"  id="overview" class="sai_tab2" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['overview'] . '</a></li>
					<li><a href="javascript:tabs.tab(\'features\')"  id="features" class="sai_tab2" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['features'] . '</a></li>
					<li>' . (empty($globals['off_screenshot_link']) ? '<a href="javascript:tabs.tab(\'screenshots\'); loadScreenshots();" class="sai_tab2" id="screenshots" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['screenshots'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_demo_link']) ? '<a href="' . ($soft >= 10000 && !empty($info['demo']) ? $info['demo'] : $globals['ind'] . 'act=demos&soft=' . $soft) . '" class="sai_tab2" id="demo" target="_blank" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['demo'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<a href="javascript:tabs.tab(\'ratings\')" class="sai_tab2" id="ratings" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['ratings'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_review_link']) && $soft < 10000 ? '<a href="javascript:tabs.tab(\'reviews\')" class="sai_tab2" id="reviews" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['reviews'] . '</a>' : '') . '</li>
					<li>' . (empty($info['import']) ? '' : '<a href="' . $globals['ind'] . 'act=import&soft=' . $soft . '" class="sai_tab2" id="ratings" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['import'] . '</a>') . '</li>
				</ul>
			</div>
		</nav>
	</div>';
    echo '<script type="text/javascript">
	$_(tabs.inittab).className = tabs.tabbedclass;

	var softid = ' . $soft . '

	tabs.override = function(id){
		if(id == \'install\'){
			$_(\'install\').className = \'sai_insbutclicked\';
		}else{
			$_(\'install\').className = \'sai_insbut\';
		}
	};
	</script>';
    //Parse and take care of images
    $info['overview'] = (!empty($info['changelog']) ? '
	<div class="modal fade" id="changelog_div" role="dialog" >
		<div class="modal-dialog modal-lg" style="margin-top:80px;">
		  <!-- Modal content-->
		  <div class="modal-content">
			<div class="modal-header" style="background:#F0F0F0;">
			  <button type="button" class="close" data-dismiss="modal">&times;</button>
			  <h4 class="modal-title">Changelog</h4>
			</div>
			<div class="modal-body" style="height: 350px; overflow-y: auto;">
			  ' . $info['changelog'] . '
			</div>
			<div class="modal-footer" style="padding-top:10px; height:50px;">
			  <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Close</button>
			</div>
		  </div>
		</div>
	</div>' : '') . '
	<div class="bg2">
		<div class="row">
			' . (!empty($scripts[$soft]['screenshots']) && empty($globals['panel_hf']) ? '
			<div class="col-sm-6">
				<div id="overview_img" style="padding:10px;" style="width:100%;"> <img src="' . $globals['mirror_images'] . 'softimages/screenshots/' . $soft . '_screenshot1.gif" class="img-responsive" alt=""> </div>
					
			</div>
			<div class="col-sm-6">' : '<div class="col-sm-12">') . '
				' . softparse($info['overview'], $soft) . '<br /><br />
				<div class="row">
					<div class="col-sm-1"><font color="#447edf"><i class="fa sai-disk fa-3x"></i></font></div>
					<div class="col-sm-5">
						<span class="sai_head">' . $l['space_req'] . '</span><br />
						<span class="sai_exp2">' . $l['available_space'] . ' : ' . (is_numeric($softpanel->spaceremain) ? number_format($softpanel->spaceremain / 1024 / 1024, 2) : $softpanel->spaceremain) . ' ' . $l['mb'] . '<br />
						' . $l['req_space'] . ' : ' . number_format($software['spacereq'] / 1024 / 1024, 2) . ' ' . $l['mb'] . '</span>
					</div>
				</div><br />
				<div class="row">
					<div class="col-sm-1"><a href="' . $info['support'] . '"><font color="#447edf"><i class="fa sai-question fa-3x"></i></font></a></div>
						<div class="col-sm-5">
							<span class="sai_head">' . $l['software_support'] . '</span><br />
							<span class="sai_exp2"><a href="' . $info['support'] . '" target="_blank">' . $l['support_link'] . '</a><br />
							' . $l['support_note'] . '</span>
						</div>
				</div>	
			</div>
		</div><br />
	</div><!--end of bg2 class-->';
    //r_print($no_autoupgrade);
    if (!empty($installations[$soft])) {
        $is_cloneable = is_cloneable($soft);
        $highlight = optGET('highlight');
        $action = optGET('postact');
        $info['overview'] .= '<br /><br />
		<center>
			<span class="sai_newhead">' . $l['current_ins'] . '</span><br />
		</center><hr>';
        $info['overview'] .= '
		<div class="bg2">
			<table class="table table-hover">
				<thead  style="background:#EFEFEF;" class="sai_head2">
					<tr>
						<th>' . $l['link'] . '</th>
						<th>' . $l['admin'] . '</th>
						<th>' . $l['ins_time'] . '</th>
						<th>' . $l['version'] . '</th>
						<th width="130">' . $l['options'] . '</th>
						<th><input type="checkbox" id="check_all"></th>
					</tr>
				</thead>';
        foreach ($installations[$soft] as $ik => $iv) {
            $is_upgradable = is_upgradable($ik);
            $info['overview'] .= '<tr id="trid' . $ik . '">
				<td class="endurl"><a href="' . $iv['softurl'] . '" target="_blank" id="insurl' . $ik . '">' . $iv['softurl'] . '</a>' . ($highlight == $ik && !empty($action) ? '<span id="highlight">&nbsp;&nbsp;<b class="sai_highlight">' . $l['act_' . $action] . '</b></span>' : '') . '</td>
				<td><a href="' . $iv['softurl'] . '/' . (!empty($iv['admin_folder']) ? $iv['admin_folder'] : admin_folder($iv['sid'])) . '" target="_blank"><img src="' . $theme['images'] . '/admin.gif" /></a></td>
				<td>' . datify($iv['itime']) . '</td>
				<td>' . $iv['ver'] . ($software['ver'] != $iv['ver'] && $is_upgradable ? ' <a href="' . $globals['ind'] . 'act=perl_upgrade&insid=' . $ik . '"><img src="' . $theme['images'] . 'updates.gif" alt="' . $l['upd_to'] . ' ' . implode(' or ', $is_upgradable) . '" title="' . $l['upd_to'] . ' ' . implode(' or ', $is_upgradable) . '" class="someclass"/></a>' : '') . '</td><td>' . (!empty($is_cloneable) ? '<a href="' . $globals['ind'] . 'act=sclone&insid=' . $ik . '" title="' . $l['clone'] . '"><img src="' . $theme['images'] . 'clone.gif" /></a>&nbsp;' : '') . (empty($globals['disable_backup_restore']) ? '<a href="' . $globals['ind'] . 'act=backup&insid=' . $ik . '" title="' . $l['backup'] . '"><img src="' . $theme['images'] . 'backup.gif" /></a>' : '') . ' &nbsp;<a href="' . $globals['ind'] . 'act=editdetail&insid=' . $ik . '" title="' . $l['editdetail'] . '"><img src="' . $theme['images'] . 'editdetail.gif" /></a>' . (asperapp(0, 0, 1) && !empty($can_publish) ? ' &nbsp;<a href="' . $globals['ind'] . 'act=publish&insid=' . $ik . '" title="' . $l['publish'] . '"><img src="' . $theme['images'] . 'publish.gif" /></a>' : '') . ' &nbsp;<a href="' . $globals['ind'] . 'act=remove&insid=' . $ik . '" title="' . $l['remove'] . '"><img src="' . $theme['images'] . 'remove.gif" /></a>
				<td>
					<input type="checkbox" name="insids[]" id="' . $iv['softurl'] . '" value="' . $ik . '" class="soft_inslist">
				</td>
				</tr>';
        }
        $info['overview'] .= '</table><br />
		<p align="right" style="width:100%;">
			<span class="sai_head">' . $l['with_selected'] . ':</span>
			<select name="multi_options" id="multi_options">
				<option name="todo" id="todo" value="0">---</option>
				<option name="todo" id="todo" value="mult_rem">' . $l['remove'] . '</option>
			</select>
			<input type="button" value="' . $l['go'] . '" onclick="show_confirm()" class="sai_graybluebut">
			<br />
		</p>
		<div id="rem_div"></div>
		</div><!--end of bg2 class-->
		
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	insids = new Array();
	removed = new Object();

	function show_confirm(){
		
		insids = new Array();
		removed = new Object();
		
		if($_("multi_options").value != "mult_rem"){
			return false;
		}

		// Build the list of Installations to remove
		var field = document.getElementsByName(\'insids[]\');
			insids = new Array();
			var c = 0;
			for(i = 0; i < field.length; i++){
				if(field[i].checked == true){
					insids[c] = field[i].value;
					c++;
				}
			
		}
		//alert(insids);
		
		if(c == 0){
			alert("' . $l['no_sel_inst'] . '");
			return false;
		}
		
		var r = confirm("' . $l['del_insid'] . '");
		if(r != true){
			return false;
		}
		
		remove_by_id(insids[0], "", 0);
	}

	function remove_by_id(insid, re, oldinsid){

		removed[insid] = false;
		
		if(re.length > 0 && oldinsid > 0){
			if(re == "removed"){
				removed[insid] = true;
			}
		}
		
		nextinsid = 0;
		
		// Find the next INSTALLATION to remove
		for(i = 0; i < insids.length; i++){
			if(typeof(removed[insids[i]]) != "undefined"){
				continue;
			}
			nextinsid = insids[i];
			break;
		}
		
		// If there is something left to be removed
		if(insid != 0){
			try{		
				AJAX("' . $globals['index'] . 'act=remove&insid="+insid+"&ajax=1&ssk="+randomstring(32)+"&random="+Math.random(), "remove_by_id(\'"+nextinsid+"\', re, \'"+insid+"\')");
				$_("rem_div").innerHTML = "<br /><br /><p align=\\"center\\"><img src=\\"' . $theme['images'] . 'ajax_remove.gif\\"> <br />' . $l['rem_inst_id'] . ' ID: " +insid+ ", URL: " + $_("insurl"+insid)+"<br /></p>";
				return true;
			}catch(e){
				return false;
			}
		}
		$_("rem_div").innerHTML = "";
		alert("' . $l['inst_remvd'] . '");
		location.reload(true);
		return true;
	}

	$(document).ready(function(){
		$("#check_all").on("click", function(event){
			if(this.checked == true){
				$(".soft_inslist").prop("checked", true);
			}else{
				$(".soft_inslist").prop("checked", false);
			}
		});
		
		$(".sai_altrowstable tr").mouseover(function(){
			var old_class = $(this).attr("class");
			
			if(old_class == "nohover") return;
			
			//alert(old_class);
			$(this).attr("class", "sai_tr_bgcolor");
			
			$(this).mouseout(function(){
				$(this).attr("class", old_class);
			});
		});';
        // If we get anything in $highlight than only we have to call this JS function other wise it will cause the JS error.
        if (!empty($highlight)) {
            $info['overview'] .= 'goto_id("insurl' . $highlight . '");
		$("#highlight").fadeOut(10000);';
        }
        $info['overview'] .= '});

	// ]]></script>';
    }
    if (count($allcatwise[$software['type']][$software['cat']]) > 2 && $software['cat'] != 'others') {
        $info['overview'] .= '<br /><br /><div class="bg2">
			<table width="100%" class="table table-hover">
				<tr>
					<th style="background:#EFEFEF" class="sai_head2">' . $l['related_scripts'] . '</th>
				</tr>
			</table>';
        $i = 0;
        foreach ($allcatwise[$software['type']][$software['cat']] as $k => $v) {
            if ($k == $soft || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
                continue;
            }
            // Show only 5 scripts
            if ($i == 5) {
                break;
            }
            $info['overview'] .= '
			<div style="text-decoration:none;display:inline-block;text-align:center;margin-top:10px;">
				<a href="' . script_link($k) . '"  title="' . $v['desc'] . '"  width="80" alt="" class="someclass" style="text-decoration:none;margin-top:5px;">
					<div class="sai_blog_script" style="margin-left:11%;">
						<div class="sai_demo_script_logo">
							<img src="' . $globals['mirror_images'] . 'top15/48/' . $v['softname'] . '.png" >	
						</div>
						<div class="sai_script_name">' . $v['name'] . '</div>
					</div>
				</a>
			</div>';
            $i++;
        }
        $info['overview'] .= '</div><!--end of bg2 class-->';
    }
    //Parse and take care of images
    $info['features'] = '<div class="bg2"><br />' . softparse($info['features'], $soft) . '</div><!--end of bg class-->';
    $info['ratings'] = '';
    $info['screenshots'] = '<div class="bg2"><iframe src="" id="screenshots_iframe" style="width:100%;height:500px;" frameborder="0" scrolling="no"></iframe></div><!--end of bg2 class-->';
    $info['reviews'] = '<div class="bg2"><div id="allreviews"></div></div><!--end of bg2 class-->';
    foreach ($info as $k => $v) {
        if (in_array($k, array('demo', 'support', 'import', 'changelog'))) {
            continue;
        }
        echo '<div id="' . $k . '_win" style="display: ' . ($init_tab == $k ? "block" : "none") . '; width:100%;"><br />
		' . $v . '
		</div>';
    }
    echo '</div><!--end of bg-->';
    softfooter();
}
Exemple #5
0
function adminindex_theme()
{
    global $theme, $globals, $user, $l;
    softheader($l['<title>']);
    echo '<script language="javascript" type="text/javascript" src="' . serverurls('latestinfo') . '"></script>

<script type="text/javascript">
function load_soft_info(){
	$_("softnews").style.width = $_("softnewsholder").offsetWidth;
	//The news
	if(typeof(soft_news) == "undefined"){
		$_("softnews").innerHTML = "' . $l['conect_to_soft'] . '";
	}else{
		var newsstr = "";
		for(x in soft_news){
			newsstr = newsstr+\'<div class="softnewshead">\'+soft_news[x][0]+\'</div>\'+\'<div class="softnewsblock">\'+soft_news[x][1]+\'</div><br />\';
		}
		$_("softnews").innerHTML = newsstr;
	}
	//The current version
	if(typeof(soft_latest_version) == "undefined"){
		$_("newsoftversion").innerHTML = "<i>' . $l['no_info'] . '</i>";
	}else{
		$_("newsoftversion").innerHTML = soft_latest_version;
	}
}
addonload(\'load_soft_info();\');
</script>

<br />
<div class="sai_divroundshad" style="width:690px; margin:0px auto;">
<table width="100%" cellpadding="1" cellspacing="1" class="sai_cbor">			
<tr>
<td class="header" align="center">
	<b>' . $l['news'] . '</b>
</td>
</tr>

<tr>
<td width="100%" class="cbgbor" height="200" valign="top" id="softnewsholder">
<div class="softnews" id="softnews"></div>
</td>
</tr>
</table>
</div>
<br /><br />';
    echo '
<div class="sai_divroundshad" style="width:650px; margin:0px auto; padding:20px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="75%" colspan="2">
<div align="center" class="infohead">' . $l['soft_info'] . '<br /></div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />
</td>
</tr>
<tr>
<td>
<div class="softinfo">' . (!defined('SOFTRESELLER') ? '<b>' . $l['soft_license'] . '</b> : ' . $globals['license'] . ' (' . $globals['primary_ip'] . ')<br />
<b>' . $l['soft_license_type'] . '</b> : ' . (empty($globals['lictype']) ? $l['type_0'] . ' (<a href="' . serverurls('buy') . '" target="_blank">' . $l['become_premium'] . '</a>)&nbsp; (<a href="' . serverurls('pricing') . '" target="_blank">' . $l['pricing'] . '</a>)' : $l['type_1']) . '&nbsp; (<a href="' . $globals['ind'] . 'refreshlicense">' . $l['refreshlicense'] . '</a>)' . (asperapp(0, 1, 1) ? '&nbsp; (<a href="' . $globals['ind'] . 'act=licensekey">Enter License Key</a>)' : '') : '') . ' <br />
<b>' . $l['server_addr'] . '</b> : ' . $_SERVER['SERVER_ADDR'] . '  <br />
' . (!defined('SOFTRESELLER') ? '<b>' . $l['expires'] . '</b> : ' . (empty($globals['licexpires']) ? $l['never'] : makedate($globals['licexpires']) . ' (DD/MM/YYYY)') . '  <br />' : '') . '<b>' . $l['ip_license'] . '</b> : ' . @substr(curl_call(fastestmirror() . '/ip.php', 0, 5), 0, 16) . '<br />
<b>' . $l['php_version'] . '</b> : ' . sphpversion() . '<br />
<b>' . $l['soft_version'] . '</b> : ' . asperapp($globals['version'], @$globals['webuzo_version'], @$globals['ampps_version']) . '<br />
<b>' . $l['latest_soft_version'] . '</b> : <span id="newsoftversion"></span>
</div>
</td>';
    if ($globals['softpanel'] == 'ampps' || $globals['softpanel'] == 'webuzo') {
        echo '<td width="20%">
	<img src="' . $theme['images'] . $globals['softpanel'] . (empty($globals['lictype']) ? 'free' : 'premium') . '.png" width="100%" />
</td>';
    } else {
        echo '<td width="23%">
	<img src="' . $theme['images'] . 'softaculous' . (empty($globals['lictype']) ? 'free' : 'premium') . '.png" width="100%" />
</td>';
    }
    echo '</tr>
</table>
</div>

<br /><br />';
    softfooter();
}
Exemple #6
0
function software_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $allcatwise;
    global $software, $soft, $info, $settings, $init_tab, $dbtype, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $cron, $datadir, $ajaxdb, $ajaxdbexists, $overwrite_option, $protocols, $nopackage, $can_publish, $not_default, $child, $install_option, $multi_ver, $child_sids, $installation_keys, $no_autoupgrade, $ajaxhttpsexists, $ajaxhttps, $new_insid, $pfx_error, $owned_themes;
    if (optGET('notify')) {
        get_softaculous_file('http://www.softaculous.com/notifyversion.php?softid="' . $soft . '"');
        echo 1;
        return true;
    }
    if (optGET('ajaxdownload') && !empty($nopackage)) {
        // Try to download the package
        if (method_exists($softpanel, 'updatesoftwares')) {
            $softpanel->updatesoftwares($soft, 0, 0, 1);
            echo 1;
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // If generate order call
    if (optGET('generate_order')) {
        $order_id = get_softaculous_file($globals['apipfx'] . 'fetch.php?apikey=' . $user['pfxapi_key'] . '&email=' . $user['email'] . '&pid=' . optGET('theme_id') . '&giveinfo=generate_order&index=' . rawurlencode($globals['index']));
        echo json_encode($order_id);
        return true;
    }
    if (!empty($ajaxdb)) {
        echo $ajaxdbexists;
        return true;
    }
    if (!empty($ajaxhttps)) {
        echo $ajaxhttpsexists;
        return true;
    }
    // Auto Installation responses
    if (isset($_GET['autoinstall'])) {
        // Installed successfully
        if (!empty($installed)) {
            echo 'installed';
            return true;
        }
        // Are there errors
        if (!empty($error)) {
            echo serialize($error);
            return false;
        }
    }
    $multi_ver = optGET('multi_ver');
    if (!empty($multi_ver)) {
        $init_tab = "install";
    }
    //First add the installation info
    if (empty($installed)) {
        $random_username = true;
        // This is to see if a script has predefined username and cannot be changed
        foreach ($settings as $ik => $iv) {
            if ($ik == 'hidden') {
                continue;
            }
            foreach ($iv as $ikk => $ivv) {
                if ($ikk == 'admin_username' && preg_match('/disabled=\\"disabled\\"/ie', $ivv['tag'])) {
                    $random_username = false;
                }
            }
        }
        $info['install'] = '<div id="fadeout_div"><form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware" class="form-horizontal">';
        if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
            $info['install'] .= '<center class="alert alert-warning">' . lang_vars($l['not_in_free'], array($software['name'])) . (!webuzo() ? '&nbsp;&nbsp;' . $l['notify_admin'] : '') . '</center>';
        }
        $info['install'] .= error_handle($error, "100%", 0, 1) . '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[


function selectversion(){
	var v = 0;
	v = $_("softbranch").value;
	
	$("#multiver_wait").css("display","");
	
	 $.ajax({
		type: "POST",
		url: "' . $globals['index'] . 'act=software&soft="+v+"&tab=install&multi_ver=1&jsnohf=1",
		// Checking for error
		success: function(data){
			$("#multiver_wait").css("display","none");
			var $response=$(data);
			//query the jq object for the values
			var output = $response.find("#install_win").html();
			$("#install_win").html(output);
			softmail();
			show_backup();
			check_pass_strength();
			' . (!empty($globals['random_pass']) ? '$("#admin_pass").val(randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . '));check_pass_strength();' : '') . (!empty($globals['random_username']) && !empty($random_username) ? '$("#admin_username").val(randstr(5));' : '') . (!empty($globals['empty_username']) && !empty($random_username) ? '$("#admin_username").val("");' : '') . (!empty($globals['admin_prefix']) && !empty($random_username) && empty($globals['random_username']) && empty($globals['empty_username']) ? 'prepend_prefix(\'' . $globals['admin_prefix'] . '\');' : '') . (!empty($globals['empty_pass']) ? '$("#admin_pass").val("");check_pass_strength();' : '') . '
		},
		error: function(data) {
			//alert(data.description);
			return false;
		}
	}); 
}

function toggle_advoptions(ele){
	//alert("#"+ele);
	if ($("#"+ele).is(":hidden")){
		$("#"+ele).slideDown("slow");
		$("#"+ele+"_toggle_plus").attr("src", "' . $theme['images'] . 'minus_new.gif");
	}
	else{
		$("#"+ele).slideUp("slow");
		$("#"+ele+"_toggle_plus").attr("src", "' . $theme['images'] . 'plus_new.gif");
	}
}

function plus_onmouseover(ele){
	$("#"+ele.id+"_plus").attr("src", "' . $theme['images'] . 'plus_hover.gif");
}

function plus_onmouseout(ele){
	$("#"+ele.id+"_plus").attr("src", "' . $theme['images'] . 'plus.gif");
}

function display_pass_strength(score, per){
	
	var lang;
	//disp_per = $("#pass-strength-hidden").val();
	
	if(typeof per == "undefined") per = 0;
	
	if(score == "bad") lang = "' . $l['bad'] . '";
	if(score == "good") lang = "' . $l['good'] . '";
	if(score == "strong") lang = "' . $l['strong'] . '";
	if(score == "short") lang = "' . $l['short'] . '";
	if(score == "strength_indicator") lang = "' . $l['strength_indicator'] . '";
	
	$("#pass-strength-result").addClass(score).html( lang+" ("+per+"/100)" );
}

function checkform(dosubmit){
	
	// If admin has set the password strength than only we will check for it.
	' . (!empty($globals['pass_strength']) ? '
	//alert($("#pass-strength-hidden").val());
	if(parseInt($("#pass-strength-hidden").val()) < ' . $globals['pass_strength'] . '){
		alert("' . $l['err_pass_strength'] . '"+' . $globals['pass_strength'] . ');
		return false;
	}' : '') . '
	
	try{
		if(!formcheck()){
			return false;
		}
	}catch(e){
		//Do nothing
	}
	$_("softsubmitbut").disabled = true;	
	
	if(!get_package()){
		return false;
	}
	
	if(useprog){
		
		// Send a request to check the status
		progressbar.start();
		
		// Return false so that the form is not submitted
		return false;
	
	// This is OLD School !
	}else{		
		if(dosubmit == 1){			
			$_("installsoftware").submit();	
		}
		show_msg("' . $l['installing'] . '");
	}
	
	return true;
	
};

var progressbar = {
	timer: 0,
	total_width: 0,	
	status_key: "",
	synctimer: 0,
	fadeout_div: "#fadeout_div",
	win_div: "#install_win",
	progress_div: "#progress_bar",
	formid: "#installsoftware",
	frequency: 8000,
	
	current: function(){
		try{
			var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
			if(tmp_cur > 100){
				tmp_cur = 99;
			}
			return tmp_cur;
		}catch(e){
			return -1;	
		}
	},
	
	reset: function(){ try{
		clearTimeout(this.timer);
		$_("progress_color").width = 1;
	}catch(e){ }},
	
	move: function(dest, speed, todo){ try{
		var cur = this.current();
		if(cur < 0){
			clearTimeout(this.timer);
			return false;
		}
		var cent = cur + 1;
		var new_width = cent/100*this.total_width;
		if(new_width < 1){
			new_width = 1;
		}
		//alert(new_width+" "+dest+" "+cent);
		$_("progress_color").width = new_width;
		$_("progress_percent").innerHTML = "("+cent+" %)";
		
		if(cent < dest){
			this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
		}else{
			eval(todo);	
		}
	}catch(e){ }},
	
	text: function(txt){ try{
		$_("progress_txt").innerHTML = txt;
	}catch(e){ }},
	
	sync: function(){
		if(progressbar.status_key.length < 2){
			return false;
		}
		$.ajax({
			url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
			type: "GET",
			success: function(data){
				if(data == 0) return false;
				var tmp = data.split("|");
				var cur = progressbar.current();
				tmp[2] = (3000/(tmp[0]-cur));
				//alert(tmp);
				if(tmp[0] > cur){
					if(parseInt(tmp[2]) == 0){
						tmp[2] = 800;
					}
					progressbar.move(tmp[0], tmp[2]);
				}
				progressbar.text(tmp[1]);
				progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
			}
		});
	},
	
	sync_abort: function(){
		clearTimeout(this.synctimer);
	},
	
	start: function(){ try{
		this.post();
		this.reset();
		this.total_width = parseInt($_("table_progress").width);
		this.move(95, 800);
		this.status_key = $("#soft_status_key").attr("value");
		this.sync();
	}catch(e){ }},
	
	post: function(){
		
		// Scroll to the Top and show the progress bar
		goto_top();
		$(progressbar.fadeout_div).fadeOut(500, 
			function(){
				$(progressbar.progress_div).fadeOut(1);
				$(progressbar.progress_div).fadeIn(500);
			}
		);
		
		try{
			var sid = $_("softbranch").value;
		}catch(e){
			var sid = ' . $soft . '
		}
		
		$.ajax({
			url: window.location+"&jsnohf=1&soft="+sid+"&multi_ver=1",
			type: "POST",
			data: $(progressbar.formid).serialize(),
			complete: function( jqXHR, status, responseText ) {
				
				progressbar.sync_abort();
				
				// Store the response as specified by the jqXHR object
				responseText = jqXHR.responseText;
				
				try{
					//alert(responseText);
					if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
						progressbar.text("' . addslashes($l['finishing_process']) . '");
						progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
					}else{
						progressbar.reset();
					}
				}catch(e){ }
				
				if ( jqXHR.isResolved() ) {
				
					// #4825: Get the actual response in case
					// a dataFilter is present in ajaxSettings
					jqXHR.done(function( r ) {
						responseText = r;
					});
			
					// Create a dummy div to hold the results
					// inject the contents of the document in, removing the scripts
					// to avoid any "Permission Denied" errors in IE
					var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
					
					$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
						$(progressbar.win_div).html(newhtml);
						show_backup();
						check_pass_strength();
						new_theme_funcs_init();
						if($("#theme_div").length != 0){
							theme_init();
						}
					}).delay(50).animate({opacity: 1}, 500);
					//alert(newhtml);
					
				}else{
					alert("Oops ... the connection was lost");
				}
			}
		});
	}
};

function show_msg(msg){	
	$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
	$_("show_txt").style.display = "";
}

// Is the package there ?
var nopackage = ' . (empty($nopackage) ? 0 : 1) . ';

// Use the Progress Bar ?
var useprog = 1; 
try{
	if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
		useprog = 0;
	}
}catch(e){ }

function get_package(){	
	if(nopackage){
		
		show_msg("' . $l['downloading'] . '");
		
		try{		
			AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&ajaxdownload=1&random="+Math.random(), "get_package_handle(re)");
		}catch(e){ }
		
		return false;
	}else{
		$_("show_txt").style.display = "none";
		return true;
	}
};

function get_package_handle(resp){
	nopackage = 0;
	show_msg("' . $l['installing'] . '");
	checkform(1);
};

softemail = new Object();
function softmail(){
	try{
		var sofdom = "softdomain";
		for(x in softemail){
			if(softemail[x] == true) continue;
			var temp = $_(x).value.split("@");
			if($_(sofdom).value.indexOf("/") > 0){
				var dom_value = $_(sofdom).value.substring(0, $_(sofdom).value.indexOf("/"));
			}else{
				var dom_value = $_(sofdom).value;
			}
			$_(x).value = temp[0] + "@" + dom_value;
		}
	}catch(e){
		return false;
	}
};

function checkhttps(proto_id, softdomain_id, alrt){
	try{
		var id = $_(proto_id);
		var proto = id.options[id.selectedIndex].text;
	
		$("#checkhttps_wait").css("display","inline-block");
		if(proto.indexOf("https") !== -1){
		
			 $.ajax({
				type: "POST",
				url: "' . $globals['index'] . 'act=software&soft=' . $soft . '&checkhttps="+encodeURIComponent(proto+$_(softdomain_id).value),
				timeout:10000,
				// Checking for error
				success: function(data){
					$("#checkhttps_wait").css("display","none");
					is_https(data);
				},
				error: function(jqXHR, status, e) {
					$("#checkhttps_wait").css("display","none");
					is_https(e);
					return false;
				}
			}); 
			
			//AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&checkhttps="+id.options[id.selectedIndex].text+$_(softdomain_id).value, "is_https(re)");
		}else{
			$("#checkhttps_wait").css("display","none");
			is_https("true");
		}
		if(alrt == true){
			alert(proto+$_(softdomain_id).value);
		}
	}catch(e){
		//
	}
	return true;
};

function is_https(re){
	try{
		httpserror = "";
		
		//Check if it exists
		if(re !== "true"){
			httpserror = "' . $l['no_https'] . '";
		}
		if(httpserror != ""){
			$_("httpserror").style.display = "block";
			$_("httpserror").innerHTML = httpserror;
			return false;
		}else{
			$_("httpserror").style.display = "none";
		}
		
	}catch(e){
		//
	}
	return true;
};

function prepend_prefix(prefix){
	
	// Decide prefix USERNAME, DOMAIN OR USER DEFINED
	if(prefix != "" && prefix == "username") prefix = "' . $softpanel->user['name'] . '";
	if(prefix != "" && prefix == "domain") prefix = "' . current(array_keys($softpanel->domainroots)) . '";
	if(prefix != "" && prefix != "domain" && prefix != "username");
	
	// APPEND OLD USERNAME OR DEFAULT USERNAME
	var old = $_("admin_username").value
	temp = $_("admin_username").value.split("-");
	if (typeof temp[1] == \'string\' || temp[1] instanceof String){
		$_("admin_username").value = prefix+"-"+temp[1];
	}else{
		$_("admin_username").value = prefix+"-"+old;
	}
}

function change_admin_prefix(domain){
	var admin_prefix = \'' . $globals['admin_prefix'] . '\';
	var random_username = \'' . (!empty($random_username) ? 'true' : '') . '\';
	var empty_username = \'' . (empty($globals['empty_username']) ? 'true' : '') . '\';
	var gl_random_username = \'' . (empty($globals['random_username']) ? 'true' : '') . '\';
	if(admin_prefix == "domain" && random_username == "true" && empty_username == "true" && gl_random_username == "true"){
		prepend_prefix(domain);
	}
}
  
// show/hide backup options
function show_backup(){

	var auto_backup = $("#auto_backup").val();
	
	if(auto_backup == 0){
		$("#auto_backup_rotation").attr("disabled", true);
	}else{
		$("#auto_backup_rotation").attr("disabled", false);
	}
	
	return true;
};

' . (!empty($_POST) ? '' : 'addonload(\'softmail();show_backup();\');');
        if (!empty($dbtype)) {
            $info['install'] .= 'function checkdbname(id, alrt){
	try{		
		AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&checkdbexists="+$_(id).value, "dbexists(\'"+id+"\', "+alrt+", re)");	
	}catch(e){
		//
	}
	return true;
};

function dbexists(id, alrt, re){
	try{
		
		dberror = "";
		
		//Is the length fine
		if($_(id).value.length > ' . (empty($softpanel->maxdblen) ? 7 : $softpanel->maxdblen) . '){
			dberror = "' . $l['db_name_long'] . '";
		}
		
		//There should be only alphanumeric characters
		if(/[^a-zA-Z0-9]/.test($_(id).value) && !' . aefer() . '0){
			dberror = "' . $l['db_alpha_num'] . '";
		}
		
		//Check if it exists
		if(re == "true"){
			dberror = "' . $l['database_exists'] . '";
		}
		
		if(dberror != ""){
			$_(id+"error").style.display = "block";
			$_(id+"error").innerHTML = dberror;
			if(alrt == true){
				alert(dberror);
			}
			return false;
		}else{
			$_(id+"error").style.display = "none";
		}
		
	}catch(e){
		//
	}
	return true;
};';
        }
        //End of if($dbtype)
        $info['install'] .= '// ]]></script>';
        $info['install'] .= '
<div class="bg">
	<div class="sai_sub_head">' . $l['setup'] . '</div><hr>';
        if (count($software['branch']) > 1) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="softbranch" class="sai_head">' . $l['choose_version'] . '</label><br />
				<span class="sai_exp2">' . $l['choose_version_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="softbranch" class="form-control" id="softbranch" onchange="selectversion()" style="display:inline-block;">';
            foreach ($software['branch'] as $ck => $cv) {
                $info['install'] .= '<option value=' . $ck . ' ' . ($cv['ver'] == $software['ver'] ? 'selected="selected"' : '') . '>' . $cv['ver'] . '</option>';
            }
            $info['install'] .= '
				</select><div style="display:none;" id="multiver_wait"><img src="' . $theme['images'] . 'progress.gif" alt="please wait.."></div>
			</div>
		</div><br />';
        }
        if (empty($softpanel->noprotocol) && empty($globals['hide_protocol'])) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="softproto" class="sai_head">' . $l['choose_protocol'] . '</label><br />
				<span class="sai_exp2">' . $l['choose_protocol_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="softproto" class="form-control" id="softproto" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
            foreach ($protocols as $k => $v) {
                $info['install'] .= '<option value="' . $k . '" ' . (optPOST('softproto') == $k || $globals['default_protocol'] == $k && empty($_POST['softproto']) ? 'selected="selected"' : '') . '>' . $v . '</option>';
            }
            $info['install'] .= '</select><div style="display:none;" id="checkhttps_wait">&nbsp;&nbsp;<img src="' . $theme['images'] . 'progress.gif" alt="please wait.."></div><br />
				<div class="row">
					<span id="httpserror" style="display:none; padding:10px;" class="alert alert-danger"></span>
				</div>
			</div>
		</div>';
        }
        $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">';
        $info['install'] .= '
				<label for="softdomain" class="sai_head">' . $l['choose_domain'] . '</label><br />
				<span class="sai_exp2">' . $l['choose_domain_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="softdomain" class="form-control" id="softdomain" onchange="softmail();change_admin_prefix(this.value);" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
        if (!empty($globals['blank_domain'])) {
            $info['install'] .= '<option value="" ' . (empty($_POST['softdomain']) ? 'selected="selected"' : '') . '>(' . $l['select_domain'] . ')</option>';
        }
        foreach ($softpanel->domainroots as $domain => $dompath) {
            $info['install'] .= '<option value="' . $domain . '" ' . (!empty($_POST['softdomain']) && $_POST['softdomain'] == $domain ? 'selected="selected"' : '') . '>' . $domain . '</option>';
        }
        $info['install'] .= '
				</select>
			</div>
		</div><br />
		
		<div class="row">
			<div class="col-sm-5">
				<label for="softdirectory" class="sai_head">' . $l['in_directory'] . '</label><br />
				<span class="sai_exp2">' . $l['in_directory_exp'] . '</span>
			</div>
			<div class="col-sm-7">	
				<input type="text" name="softdirectory" class="form-control" id="softdirectory" size="30" value="' . POSTval('softdirectory', !empty($globals['no_prefill']) ? '' : $software['softname']) . '" />
			</div>
		</div><br />';
        if (!empty($datadir)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="datadir" class="sai_head">' . $l['datadir'] . '</label><br />
				<span class="sai_exp2">' . $l['datadir_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="text" name="datadir" class="form-control" id="datadir" size="30" value="' . POSTval('datadir', $datadir) . '" />		
			</div>
		</div><br />';
        }
        if (!empty($dbtype)) {
            $dbname = mysqldbname($software['softname']);
            if (method_exists($softpanel, 'mysqldbname')) {
                $dbname = $softpanel->mysqldbname();
            }
            // This is default
            $dbhost = 'localhost';
            // Don't prefill database details
            if (!empty($globals['no_prefill_db'])) {
                $dbname = '';
                $dbhost = '';
            }
            if (aefer()) {
                $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="softdb" class="sai_head">' . $l['database_name'] . '</label><br />
				<span class="sai_exp2">' . $l['database_name_exp_aefer'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="text" name="softdb" class="form-control" id="softdb" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" />
				<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
			</div>
		</div><br />';
            }
            if (!empty($softpanel->no_db_create)) {
                // Database Username
                $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label class="sai_head">' . $l['dbusername'] . '</label><br />
				<span class="sai_exp2">' . $l['dbusername_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="text" name="dbusername" class="form-control" id="dbusername" size="30" value="' . POSTval('dbusername', '') . '" />
			</div>
		</div><br />';
                // Database Password
                $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label class="sai_head">' . $l['dbuserpass'] . '</label><br />
				<span class="sai_exp2">' . $l['dbuserpass_exp'] . '</span>
			</div>	
			<div class="col-sm-7"> 	
				<input type="text" name="dbuserpass" class="form-control" id="dbuserpass" size="30" value="' . POSTval('dbuserpass', '') . '" />
			</div>
		</div><br />';
                //Database Host Name
                $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="hostname" class="sai_head">' . $l['hostname'] . '</label><br />
				<span class="sai_exp2">' . $l['hostname_exp'] . '</span>
			</div>	
			<div class="col-sm-7">	
				<input type="text" name="hostname" class="form-control" id="hostname" size="30" value="' . POSTval('hostname', $dbhost) . '" />
			</div>	
		</div><br />
		';
            }
        }
        // Are there any cron jobs
        if (!empty($cron)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<span class="sai_head">' . $l['cron_job'] . '</span><br />
				<span class="sai_exp2">' . $l['cron_job_exp'] . '</span>
			</div>
			<div class="col-sm-7">
					<div class="row">
						<div class="col-sm-2">
							<span>' . $l['cron_min'] . '</span>	
							<input type="text" class="form-control" name="cron_min" id="cron_min" size="2" value="' . POSTval('cron_min', $cron['min']) . '" />
						</div>
						<div class="col-sm-2">
							<span>' . $l['cron_hour'] . '</span>
							<input type="text" class="form-control" name="cron_hour" id="cron_hour" size="2" value="' . POSTval('cron_hour', $cron['hour']) . '" />
						</div>
						<div class="col-sm-2">
							<span>' . $l['cron_day'] . '</span>
							<input type="text" class="form-control" name="cron_day" id="cron_day" size="2" value="' . POSTval('cron_day', $cron['day']) . '" />
						</div>
						<div class="col-sm-2">
							<span>' . $l['cron_month'] . '</span>
							<input type="text" class="form-control" name="cron_month" id="cron_month" size="2" value="' . POSTval('cron_month', $cron['month']) . '" />
						</div>
						<div class="col-sm-2">
							<span>' . $l['cron_weekday'] . '</span>
							<input type="text" class="form-control" name="cron_weekday" id="cron_weekday" size="2" value="' . POSTval('cron_weekday', $cron['weekday']) . '" />
						</div>
					</div>
			</div>
		</div><br />';
        }
        if (!empty($overwrite_option)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<span class="sai_head">' . $l['overwrite'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="checkbox" name="overwrite_existing" id="overwrite_existing" />
			</div>
		</div>';
        }
        $info['install'] .= '</div><br /><!--end of bg class-->';
        if (!empty($settings)) {
            if (file_exists($software['path'] . '/install.js')) {
                $info['install'] .= '<script language="javascript" type="text/javascript"><!--// --><![CDATA[';
                $info['install'] .= @parselanguages(str_replace('$(', '$_(', implode('', file($software['path'] . '/install.js'))));
                $info['install'] .= '// ]]></script>';
            }
            foreach ($settings as $group => $sets) {
                if ($group == 'hidden' || empty($sets)) {
                    continue;
                }
                $info['install'] .= '
					<div class="bg">
						<div class="sai_sub_head">' . $group . '</div><hr>';
                foreach ($sets as $sk => $sv) {
                    //Adding class to input
                    if (preg_match('/type="text"/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/>/is', ' class="form-control">', $sv['tag']);
                    }
                    if (preg_match('/<select/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/<select/is', '<select class="form-control"', $sv['tag']);
                    }
                    $info['install'] .= '
								<div class="row">
									<div class="col-sm-5">
										<label for=' . $sk . ' class="sai_head" id="sai_head">' . $sv['head'] . '</label>
											' . (empty($sv['exp']) ? '' : '<span class="sai_exp">' . $sv['exp'] . '</span>') . '	
									</div>
									' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? preg_replace('/>|\\/>/is', ' onkeyup="check_pass_strength();" >', '
										<div class="col-sm-6">' . $sv['tag'] . '<div id="pass-strength-result" style="border-radius:3px;">' . $l['strength_indicator'] . '</div></div>') : '<div class="col-sm-7 ">' . $sv['tag'] . '</div>') . '
										' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										softemail["' . $sk . '"] = false;
										//Add an event handler
										$_("' . $sk . '").onkeydown = function(){
											softemail["' . $sk . '"] = true;
										}
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? '
										<div class="col-sm-1">
											<a href="javascript: void(0);"  onclick="$_(\'' . $sk . '\').value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');check_pass_strength();return false;" title="' . $l['randpass'] . '"><img src="' . $theme['images'] . 'randpass.gif" /></a>
										</div>
										<div class="clearfix"></div>
										' : '') . '
										
										' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && (!empty($softpanel->securepass) || !empty($globals['random_pass'])) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');check_pass_strength();\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && !empty($globals['empty_pass']) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value="";check_pass_strength();\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/dbprefix/is', $sv['tag']) && !empty($globals['random_dbprefix']) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value=randstr(3)+"_";\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['random_username']) && !empty($random_username) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value=randstr(5);\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['empty_username']) && !empty($random_username) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value="";\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['admin_prefix']) && empty($globals['empty_username']) && empty($globals['random_username']) && !empty($random_username) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'prepend_prefix("' . $globals['admin_prefix'] . '");\');
											// ]]></script>
										' : '') . '
								</div><br />';
                }
                $info['install'] .= '
					</div><br /><!--end of bg class-->';
            }
            //The Hidden groups
            if (!empty($settings['hidden'])) {
                foreach ($settings['hidden'] as $sk => $sv) {
                    $info['install'] .= $sv['tag'] . '
				' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
				softemail["' . $sk . '"] = false;
				//Add an event handler
				$_("' . $sk . '").onkeydown = function(){
					softemail["' . $sk . '"] = true;
				}
				// ]]></script>
				' : '');
                }
            }
        }
        //End of if($settings)
        //Is it a SOFTCOPY, then Leave a NOTE
        if (!empty($setupcontinue)) {
            $info['install'] .= '
		' . $l['softcopy_note'] . '
		';
        }
        // Advance option
        $info['install'] .= '
	<div class="bg">
		<div class="sai_sub_head" id="advoptions_toggle" onclick="toggle_advoptions(\'advoptions\');" style="cursor:pointer"><img id="advoptions_toggle_plus"  src="' . $theme['images'] . 'plus_new.gif" style="margin-top:-4px;"/>&nbsp;&nbsp;' . $l['adv_option'] . '</div>
			<div id="advoptions" style="display:none;"><hr>
				' . (empty($dbtype) || aefer() ? "" : '<div class="row">
					<div class="col-sm-5">
						<label for="softdb" class="sai_head">' . $l['database_name'] . '</label><br />
						<span class="sai_exp2">' . $l['database_name_exp'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="text" name="softdb" class="form-control" id="softdb" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" /><br />
						<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
					</div>
				</div>') . '

				<div class="row">
					<div class="col-sm-5">
						<label class="sai_head">' . $l['disable_notify_update'] . '</label>
						<span class="sai_exp">' . $l['exp_disable_notify_update'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="checkbox" name="disable_notify_update" id="disable_notify_update" ' . POSTchecked('disable_notify_update') . ' />
					</div>	
				</div><br />';
        // Auto upgrade is not available in AMPPS
        if ($globals['softpanel'] != 'ampps' && !empty($scripts[$soft]['auto_upgrade']) && empty($no_autoupgrade['disable_autoupgrade']) && empty($no_autoupgrade['scripts'][$soft])) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . $l['eu_auto_upgrade'] . '</label>
							<span class="sai_exp">' . $l['exp_eu_auto_upgrade'] . '</span>
						</div>
						<div class="col-sm-7">
							<input type="checkbox" name="eu_auto_upgrade" id="eu_auto_upgrade" ' . POSTchecked('eu_auto_upgrade', $globals['enable_auto_upgrade']) . (!empty($globals['force_auto_upgrade']) ? ' checked="checked" disabled' : '') . '/>
						</div>	
					</div><br />';
        }
        // Auto upgrade plugins
        if (empty($globals['off_upgrade_plugins']) && !empty($software['update_plugins'])) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . lang_vars($l['auto_upgrade_plugins'], array($software['name'])) . '</label>
							<span class="sai_exp">' . lang_vars($l['exp_auto_upgrade_plugins'], array($software['name'])) . '</span>
						</div>
						<div class="col-sm-7">
							<input type="checkbox" name="auto_upgrade_plugins" id="auto_upgrade_plugins" ' . POSTchecked('auto_upgrade_plugins') . ' />
						</div>	
					</div><br />';
        }
        // Auto upgrade themes
        if (empty($globals['off_upgrade_themes']) && !empty($software['update_themes'])) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . lang_vars($l['auto_upgrade_themes'], array($software['name'])) . '</label>
							<span class="sai_exp">' . lang_vars($l['exp_auto_upgrade_themes'], array($software['name'])) . '</span>
						</div>
						<div class="col-sm-7">
							<input type="checkbox" name="auto_upgrade_themes" id="auto_upgrade_themes" ' . POSTchecked('auto_upgrade_themes') . ' />
						</div>	
					</div><br />';
        }
        // Auto backups option only if backups is not disabled and panel is not remote
        if (empty($globals['disable_backup_restore']) && empty($globals['disable_auto_backup']) && !aefer() && empty($softpanel->disable_auto_backup)) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label for="auto_backup" class="sai_head">' . $l['auto_backup'] . '</label>
							<span class="sai_exp">' . $l['exp_auto_backup'] . '</span>
						</div>
						<div class="col-sm-7">
							<select name="auto_backup" class="form-control" id="auto_backup" onchange="show_backup();">
								<option value="0" ' . POSTselect('auto_backup', '0', 1) . '>' . $l['no_backup'] . '</option>' . (empty($globals['disable_auto_backup_daily']) ? '<option value="daily" ' . POSTselect('auto_backup', 'daily') . '>' . $l['daily'] . '</option>' : '') . (empty($globals['disable_auto_backup_weekly']) ? '<option value="weekly" ' . POSTselect('auto_backup', 'weekly') . '>' . $l['weekly'] . '</option>' : '') . (empty($globals['disable_auto_backup_monthly']) ? '<option value="monthly" ' . POSTselect('auto_backup', 'monthly') . '>' . $l['monthly'] . '</option>' : '') . '
							</select>
						</div>	
					</div><br />
					
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . $l['auto_backup_rotation'] . '</label>
							<span class="sai_exp">' . $l['exp_auto_backup_rotation'] . '</span>
						</div>
						<div class="col-sm-7"> 
							<select name="auto_backup_rotation" class="form-control" id="auto_backup_rotation">';
            for ($i = 0; $i <= 10; $i++) {
                // Do we have a limit from admin ?
                if (!empty($globals['auto_backup_limit']) && ($i > $globals['auto_backup_limit'] || $i == 0) || !empty($globals['max_backups']) && ($i > $globals['max_backups'] || $i == 0)) {
                    continue;
                }
                $info['install'] .= '<option value="' . $i . '" ' . POSTselect('auto_backup_rotation', $i, $i == 4 ? '1' : '0') . '>' . (empty($i) ? $l['unlimited'] : $i) . '</option>';
            }
            $info['install'] .= '</select>
						</div>	
					</div><br />';
        }
        $info['install'] .= '
			</div>
	</div><br /><!--end of bg-->';
        // Do we have to display the theme
        if (!empty($globals['eu_enable_themes']) && !empty($software['has_theme'])) {
            $info['install'] .= '
		<div class="bg">
			<div id="pfx_div" style="display:none"></div>
		</div><br /><!--end of bg class-->
		<script id="paypal_js" language="javascript" type="text/javascript"></script>
		<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

		var pfx_div = \'' . str_replace(array("\n", "'"), array('', "\\'"), '<style>
		@import url(https://fonts.googleapis.com/css?family=Open+Sans:300light,400light,700light,400,400,700); 
		</style>
		<div id="themesearch" class="sai_popupc" style="display:none;">
			<div class="sai_themesearch_div sai_popuptitle" align="center" style="padding-left:20px;">
					<fieldset class="sai_inputs">
						<div class="row">
							<input type="text"  name="themesearchstring" class="col-sm-10" id="themesearchstring"  class="sai_inputs" autofocus placeholder="Search Themes" autocomplete="off">
							<div class="col-sm-6" style="text-align:right; margin-top:8px;">
								<a href="javascript:void(0);" class="sai_popupclose b-close">Close</a>
							</div>
						</div>
						<div class="row">
							<h4 id="results-text" style="display:none;">Showing results for: <b id="search-string"></b></h4>
							<ul id="results"></ul><br />
						</div>
					</fieldset>
			</div>
			<div id="searchsuggestions"></div>
		</div>
		<div class="sai_sub_head" id="theme_toggle" onclick="toggle_advoptions(\'theme\');" class="sai_heading_full" style="cursor:pointer"><img id="theme_toggle_plus" src="' . $theme['images'] . 'minus_new.gif" />&nbsp;&nbsp;' . $l['choose_theme'] . '</div>
		<div class="row">
			<div id="theme" style="display:block;" class="col-sm-12"><hr>
				<div id="theme_div" style="display:block;">
					<div class="row">
						<div class="col-sm-2">
							<a class="btn btn-default" id="search_theme">' . $l['search'] . '</a>
						</div>
						<div class="col-sm-8">		
							<center>' . $l['theme_is_optional'] . '</center>
						</div>
						<div class="col-sm-2">
							<a class="btn btn-default pull-right" id="refresh_theme">' . $l['refresh'] . '</a>
							<div id="sloading" style="display:none;">
								<center><img src="' . $theme['images'] . 'loading.gif" alt="Loading..." /></center>
							</div>
						</div>
					</div><br />
					
					<div class="row">
						<div style="height:280;">
							<div id="loading" style="display:block;z-index:99;">
								<center><img src="' . $theme['images'] . 'loading.gif" alt="Loading..." /></center>
							</div>
							<center><div id="display_theme" style="height:auto;"></div></center>
						</div>
					</div>
					
					<div class="row">
						<div class="col-sm-1">
							<span id="prevBtn"><a href="javascript:void(0);"></a></span>
						</div>
						<div class="col-sm-10">
							<center><div id="clear_theme" name="clear_theme" class="sai_searchbox_button" onclick="clear_theme();" style="display:none;">' . $l['clear_theme'] . '</div></center>
						</div>
						<div class="col-sm-1">
							<span id="nextBtn"><a href="javascript:void(0);"></a></span>
						</div>	
					</div>
				</div>
			</div>
		</div>') . '\';
			
		var length;
		var deduct;
		var payment_timer;
		var dg;

		' . (!empty($owned_themes) ? 'owned_theme = new Array("' . implode('", "', array_values($owned_themes)) . '");' : 'var owned_theme = new Array();') . '

		var screen_width = $(window).width();

		if(screen_width < 1282 && screen_width > 982){
			length = 3;
			deduct = 3;
		}else if(screen_width < 982 && screen_width >802){
			length = 2;
			deduct = 2;
		}else if(screen_width < 802 && screen_width >770){
			length = 1;
			deduct = 1;
		}else if(screen_width < 770 && screen_width > 362){
			length = 2;
			deduct = 2;
		}else if(screen_width < 363 && screen_width > 200){
			length = 1;
			deduct = 1;
		}else{
			length = 4;
			deduct = 4;
		}

		' . (!empty($softpanel->pheader) ? 'length = 2;deduct = 2;' : '') . '

		' . (empty($user['pfxapi_key']) ? 'var api_key = 0;' : 'var api_key = 1;') . '
		' . (empty($globals['eu_themes_premium']) ? 'var premium = 0;' : 'var premium = "' . $globals['eu_themes_premium'] . '";') . '

		function sleep(milliseconds) {
		  var start = new Date().getTime();
		  for (var i = 0; i < 1e7; i++) {
			if ((new Date().getTime() - start) > milliseconds){
			  break;
			}
		  }
		}

		if(api_key == 0){
		 $.ajax({
			type: "POST",
			data: "generate_apikey=1&ajax=1",
			url: "' . $globals['index'] . 'act=my_themes&jsnohf=1",
			// Checking for error
			success: function(data){
				// Do nothing :)
			}
		 });
		}

		function show_pfx_div(){
			var current_html = $("#pfx_div").html();
			if(current_html == ""){
				$("#pfx_div").html(pfx_div);
				$("#pfx_div").show();
				theme_init();
			}
		}

		function show_pay(){
			
			//alert(arguments[0] +" -- "+arguments[1]+" -- "+arguments[2]+" -- "+arguments[3]);
			//alert($("#paypal_js").attr("src"))
			
			$("#display_theme").fadeOut(100);
			$("#loading").show();
			
			// We will have to create an order now
			$.ajax({
				type: "GET",
				url: window.location+"&generate_order=1&ajax=1&jsnohf=1&theme_id="+arguments[1],
				success: function(data){
					//alert(data)
					var order_id = $.parseJSON(data);
					$("#custom").val(order_id);
					$("#loading").hide();
					$("#display_theme").fadeIn(100);
					//$("#pfxpay").bPopup();			
				}	
			});
			
			$.getScript("https://www.paypalobjects.com/js/external/dg.js", function( data, textStatus, jqxhr ) {
				//alert(data +" -- "+textStatus+" -- "+jqxhr)
				
				if(textStatus == "success"){
					dg = new PAYPAL.apps.DGFlow({
						// HTML ID of form submit buttons that call setEC
						trigger:"submit_pay",
						expType:"instant"
					});
				}
			});
			
			// Now set the variable for sending the data
			$("#item_name").val(arguments[0]);
			$("#item_number").val(arguments[1]);
			$("#amount").val(arguments[2]);
			$("#item_price").html(arguments[2]);
			select_theme(arguments[3]);
			
			$("#submit_pay").click(function(){
				
				/*var timer = setInterval(function() {   
					if(dg.isOpen() !== true) {  
						clearInterval(timer);  
						alert("closed");
					}  
				}, 30000);*/
				$("#pfxpay").bPopup().close();
			});
			
			$(".b-close").click(function(){
				
			});
		}

		function show_selected_theme(){
			
			var th_name = $("#theme_name").val();
			var th_id = $("#theme_id").val();
			
			//alert("' . $globals['s2api_pfx'] . 'theme_search.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&q="+th_name+"&start=0&length=1&premium="+premium+"&callback=?")
			
			$.getJSON("' . $globals['s2api_pfx'] . 'theme_search.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&q="+th_name+"&start=0&length=1&premium="+premium+"&callback=?",
				function (data) {
					
					var soft_themes = \'<div id="slider"><div class="row">\';
					var new_li = 0;
					$.each(data.data, function (i, item) {
						
						if(item.name != undefined){
							soft_themes += \'<div class="row"><div class="sai_image_container" id="img_\'+new_li+\'" onmouseover="onthemeover(\'+new_li+\');" onmouseout="onthemeout(\'+new_li+\');" value="\'+item.pid+\'" theme_name="\'+item.softname+\'"><div class="sai_theme_header">\'+item.name+\'</div><img src="\'+data.img_url+item.pid+\'/\'+item.pid+\'_200.png" width="100%" height="100" class="img-responsive"><div class="sai_navigation" id="nav_\'+new_li+\'" style="display:none;"><span class="sai_demo"><a href="\'+item.demo_url+\'" target="_blank">' . addslashes($l['demo']) . '</a></span></div></div></div>\';
							soft_themes += \'</div><div class="row"><input type="hidden" name="theme_id" id="theme_id" value="\'+item.pid+\'"><input type="hidden" name="theme_name" id="theme_name" value="\'+item.softname+\'"></div></div>\';
						}
						new_li += 1;
					});// end of each loop
			
					
					$("#display_theme").html(soft_themes);
					$(".sai_image_container").removeClass("sai_theme_selected");
					$(".sai_image_container").addClass("sai_theme_selected");
					$(function(){
						$(".sai_image_container, #select_this_theme").click(function(){
							$(".sai_image_container").removeClass("sai_theme_selected");
							if(this.id == "select_this_theme"){
								$("#"+$(this).attr("val")).addClass("sai_theme_selected");
								$("#theme_id").val($("#"+$(this).attr("val")).attr("value"));
								$("#theme_name").val($("#"+$(this).attr("val")).attr("theme_name"));
							}else{
								$(this).addClass("sai_theme_selected");
								$("#theme_id").val($(this).attr("value"));
								$("#theme_name").val($(this).attr("theme_name"));
							}						
						 })
					});
					
					$("#themesearch").bPopup().close();
				});
		}

		function clear_theme(){
			$(".sai_image_container").removeClass("sai_theme_selected");
			$("#theme_id").val("");
			$("#theme_name").val("");
			$("#clear_theme").hide();
			show_list($("#prevBtn").val(), length);
		}

		function onthemeover(id_no){
			$("#nav_"+id_no).show();
		}

		function onthemeout(id_no){
			$("#nav_"+id_no).hide();
		}

		var startpt;
		function search() {
			
			var query_value = $("input#themesearchstring").val();
			$("b#search-string").html(query_value);
			
			if(startpt == undefined || startpt == ""){
				startpt = 0;
			}
			var top = 0;
			if(query_value === ""){
				top = 1;
			}
			
			$.getJSON("' . $globals['s2api_pfx'] . 'theme_search.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&start="+startpt+"&length=20&q="+query_value+"&top="+top+"&premium="+premium+"&callback=?",
			function (data) {
				var search_themes = \'<div id="slider"><table border="0" width="100%" height="200" cellspacing="5" cellpadding="3">\';
				var new_li = 0;
				$.each(data.data, function (i, item) {
					var you_own = "";
					if(item.name != undefined){
					
						var params = new Array();
						params[0] = "\'"+item.name+" - "+item.desc+"\'";
						params[1] = item.pid;
						params[2] = item.price;
						params[3] = "\'simg_"+new_li+"\'";
						
						//alert(item.pid+" -- "+ owned_theme+ " -- "+ $.inArray(item.pid, owned_theme) + " -- "+val_count(owned_theme, item.pid))
						if($.inArray(item.pid, owned_theme) !== -1){
							you_own = \'<img src="' . $theme['images'] . 'success.png" class="someclass" title="' . addslashes($l['your_purchased']) . '(\'+val_count(owned_theme, item.pid)+\')' . addslashes($l['your_purchased_times']) . '" alt="" height="22" width="22">\';
						}else{
							you_own = "&nbsp;";
						}
						
						if(item.price > 0){
							var price_lable = \'<td align="center" width="200"><table border="0" width="100%" cellpadding="0" cellspacing="0"><tr><td width="30%"><div class="sai_searchbox_button" onclick="show_pay(\'+params+\');"><span style="margin-right:20px">\'+you_own+\'</span><a href="javascript:void(0);" >' . addslashes($l['purchase']) . '&nbsp;&nbsp;$\'+item.price+\'</a></div></td></tr></table></td>\';
						}else{
							var price_lable = \'<td align="center" width="20">&nbsp</td>\';
						}
						
						search_themes += \'<tr class="sai_tr_color"><td align="center" style="padding-left:10px;"><table border="0" width="100%" cellspacing="0" cellpadding="3"><tr><td width="180"><div class="sai_image_container" id="simg_\'+new_li+\'" value="\'+item.pid+\'" theme_name="\'+item.softname+\'" style="width:160px;height:175px;"><img src="\'+data.img_url+item.pid+\'/\'+item.pid+\'_200.png" width="150" height="150" ><div class="sai_navigation" id="snav_\'+new_li+\'" style="display:none;"><span class="sai_demo"><a href="\'+item.demo_url+\'" target="_blank">' . addslashes($l['demo']) . '</a></span></div></div></td><td><table border="0" cellpadding="5" cellspacing="0" width="100%"><tr><td colspan="3"><b>\'+item.name+\'</b></td></tr><tr><td colspan="3" class="sai_search_description">\'+item.desc+\'</td></tr><tr><td colspan="3" class="sai_search_description">\'+item.overview+\'</td></tr><tr><td width="200"><div class="sai_searchbox_button" id="select_this_theme" val="simg_\'+new_li+\'">' . addslashes($l['use_this_theme']) . '</div></td><td width="200"><a href="\'+item.demo_url+\'" target="_blank" style="text-decoration:none;"><div class="sai_searchbox_button">' . addslashes($l['demo']) . '</div></a></td>\'+price_lable+\'</tr></table></td><td></td></tr><br /></table></td></tr>\';
					}
					new_li += 1;
				});// end of each loop

				search_themes += \'<tr><td><input type="hidden" name="theme_id" id="theme_id"><input type="hidden" name="theme_name" id="theme_name"></td></tr></table></div>\';
				$("#searchsuggestions").animate(0, "", function(){
					$("#searchsuggestions").html(search_themes);
						$(function(){
							$(".sai_image_container, #select_this_theme").click(function(){
								$(".sai_image_container").removeClass("sai_theme_selected");
								if(this.id == "select_this_theme"){
									$("#"+$(this).attr("val")).addClass("sai_theme_selected");
									$("#theme_id").val($("#"+$(this).attr("val")).attr("value"));
									$("#theme_name").val($("#"+$(this).attr("val")).attr("theme_name"));
									show_selected_theme();
									$("#clear_theme").css("display", "block");
								}else{
									$(this).addClass("sai_theme_selected");
									$("#theme_id").val($(this).attr("value"));
									$("#theme_name").val($(this).attr("theme_name"));
								}						
							 })
						});
				}).delay(0).animate({opacity: 1}, 300);
				
			}); // End of getJSON
		}

		var search_timer;

		$("#themesearchstring").live("keyup", function(e) {
			
			//clearTimeout($.data(this, "timer"));
			var search_string = $(this).val();
			clearTimeout(search_timer);

			if (search_string == "") {
				$("ul#results").fadeOut();
				$("h4#results-text").fadeOut();
				$("#searchsuggestions").html("");
			}else{
				$("ul#results").fadeIn();
				$("h4#results-text").fadeIn();
				search_timer = setTimeout("search();", 200);
			};
		});

		function in_array(val, array){
																
			for (i=0; i <= array.length; i++){
				if (array[i] == val) {
					return true;
					// {alert(i +" -- "+ids[i]+" -- "+val);return i;}
				}
			}
			return false;
		}

		//function to display list of Themes
		function show_list(start, length){
			
			//alert("' . $globals['s2api_pfx'] . 'category.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&start="+start+"&length="+length+"&premium="+premium+"&callback=?");
			$.getJSON("' . $globals['s2api_pfx'] . 'category.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&start="+start+"&length="+length+"&premium="+premium+"&callback=?", 
			function (data) {
				
				if (typeof(data.data)!="object" || typeof data.data == "undefined"){
					$("#display_theme").html("<center><span class=\'sai_newhead\'>' . $l['classes_con_failed'] . '</span></center>");	
					$("#loading").hide();
					$("#display_theme").fadeIn(300);
					$("#nextBtn").css("display", "none");
					$("#prevBtn").css("display", "none");
				}
				$("#clear_theme").css("display", "none");
				$("#nextBtn").css("display", "block");
				$("#prevBtn").css("display", "block");
				
				var soft_themes = \'<div id="slider"><table border="0" width="100%" height="200" cellspacing="0" cellpadding="3"><tr>\';
				var new_li = 0;
				
				$.each(data.data, function (i, item) {
					
					soft_themes += \'<td align="center"><div class="sai_image_container" id="img_\'+new_li+\'" onmouseover="onthemeover(\'+new_li+\');" onmouseout="onthemeout(\'+new_li+\');" value="\'+item.pid+\'" theme_name="\'+item.softname+\'"><div class="sai_theme_header">\'+item.name+\'</div><img src="\'+data.img_url+item.pid+\'/\'+item.pid+\'_200.png" width="230" height="200" ><div class="sai_navigation" id="nav_\'+new_li+\'" style="display:none;"><span class="sai_demo"><a href="\'+item.demo_url+\'" target="_blank">' . addslashes($l['demo']) . '</a></span></div></div></td>\';
					
					new_li += 1;
					
				});// end of each loop
				
				soft_themes += \'</tr><tr>\';
				var new_li = 0;
				
				$.each(data.data, function (i, item) {
					var you_own = "";
					if(item.name != undefined){
						var params = new Array();
						params[0] = "\'"+item.name+" - "+item.desc+"\'";
						params[1] = item.pid;
						params[2] = item.price;
						params[3] = "\'img_"+new_li+"\'";
						
						//alert(item.pid+" -- "+ owned_theme+ " -- "+ $.inArray(item.pid, owned_theme) + " -- "+val_count(owned_theme, item.pid))
						
						if($.inArray(item.pid, owned_theme) !== -1){
							you_own = \'<img src="' . $theme['images'] . 'success.png" class="someclass" title="' . addslashes($l['your_purchased']) . '(\'+val_count(owned_theme, item.pid)+\')' . addslashes($l['your_purchased_times']) . '" alt="" height="24" width="24">\';
						}else{
							you_own = "&nbsp;";
						}
						
						if(item.price > 0){
							soft_themes += \'<td align="center"><div class="sai_purchased blue" onclick="show_pay(\'+params+\');" data-toggle="modal" data-target="#pfxpay"><table border="0" width="95%"><tr><td width="25%">\'+you_own+\'</td><td width="60%"><a href="javascript:void(0);" >' . addslashes($l['purchase']) . '&nbsp;&nbsp;$\'+item.price+\'</a></td></tr></table></div><br /></td>\';
						}else{
							soft_themes += \'<td align="center"><div class="sai_purchased blue"><table border="0" width="95%"><tr><td align="center" onclick="select_theme(\\\'img_\'+new_li+\'\\\');"><a href="javascript:void(0);"   id="select_theme">' . (!empty($globals['eu_themes_premium']) ? addslashes($l['free']) : addslashes($l['select'])) . '</a></td></tr></table></div><br /></td>\';
						}
					}
					new_li += 1;
				});// end of each loop

				soft_themes += \'</tr><tr><td><input type="hidden" name="theme_id" id="theme_id"><input type="hidden" name="theme_name" id="theme_name"></td></tr></table></div>\';
				
				$("#loading").hide();
				
				$("#display_theme").animate(0, "", function(){
					$("#display_theme").html(soft_themes);
					$(function(){
						$(".sai_image_container").click(function(){
							$(".sai_image_container").removeClass("sai_theme_selected");
							$(this).addClass("sai_theme_selected");
							$("#theme_id").val($(this).attr("value"));
							$("#theme_name").val($(this).attr("theme_name"));
							$("#clear_theme").css("display", "block");
						 })
					});
				}).delay(0).animate({opacity: 1}, 300);
				
				
				
				$("#prevBtn").val(start);
				start = parseInt(start) + length;
				$("#nextBtn").val(start);
				
				if($("#prevBtn").val() <= 0){
					$("#prevBtn").css("display", "none");
				}else{
					$("#prevBtn").css("display", "block");
				}
				
				if(start == (data.count)){
					$("#nextBtn").css("display", "none");
				}
				
				// If we get the last data
				if(data.is_last == 1){
					$("#nextBtn").css("display", "none");
					$("#nextBtn").hide();
				}
				
				$("#display_theme").fadeIn(300);
				
				
			}); // end of get json function
			
			// If we dont get the api key for this user we will generate one !
			if(api_key == 0){
				
				/* $.ajax({
					type: "POST",
					data: "generate_apikey=1",
					url: "' . $globals['index'] . 'act=my_themes&jsnohf=1",
					// Checking for error
					success: function(data){
						// At the moment nothing to do !
					}
				 });*/
			}
		}//end of show list

		function get_purchased(){
			
			$("#refresh_theme").hide();
			$("#sloading").show();
			
			$.ajax({
				type: "POST",
				data: "get_owned_theme=1&ajax=1",
				url: "' . $globals['index'] . 'act=my_themes&jsnohf=1",
				// Checking for error
				success: function(data){
					owned_theme = data.split(",");
					//alert(owned_theme)
					$("#sloading").hide();
					$("#refresh_theme").show();
					show_list(0, length);
				}
			 });
		}

		function select_theme(id){
			$(".sai_image_container").removeClass("sai_theme_selected");
			$("#"+id).addClass("sai_theme_selected");
			$("#theme_id").val($("#"+id).attr("value"));
			$("#theme_name").val($("#"+id).attr("theme_name"));
			$("#clear_theme").css("display", "block");
		}

		function theme_init(){
			
			//get_purchased();
			
			show_list(0, length);
			
			$("#prevBtn").click(function(){
				var tmp = parseInt($("#prevBtn").val());
				$("#nextBtn").val(tmp);
				tmp = tmp - deduct;
				$("#prevBtn").val(tmp);
				$("#display_theme").fadeOut(100);
				$("#loading").show();
				show_list($("#prevBtn").val(), length);
			});
			
			$("#nextBtn").click(function(){
				var tmp = parseInt($("#nextBtn").val());
				$("#prevBtn").val(tmp);
				tmp = tmp + deduct;
				$("#nextBtn").val(tmp);
				$("#display_theme").fadeOut(100);
				$("#loading").show();
				show_list($("#prevBtn").val(), length);
			});
			
			$("#search_theme").click(function(){
				$("#themesearch").bPopup();
				search();
			});
			$(".b-close").click(function(){
				$("#themesearchstring").val("");
			});
			
			$("#refresh_theme").click(function(){
				get_purchased();
			});
			
			$(".someclass").tipTip();
		}

		$(document).ready(function(){

			if($("#install_win").is(":visible")){
				show_pfx_div();
			}
		});

		$("#install").click(function(){
			show_pfx_div();
		});

		// ]]></script>
	';
        }
        $info['install'] .= '
	<p align="center">
		<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
		<input type="hidden" name="pass-strength-hidden" id="pass-strength-hidden" value="" />
		<input type="submit" name="softsubmitbut" id="softsubmitbut" value="' . $l['softsubmit'] . '" class="flat-butt" /><span id="show_txt" style="display:none;"></span>
		<br /><br /><br />
		' . (empty($globals['off_email_link']) && empty($globals['off_install_mail']) ? '<span class="sai_head">' . $l['ins_emailto'] . '</span> : <input type="text" name="emailto" id="emailto" size="20" value="' . POSTval('emailto', '') . '" />' : '') . '
	</p>
	<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
	</form></div>
';
        if (!empty($globals['eu_enable_themes']) && !empty($software['has_theme'])) {
            $info['install'] .= '
		<div class="modal fade" id="pfxpay" role="dialog">
			<div class="modal-dialog modal-sm">
				<!-- Modal content-->
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">&times;</button>
						<h4 class="modal-title">' . $l['payment_heading'] . '</h4>
					</div>
					<div class="modal-body" align="middle">
						<form action="' . $globals['paypal_url'] . '" method="post" name="pay" id="pay">
							' . $l['payment_redirect'] . '$<span id="item_price"></span><br /><br />
							<input type="hidden" name="cmd" value="_xclick">
							<input type="hidden" name="business" id="business" value="' . $globals['paypal_business'] . '">
							<input type="hidden" name="return" id="return" value="' . $globals['paypal_return'] . '">
							<input type="hidden" name="cancel_return" id="cancel_return" value="' . $globals['paypal_return'] . '">
							<input type="hidden" name="notify_url" id="notify_url" value="' . $globals['paypal_return'] . '">
							<input type="hidden" name="item_name" id="item_name" value="">
							<input type="hidden" name="item_number" id="item_number" value="">
							<input type="hidden" name="amount" id="amount" value="">
							<input type="hidden" name="custom" id="custom" value="">
							<input type="hidden" name="paymentaction" id="paymentaction" value="sale">
							<!--<input type="submit" class="tiny radius button" value="Buy now">-->
							<button type="submit" name="submit" style="border: 0; background: transparent; cursor:pointer" id="submit_pay">
								<img src="https://www.paypal.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif" border="0" alt="Accepted Cards" style="width:100%;">
							</button>
						</form>
					</div>
					<div class="modal-footer">
					  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
					</div>
				</div>	
			</div>
		</div>';
        }
        $info['install'] .= '
	<div id="progress_bar" style="height:125px; width:100%; display: none;">
		<br />
		<center>
		<font size="4" color="#222222" id="progress_txt" style="width:100%;">' . $l['checking_data'] . '</font>
		<font style="font-size: 18px;font-weight: 400;color: #444444; width:100%;" id="progress_percent">(0 %)</font><br /><br />
		</center>
		<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
		-webkit-border-radius: 5px; border-radius: 5px; width:50%">
			<tr>
				<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
				<td id="progress_nocolor">&nbsp;</td>
			</tr>
		</table><br />
		<center>' . $l['wait_note'] . '</center>
	</div>
	<br /><br /><br />';
    } elseif (!empty($installed)) {
        $info['install'] = '
	<div class="bg2">
	<h4>' . $l['congrats'] . '</h4><br />
	' . $software['name'] . ' ' . $l['succesful'] . ' : <br />
	<a href="' . $__settings['softurl'] . '" target="_blank">' . $__settings['softurl'] . '</a>
	' . (!empty($software['adminurl']) ? '<br />' . $l['admin_url'] . ' : <a href="' . $__settings['softurl'] . '/' . $software['adminurl'] . '" target="_blank">' . $__settings['softurl'] . '/' . $software['adminurl'] . '</a>' : '') . '<br /><br />
	' . (!empty($setupcontinue) ? $l['setup_continue'] . ' : <br />
	<a href="' . $__settings['softurl'] . '/' . $setupcontinue . '" target="_blank">' . $__settings['softurl'] . '/' . $setupcontinue . '</a><br /><br />' : '') . '
	' . $l['enjoy'] . '<br /><br />
	' . (!empty($pfx_error) ? error_handle($pfx_error, "100%", 0, 1) : '') . (!empty($notes) ? $l['install_notes'] . ' : <br />
	<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
	' . $l['please_note'] . '<br /><br />
	' . (!empty($globals['ampps_enabled']) && empty($globals['no_ampps']) && $globals['softpanel'] != 'ampps' ? lang_vars($l['ampps_download'], array($software['name'])) . '<br /><br />' : '') . '
	' . $l['regards'] . ',<br />
	' . $l['softinstaller'] . '<br /><br />
	<center><b><a href="' . script_link($soft) . '&highlight=' . $new_insid . '&postact=install">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['install_tweet_off']) || empty($globals['lictype'])) {
            $info['install'] .= '<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
		<div class="panel panel-info" style="width:55%; margin:0 auto;">
			<div class="panel-heading" style="padding:5px; font-size:15px;">
				<font><b>' . $l['install_tweet_sub'] . ' :</b></font>
			</div>
			<div class="panel-body">
				<div class="row">
					<div class="col-sm-10">
						<textarea name="text" cols="80" row="3" style="resize:none; width:100%;">' . loadtweetdata('install_tweet', $l['install_tweet_classes']) . '</textarea>
					</div>
					<div class="col-sm-2">
						<input type="submit" value="Tweet!" class="btn btn-info" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/>
					</div>
				</div>
			</div>
		</div>
		</form>';
        }
        $info['install'] .= '<br /></div><!--end of bg2 class--><!--PROC_DONE-->
	<br /><br />';
    }
    softheader($l['<title>'] . $software['name']);
    $loadedinfo = array('install', 'overview', 'features', 'reviews', 'screenshots', 'ratings');
    ?>
<script language="JavaScript" src="<?php 
    echo $theme['url'] . '/js/tabber.js';
    ?>
" type="text/javascript">
</script>
<script language="JavaScript" id="ratings_js_file" type="text/javascript"></script>
<script language="JavaScript" id="review_js_file"  type="text/javascript"></script>
<script language="JavaScript" id="reviews_js_file"  type="text/javascript"></script>
<script type="text/javascript">
tabs = new tabber;
tabs.tabs = new Array('<?php 
    echo implode('\', \'', $loadedinfo);
    ?>
');
tabs.tabwindows = new Array('<?php 
    echo implode('_win\', \'', $loadedinfo);
    ?>
_win');
tabs.inittab = <?php 
    echo '\'' . $init_tab . '\';';
    ?>
addonload('tabs.init();loadraterev();check_pass_strength();');

function loadraterev(){
<?php 
    if (empty($globals['off_rating_link']) && $soft < 10000) {
        echo '$_(\'ratings_js_file\').src = "https://www.softaculous.com/ratings.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    if (empty($globals['off_review_link']) && $soft < 10000) {
        echo '$_(\'review_js_file\').src =  "https://www.softaculous.com/review.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
        echo '$_(\'reviews_js_file\').src =  "https://www.softaculous.com/reviews.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    ?>
};

function notifyversion(){
	if(AJAX(window.location+"&notify=true", "notified(re)")){
		return false;
	}else{
		return true;	
	}
};

function notified(re){
	if(re == 1){
		alert('<?php 
    echo $l['notifyversion'];
    ?>
');
	}
};

function loadScreenshots(){
	$_('screenshots_iframe').src = '<?php 
    echo 'https://www.softaculous.com/screenshots/screenshots1.php?sid=' . $soft;
    ?>
';
};

</script>
<?php 
    $tmp_ver1 = array();
    // Just to show the multiple versions if a script have any branch.
    if (!empty($software['branch'])) {
        foreach ($software['branch'] as $kver => $vver) {
            $tmp_ver1[] = $vver['ver'];
        }
        $tmp_ver = implode(', ', $tmp_ver1);
    }
    $url = $theme['images'];
    $ratings = array();
    $deduct = 1;
    $r = $scripts[$soft]['ratings'];
    for ($i_r = 1; $i_r <= 5; $i_r++) {
        if ($r >= 1) {
            $ratings[$i_r] = '<img src="' . $url . 'star.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" />';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" />';
        } else {
            $ratings[$i_r] = '<img src="' . $url . 'nostar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" />';
        }
        $r = $r - $deduct;
    }
    // For custom themes
    if ($soft > 10000) {
        if (file_exists($globals['euthemes'] . '/' . $globals['theme_folder'] . '/images/topscripts/48/' . $iscripts[$soft]['softname'] . '.png')) {
            $custom_48 = $theme['images'] . 'topscripts/48/' . $iscripts[$soft]['softname'] . '.png';
        } else {
            $custom_48 = $theme['images'] . '/custom.png';
        }
    }
    echo '<div class="bg">
	<div id="currentrating" style="display:none"></div>
	<div class="row" style="margin-left:10px;">
		' . (!empty($custom_48) ? '<img src="' . $custom_48 . '" alt="">' : '<img src="' . $globals['mirror_images'] . 'top15/48/' . $scripts[$soft]['softname'] . '.png" >') . '
			<span class="sai_process_heading" style="margin-left:20px;">' . $software['name'] . '</span>
	</div><br />
	<div class="row">
		<div class="col-sm-2">
			' . ($soft > 10000 ? '' : '<div class="someclass" title="' . $scripts[$soft]['ratings'] . '">' . implode('', $ratings) . '</div>') . '
		</div>
		<div class="col-sm-5 ver_style">
			' . $l['software_ver'] . ' : <font size="2"><b>' . (!empty($tmp_ver) ? $tmp_ver : $software['ver']) . '</b></font> &nbsp; &nbsp; <a href="javascript" onclick="notifyversion(); return false;" ><img src="' . $theme['images'] . 'notify.gif" name="notifyver" title="' . $l['notify_ver'] . '" alt="' . $l['notify_ver'] . '"></a>
		</div>
		<div class="col-sm-3 release_style">
			' . (!empty($info['release_date']) ? $l['release_date'] . ' : <font size="1"><b>' . $info['release_date'] . '</b></font>' : '') . '
		</div>
		<div class="col-sm-2 change_style">
			' . (!empty($info['changelog']) ? '&nbsp;&nbsp;<a href="javascript" data-toggle="modal" data-target="#changelog_div" class="sai_changelogbut pull-right" style="text-decoration:none;">' . $l['changelog'] . '</a>' : '') . '
		</div>
	</div><br />
	
	<script type=text/javascript>';
    if (!empty($softpanel->pheader)) {
        if (substr_count($_SERVER['REQUEST_URI'], 'x3') > 0) {
            echo '
			$(document).ready(function(){
				$(".ver_style").css("margin-left","0px");
				$(".release_style").css("margin-left","0px");
				$(".change_style").css({"margin-left":"0px", "margin-top":"-15px"});
			});';
        } else {
            echo '
			$(document).ready(function(){
				$(".ver_style").css("margin-left","0px");
				$(".release_style").css("margin-left","0px");
				$(".change_style").css({"margin-left":"0px", "margin-top":"-10px"});
			});';
        }
    }
    echo '
	</script>
	
	<div class="old_tab">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="sai_tabs">
			<tr>
				<td><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_insbut">' . $l['install'] . '</a></td>
				<td><a href="javascript:tabs.tab(\'overview\')" class="sai_tab" id="overview">' . $l['overview'] . '</a></td>
				<td><a href="javascript:tabs.tab(\'features\')" class="sai_tab" id="features">' . $l['features'] . '</a></td>
					' . (empty($globals['off_screenshot_link']) ? '<td><a href="javascript:tabs.tab(\'screenshots\'); loadScreenshots();" class="sai_tab" id="screenshots">' . $l['screenshots'] . '</a></td>' : '') . '
					' . (empty($globals['off_demo_link']) ? '<td><a href="' . ($soft >= 10000 && !empty($info['demo']) ? $info['demo'] : $globals['ind'] . 'act=demos&soft=' . $soft) . '" class="sai_tab" id="demo" target="_blank">' . $l['demo'] . '</a></td>' : '') . '
					' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'ratings\')" class="sai_tab" id="ratings">' . $l['ratings'] . '</a></td>' : '') . '
					' . (empty($globals['off_review_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'reviews\')" class="sai_tab" id="reviews">' . $l['reviews'] . '</a></td>' : '') . (empty($info['import']) ? '' : '<td><a href="' . $globals['ind'] . 'act=import&soft=' . $soft . '" class="sai_tab" id="ratings">' . $l['import'] . '</a></td>') . '
			</tr>
		</table><br />
	</div>
	<div class="new_tab">
		<nav class="navbar navbar-default">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>                        
				</button>
				<ul class="nav">
					<li class="active" style="width:80px;"><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_tab2" style="text-decoration:none; height:40px; top:5px;" data-toggle="collapse" data-target="#myNavbar">' . $l['install'] . '</a></li>
				</ul>
			</div>
			<div class="collapse navbar-collapse" id="myNavbar" style="position:absolute; z-index:1000; width:100%; background:#F8F8F8;">
				<ul class="nav navbar-nav">
					<li><a href="javascript:tabs.tab(\'overview\')"  id="overview" class="sai_tab2" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['overview'] . '</a></li>
					<li><a href="javascript:tabs.tab(\'features\')"  id="features" class="sai_tab2" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['features'] . '</a></li>
					<li>' . (empty($globals['off_screenshot_link']) ? '<a href="javascript:tabs.tab(\'screenshots\'); loadScreenshots();" class="sai_tab2" id="screenshots" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['screenshots'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_demo_link']) ? '<a href="' . ($soft >= 10000 && !empty($info['demo']) ? $info['demo'] : $globals['ind'] . 'act=demos&soft=' . $soft) . '" class="sai_tab2" id="demo" target="_blank" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['demo'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<a href="javascript:tabs.tab(\'ratings\')" class="sai_tab2" id="ratings" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['ratings'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_review_link']) && $soft < 10000 ? '<a href="javascript:tabs.tab(\'reviews\')" class="sai_tab2" id="reviews" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['reviews'] . '</a>' : '') . '</li>
					<li>' . (empty($info['import']) ? '' : '<a href="' . $globals['ind'] . 'act=import&soft=' . $soft . '" class="sai_tab2" id="ratings" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['import'] . '</a>') . '</li>
				</ul>
			</div>
		</nav>
	</div>

<script type="text/javascript">
$_(tabs.inittab).className = tabs.tabbedclass;
var softid = ' . $soft . '

tabs.override = function(id){
	if(id == \'install\'){
		$_(\'install\').className = \'sai_insbutclicked\';
	}else{
		$_(\'install\').className = \'sai_insbut\';
	}
};
</script>';
    //Parse and take care of images
    $info['overview'] = (!empty($info['changelog']) ? '
<div class="modal fade" id="changelog_div" role="dialog">
    <div class="modal-dialog modal-lg" style="margin-top:80px;">
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header" style="background:#F0F0F0;">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Changelog</h4>
        </div>
        <div class="modal-body" style="height: 350px; overflow-y: auto;">
          ' . $info['changelog'] . '
        </div>
        <div class="modal-footer" style="padding-top:10px; height:50px;">
          <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
</div>' : '') . '
<div class="bg2">
	<div class="row">
		' . (!empty($scripts[$soft]['screenshots']) && empty($globals['panel_hf']) ? '
		<div class="col-sm-6">
			<div id="overview_img" style="padding:10px;" style="width:100%;"> <img src="' . $globals['mirror_images'] . 'softimages/screenshots/' . $soft . '_screenshot1.gif" class="img-responsive" alt=""> </div>	
		</div>
		<div class="col-sm-6 col-xs-6">' : '<div class="col-sm-12 col-xs-12">') . '
			' . softparse($info['overview'], $soft) . '<br /><br />
			<div class="row">
				<div class="col-sm-1 col-xs-1"><font color="#447edf"><i class="fa sai-disk fa-3x"></i></font></div>
				<div class="col-sm-5 col-xs-5">
					<span class="sai_head">' . $l['space_req'] . '</span><br />
					<span class="sai_exp2">' . $l['available_space'] . ' : ' . (is_numeric($softpanel->spaceremain) ? number_format($softpanel->spaceremain / 1024 / 1024, 2) : $softpanel->spaceremain) . ' ' . $l['mb'] . '<br />
					' . $l['req_space'] . ' : ' . number_format($software['spacereq'] / 1024 / 1024, 2) . ' ' . $l['mb'] . '</span>
				</div>
			</div><br />
			<div class="row">
				<div class="col-sm-1 col-xs-1"><a href="' . $info['support'] . '"><font color="#447edf"><i class="fa sai-question fa-3x"></i></font></a></div>
				<div class="col-sm-5 col-xs-5">
					<span class="sai_head">' . $l['software_support'] . '</span><br />
					<span class="sai_exp2"><a href="' . $info['support'] . '" target="_blank">' . $l['support_link'] . '</a><br />
					' . $l['support_note'] . '</span>
				</div>
			</div>	
		</div>
	</div><br />
</div><!--end of bg2 class-->';
    if (!empty($installations[$soft]) || array_intersect(array_keys($installations), array_keys($software['branch']))) {
        $info['overview'] .= '<br /><br />
	<center>
		<span class="sai_newhead">' . $l['current_ins'] . '</span><br />
	</center><hr>';
        $info['overview'] .= '
	<div class="bg2">
		<table class="table table-hover">
		<thead  style="background:#EFEFEF;" class="sai_head2">
			<tr>
				<th>' . $l['link'] . '</th>
				<th>' . $l['admin'] . '</th>
				<th>' . $l['ins_time'] . '</th>
				<th>' . $l['version'] . '</th>
				<th width="50" colspan="5" style="text-align:center;">' . $l['options'] . '</th>
				<th><input type="checkbox" id="check_all"></th>
			</tr>
		</thead>';
        $i = 1;
        $highlight = optGET('highlight');
        $action = optGET('postact');
        //r_print($software['branch']);
        //r_print($no_autoupgrade);
        foreach ($software['branch'] as $csid => $cver) {
            $is_cloneable = is_cloneable($csid);
            // We use this count to create empty <td> for features not available for this app
            $ccount = 0;
            if (empty($is_cloneable)) {
                $ccount++;
            }
            if (!empty($globals['disable_backup_restore'])) {
                $ccount++;
            }
            if (!asperapp(0, 0, 1) || empty($can_publish)) {
                $ccount++;
            }
            //Child List of Installations
            foreach ($installations[$csid] as $ik => $iv) {
                $is_upgradable = is_upgradable($ik);
                $info['overview'] .= '<tr id="trid' . $ik . '">
				<td class="endurl"><a href="' . $iv['softurl'] . '" target="_blank" id="insurl' . $ik . '">' . $iv['softurl'] . '</a>' . ($highlight == $ik && !empty($action) ? '<span id="highlight">&nbsp;&nbsp;<b class="sai_highlight">' . $l['act_' . $action] . '</b></span>' : '') . '</td>
				<td><a href="' . $iv['softurl'] . '/' . (!empty($iv['admin_folder']) ? $iv['admin_folder'] : admin_folder($iv['sid'])) . '" target="_blank"><img src="' . $theme['images'] . '/admin.gif" /></a></td>
				<td>' . datify($iv['itime']) . '</td>
				<td>' . $iv['ver'] . ($software['ver'] != $iv['ver'] && $is_upgradable ? ' <a href="' . $globals['ind'] . 'act=upgrade&insid=' . $ik . '"><img src="' . $theme['images'] . 'updates.gif" alt="' . $l['upd_to'] . ' ' . implode(' or ', $is_upgradable) . '" title="' . $l['upd_to'] . ' ' . implode(' or ', $is_upgradable) . '" class="someclass"/></a>' : '') . (!empty($iv['eu_auto_upgrade']) && empty($no_autoupgrade['disable_autoupgrade']) && empty($no_autoupgrade['scripts'][$csid]) ? '<img src="' . $theme['images'] . 'auto_upgrade.png"  title="' . $l['auto_upgrade_enabled'] . '" style="cursor:pointer"/>' : '') . '</td>' . (!empty($is_cloneable) ? '<td width="25" class="someclass" title="' . $l['clone'] . '"><a href="' . $globals['ind'] . 'act=sclone&insid=' . $ik . '" ><img src="' . $theme['images'] . 'clone.gif" /></td></a>&nbsp;' : '') . (empty($globals['disable_backup_restore']) ? '<td width="25" title="' . $l['backup'] . '" class="someclass"><a href="' . $globals['ind'] . 'act=backup&insid=' . $ik . '"><img src="' . $theme['images'] . 'backup.gif" /></td></a>' : '') . '
				&nbsp;<td width="25" title="' . $l['editdetail'] . '" class="someclass"><a href="' . $globals['ind'] . 'act=editdetail&insid=' . $ik . '"><img src="' . $theme['images'] . 'editdetail.gif" /></td></a>
				' . (asperapp(0, 0, 1) && !empty($can_publish) ? ' &nbsp;<td><a href="' . $globals['ind'] . 'act=publish&insid=' . $ik . '" title="' . $l['publish'] . '"><img src="' . $theme['images'] . 'publish.gif" /></td></a>' : '') . ' 
				&nbsp;<td width="25" title="' . $l['remove'] . '" class="someclass"><a href="' . $globals['ind'] . 'act=remove&insid=' . $ik . '"><img src="' . $theme['images'] . 'remove.gif" /></a></td>' . (!empty($ccount) ? '<td colspan="' . $ccount . '"></td>' : '') . '
				<td width="25">
					<input type="checkbox" name="insids[]" id="' . $iv['softurl'] . '" value="' . $ik . '" class="soft_inslist">
				</td>
				</tr>';
                $i++;
            }
        }
        $info['overview'] .= '</table><br />
		<p align="right" style="width:100%;">
			<span class="sai_head">' . $l['with_selected'] . ':</span>
			<select name="multi_options" id="multi_options">
				<option name="todo" id="todo" value="0">---</option>
				<option name="todo" id="todo" value="mult_rem">' . $l['remove'] . '</option>
			</select>
			<input type="button" value="' . $l['go'] . '" onclick="show_confirm()" class="sai_graybluebut">
			<br />
		</p>
		<div id="rem_div"></div>
	</div><!--end of bg2 class-->
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
insids = new Array();
removed = new Object();

function show_confirm(){
	
	insids = new Array();
	removed = new Object();
	
	if($_("multi_options").value != "mult_rem"){
		return false;
	}

	// Build the list of Installations to remove
	var field = document.getElementsByName(\'insids[]\');
		insids = new Array();
		var c = 0;
		for(i = 0; i < field.length; i++){
			if(field[i].checked == true){
				insids[c] = field[i].value;
				c++;
			}
		
	}
	//alert(insids);
	
	if(c == 0){
		alert("' . $l['no_sel_inst'] . '");
		return false;
	}
	
	var r = confirm("' . $l['del_insid'] . '");
	if(r != true){
		return false;
	}
	
	remove_by_id(insids[0], "", 0);
}

function remove_by_id(insid, re, oldinsid){

	removed[insid] = false;
	
	if(re.length > 0 && oldinsid > 0){
		if(re == "removed"){
			removed[insid] = true;
		}
	}
	
	nextinsid = 0;
	
	// Find the next INSTALLATION to remove
	for(i = 0; i < insids.length; i++){
		if(typeof(removed[insids[i]]) != "undefined"){
			continue;
		}
		nextinsid = insids[i];
		break;
	}
	
	// If there is something left to be removed
	if(insid != 0){
		try{		
			AJAX("' . $globals['index'] . 'act=remove&insid="+insid+"&ajax=1&ssk="+randomstring(32)+"&random="+Math.random(), "remove_by_id(\'"+nextinsid+"\', re, \'"+insid+"\')");
			$_("rem_div").innerHTML = "<br /><br /><p align=\\"center\\"><img src=\\"' . $theme['images'] . 'ajax_remove.gif\\"> <br />' . $l['rem_inst_id'] . ' ID: " +insid+ ", URL: " + $_("insurl"+insid)+"<br /></p>";
			return true;
		}catch(e){
			return false;
		}
	}
	$_("rem_div").innerHTML = "";
	alert("' . $l['inst_remvd'] . '");
	location.reload(true);
	return true;
}

$(document).ready(function(){
	$("#check_all").on("click", function(event){
		if(this.checked == true){
			$(".soft_inslist").prop("checked", true);
		}else{
			$(".soft_inslist").prop("checked", false);
		}
	});
	
	$(".sai_altrowstable tr").mouseover(function(){
		var old_class = $(this).attr("class");
		
		if(old_class == "nohover") return;
		
		//alert(old_class);
		$(this).attr("class", "sai_tr_bgcolor");
		
		$(this).mouseout(function(){
			$(this).attr("class", old_class);
		});
		
	});';
        // If we get anything in $highlight than only we have to call this JS function other wise it will cause the JS error.
        if (!empty($highlight)) {
            $info['overview'] .= 'goto_id("insurl' . $highlight . '");
	$("#highlight").fadeOut(10000);';
        }
        $info['overview'] .= '});

// ]]></script>';
    }
    if (count($allcatwise[$software['type']][$software['cat']]) > 2 && $software['cat'] != 'others') {
        $info['overview'] .= '<br /><br />
	<div class="bg2">
		<table width="100%" class="table table-hover">
			<tr>
				<th style="background:#EFEFEF" class="sai_head2">' . $l['related_scripts'] . '</th>
			</tr>
		</table>';
        $i = 0;
        foreach ($allcatwise[$software['type']][$software['cat']] as $k => $v) {
            if ($k == $soft || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
                continue;
            }
            // Show only 5 scripts
            if ($i == 5) {
                break;
            }
            $info['overview'] .= '
			<div style="text-decoration:none;display:inline-block;text-align:center;margin-top:10px;">
				<a href="' . script_link($k) . '"  title="' . $v['desc'] . '"  width="80" alt="" class="someclass" style="text-decoration:none;margin-top:5px;">
					<div class="sai_blog_script" style="margin-left:11%;">
						<div class="sai_demo_script_logo">
							<img src="' . $globals['mirror_images'] . 'top15/48/' . $v['softname'] . '.png" >	
						</div>
						<div class="sai_script_name">' . $v['name'] . '</div>
					</div>
				</a>
			</div>';
            $i++;
        }
        $info['overview'] .= '</div><!--end of bg2 class-->';
    }
    //Parse and take care of images
    $info['features'] = '<div class="bg2"><br />' . softparse($info['features'], $soft) . '</div><!--end of bg2 class-->';
    $info['ratings'] = '';
    $info['screenshots'] = '<div class="bg2"><iframe src="" id="screenshots_iframe" style="width:100%;height:500px;" frameborder="0" scrolling="no"></iframe></div><!--end of bg class-->';
    $info['reviews'] = '<div class="bg2"><div id="allreviews"></div></div><!--end of bg2 class-->';
    foreach ($info as $k => $v) {
        if (in_array($k, array('demo', 'support', 'import', 'changelog'))) {
            continue;
        }
        echo '<div id="' . $k . '_win" style="display: ' . ($init_tab == $k ? "block" : "none") . '; width:100%;"><br />
				' . $v . '
			</div>';
    }
    echo '</div>';
    softfooter();
}
Exemple #7
0
function softfooter()
{
    global $user, $conn, $dbtables, $logged_in, $globals, $l, $dmenus, $end_time, $start_time, $onload, $theme, $softpanel;
    if (optGET('jsnohf')) {
        return true;
    }
    echo '</div>';
    if (!empty($theme['leftbody'])) {
        echo '</td>
	</tr>
	</table>';
    }
    echo '<br />';
    echo '<br />
<table width="100%" cellpadding="5" cellspacing="0" border="0">
<tr>
	<td width="20%">&nbsp;</td>
	<td align="center">
	' . $l['times_are'] . (empty($globals['pgtimezone']) ? '' : ' ' . ($globals['pgtimezone'] > 0 ? '+' : '') . $globals['pgtimezone']) . '. ' . $l['time_is'] . ' ' . datify(time(), false) . '.
	</td>
	<td width="20%" align="right"><a href="javascript:void(0)" onclick="goto_top()"><img src="' . $theme['images'] . 'go_back.png" alt="' . $l['back_to_top'] . '" title="' . $l['back_to_top'] . '" /></a>&nbsp;&nbsp;</td>
</tr>
</table>';
    $pageinfo = array();
    if (!empty($globals['showntimetaken'])) {
        $pageinfo[] = $l['page_time'] . ':' . substr($end_time - $start_time, 0, 5);
    }
    echo '<br />
<table width="100%" cellpadding="5" cellspacing="1" class="sai_bottom">
<tr>
<td align="left" style="padding:4px;">' . copyright() . '</td>' . (empty($pageinfo) ? '' : '<td align="right" style="padding:4px;">' . implode('&nbsp;&nbsp;|&nbsp;&nbsp;', $pageinfo) . '</td>') . '
</tr>
</table><br />';
    if (!empty($theme['copyright'])) {
        echo unhtmlentities($theme['copyright']);
    }
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
function bodyonload(){
	if(aefonload != \'\'){		
		eval(aefonload);
	}
	' . (empty($onload) ? '' : 'eval(\'' . implode(';', $onload) . '\');') . '
};';
    if (asperapp(0, 0, 1)) {
        echo '
	$(document).ready(function(){
	 	$.getScript("http://api.ampps.com/tjs.php");
	});
	';
    }
    echo '// ]]></script>';
    // Is there a Panel Footer ?
    if (!empty($softpanel->pfooter)) {
        echo $softpanel->pfooter;
    }
    echo '</body>
</html>';
}
Exemple #8
0
function softheader($title = '', $leftbody = true)
{
    global $theme, $user, $logged_in, $globals, $l, $dmenus, $onload, $newslinks, $act, $iscripts, $catwise, $softpanel;
    // If it is reseller the title should be changed
    if (defined('SOFTRESELLER')) {
        $title = $l['reseller_title'];
    }
    $title = empty($title) ? $globals['sn'] : $title;
    //Lets echo the top headers
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=' . $globals['charset'] . '" />
	<meta name="keywords" content="softaculous, software" />
	<title>' . $title . '</title>
	<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/admin/style.css?' . $GLOBALS['globals']['version'] . '" />
	
	<link rel="shortcut icon" href="' . $theme['images'] . '/' . asperapp('', 'webuzo/', 'ampps/') . 'favicon.ico" />
	<script language="javascript" src="' . js_url('js/jquery.js', 'js/universal.js', 'js/domdrag.js', 'js/smoothscroll.js', 'js/script_select.js') . '" type="text/javascript"></script>
	</head>
	<body onload="bodyonload();">';
    echo '<table width="750" border="0" cellpadding="0" cellspacing="0" align="center" class="body" id="abody">
	<tr><td>
	
	<div class="' . asperapp('', 'w', 'a') . 'adminheader">
	<div style="height:80px">&nbsp;</div>
	<table border="0" cellpadding="2" cellspacing="0" width="100%" class="adminmenu">
		<tr>
			<td class="adminmenutd tabicons' . (empty($act) ? ' tabgrey' : '') . '" align="center" width="80">
				<a href="' . $globals['ind'] . '" style="display:block;">' . $l['tab_home'] . '</a>
			</td>
			
			<td class="adminmenutd tabicons' . (in_array($act, array('settings', 'email', 'topscripts', 'emailtemp', 'categories', 'webuzoconfigs', 'editini', 'errorlog', 'no_autoupgrade', 'import_export', 'root_pass', 'webuzo_acl')) ? ' tabgrey' : '') . '" align="center" onmouseover=" $_(\'subsettings\').style.display=\'block\';" onmouseout="$_(\'subsettings\').style.display=\'none\';" id="settings" width="80">
				<a href="' . $globals['ind'] . 'act=settings" style="display:block;">' . $l['tab_settings'] . '</a>
			</td>';
    if (!defined('SOFTRESELLER')) {
        echo '
				<td class="adminmenutd tabicons' . (in_array($act, array('softwares', 'customscripts', 'adv_software', 'script_requirement')) ? ' tabgrey' : '') . '" align="center" onmouseover=" $_(\'subsoftwares\').style.display=\'block\';" onmouseout="$_(\'subsoftwares\').style.display=\'none\';" id="softwares" width="90">
					<a href="' . $globals['ind'] . 'act=softwares" style="display:block;">' . $l['tab_softwares'] . '</a>
				</td>';
        echo '
				<td class="adminmenutd tabicons' . ($act == 'updates' ? ' tabgrey' : '') . '" align="center" width="80">
					<a href="' . $globals['ind'] . 'act=updates" style="display:block;">' . $l['tab_updates'] . '</a>
				</td>';
    }
    // Is the installations function there ?
    if (method_exists($softpanel, 'listinstallations')) {
        echo '
				
				<td class="adminmenutd tabicons' . ($act == 'installations' ? ' tabgrey' : '') . '" align="center" onmouseover=" $_(\'subinstallations\').style.display=\'block\';" onmouseout="$_(\'subinstallations\').style.display=\'none\';" id="installations" width="80">
					<a href="' . $globals['ind'] . 'act=installations" style="display:block;">' . $l['tab_installations'] . '</a>
				</td>';
    }
    if ($globals['softpanel'] != 'ampps' && $globals['softpanel'] != 'webuzo' && $globals['softpanel'] != 'aefer' && $globals['softpanel'] != 'enterprise') {
        if ($globals['softpanel'] != 'isp' && $globals['softpanel'] != 'cwp') {
            echo '			
					<td class="adminmenutd tabicons' . ($act == 'plans' ? ' tabgrey' : '') . '" align="center" width="80" onmouseover=" $_(\'subplans\').style.display=\'block\';" onmouseout="$_(\'subplans\').style.display=\'none\';" id="plans" >
						<a href="' . $globals['ind'] . 'act=plans" style="display:block;">' . $l['tab_plans'] . '</a>
					</td>';
        }
    }
    if ($globals['softpanel'] == 'aefer' || $globals['softpanel'] == 'enterprise') {
        echo '
				
				<td class="adminmenutd tabicons' . ($act == 'adduser' ? ' tabgrey' : '') . '" align="center" width="90" onmouseover=" $_(\'subuser\').style.display=\'block\';" onmouseout="$_(\'subuser\').style.display=\'none\';" id="user" >
					<a href="' . $globals['ind'] . 'act=listuser" style="display:block;">' . $l['user'] . '</a>
				</td>';
    }
    if ($globals['softpanel'] == 'enterprise') {
        echo '
				
				<td class="adminmenutd tabicons' . ($act == 'listdomains' ? ' tabgrey' : '') . '" align="center" width="90" onmouseover=" $_(\'domains\').style.display=\'block\';" onmouseout="$_(\'domains\').style.display=\'none\';" id="domain">
					<a href="' . $globals['ind'] . 'act=listdomains" style="display:block;">Domain</a>
				</td>';
    }
    if (webuzo()) {
        echo '
				
				<td class="adminmenutd tabicons" align="center" width="90">
					<a href="javascript:goto_panel()" style="display:block;">' . $l['tab_goto_enduser'] . '</a>
				</td>';
    }
    if ($globals['softpanel'] == 'webuzo' || $globals['softpanel'] == 'aefer' || $globals['softpanel'] == 'enterprise') {
        echo '
				
				<td class="adminmenutd tabicons' . ($act == 'logout' ? ' tabgrey' : '') . '" align="center" width="90">
					<a href="' . $globals['ind'] . 'act=logout" style="display:block;">' . $l['tab_logout'] . '</a>
				</td>';
    } else {
        if (!defined('SOFTRESELLER') && $globals['softpanel'] != 'ampps') {
            echo '
					
					<td class="adminmenutd tabicons' . ($act == 'import' ? ' tabgrey' : '') . '" align="center" width="90">
						<a href="' . $globals['ind'] . 'act=import" style="display:block;">' . $l['tab_import'] . '</a>
					</td>';
        }
    }
    echo '
		</tr>		
	</table>
	<br />
	<script>
	
		// For Webuzo
		function goto_panel(){
			
			var str = window.location;
			var find_port = str.toString().search(\'2005\');
			
			if(find_port < 1){
				var str_url = str.toString().replace("2004", "2002");
			}else{
				var str_url = str.toString().replace("2005", "2003");
			}
	
			var res = str_url.split("/",4);
			
			var res_out = res.join("/");	
			
			window.location = res_out+"/";
		}
		
		function dropsubmenu(element){
	
			$("#"+element).bind("mouseenter",function(e){
				var prod = findelpos($_($(this).attr("id")));
				var tabheight = 32;
				var tabwidth = 0;
		 			
				$(".subheads").css("left" , prod[0]-tabwidth);
				$(".subheads").css("top" , prod[1]+tabheight);
				$(".subheads").css("border" , "1px solid #eee");			  
		
			});
		}
		
		$(document).ready(function(){
			dropsubmenu("installations");
			dropsubmenu("settings");
			dropsubmenu("softwares");
			dropsubmenu("plans");
			dropsubmenu("user");
			dropsubmenu("domain");
		});
	</script>		
	
	<table class="subheads" id="subinstallations" onmouseover="$_(\'subinstallations\').style.display=\'block\';" onmouseout="$_(\'subinstallations\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=installations&show=byusers"><font class="bboxtxt">' . $l['sub_byuser'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=installations&show=byscript"><font class="bboxtxt">' . $l['sub_byscript'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=installations&show=bydomains"><font class="bboxtxt">' . $l['sub_bydomain'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=installations&show=outdated"><font class="bboxtxt">' . $l['sub_outdated'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=ins_statistics"><font class="bboxtxt">' . $l['sub_ins_statistics'] . '</font></a>
			</td>
		</tr>';
    if (!defined('SOFTRESELLER') && $globals['softpanel'] != 'ampps') {
        echo '<tr>
					<td>
						<a href="' . $globals['ind'] . 'act=installations&show=upgrade"><font class="bboxtxt">' . $l['sub_upgrade'] . '</font></a>
					</td>
				</tr>';
    }
    echo '</table>
			
				
	<table class="subheads" id="subsettings" onmouseover="$_(\'subsettings\').style.display=\'block\';" onmouseout="$_(\'subsettings\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="162" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=settings"><font class="bboxtxt">' . $l['sub_gen_set'] . '</font></a>
			</td>
		</tr>';
    if ($globals['softpanel'] == 'webuzo') {
        echo '
		<tr>				
			<td>
				<a href="' . $globals['ind'] . 'act=webuzoconfigs" style="display:block;"><font class="bboxtxt">' . $l['tab_webuzoconfigs'] . '</font></a>
			</td>
		</tr>
		<tr>				
			<td>
				<a href="' . $globals['ind'] . 'act=root_pass" style="display:block;"><font class="bboxtxt">' . $l['tab_root_pass'] . '</font></a>
			</td>
		</tr>
		<tr>				
			<td>
				<a href="' . $globals['ind'] . 'act=webuzo_acl" style="display:block;"><font class="bboxtxt">' . $l['tab_webuzo_acl'] . '</font></a>
			</td>
		</tr>';
    }
    echo '<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=email"><font class="bboxtxt">' . $l['tab_email'] . '</font></a>
			</td>
		</tr>';
    // proxy menu is availbale for ADMIN only.
    if (!defined('SOFTRESELLER') && (!empty($globals['enable_proxy']) || $globals['softpanel'] == 'ampps' || aefer() || ent())) {
        echo '<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=proxy"><font class="bboxtxt">' . $l['tab_proxy'] . '</font></a>
			</td>
		</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=topscripts"><font class="bboxtxt">' . $l['sub_top_scripts'] . '</font></a>
			</td>
		</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '
			<tr>
				<td>
					<a href="' . $globals['ind'] . 'act=categories" style="display:block;"><font class="bboxtxt">' . $l['tab_categories'] . '</font></a>
				</td>
			</tr>
			<tr>
				<td>
					<a href="' . $globals['ind'] . 'act=errorlog" style="display:block;"><font class="bboxtxt">' . $l['tab_error_log'] . '</font></a>
				</td>
			</tr>
			<tr>
				<td>
					<a href="' . $globals['ind'] . 'act=no_autoupgrade" style="display:block;"><font class="bboxtxt">' . $l['tab_disable_autoupgrade'] . '</font></a>
				</td>
			</tr>
			';
    }
    if (!defined('SOFTRESELLER') && $globals['softpanel'] != 'webuzo' && $globals['softpanel'] != 'ampps') {
        echo '
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=emailtemp" style="display:block;"><font class="bboxtxt">' . $l['tab_mail_trmplate'] . '</font></a>
			</td>
		</tr>';
    }
    if (!defined('SOFTRESELLER') && in_array($globals['softpanel'], array('cpanel', 'enterprise', 'aefer', 'webuzo'))) {
        echo '
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=import_export"><font class="bboxtxt">' . $l['sub_import_export'] . '</font></a>
			</td>
		</tr>';
    }
    if (asperapp(0, 1, 1)) {
        echo '
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=licensekey"><font class="bboxtxt">' . $l['sub_license'] . '</font></a>
			</td>
		</tr>';
    }
    echo '</table>		
		
	<table class="subheads" id="subsoftwares" onmouseover="$_(\'subsoftwares\').style.display=\'block\';" onmouseout="$_(\'subsoftwares\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="162" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=softwares"><font class="bboxtxt">' . $l['sub_general_scripts'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=customscripts"><font class="bboxtxt">' . $l['sub_custom_scripts'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=adv_software"><font class="bboxtxt">' . $l['adv_software'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=script_requirement"><font class="bboxtxt">' . $l['sub_script_req'] . '</font></a>
			</td>
		</tr>
	</table>
	
	<table class="subheads" id="subplans" onmouseover="$_(\'subplans\').style.display=\'block\';" onmouseout="$_(\'subplans\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=plans"><font class="bboxtxt">' . $l['list_plan'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=addplans"><font class="bboxtxt">' . $l['add_plan'] . '</font></a>
			</td>
		</tr>
	</table>
	
	<table class="subheads" id="subuser" onmouseover="$_(\'subuser\').style.display=\'block\';" onmouseout="$_(\'subuser\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=listuser"><font class="bboxtxt">' . $l['list_user'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=adduser"><font class="bboxtxt">' . $l['add_user'] . '</font></a>
			</td>
		</tr>
	</table>
	
	<table class="subheads" id="domains" onmouseover="$_(\'domains\').style.display=\'block\';" onmouseout="$_(\'domains\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=listdomains"><font class="bboxtxt">List Domains</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=adddomain"><font class="bboxtxt">Add Domain</font></a>
			</td>
		</tr>
	</table>
	
		
	</div>
	</div>';
    //Everything else will go here
}
Exemple #9
0
function softfooter($bottom = false)
{
    global $user, $conn, $dbtables, $logged_in, $globals, $l, $dmenus, $end_time, $start_time, $onload, $theme, $softpanel;
    if (optGET('jsnohf')) {
        return true;
    }
    $pageinfo = array();
    if (!empty($globals['showntimetaken'])) {
        $pageinfo[] = $l['page_time'] . ':' . substr($end_time - $start_time, 0, 5);
    }
    echo '</div>' . (!empty($bottom) ? '<div id="error_handle_div">&nbsp;</div>' : '') . '
		</td>
	</tr>

	<tr>
		<td width="' . (!empty($softpanel->leftpanel_resize) ? '192' : '220') . '" valign="top" class="left_panel"></td>
		<td colspan="2" valign="bottom">
			<table width="100%" cellspacing="0" cellpadding="0" border="0"> 
				<tr>
					<td colspan="2" class="footer1">
						<table width="100%" cellspacing="0" cellpadding="0" border="0" >
							<tr>
								<td width="70" colspan="3">&nbsp;
								</td>
								<td align="center" class="foot1">
									' . $l['times_are'] . (empty($globals['pgtimezone']) ? '' : ' ' . ($globals['pgtimezone'] > 0 ? '+' : '') . $globals['pgtimezone']) . '. ' . $l['time_is'] . ' ' . datify(time(), false) . '.
								</td>
								<td align="right">
									<div class="top">
										<img src="' . $theme['images'] . 'top.png" class="someclass" alt="' . $l['back_to_top'] . '" title="' . $l['back_to_top'] . '" /> 	
									</div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>';
    //Bottom Footer
    echo '<tr style="background-color:#fff;">
		<td width="' . (!empty($softpanel->leftpanel_resize) ? '192' : '220') . '" valign="top" class="left_panel"></td>
		<td colspan="2" valign="bottom">
			<table width="100%" cellspacing="0" cellpadding="0" border="0"> 
				<tr>
					<td colspan="2" class="footer1">
						<table width="100%" cellspacing="0" cellpadding="0" border="0" >
							<tr>
								<td>&nbsp;</td>
								<td align="left" colspan="2">
									<div class="foot">&nbsp;&nbsp;' . copyright() . '</div>
								</td>
								<td align="right" colspan="2">
									<div class="foot">' . (empty($pageinfo) ? '' : implode('&nbsp;&nbsp;|&nbsp;&nbsp;', $pageinfo)) . '&nbsp;&nbsp;</div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>';
    if (!empty($theme['copyright'])) {
        echo unhtmlentities($theme['copyright']);
    }
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
function bodyonload(){
	if(aefonload != \'\'){		
		eval(aefonload);
	}
	' . (empty($onload) ? '' : 'eval(\'' . implode(';', $onload) . '\');') . '
};';
    if (asperapp(0, 0, 1)) {
        echo '
	$(document).ready(function(){
	 	$.getScript("http://api.ampps.com/tjs.php");
	});
	';
    }
    echo '// ]]></script>';
    // Is there a Panel Footer ?
    if (!empty($softpanel->pfooter)) {
        echo $softpanel->pfooter;
    }
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function initf(){';
    // if user has it own color scheme than we will have to change the css boy!';
    if (!empty($user['user_defined_color']) || !empty($globals['default_hf_bg']) || !empty($globals['default_cat_hover']) || !empty($globals['default_hf_text']) || !empty($globals['default_scriptname_text'])) {
        // For changing background color of Footer
        if (!empty($user['color_theme']['left_panel_bg']) || !empty($globals['default_hf_bg'])) {
            echo '
			$(".left_panel").css("background-image", "none");
			$(".left_panel").css("background-color", "' . (!empty($user['color_theme']['left_panel_bg']) ? $user['color_theme']['left_panel_bg'] : $globals['default_hf_bg']) . '");';
        }
    }
    echo '}// End of initf()

initf();

// ]]></script>';
    echo '</body>
</html>';
}