Exemple #1
0
function java_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">

' . error_handle($error, "100%", 0, 1) . '

<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

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

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

function plus_onmouseout(){
	$("#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();
					}).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=java&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=java&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=java&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>';
        if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
            $info['install'] .= '<center class="sai_anotice">' . lang_vars($l['not_in_free'], array($software['name'])) . (!webuzo() ? '&nbsp;&nbsp;' . $l['notify_admin'] : '') . '</center><br />';
        }
        $info['install'] .= '
<table width="100%" cellpadding="8" cellspacing="0" border="0" class="sai_divroundshad">
<tr>
<td class="sai_heading_full" colspan="2">' . $l['setup'] . '</td>
</tr>';
        if (empty($softpanel->noprotocol) && empty($globals['hide_protocol'])) {
            $info['install'] .= '<tr>
<td>
<span class="sai_head">' . $l['choose_protocol'] . '</span><br />
<span class="sai_exp">' . $l['choose_protocol_exp'] . '</span>
</td>
<td valign="top">
<select name="softproto" id="softproto" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
            foreach ($protocols as $k => $v) {
                $info['install'] .= '<option value="' . $k . '" ' . (!empty($_POST['softproto']) && $_POST['softproto'] == $k ? '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 />
<span id="httpserror" style="background: #FDB3B3; display:none; width:200px;"></span>
</td>
</tr>';
        }
        $info['install'] .= '<tr>
<td width="50%">
<span class="sai_head">' . $l['choose_domain'] . '</span><br />
<span class="sai_exp">' . $l['choose_domain_exp'] . '</span>
</td>
<td>
<select name="softdomain" 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->webroots as $domain => $dompath) {
            $info['install'] .= '<option value="' . $domain . '" ' . (!empty($_POST['softdomain']) && $_POST['softdomain'] == $domain ? 'selected="selected"' : '') . '>' . $domain . '</option>';
        }
        $info['install'] .= '</select>
</td>
</tr>
<tr>
<td>
<span class="sai_head">' . $l['in_directory'] . '</span><br />
<span class="sai_exp">' . $l['in_directory_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="softdirectory" id="softdirectory" size="30" value="' . POSTval('softdirectory', !empty($globals['no_prefill']) ? '' : $software['softname']) . '" />
</td>
</tr>';
        // A data Directory ?
        if (!empty($datadir)) {
            $info['install'] .= '<tr>
<td>
<span class="sai_head">' . $l['datadir'] . '</span><br />
<span class="sai_exp">' . $l['datadir_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="datadir" id="datadir" size="30" value="' . POSTval('datadir', $datadir) . '" />
</td>
</tr>';
        }
        if (!empty($dbtype)) {
            $dbname = mysqldbname($software['softname']);
            if (method_exists($softpanel, 'mysqldbname')) {
                $dbname = $softpanel->mysqldbname();
            }
            if (empty($dbtype) || aefer()) {
                $info['install'] .= '
<tr>
<td>
<span class="sai_head">' . $l['database_name'] . '</span><br />
<span class="sai_exp">' . $l['database_name_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="softdb" id="softdb" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" /><br />
<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
</td>
</tr>';
            }
        }
        // Are there any cron jobs
        if (!empty($cron)) {
            $info['install'] .= '<tr>
<td>
<span class="sai_head">' . $l['cron_job'] . '</span><br />
<span class="sai_exp">' . $l['cron_job_exp'] . '</span>
</td>
<td valign="top">
	<table width="100%" cellpadding="2" cellspacing="1">
		<tr>
			<td>' . $l['cron_min'] . '</td>
			<td>' . $l['cron_hour'] . '</td>
			<td>' . $l['cron_day'] . '</td>
			<td>' . $l['cron_month'] . '</td>
			<td>' . $l['cron_weekday'] . '</td>
		</tr>
		<tr>
			<td><input type="text" name="cron_min" id="cron_min" size="2" value="' . POSTval('cron_min', $cron['min']) . '" /></td>
			<td><input type="text" name="cron_hour" id="cron_hour" size="2" value="' . POSTval('cron_hour', $cron['hour']) . '" /></td>
			<td><input type="text" name="cron_day" id="cron_day" size="2" value="' . POSTval('cron_day', $cron['day']) . '" /></td>
			<td><input type="text" name="cron_month" id="cron_month" size="2" value="' . POSTval('cron_month', $cron['month']) . '" /></td>
			<td><input type="text" name="cron_weekday" id="cron_weekday" size="2" value="' . POSTval('cron_weekday', $cron['weekday']) . '" /></td>
		</tr>
	</table>
</td>
</tr>';
        }
        if (!empty($overwrite_option)) {
            $info['install'] .= '<tr>
<td>
<span class="sai_head">' . $l['overwrite'] . '</span>
</td>
<td valign="top">
	<input type="checkbox" name="overwrite_existing" id="overwrite_existing" />
</td>
</tr>';
        }
        $info['install'] .= '</table>';
        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'] .= '<br />
<table width="100%" cellpadding="8" cellspacing="0" border="0" class="sai_divroundshad">
<tr>
<td class="sai_heading_full" colspan="2">' . $group . '</td>
</tr>';
                foreach ($sets as $sk => $sv) {
                    $info['install'] .= '<tr>
<td width="50%">
<span class="sai_head">' . $sv['head'] . '</span>
' . (empty($sv['exp']) ? '' : '<br /><span class="sai_exp">' . $sv['exp'] . '</span>') . '
</td>
<td valign="top">
' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? preg_replace('/>|\\/>/is', ' onkeyup="check_pass_strength();">', $sv['tag']) : $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>
' : '') . '
' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? '
<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 id="pass-strength-result" class="">' . $l['strength_indicator'] . '</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="";\');
// ]]></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>
' : '') . '
</td>
</tr>';
                }
                $info['install'] .= '</table>';
            }
            //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'] .= '<br />' . $l['softcopy_note'] . '<br /><br />';
        }
        // Advance option
        $info['install'] .= '
<br /><br />
<table width="100%" cellpadding="8" cellspacing="1" border="0" class="sai_divroundshad">
	<tr class="nohover">
		<td class="sai_heading_full" colspan="5" id="advoptions_toggle" onclick="toggle_advoptions(\'advoptions\');" class="sai_heading_full" style="cursor:pointer" ><img id="advoptions_toggle_plus" src="' . $theme['images'] . 'plus_new.gif" />&nbsp;&nbsp;' . $l['adv_option'] . '</td>
	</tr>
	<tr>
		<td>
			<div id="advoptions" style="display:none;">
			<table border="0" cellpadding="5" cellspacing="0" width="100%">
			' . (aefer() ? "" : '<tr>
					<td>
						<span class="sai_head">' . $l['database_name'] . '</span><br />
						<span class="sai_exp">' . $l['database_name_exp'] . '</span>
					</td>
					<td valign="top">
						<input type="text" name="softdb" id="softdb" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" /><br />
						<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
					</td>
				</tr>') . '

				<tr>
					<td width="50%">
						<span class="sai_head">' . $l['disable_notify_update'] . '</span><br />
						<span class="sai_exp">' . $l['exp_disable_notify_update'] . '</span>
					</td>
					<td>
						<input type="checkbox" name="disable_notify_update" id="disable_notify_update" ' . POSTchecked('disable_notify_update') . ' />
					</td>	
				</tr>';
        // 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'] .= '<tr>
		<td width="50%">
			<span class="sai_head">' . $l['auto_backup'] . '</span><br />
			<span class="sai_exp">' . $l['exp_auto_backup'] . '</span>
		</td>
		<td>
			<select name="auto_backup" 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>
		</td>	
	</tr>
	<tr>
		<td width="50%">
			<span class="sai_head">' . $l['auto_backup_rotation'] . '</span><br />
			<span class="sai_exp">' . $l['exp_auto_backup_rotation'] . '</span>
		</td>
		<td>
			<select name="auto_backup_rotation" 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>
		</td>	
	</tr>';
        }
        $info['install'] .= '</table>
</div>
</td>
</tr>
</table>';
        $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="sai_graybluebut" /><span id="show_txt" style="display:none;"></span>
<br /><br /><br />
' . (empty($globals['off_email_link']) && empty($globals['off_install_mail']) ? $l['ins_emailto'] . ' : <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; display: none;">
	<br />
	<center>
	<font size="4" color="#222222" id="progress_txt">' . $l['checking_data'] . '</font>
	<font style="font-size: 18px;font-weight: 400;color: #444444;" 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;background-color:#efefef;">
		<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'] = '<h3>' . $l['congrats'] . '</h3><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 />
' . $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);">
		<table border="0" cellpadding="5" cellspacing="1" align="center" class="sai_divroundshad">
			<tr>
				<td colspan="2">
					<font size="+1"><b>' . $l['install_tweet_sub'] . ' :</b></font>
				</td>
			</tr>
			<tr>
				<td valign="middle">
				<textarea name="text" cols="60" row="3" style="resize:none">' . loadtweetdata('install_tweet', $l['install_tweet']) . '</textarea>
				</td>
				<td valign="middle">
				<input type="submit" value="Tweet!" class="sai_twitter-btn" onsubmit="return false;" id="twitter-btn"/>
				</td>
			</tr>
		</table>
		</form>';
        }
        $info['install'] .= '<!--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'] . '&timezone=' . $globals['timezone'] . '&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] = '<td><img src="' . $url . 'star.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" /></td>';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<td><img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" /></td>';
        } else {
            $ratings[$i_r] = '<td><img src="' . $url . 'nostar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" /></td>';
        }
        $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 id="currentrating" style="display:none"></div>
<table width="100%" cellpadding="4" cellspacing="1" border="0">
	<tr>
		<td width="10%" align="center">' . (!empty($custom_48) ? '<img src="' . $custom_48 . '" alt="">' : '<img src="' . $globals['mirror_images'] . 'top15/48/' . $scripts[$soft]['softname'] . '.png" >') . '</td>
		<td width="90%" class="sai_process_heading" colspan="4">' . $software['name'] . '</td>
	</tr>
	<tr>
		<td align="center" width="10%">' . ($soft > 10000 ? '' : '<div class="someclass" title="' . $scripts[$soft]['ratings'] . '"><table><tr>' . implode('', $ratings) . '</tr></table></div>') . '</td>
		<td valign="top" align="left" width="20%">
			' . $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>
		</td>
		<td align="left" width="60%">
			' . (!empty($info['release_date']) ? $l['release_date'] . ' : <font size="1"><b>' . $info['release_date'] . '</b></font>' : '') . '
		</td>
		<td width="10%">
			' . (!empty($info['changelog']) ? '&nbsp;&nbsp;<a href="javascript" onclick="$(\'#changelog_div\').bPopup(); return false;" class="sai_changelogbut" style="text-decoration:none;">' . $l['changelog'] . '</a>' : '') . '
		</td>
	</tr>
</table><br />

<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 />

<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 id="changelog_div" class="sai_popup" style="display:none;"><span class="sai_clogbutton b-close"><span>X</span></span><div class="sai_changelog">' . $info['changelog'] . '</div></div>' : '') . '

<table width="100%" cellpadding="8" cellspacing="1" border="0">
<tr>
	' . (!empty($scripts[$soft]['screenshots']) && empty($globals['panel_hf']) ? '
	<td width="20%" valign="top">
		<div id="overview_img"> <img src="' . $globals['mirror_images'] . 'softimages/screenshots/' . $soft . '_screenshot1.gif" width="500" alt="" > </div>
	</td>' : '') . '
	
	<td valign="top" style="padding:10px;">
		' . softparse($info['overview'], $soft) . '<br /><br />
		<table width="100%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td width="52" valign="top" align="center"><font color="#447edf"><i class="fa sai-disk fa-3x"></i></font></td>
				<td valign="top">
					<span class="sai_head">' . $l['space_req'] . '</span><br />
					<span class="sai_exp">' . $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>
				</td>
			</tr>
			<tr>
				<td valign="top" align="center"><a href="' . $info['support'] . '"><font color="#447edf"><i class="fa sai-question fa-3x"></i></font></a></td>
				<td valign="top">
					<span class="sai_head">' . $l['software_support'] . '</span><br />
					<span class="sai_exp"><a href="' . $info['support'] . '" target="_blank">' . $l['support_link'] . '</a><br />
					' . $l['support_note'] . '</span>
				</td>
			</tr>
		</table>
	</td>
</tr>
</table>';
    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>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" style="margin:8px 0px;" />';
        $info['overview'] .= '<table border="0" cellpadding="5" cellspacing="0" width="100%" class="sai_altrowstable">
<tr>
	<th class="sai_exp">' . $l['link'] . '</th>
	<th width="50" class="sai_exp" >' . $l['admin'] . '</th>
	<th width="180" class="sai_exp">' . $l['ins_time'] . '</th>
	<th width="80" class="sai_exp">' . $l['version'] . '</th>
	<th width="145" class="sai_exp" style="text-align:center">' . $l['options'] . '</th>
</tr>';
        $i = 1;
        foreach ($installations[$soft] as $ik => $iv) {
            $info['overview'] .= '<tr id="trid' . $ik . '" class="' . ($i % 2 == 0 ? "sai_evenrowcolor" : "sai_oddrowcolor") . '">
		<td><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'] && file_exists($software['path'] . '/upgrade.xml') ? ' <a href="' . $globals['ind'] . 'act=upgrade&insid=' . $ik . '"><img src="' . $theme['images'] . 'updates.gif" alt="' . $l['upd_to'] . ' ' . $scripts[$soft]['ver'] . '" /></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> &nbsp;<a href="' . $globals['ind'] . 'act=remove&insid=' . $ik . '"><img src="' . $theme['images'] . 'remove.gif" /></a>&nbsp;<input type="checkbox" name="insids[]" id="' . $iv['softurl'] . '" value="' . $ik . '"></td>
	</tr>';
            $i++;
        }
        $info['overview'] .= '</table>
	<p align="right">
		' . $l['with_selected'] . ': 
		<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()">
		<br />
	</p>
	<div id="rem_div"></div>
	
<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(){
	
	$(".sai_altrowstable tr").mouseover(function(){
		var old_class = $(this).attr("class");
		//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 /><br /><br />
		<table width="100%" cellpadding="8" cellspacing="0" border="0" class="sai_divroundshad">
			<tr>
				<td class="sai_heading_full" colspan="2">' . $l['related_scripts'] . '</td>
			</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++;
        }
    }
    //Parse and take care of images
    $info['features'] = softparse($info['features'], $soft);
    $info['ratings'] = '';
    $info['screenshots'] = '<iframe src="" id="screenshots_iframe" style="width:100%;height:600px;" frameborder="0" scrolling="no"></iframe>';
    $info['reviews'] = '<div id="allreviews"></div>';
    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") . ';">
	' . $v . '
	</div>';
    }
    softfooter();
}
Exemple #2
0
function restore_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $_insid, $dbexist, $restored, $datadir, $wwwdir;
    global $backups, $deleted, $soft, $backupinfo;
    // 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;
    }
    softheader($l['<title>']);
    echo '
	<div id="install_win">';
    if (!empty($restored)) {
        echo '
			<div class="bg"><br />
				<div class="alert alert-warning">
					<center><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . $l['restore'] . '
					<center><b><a href="' . script_link($soft) . '&highlight=' . $backupinfo['insid'] . '&postact=restore"></a></b></center></center>
				</div>
				<br />
				<center><b><a href="' . script_link($soft) . '" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />
			</div>
		
			<!--PROC_DONE-->';
    } else {
        echo '
			<div id="fadeout_div">
				<form accept-charset="' . $globals['charset'] . '" name="restore" method="post" action="" onsubmit="return checkform();" id="restore">
				
					<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
					function checkform(dosubmit){
						var conf = confirm(\'' . $l['confirm_restore'] . '\');
						if(conf){
							$_("restorebtn").disabled = true;
							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 !
							}
							
							return true;
						}else{
							return false;
						}
					}	
					
					var progressbar = {
						timer: 0,
						total_width: 0,	
						status_key: "",
						synctimer: 0,
						fadeout_div: "#fadeout_div",
						win_div: "#install_win",
						progress_div: "#progress_bar",
						formid: "#restore",
						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);
											new_theme_funcs_init();
										}).delay(50).animate({opacity: 1}, 500);
										
										//alert(newhtml);
										
									}else{
										alert("Oops ... the connection was lost");
									}
								}
							});
						}
					};
					
						
					// Use the Progress Bar ?
					var useprog = 1;
					try{
						if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
							useprog = 0;
						}
					}catch(e){ }
					
					// ]]></script>
				
				
					<div class="bg"><br />
						<div class="row sai_main_head" style="width:100%;" align="center">
							<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
								<i class="fa sai-restore fa-2x" style="color:#00A0D2;"></i>
							</div>
							<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_restoring'] . $iscripts[$soft]['name'] . '</div>
						</div>
						<hr><br />';
        echo error_handle($error, "100%", 0, 1);
        echo '
						<div class="row">
							<div class="col-sm-5">
								<label class="sai_head">' . $l['restore_dir'] . '</label><br />
								<span class="sai_exp2">' . $l['restore_dir_exp'] . '</span>
							</div>
							<div class="col-sm-7">
								<input type="checkbox" name="restore_dir" ' . POSTchecked('restore_dir', true) . ' />
							</div>
						</div><br />';
        // Web directory ?
        if (!empty($wwwdir)) {
            echo '
							<div class="row">
								<div class="col-sm-5">
									<label class="sai_head">' . $l['restore_wwwdir'] . '</label><br />
									<span class="sai_exp2">' . $l['restore_wwwdir_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<input type="checkbox" name="restore_wwwdir" ' . POSTchecked('restore_wwwdir', true) . ' />
								</div>
							</div><br />';
        }
        // Data directory ?
        if (!empty($datadir)) {
            echo '
							<div class="row">
								<div class="col-sm-5">
									<label class="sai_head">' . $l['restore_datadir'] . '</label><br />
									<span class="sai_exp2">' . $l['restore_datadir_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<input type="checkbox" name="restore_datadir" ' . POSTchecked('restore_datadir', true) . ' />
								</div>
							</div><br />';
        }
        if (!empty($dbexist)) {
            echo '
							<div class="row">
								<div class="col-sm-5">
									<label class="sai_head">' . $l['restore_db'] . '</label><br />
									<span class="sai_exp2">' . $l['restore_db_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<input type="checkbox" name="restore_db" ' . POSTchecked('restore_db', true) . ' />
								</div>
							</div><br />';
        }
        echo '<br /><br />
						<p align="center">
							<input type="hidden" name="restore_ins" value="1" />
							<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
							<input type="submit" name="restorebtn" class="flat-butt" id="restorebtn" value="' . $l['restore_ins'] . '"  />
						</p>
						<br /><br />
						<center><b><a href="' . script_link($soft) . '" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />				
					</div><br /><!--end of bg class-->
				</form>
			</div>			
			
			<div id="progress_bar" style="display: none; width: 100%;">
				<br />
				<div class="bg">
					<center>
						<div class="row sai_main_head" style="width:100%;" align="center">
							<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
								<i class="fa sai-restore fa-2x" style="color:#00A0D2;"></i>
							</div>
							<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_restoring'] . $iscripts[$soft]['name'] . '</div>
						</div><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><br />
					<center><b><a href="' . script_link($soft) . '">' . $l['return'] . '</a></b></center><br /><br />
				</div>
			</div><br /><br />';
    }
    echo '
	</div>';
    softfooter();
}
Exemple #3
0
function apache_conf_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $done, $filename, $iapps, $web_server;
    // For updating entir file
    if (optGET('ajaxapache')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['change_final_file'];
            return true;
        }
    }
    softheader($l['<title>']);
    if ($web_server == '18') {
        echo '<br /><center class="sai_tit"><img src="' . $theme['a_images'] . 'nginx_conf.gif" />&nbsp;' . $l['nginxhead'] . '</center><br />';
    } elseif ($web_server == '60') {
        echo '<br /><center class="sai_tit"><img src="' . $theme['a_images'] . 'lighttpd_conf.gif" />&nbsp;' . $l['lighttpdhead'] . '</center><br />';
    } else {
        echo '<br /><center class="sai_tit"><img src="' . $theme['a_images'] . 'apache_conf.gif" />&nbsp;' . $l['apachehead'] . '</center><br />';
    }
    echo '<script language="javascript" src="' . js_url('js/combined.js') . '" type="text/javascript"></script>
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

	var message_box = function(){			
		return {
			show_message: function(title, body , image) {			
				var okbutton = \'<input  style="width:75px" class="sai_submit" type="button" onclick="message_box.close_message();" value="OK" />\';
				if(image == "1"){
					var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
				}else{
					var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
				}
									
				if(jQuery(\'.sai_message_box\').html() === null) {
					var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
					jQuery(document.body).append( message );								
					jQuery(".sai_message_box").css("top", jQuery("html, body").scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
				}else{
					var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
					jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
					jQuery(\'.sai_message_box\').html( message );
				}
			},
			close_message: function() {				
				jQuery(\'.sai_message_box\').hide(\'fast\');
				window.location=window.location;
			}
		}
	}();

	$(document).ready(function(){		
		
		// For updating entire file
		$("#saveapache").click(function(){					
			
			$("#save_apache").css("display", "");					
			$.ajax({
				type: "POST",
				url: window.location+"&ajaxapache=1&saveapache=1",					
				data: $("#editphpini").serialize(),
				
				// Checking for error
				success: function(data){
					
					$("#save_apache").css("display", "none");
					var result = data.substring(0,1);
					if(result == "1"){							
						var msg = data.substring(1);
						message_box.show_message( "Done ",msg,2);																					
					}
					if(result == "0"){							
						var msg = data.substring(1);
						message_box.show_message( "Error",msg,1);
					}
				},
				error: function() {
					message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
				}															
			});	
			return false;												
		});	
	});	
	
	// ]]></script>';
    $linecount = count(file($filename));
    echo '<form accept-charset="' . $globals['charset'] . '" name="editemailsettings" method="post" action="" id="editphpini">
		<div style="height:400px; width:700px; overflow:auto; border: 2px solid #CCC; margin:0px auto; ">
			<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad">
				<tr>
					<td style="background-color:#CCC;vertical-align:top;font-size:12px;">';
    for ($i = 1; $i <= $linecount; $i++) {
        echo $i . "<br />";
    }
    echo '</td><td nowrap="nowrap"><textarea style=" overflow:hidden; font-size:12px; border:none; resize: none;" WRAP=OFF name="apache_data" id="apache_data" rows=' . $linecount . ' cols=120 >' . htmlentities(file_get_contents($filename), ENT_QUOTES, "UTF-8") . '</textarea>
					</td>
				</tr>
			</table>
		</div><br />
		<p align="center">			
			<input type="submit" value="' . $l['save'] . '" name="savephp" class="sai_graybluebut" id="saveapache" /> &nbsp;<img id="save_apache" src="' . $theme['images'] . 'progress.gif" style="display:none">
		</p>
	</form>';
    softfooter();
}
function browse_themes_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $edit, $settings;
    global $insid, $edited, $software, $soft, $scripts, $purchased, $owned_themes;
    softheader($l['<title>']);
    // 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;
    }
    echo '
<script id="paypal_js"></script>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

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");
}

var length;
var deduct;
var payment_timer;
var dg;
var owned_theme = new Array("' . implode('", "', array_values($owned_themes)) . '");

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

if(screen_width < 1024){
	length = 3;
	deduct = 20;
}else{
	length = 4;
	deduct = 20;
}

' . (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 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]);
	
	$("#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=' . $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=' . $iscripts[$soft]['name'] . '&q="+th_name+"&start=0&length=1&premium="+premium+"&callback=?",
		function (data) {
			
			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) {
				
				if(item.name != undefined){
					soft_themes += \'<td align="center"><div class="sai_image_container" id="img_\'+new_li+\'" onmouseover="onthemeover(nav_\'+new_li+\');" onmouseout="onthemeout(nav_\'+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>\';
					soft_themes += \'</tr><tr><td><input type="hidden" name="theme_id" id="theme_id" value="\'+item.pid+\'"><input type="hidden" name="theme_name" id="theme_name" value="\'+item.softname+\'"></td></tr></table></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(0, length);
}*/

function onthemeover(id_no){
	$(id_no).show();
}

function onthemeout(id_no){
	$(id_no).hide();
}

var use_this_theme_lang = "' . $l['use_this_theme'] . '";
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=' . $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) {
			
			if(item.name != undefined){
				
				var params = new Array();
				params[0] = "\'"+item.name+" - "+item.desc+"\'";
				params[1] = item.pid;
				params[2] = item.price;
				//alert(item.pid+" -- "+ owned_theme)

				if($.inArray(item.pid, owned_theme) !== -1){
					you_own = \'<span>' . $l['your_purchased'] . '</span>\';
				}else{
					you_own = "";
				}
				
				if(item.price > 0){
					var price_lable = \'<td align="center" width="200" onclick="show_pay(\'+params+\');"><table border="0" width="100%" cellpadding="0" cellspacing="0"><tr><td width="30%"><div class="sai_searchbox_button"><span style="margin-right:20px">\'+you_own+\'</span><a href="javascript:void(0);">' . $l['purchase'] . '&nbsp;&nbsp;$\'+item.price+\'</a></div></td></tr></table></td>\';
				}else{
					var price_lable = \'<td align="center" width="200"><table border="0" width="100%"><tr><td align="center"><div class="sai_searchbox_button"><a href="javascript:void(0);">' . (!empty($globals['eu_themes_premium']) ? addslashes($l['free']) : addslashes($l['select'])) . '</a></div></td></tr></table></td>\';
				}
				
				 search_themes += \'<tr class="sai_tr_color"><td align="center"><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"><a href="\'+item.demo_url+\'" target="_blank">' . addslashes($l['demo']) . '</a></div></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 to display list of Themes
function show_list(start, length){
	length = 20;
	//alert("' . $globals['s2api_pfx'] . 'category.php?in=json&cversion=' . $software['ver'] . '&cat=' . $iscripts[$soft]['name'] . '&start="+start+"&length="+length+"&premium="+premium+"&callback=?");
    $.getJSON("' . $globals['s2api_pfx'] . 'category.php?in=json&cversion=' . $software['ver'] . '&cat=' . $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;
		var new_tr = 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;
				//alert(item.pid+" -- "+ owned_theme)

				if($.inArray(item.pid, owned_theme) !== -1){
					you_own = \'<span>' . addslashes($l['your_purchased']) . '</span>\';
				}else{
					you_own = "";
				}
				
				if(item.price > 0){
					var price_lable = \'<div class="sai_purchased blue" onclick="show_pay(\'+params+\');"><table border="0" width="100%"><tr><td width="30%">\'+you_own+\'</td><td width="60%"><a href="javascript:void(0);">' . addslashes($l['purchase']) . '&nbsp;&nbsp;$\'+item.price+\'</a></td></tr></table></div>\';
				}else{
					var price_lable = \'<div class="sai_purchased blue"><table border="0" width="100%"><tr><td align="center"><a href="javascript:void(0);">' . addslashes($l['free']) . '</a></td></tr></table></div>\';
				}
				
				soft_themes += \'<td align="center"><div class="sai_image_container" id="img_\'+new_li+\'" onmouseover="onthemeover(nav_\'+new_li+\');" onmouseout="onthemeout(nav_\'+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>\'+price_lable+\'<br /></td>\';
			}
			
			new_li += 1;
			new_tr += 1;
			if(new_tr == 4){
				soft_themes += \'</tr><tr>\';
				new_tr = 0;
			}
			
	    });// 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",
		url: "' . $globals['index'] . 'act=my_themes&jsnohf=1",
		// Checking for error
		success: function(data){
			
			owned_theme = eval(data.substring(0, data.indexOf("<")));
			
			//alert(owned_theme);
			$("#sloading").hide();
			$(".refresh_theme").show();
			//show_list(0, length);
		}
	 });
}

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();
	});
}

$(document).ready(function(){
	theme_init();
});

// ]]></script>';
    if (!empty($edited)) {
    } else {
        echo '<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>
<div id="themesearch" class="sai_popupc" style="display:none;">
	<div class="sai_themesearch_div sai_popuptitle" align="center">
			<fieldset class="sai_inputs">
				<div class="row">
					<div class="col-lg-12">
						<input type="text"  name="themesearchstring" class="col-lg-10 col-md-10 col-sm-10 col-xs-10" id="themesearchstring"  class="sai_inputs" autofocus placeholder="' . $l['search_theme'] . '" autocomplete="off">
						<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6" style="text-align:right;">
							<a href="javascript:void(0);" class="sai_popupclose b-close">Close</a>
						</div>
					</div>
				</div>
				<div class="row">
					<h4 id="results-text" style="display:none;">' . $l['result_for'] . '<b id="search-string"></b></h4>
					<ul id="results"></ul><br />
				</div>
			</fieldset>
	</div>
	<div id="searchsuggestions"></div>
</div>
<div class="bg">
<div id="theme_toggle" onclick="toggle_advoptions(\'theme\');" class="sai_main_head" align="center">' . $l['browse_theme'] . '</div><hr>';
        error_handle($error, '100%');
        echo '
<div id="theme" style="display:block;">
	<div id="theme_div" style="display:block;"><br />
		<table border="0" cellpadding="2" cellspacing="0" style="width:100%;table-layout: fixed;">
			<tr>
				<td>&nbsp;</td>
				<td align="center" width="150">
					<div id="search_theme" class="flat-butt">' . $l['search'] . '</div><br /><br />
				</td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td colspan="3"  height="270">
					<div id="loading" style="display:block;z-index:99;">
						<center><img src="' . $theme['images'] . 'loading.gif" alt="Loading..." /></center>
					</div>
					<div id="display_theme" style="height:auto"></div>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<table border="0" cellpadding="2" cellspacing="0" style="width:100%;table-layout: fixed;">
						<tr>
							<td width="5%" align="center">
								<span id="prevBtn"><a href="javascript:void(0);"></a></span>
							</td>
							<td width="90%">&nbsp;&nbsp;</td>
							<td align="center" width="5%">
								<span id="nextBtn"><a href="javascript:void(0);"></a></span>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
</div>
</div>
<br /><br />';
    }
    softfooter();
}
Exemple #5
0
function ftpmanage_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $ftp_list, $done, $tuser;
    // for delete
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['delete'];
            return true;
        }
    }
    $__tmp = explode(':', !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost');
    $__ip = $__tmp[0];
    softheader($l['<title>']);
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
			// For msgbox
			var message_box = function() {			
				return {
					show_message: function(title, body , image) {			
						var okbutton = \'<input  style="width:75px" class="sai_submit" type="button" onclick="message_box.close_message();" value="OK" />\';
						if(image == "1"){
							var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
						}else{
							var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
						}					
						if(jQuery(\'.sai_message_box\').html() === null) {
							var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
							jQuery(document.body).append( message );								
							jQuery(\'.sai_message_box\').css(\'top\', jQuery(\'html, body\').scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
						}else{
							var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
							jQuery(\'.sai_message_box\').css(\'top\', jQuery(\'html, body\').scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
							jQuery(\'.sai_message_box\').html( message );
						}
					},
					delete_message: function(title, body ,did) {								
						var yesbutton = \'<input type="button" style="width:75px" onclick="message_box.yes_close_message(\\\'\'+did+\'\\\');" value="YES" class="sai_submit"/>\';
						var nobutton = \'<input type="button" style="width:75px" onclick="message_box.no_close_message();" value="NO" class="sai_submit" />\';
						var img = \'<img src="' . $theme['images'] . 'remove_big.gif" />\';
						if(jQuery(\'.sai_message_box\').html() === null) {
							var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1" height="10%">\' +  title + \'</td></tr><tr ><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table></div>\';				
							jQuery(document.body).append( message );								
							jQuery(\'.sai_message_box\').css(\'top\', jQuery(\'html, body\').scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
						}else{
							var message = \' <table  border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1" height="10%">\' + title + \'</td></tr><tr><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table>\'
							jQuery(\'.sai_message_box\').css(\'top\', jQuery(\'html, body\').scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
							jQuery(\'.sai_message_box\').html( message );
						}
					},
					close_message: function() {
						jQuery(\'.sai_message_box\').hide(\'fast\');
					},
					yes_close_message: function(did) {						
						$(\'#did\'+did).attr("src","' . $theme['images'] . 'progress.gif");						
						jQuery(\'.sai_message_box\').hide(\'fast\');
						$.ajax({				
							type: "POST",				
							url: window.location+"&ajaxdel=1&delete_fuser_id="+did,				
							// checking for error
							success: function(data){								
								var result = data.substring(0,1);					
								var msg = data.substring(1);
								if(result == "1"){
									message_box.show_message( "Delete ",msg,2);
									$("#tr"+did).fadeOut(2000);																														
								}
								if(result == "0"){
									message_box.show_message( "Error ",msg,1);																																			
								}
							},				
							error: function(request,error) {
								message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);					
							}
						});					
					},
					no_close_message: function() {
						jQuery(\'.sai_message_box\').hide(\'fast\');			
					}
				}
			}();
				
			$(document).ready(function(){	
				$(".sai_altrowstable tr").mouseover(function(){
					var old_class = $(this).attr("class");		
					$(this).attr("class", "sai_tr_bgcolor");		
					$(this).mouseout(function(){
						$(this).attr("class", old_class);
					});
				});
				
				// fro deleting record
				$(".delete").click(function() {	
					var did = $(this).attr(\'id\');
					did = did.substr(3);			
					message_box.delete_message (\'Warning\',\'' . $l['record_del_conf'] . '\',did);			
				});
			});	
		// ]]></script>
			
	<center><div class="sai_heading"><img src="' . $theme['images'] . 'ftp.gif" alt="" /> &nbsp;' . $l['ftp_head'] . '</div></center>
	<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" />
	
	<br /><br />
	<table border="0" cellpadding="8" cellspacing="1" width="95%" class="sai_altrowstable">';
    echo '<tr>
			<th width="60">' . $l['ftp_name'] . '</th>
			<th width="30">' . $l['ftp_path'] . '</th>
			<th width="10">' . $l['ftp_option'] . '</th>
		</tr>
		<tr>';
    $i = 1;
    foreach ($ftp_list as $key => $value) {
        echo '<tr class="' . ($i % 2 == 0 ? "sai_evenrowcolor" : "sai_oddrowcolor") . '" id="tr' . $key . '"><td>' . $key . '</td>';
        echo '<td>' . $value['dir'] . '</td>';
        if ($key != 'soft') {
            echo '<td><img title="Delete" class="delete" id="did' . $key . '" src="' . $theme['images'] . 'remove.gif" />&nbsp&nbsp&nbsp;<a href="' . $globals['ind'] . 'act=ftpchangepass&fuser='******'" title="' . $l['editdetail'] . '"><img title="Change Password" src="' . $theme['images'] . 'randpass.gif" /></a></td>';
        } else {
            echo '<td align="center">-</td>';
        }
        $i++;
    }
    echo '</tr>
	</table>	
	<br /><br /><br />	
	<center><a href="' . $globals['ind'] . 'act=ftpadd" class="sai_abut">' . $l['add_new'] . '</a></center>';
    softfooter();
}
Exemple #6
0
function userindex_theme()
{
    global $theme, $globals, $softpanel, $user, $l, $updates_available, $iscripts, $scripts, $info, $cscripts;
    if ($globals['softpanel'] == 'webuzo') {
        $usage = array();
        $usage['cpu'] = $softpanel->cpu();
        $usage['ram'] = $softpanel->ram();
        $usage['disk'] = $softpanel->disk();
        $usage['bandwidth'] = $softpanel->bandwidth();
        if (optGET('ajax')) {
            echo 'var server_cpu = [
				{ label: "Used",  data: ' . $usage['cpu']['percent'] . '},
				{ label: "Free",  data: ' . $usage['cpu']['percent_free'] . '}
			];
			
			var server_ram = [
				{ label: "Used",  data: ' . $usage['ram']['used'] . '},
				{ label: "Free",  data: ' . $usage['ram']['free'] . '}
			];
			
			var server_disk = [
				{ label: "Used",  data: ' . $usage['disk']['total']['used_gb'] . '},
				{ label: "Free",  data: ' . $usage['disk']['total']['free_gb'] . '}
			];
			
			var server_bandwidth = [
				{ label: "Used",  data: ' . (empty($usage['bandwidth']['used_gb']) ? 0.01 : $usage['bandwidth']['used_gb']) . '},
				{ label: "Free",  data: ' . (empty($usage['bandwidth']['free_gb']) ? $usage['bandwidth']['used_gb'] * 100 : $usage['bandwidth']['free_gb']) . '}
			];';
            return true;
        }
    }
    $__tmp = explode(':', !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost');
    $globals['HTTP_HOST'] = $__tmp[0];
    softheader($l['<title>'], 'js');
    /*For native UI support*/
    if (!empty($softpanel->pheader)) {
        if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0) {
            echo '
			<style>
				.row_usi {
				padding-left: 100px;
				padding-right: 5px;
				}
				
				.row_usi_warn {
				padding-left: 110px;
				padding-right: 30px;
				}
				
				.sai_inputs_cls input{
				width:280px;
				}
				
				.sai_suggestions_cls{
				width:280px;
				}
				
				.row_usi_cls {
				padding-left: 50px;
				}
				
				@media screen and (min-width: 980px) and (max-width: 1279px){
					.row_usi{
					padding-left: 35px;
					padding-right: 0;
					}
					
					.row_usi_warn{
					padding-left: 55px;
					padding-right: 0;
					}
				}
				
				@media screen and (min-width: 800px) and (max-width: 980px){
					.row_usi{
					padding: 0 20px;
					}
					
					.row_usi_warn{
					padding-left: 30px;
					padding-right: 5px;
					}
					
					.sai_inputs_cls input{
					width:250px;
					}
					
					.sai_suggestions_cls{
					width:250px;
					}
				}
				
				@media screen and (min-width: 768px) and (max-width: 799px){
					.row_usi{
					padding: 0 115px;
					}
					
					.row_usi_warn{
					padding-left: 130px;
					padding-right: 120px;
					}
					
					.sai_inputs_cls{
					padding-left:70px;	
					}
					
					.sai_inputs_cls input{
					width:300px;
					}
					
					.sai_suggestions_cls{
					width:300px;
					}
					
					.row_usi_cls {
					padding-left: 180px;
					}
				}
				
				@media screen and (min-width: 360px) and (max-width: 767px){
					.row_usi{
					padding: 0 10px;
					}
					
					.row_usi_warn{
					padding-left: 25px;
					padding-right: 80px;
					}
					
					.sai_inputs_cls input{
					width:130px;
					}
					
					.sai_suggestions_cls{
					width:130px;
					}
					
					.row_usi_cls {
					padding-left: 0;
					}
					
					.sai_classes_boxgrid{
					width:250px;
					}
					
					.sai_classes_boxgrid2{
					width:250px;
					}
				}
				
				@media screen and (min-width: 320px) and (max-width: 359px){
					.row_usi{
					padding: 0 10px;
					}
					
					.row_usi_warn{
					padding-left: 20px;
					padding-right: 40px;
					}
					
					.sai_inputs_cls input{
					width:130px;
					}
					
					.sai_suggestions_cls{
					width:130px;
					}
					
					.row_usi_cls {
					padding-left: 0;
					}
					
					.sai_classes_boxgrid{
					width:250px;
					}
					
					.sai_classes_boxgrid2{
					width:250px;
					}
				}
			</style>';
        } else {
            echo '
			<style>
				.row_usi {
				padding: 0 35px;
				}
				
				.row_usi_warn {
				padding-left: 45px;
				padding-right: 40px;
				}
				
				.sai_inputs_cls input{
				width:190px;
				}
				
				.sai_suggestions_cls{
				width:190px;
				}
				
				.row_usi_cls {
				padding-left: 80px;
				}
				
				@media screen and (min-width: 1280px) and (max-width: 1300px){
					.row_usi{
					padding: 0 35px;
					}
					
					.row_usi_warn{
					padding-left: 50px;
					padding-right: 40px;
					}
				}
				
				@media screen and (min-width: 980px) and (max-width: 1279px){
					.row_usi{
					padding: 0 40px;
					}
					
					.row_usi_warn{
					padding-left: 55px;
					padding-right: 40px;
					}
				}
				
				@media screen and (min-width: 800px) and (max-width: 979px){					
					.row_usi_warn{
					padding-left: 40px;
					padding-right: 40px;
					}
				}
				
				@media screen and (min-width: 768px) and (max-width: 799px){
					.row_usi {
					padding: 0 120px;
					}
					
					.row_usi_warn{
					padding-left: 130px;
					padding-right: 135px;
					}
					
					.sai_inputs_cls{
					padding-left:70px;	
					}
					
					.sai_inputs_cls input{
					width:300px;
					}
					
					.sai_suggestions_cls{
					width:300px;
					}
					
					.row_usi_cls {
					padding-left: 180px;
					}
				}
			</style>';
        }
    }
    echo '<script>
	$(document).ready(function(){
		
		var this_theme = "' . $theme['this_theme'] . '";
		
		if(this_theme == "modern"){
			$("body").css("background-color", "#F8F8F8");
		}
		
		$(".sai_boxgrid").hover(function(){
			$(this).stop().animate({top:"-200px"},{queue:false,duration:200});
			
			}, function() {
				$(this).stop().animate({top:"0px"},{queue:true,duration:200});
		});
		
		$(".about").click(function(){
			$(".right_panel_two").fadeOut(1); 
			$(".right_panel_one").fadeIn(500);
		});
		$(".topscripts").click(function(){
			$(".right_panel_one").fadeOut(1); 
			$(".right_panel_two").fadeIn(500);
		});
		
		$("#news").attr("src", "https://www.softaculous.com/news.js");
		
		$("#inputs_searchs").bind("keyup",function(){
			
			var selfVal = $(this).val().toLowerCase();
							
			var compareDivs = $("td"); 		
			
			compareDivs.each(function(i, item){
		
				var id_tmp = item.id.toString();
				
				var search = id_tmp.substring(0,12);	 
						
				if(trim(search) == "webuzo_icons" && typeof $("#"+item.id).attr("value") != "undefined") {
					
					var divVal = $("#"+item.id).attr("value").toString().toLowerCase();				
					
					console.log(divVal);
					 
					if (divVal.indexOf(selfVal) < 0){
						
						if(selfVal == "") return;
						
						$("#"+item.id).hide();
						
					}else{
											
						$("#"+item.id).show();
					}			
				}
							
			});
			remove_unnecessary_tables_webuzo();
		});
		
	});
	
	function remove_unnecessary_tables_webuzo(){
		var no_script = 0;	
		
		for(var i = 1; i<=12;i++){
			
			var hide_chk = 0;
			var id = $($("#main_table"+i).find("tr").children());
			
			var td_length = $("#main_table"+i+" tr td").length;
			var tmp_td_length = $("#main_table"+i+" tr").children();
			
			tmp_td_length.each(function(i, item){
				
				if(trim($("#"+item.id).text()) == ""){
					td_length -= 1;
				}
			});	
			
			var tds = $("#main_table"+i+" tr").children();
			tds.each(function(i, item){
				if(typeof $("#"+item.id).attr("value") != "undefined"){
				
					var disp = $("#"+item.id).css("display");
					var disp_val = $("#"+item.id).attr("value").toString();			
					
					if(disp == "none"){
						hide_chk += 1;						
					}
				}
				
			});	
				
			if(hide_chk == td_length){			
				$("#main_div"+i).hide();			
				no_script += 1;			
			}else{
				$("#main_div"+i).show();
			}
		}
		
		if(no_script == 12){
			$("#show_none").show();		
		}else{
			$("#show_none").hide();
		}
	}
	</script>
	
	<script>
	function show_desc(element){
		var eid = (element.id).split("_");
		$("#saihover_"+eid[1]).css("opacity", 1);
	}
	
	function hide_desc(element){
		var eid = (element.id).split("_");
		$("#saihover_"+eid[1]).css("opacity", 0);
	}
	</script>';
    // top 10 scripts based on the rating formula
    foreach ($scripts as $k => $v) {
        if (empty($iscripts[$k]) || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
            continue;
        }
        $top[$k] = $v['ratings'] * $v['votes'];
    }
    arsort($top);
    if (file_exists($globals['path'] . '/conf/top_scripts.php') && !empty($globals['lictype'])) {
        $top = unserialize(file_get_contents($globals['path'] . '/conf/top_scripts.php'));
    }
    //r_print($globals);
    if (!empty($globals['show_cscript_in_top'])) {
        //r_print($top_custom_list);
        foreach ($cscripts as $ck => $cv) {
            if (array_key_exists($ck, $iscripts)) {
                $top_custom[$ck] = $ck;
            }
        }
        $tmp_top = $top;
        // Do we need to add any other default scripts ?
        if (!empty($top_custom)) {
            $top = $top_custom;
        }
        if (!empty($tmp_top)) {
            $top += $tmp_top;
        }
    }
    foreach ($scripts as $k => $v) {
        // We have to remove the scripts which are not enabled AND yet coming from top_scripts.php (i.e. Admin have saved it from top scripts)
        if (!array_key_exists($k, $iscripts) && !empty($top[$k])) {
            unset($top[$k]);
        }
        if (empty($iscripts[$k]) || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
            continue;
        }
        $top[$k] = $v['ratings'] * $v['votes'];
    }
    $ts_head1 = !empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 'col-sm-11 col-xs-10' : 'col-sm-10 col-xs-10' : 'col-sm-11 col-xs-10';
    $ts_head2 = !empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 'col-sm-1 col-xs-2' : 'col-sm-2 col-xs-2' : 'col-sm-1 col-xs-2';
    echo '
	<div>
		<div class="right_panel_two" ' . ($globals['softpanel'] == 'ampps' || $globals['softpanel'] == 'webuzo' ? 'style="display:none"' : '') . '>
			<br />
			<div class="row">
				<div class="' . $ts_head1 . '" style="text-align:center;">
					<span class="sai_main_head">' . $l['top_scrip'] . '</span>
				</div>
					
				<div class="' . $ts_head2 . '">
					<div class="about">
						<img src="' . $theme['images'] . 'info_star.png" width="30" height="30" class="someclass" title="About" style="border:none;"/>&nbsp;&nbsp;							
					</div>
				</div>
			</div>
			<hr>';
    if (!empty($updates_available)) {
        echo '
				<div class="row row_usi_warn">
				<div class="alert alert-warning" style="width:99%;">
					<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
					<center>
						<a href="' . $globals['ind'] . 'act=installations&showupdates=true" alt="" style="text-decoration:none;"><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . lang_vars($l['updates_available'], array($updates_available)) . '</a>
					</center>
				</div>
				</div>';
    }
    echo '
			<div class="row row_usi">
				<div class="col-md-1"></div>
				<div class="col-md-10">';
    $i = 0;
    $j = 1;
    $url = $globals['mirror_images'];
    $url_i = $globals['mirror_images'] . 'top15/';
    foreach ($top as $k => $v) {
        $demo_scriptname = str_replace(' ', '_', $scripts[$k]['name']);
        $ratings = array();
        $deduct = 1;
        $r = $scripts[$k]['ratings'];
        if ($k > 10000) {
            if (file_exists($globals['euthemes'] . '/' . $globals['theme_folder'] . '/images/topscripts/' . $iscripts[$k]['softname'] . '.png')) {
                $url_i = $theme['images'] . 'topscripts/' . $iscripts[$k]['softname'] . '.png';
                $url_i32 = $theme['images'] . 'topscripts/32/' . $k . '__logo.gif';
            } else {
                $url_i = $theme['images'] . 'custom_script.png';
            }
            $image_name = $url_i;
        } else {
            $url_i = $globals['mirror_images'] . 'top15/';
            $url_i32 = $globals['mirror_images'] . 'softimages/32/' . $k . '__logo.gif';
            $image_name = $url_i . $iscripts[$k]['softname'] . '.png';
        }
        for ($i_r = 1; $i_r <= 5; $i_r++) {
            if ($r >= 1) {
                $ratings[$i_r] = '<img src="' . $theme['images'] . 'star_ts.png' . '" width="11" height="12" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
            } elseif ($r > 0) {
                $ratings[$i_r] = '<img src="' . $theme['images'] . 'halfstar_ts.png' . '" width="11" height="12" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
            } else {
                $ratings[$i_r] = '<img src="' . $theme['images'] . 'nostar_ts.png' . '" width="11" height="12" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
            }
            $r = $r - $deduct;
        }
        $ts_class = !empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 'col-lg-4 col-md-6 col-sm-6 col-xs-12' : 'col-lg-6 col-md-6 col-sm-6 col-xs-12' : 'col-lg-4 col-md-4 col-sm-6 col-xs-12';
        echo '
					<div class="' . $ts_class . '" style="padding-bottom: 20px;">
						<div class="sai_boxgrid2_ts">
							<div class="row" id="row_' . $j . '" style="height:80%; padding-top:5px;" onmouseover="show_desc(this);" onmouseout="hide_desc(this);">
								<div class="sai_block" id="saiblock_' . $j . '">
									<center>	
										<img class="cover" src="' . $image_name . '" class="img-responsive" /><br />
									</center>
								</div>
								
								<div class="sai_hover" id="saihover_' . $j . '">
									<a href="' . script_link($k, 1) . '&tab=overview"><p style="height:75%;">' . (strlen($iscripts[$k]['desc']) > 120 ? substr($iscripts[$k]['desc'], 0, 116) . '<br /><font size="2" color="#FFF">[' . $l['more'] . ']</font>' : $iscripts[$k]['desc']) . '</p></a>
									
									<div class="row">
										<div class="col-sm-4 col-xs-4">
											<a href="' . script_link($k, 1) . '&tab=install" class="sai_insbut sai_insbutpad" style="text-decoration:none; padding:4px; vertical-align:bottom;">' . $l['install_button'] . '</a>
										</div>
										
										<div class="col-sm-3 col-xs-3">
											<span>' . (empty($globals['off_demo_link']) ? '<a href="' . $globals['ind'] . 'act=demos&soft=' . $k . '" target="_blank" class="sai_insbut_ts" style="vertical-align:bottom;"><b>' . $l['demo_button'] . '</b></a>' : '') . '</span>
										</div>
										
										<div class="col-sm-3 col-xs-3">
											<span><a href="' . script_link($k, 1) . '&tab=overview" class="sai_insbut_ts" style="vertical-align:bottom;"><b>' . $l['overview_button'] . '</b></a></span>
										</div>
									</div>
									
								</div>
							</div>
					
							<a href="' . script_link($k, 1) . '&tab=overview" style="text-decoration:none;">
							<div class="row" id="row_ts_' . $j . '" style="height:20%; text-align:center; padding-top:3px; background-color:#ECECEC;">
								<font size="2" style="color:#717276;"><strong>' . $iscripts[$k]['name'] . '</strong></font><br />
								' . (empty($globals['off_rating_link']) && $k < 10000 ? '<div class="sai_coverstars" style="margin-left:0;">' . implode('', $ratings) . '</div>' : '') . '
							</div>
							</a>
						</div>
					</div>';
        if ($j == (!empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 15 : 8 : 15)) {
            break;
        }
        $j++;
        $i++;
    }
    echo '	
				</div>
				<div class="col-md-1"></div>
			</div>
		</div>';
    echo '
		<div class="right_panel_one" ' . ($globals['softpanel'] == 'ampps' || $globals['softpanel'] == 'webuzo' ? '' : 'style="display:none"') . '>
			<br /><br />';
    if ($globals['softpanel'] == 'webuzo') {
        global $apps;
        $ins_apps = $softpanel->loadinsapps();
        $def_mysql = $softpanel->getConf('WU_DEFAULT_MYSQL');
        $mysql = !empty($def_mysql) ? $softpanel->get_app_record($def_mysql) : 16;
        $def_web_server = $softpanel->getConf('WU_DEFAULT_SERVER');
        $web_server = !empty($def_web_server) ? $softpanel->get_app_record($def_web_server) : 3;
        $onlyapache = $softpanel->current_apache_id();
        $onlyapache = !empty($onlyapache) ? $onlyapache : 3;
        $disable_sysapps = $softpanel->is_sysapps_disable();
        echo '
				<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="' . $theme['url'] . '/js/excanvas.min.js"></script><![endif]-->
				
				<script language="javascript" src="' . $theme['url'] . '/js/jquery.flot.min.js" type="text/javascript"></script>
				<script language="javascript" src="' . $theme['url'] . '/js/jquery.flot.pie.min.js" type="text/javascript"></script>
				<link rel="stylesheet" type="text/css" href="https://images.softaculous.com/webuzo/sprites/32.css" />
				<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
				
				function getusage(){
					if(AJAX("' . $globals['index'] . 'ajax=true", "server_graph_data(re)")){
						return false;
					}else{
						return true;	
					}
				};
				
				function startusage(){
					ajaxtimer = setInterval("getusage()", 5000);
				};	
				
				function server_graph_data(re){		
				
					var server_cpu = [
						{ label: "Used",  data: ' . $usage['cpu']['percent'] . '},
						{ label: "Free",  data: ' . $usage['cpu']['percent_free'] . '}
					];
					
					var server_ram = [
						{ label: "Used",  data: ' . $usage['ram']['used'] . '},
						{ label: "Free",  data: ' . $usage['ram']['free'] . '}
					];
					
					var server_disk = [
						{ label: "Used",  data: ' . $usage['disk']['total']['used_gb'] . '},
						{ label: "Free",  data: ' . $usage['disk']['total']['free_gb'] . '}
					];
					
					var server_bandwidth = [
						{ label: "Used",  data: ' . (empty($usage['bandwidth']['used_gb']) ? 0.01 : $usage['bandwidth']['used_gb']) . '},
						{ label: "Free",  data: ' . (empty($usage['bandwidth']['free_gb']) ? $usage['bandwidth']['used_gb'] * 100 : $usage['bandwidth']['free_gb']) . '}
					];
					
					if(re.length > 0){
						try{
							eval(re);
						}catch(e){ }
					}
					
					// Fill in the Text
					$_("server_cpu_text").innerHTML = server_cpu[0].data+"% / 100%";
					$_("server_ram_text").innerHTML = server_ram[0].data+" MB / "+(server_ram[0].data+server_ram[1].data)+" MB";
					$_("server_disk_text").innerHTML = server_disk[0].data+" GB / "+Math.round((server_disk[0].data+server_disk[1].data)*100)/100+" GB";
					$_("server_bandwidth_text").innerHTML = server_bandwidth[0].data+" GB / ' . (empty($usage['bandwidth']['limit_gb']) ? $l['webuzo_unlimited'] : $usage['bandwidth']['limit_gb'] . " GB") . '";
					
					// CPU
					server_graph("server_cpu", server_cpu);
					
					// RAM
					server_graph("server_ram", server_ram);
					
					// DISK
					server_graph("server_disk", server_disk);
					
					// Bandwidth
					server_graph("server_bandwidth", server_bandwidth);
				};	
				
				// Draw a Server Resource Graph
				function server_graph(id, data){		
				
					$.plot($("#"+id), data, 
					{
						series: {
							pie: { 
								innerRadius: 0.7,
								radius: 1,
								show: true,
								label: {
									show: true,
									radius: 0,
									formatter: function(label, series){
										if(label != "Used") return "";
										return \'<div style="font-size:13px;"><b>\'+Math.round(series.percent)+\'%</b></div><div style="font-size:9px;">\'+label+\'</div>\';	
									}
								}
							}
						},
						legend: {
							show: false
						}
					});
				}
				ids = ["' . implode('", "', array_keys($ins_apps)) . '"];
				tools = ["phpmyadmin","rockmongo","squirrel", "tomcat", "monsta"];
				//alert(ids);
				
				function in_array(val, arr){
					
					for (var i in arr) {
						var tmp_val = arr[i].split("_");
						if(tmp_val[0] == val){
							return true;
						}
					}
					return false;
				}
				
				function is_app_inst(app_id, act){
					
					if(in_array(app_id, ids)){
						if(in_array(act, tools)){
							if(act == "tomcat"){
								window.open("http://' . $softpanel->getConf('WU_PRIMARY_DOMAIN') . ':8080/manager/", "_blank");
							}else{
								window.open(act+"/", "_blank");
							}
						}else{
							window.location = "index.php?act="+act;
						}
					}else{
						var r = confirm("' . $l['webuzo_install_utility'] . '")
						if(r==true){
							' . (empty($disable_sysapps) ? 'window.location = "index.php?act=apps&app="+app_id;' : 'alert("' . $l['webuzo_sysapps_disabled'] . '")') . '
						}else{
							return true;
						}
					}
					
				}
					
				addonload("server_graph_data(\'void(0);\'); startusage();");
				// ]]></script>';
        echo '<center><span class="sai_newhead">' . (empty($globals['sn']) ? $l['webuzo'] : $globals['sn']) . '</span>
				<br /><br />
					<form accept-charset="' . $globals['charset'] . '" name="classsearch" method="post" action=""  id="classsearchform" class="sai_inputs">
						<input id="inputs_searchs" type="text" name="searchFeature" class="sai_inputs" autofocus placeholder="Search" autocomplete="off"><br />			
					</form><br /><br />
					<div id="show_none" class="sai_notice" style="text-align:center; display:none; width:500px;">' . $l['webuzo_no_search'] . '</div></center>
			<table cellpadding="8" cellspacing="1" width="700px" align="center" border="0" id="main_table">	
				<tr id="main_div1">
					<td>
						<div margin:0px auto; >
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">			
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_domain'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%" valign="top">
										<table cellpadding="5" cellspacing="5" border="0" id="main_table1">
											<tr align="center">
												
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons11" value="' . $l['webuzo_mandom'] . '">
														<a href="' . $globals['ind'] . 'act=domainmanage" ><img src="' . $theme['a_images'] . 'domains.gif" alt="" /><br />' . $l['webuzo_mandom'] . '</a>
													</td>
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons12" value="' . $l['webuzo_adddom'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(34, \'domainadd\'); return;"><img src="' . $theme['a_images'] . 'adddomain.gif" alt="" /><br />' . $l['webuzo_adddom'] . '</a>	
													</td>					
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons13" value="' . $l['webuzo_advance_dns'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(34, \'advancedns\'); return;"><img src="' . $theme['a_images'] . 'advancedns.gif" alt="" /><br />' . $l['webuzo_advance_dns'] . '</a>	
													</td>									
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons14" value="' . $l['webuzo_network_tools'] . '">
														<a href="' . $globals['ind'] . 'act=network_tools"><img src="' . $theme['a_images'] . 'network_tools.gif" alt="" /><br />' . $l['webuzo_network_tools'] . '</a>	
													</td>								
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons15" value="' . $l['webuzo_extra_conf'] . '">
														<a href="' . $globals['ind'] . 'act=extra_conf"><img src="' . $theme['a_images'] . 'extra_conf.gif" alt="" /><br />' . $l['webuzo_extra_conf'] . '</a>	
													</td>												
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div2">
					<td>
						<div margin:0px auto; >
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">			
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_mysql'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top">
										<table cellpadding="5" cellspacing="5" border="0" id="main_table2">
											<tr align="center">
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons21" value="' . $l['webuzo_mandb'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $mysql . ', \'dbmanage\'); return;"><img src="' . $theme['a_images'] . 'database.gif" alt="" /><br />' . $l['webuzo_mandb'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons22" value="' . $l['webuzo_adddb'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $mysql . ', \'dbmanage#adddb\'); return;"><img src="' . $theme['a_images'] . 'adddb.gif" alt="" /><br />' . $l['webuzo_adddb'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons23" value="' . $l['webuzo_phpmyadmin'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $mysql . ', \'phpmyadmin\'); return;"><img src="' . $theme['a_images'] . 'phpmyadmin.gif" alt="" /><br />' . $l['webuzo_phpmyadmin'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons24" value="' . $l['ampps_rockmongo'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(39, \'rockmongo\'); return;"><img src="' . $theme['a_images'] . 'rockmongo.gif" alt="RockMongo" /><br />' . $l['ampps_rockmongo'] . '</a>
												</td>									
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons25">										
												</td>																									
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>	
				<tr id="main_div3">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_cat_ftp'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table3">
											<tr align="center">																	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons31" value="' . $l['webuzo_ftp'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(31, \'ftp\'); return;"><img src="' . $theme['a_images'] . 'ftp.gif" alt="" /><br />' . $l['webuzo_ftp'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons32" value="' . $l['webuzo_ftp_account'] . '">		
													<a href="javascript:void(0)" onclick="is_app_inst(31, \'ftp_account\'); return;"><img src="' . $theme['a_images'] . 'addftp.gif" alt="" /><br />' . $l['webuzo_ftp_account'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons33" value="' . $l['webuzo_web_ftp'] . '">		
													<a href="javascript:void(0)" onclick="is_app_inst(31, \'monsta\'); return;"><img src="' . $theme['a_images'] . 'web_ftp.gif" alt="" /><br />' . $l['webuzo_web_ftp'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons34" value="' . $l['webuzo_ftp_connections'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(31, \'ftp_connections\'); return;"><img src="' . $theme['a_images'] . 'ftp_connections.gif" alt="" /><br />' . $l['webuzo_ftp_connections'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons35">
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>';
        $tmpapps = $apps;
        foreach ($tmpapps as $key => $val) {
            if (array_key_exists($key . '_1', $ins_apps) || $val['type'] == 'library') {
                unset($tmpapps[$key]);
            }
        }
        // Hope all the apps are not installed !!!
        if (!empty($tmpapps) && empty($disable_sysapps)) {
            shuffle($tmpapps);
            echo '
				<tr id="main_div4">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_install_sysapps'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table4">
											<tr align="center">';
            $cnt = 0;
            while ($cnt < 5) {
                // Blank fields - If any !!!
                if (empty($tmpapps[$cnt]['aid'])) {
                    echo '
														<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons4' . $cnt . '">
														</td>';
                    $cnt++;
                    continue;
                }
                echo '
														<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons4' . $cnt . '" value="' . $tmpapps[$cnt]['name'] . '">
															<a href="?act=apps&app=' . $tmpapps[$cnt]['aid'] . '"><div class="sp32_' . $tmpapps[$cnt]['softname'] . '"></div><br />' . $tmpapps[$cnt]['name'] . '</a>
														</td>';
                $cnt++;
            }
            echo '
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>';
        }
        echo '
				<tr id="main_div5">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_ssl'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table5">
											<tr>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons51" value="' . $l['webuzo_key'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(4, \'sslkey\'); return;"><img src="' . $theme['a_images'] . 'sslkey.gif" alt="" /><br />' . $l['webuzo_key'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons52" value="' . $l['webuzo_csr'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(4, \'sslcsr\'); return;"><img src="' . $theme['a_images'] . 'sslcsr.gif" alt="" /><br />' . $l['webuzo_csr'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons53" value="' . $l['webuzo_crt'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(4, \'sslcrt\'); return;"><img src="' . $theme['a_images'] . 'sslcrt.gif" alt="" /><br />' . $l['webuzo_crt'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons54" value="' . $l['webuzo_install_cert'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $web_server . ', \'install_cert\'); return;"><img src="' . $theme['a_images'] . 'install_cert.gif" alt="" /><br />' . $l['webuzo_install_cert'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons55">
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div6">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_cat_email'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table6">
											<tr>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons61" value="' . $l['webuzo_email_acc'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(35, \'email_account\'); return;"><img src="' . $theme['a_images'] . 'email_account.gif" alt="" /><br />' . $l['webuzo_email_acc'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons62" value="' . $l['webuzo_email_forward'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(35, \'email_forward\'); return;"><img src="' . $theme['a_images'] . 'email_forward.gif" alt="" /><br />' . $l['webuzo_email_forward'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons63" value="' . $l['webuzo_mx_entry'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(34, \'mxentry\'); return;"><img src="' . $theme['a_images'] . 'mx_entry.gif" alt="" /><br />' . $l['webuzo_mx_entry'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons64" value="' . $l['webuzo_squirrel'] . '">		
													<a href="javascript:void(0)" onclick="is_app_inst(35, \'squirrel\'); return;"><img src="' . $theme['a_images'] . 'squirrel.gif" alt="" /><br />' . $l['webuzo_squirrel'] . '</a><br />
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons65" value="' . $l['webuzo_email'] . '">		
													<a href="' . $globals['ind'] . 'act=email"><img src="' . $theme['a_images'] . 'emails.gif" alt="" /><br />' . $l['webuzo_email'] . '</a>
												</td>	
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>';
        if (empty($disable_sysapps)) {
            echo '
				<tr id="main_div7">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_configuration'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table7">
											<tr>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons71" value="' . $l['webuzo_php'] . '">
													<a href="' . $globals['ind'] . 'act=editini"><img src="' . $theme['a_images'] . 'php_conf.gif" alt="" /><br />' . $l['webuzo_php'] . '</a>
												</td>									
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons72" value="' . ($softpanel->getConf('WU_DEFAULT_SERVER') == 'nginx' ? $l['webuzo_nginx'] : ($softpanel->getConf('WU_DEFAULT_SERVER') == 'lighttpd' ? $l['webuzo_lighttpd'] : $l['webuzo_apache'])) . '">
											' . ($softpanel->getConf('WU_DEFAULT_SERVER') == 'nginx' ? '<a href="javascript:void(0)" onclick="is_app_inst(18, \'apache_conf\'); return;"><img src="' . $theme['a_images'] . 'nginx_conf.gif" alt="" /><br />' . $l['webuzo_nginx'] . '</a>' : ($softpanel->getConf('WU_DEFAULT_SERVER') == 'lighttpd' ? '<a href="javascript:void(0)" onclick="is_app_inst(60, \'apache_conf\'); return;"><img src="' . $theme['a_images'] . 'lighttpd_conf.gif" alt="" /><br />' . $l['webuzo_lighttpd'] . '</a>' : '<a href="javascript:void(0)" onclick="is_app_inst(' . $onlyapache . ', \'apache_conf\'); return;"><img src="' . $theme['a_images'] . 'apache_conf.gif" alt="" /><br />' . $l['webuzo_apache'] . '</a>')) . '										
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons73" value="' . $ins_apps[$mysql . '_1']['name'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $mysql . ', \'mysql_conf\'); return;"><img src="' . $theme['a_images'] . $mysql . '_icon.gif" alt="" /><br />' . $ins_apps[$mysql . '_1']['name'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons74" value="' . $l['webuzo_php_ext'] . '">
													<a href="' . $globals['ind'] . 'act=php_ext"><img src="' . $theme['a_images'] . 'php_ext.gif" alt="" /><br />' . $l['webuzo_php_ext'] . '</a>
												</td>
												';
            if ($softpanel->getConf('WU_DEFAULT_SERVER') == 'httpd') {
                echo '<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons75" value="' . $l['apache_settings'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(3, \'apache_settings\'); return;"><img src="' . $theme['a_images'] . 'apache_settings.gif" alt="" /><br />' . $l['apache_settings'] . '</a>
													</td>';
            } elseif ($softpanel->getConf('WU_DEFAULT_SERVER') == 'nginx') {
                echo '<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons75" value="' . $l['nginx_settings'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(18, \'apache_settings\'); return;"><img src="' . $theme['a_images'] . 'nginx_settings.gif" alt="" /><br />' . $l['nginx_settings'] . '</a>
													</td>';
            } else {
                echo '<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons75">
													</td>	';
            }
            echo '									
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>';
        }
        echo '
				<tr id="main_div8">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_cat_security'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table8">
											<tr>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons81" value="' . $l['webuzo_pass'] . '">
													<a href="' . $globals['ind'] . 'act=changepassword"><img src="' . $theme['a_images'] . 'changepassword.gif" alt="" /><br />' . $l['webuzo_pass'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons82" value="' . $l['webuzo_ip_block'] . '">
													<a href="' . $globals['ind'] . 'act=ipblock"><img src="' . $theme['a_images'] . 'ip_block.gif" alt="" /><br />' . $l['webuzo_ip_block'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons83" value="' . $l['webuzo_csf'] . '">	
													<a href="javascript:void(0)" onclick="is_app_inst(62, \'csf_conf\'); return;"><img src="' . $theme['a_images'] . 'firewall.gif" alt="" /><br />' . $l['webuzo_csf'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons84" value="' . $l['webuzo_ssh_access'] . '">
													<a href="' . $globals['ind'] . 'act=ssh_access"><img src="' . $theme['a_images'] . 'ssh_login.gif" alt="" /><br />' . $l['webuzo_ssh_access'] . '</a>
												</td>';
        if ($softpanel->getConf('WU_DEFAULT_SERVER') == 'httpd' || $softpanel->getConf('WU_DEFAULT_SERVER') == 'httpd2') {
            echo '										
													<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons85" value="' . $l['webuzo_pass_protect_dir'] . '">
														<a href="' . $globals['ind'] . 'act=pass_protect_dir"><img src="' . $theme['a_images'] . 'pass_protect_dir.gif" alt="" /><br />' . $l['webuzo_pass_protect_dir'] . '</a>
												</td>';
        } else {
            echo '
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons85">										
													</td>';
        }
        echo '</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div9">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_advance_setting'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table9">
											<tr>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons91" value="' . $l['webuzo_apps_updates'] . '">
													<a href="' . $globals['ind'] . 'act=apps_updates"><img src="' . $theme['a_images'] . 'apps_updates.gif" alt="" /><br />' . $l['webuzo_apps_updates'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons92" value="' . $l['webuzo_settings'] . '">
													<a href="' . $globals['ind'] . 'act=settings"><img src="' . $theme['a_images'] . 'settings.gif" alt="" /><br />' . $l['webuzo_settings'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons93" value="' . $l['webuzo_cron'] . '">
													<a href="' . $globals['ind'] . 'act=cronjob"><img src="' . $theme['a_images'] . 'cronjob.gif" alt="" /><br />' . $l['webuzo_cron'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons94" value="' . $l['webuzo_system_utilities'] . '">
													<a href="' . $globals['ind'] . 'act=service_manager"><img src="' . $theme['a_images'] . 'service_manager.gif" alt="" /><br />' . $l['webuzo_system_utilities'] . '</a>
												</td>
												';
        if (empty($disable_sysapps)) {
            echo '
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons95" value="' . $l['webuzo_services'] . '">		
													<a href="' . $globals['ind'] . 'act=services"><img src="' . $theme['a_images'] . 'services.gif" alt="" /><br />' . $l['webuzo_services'] . '</a>
												</td>';
        } else {
            echo '
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons95">										
													</td>';
        }
        echo '	
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div10">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_server_setting'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table10">
											<tr>									
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons101" value="' . $l['webuzo_filemanager'] . '">
													<a href="filemanager/" target="_blank"><img src="' . $theme['a_images'] . 'filemanager.gif" alt="" /><br />' . $l['webuzo_filemanager'] . '</a>
												</td>									
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons102" value="' . $l['webuzo_awstats'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(38, \'awstats\'); return;"><img src="' . $theme['a_images'] . 'awstats.gif" alt="" /><br />' . $l['webuzo_awstats'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons103" value="' . $l['webuzo_login_logs'] . '">
													<a href="' . $globals['ind'] . 'act=login_logs"><img src="' . $theme['a_images'] . 'login_logs.gif" alt="" /><br />' . $l['webuzo_login_logs'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons104" value="' . $l['webuzo_import_cpanel'] . '">
													<a href="' . $globals['ind'] . 'act=import_cpanel"><img src="' . $theme['a_images'] . 'import_cpanel.gif" alt="" /><br />' . $l['webuzo_import_cpanel'] . '</a>
												</td>';
        // Hide it if tomcat is not installed and DISABLED_SYSAPPS
        if (!empty($disable_sysapps) && empty($ins_apps['37_1'])) {
            echo '
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons105">										
													</td>';
        } else {
            echo '
													<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons105" value="' . $l['webuzo_apache_tomcat'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(37, \'tomcat\'); return;"><img src="' . $theme['a_images'] . 'apache_tomcat.gif" alt="" /><br />' . $l['webuzo_apache_tomcat'] . '</a>										
													</td>';
        }
        echo '
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div11">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_server_info'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table11">
											<tr>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons111" value="' . $l['webuzo_cpu'] . '">
													<a href="' . $globals['ind'] . 'act=cpu"><img src="' . $theme['a_images'] . 'cpu.gif" alt=""/><br />' . $l['webuzo_cpu'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons112" value="' . $l['webuzo_ram'] . '">	
													<a href="' . $globals['ind'] . 'act=ram"><img src="' . $theme['a_images'] . 'ram.gif" alt=""/><br />' . $l['webuzo_ram'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons113" value="' . $l['webuzo_disk'] . '">
													<a href="' . $globals['ind'] . 'act=disk"><img src="' . $theme['a_images'] . 'disk.gif" alt=""/><br />' . $l['webuzo_disk'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons114" value="' . $l['webuzo_bandwidth'] . '">
													<a href="' . $globals['ind'] . 'act=bandwidth"><img src="' . $theme['a_images'] . 'bandwidth.gif" alt=""/><br />' . $l['webuzo_bandwidth'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons115" value="' . $l['webuzo_error_log'] . '">
													<a href="' . $globals['ind'] . 'act=errorlog"><img src="' . $theme['a_images'] . 'error_log.gif" alt=""/><br />' . $l['webuzo_error_log'] . '</a>
												</td>	
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr>
					<td id="main_div12">
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_scripts'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top">
										<table cellpadding="5" cellspacing="5" border="0" id="main_table12">
											<tr>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons121" value="' . $l['webuzo_demos'] . '">
													<a href="' . $globals['ind'] . 'act=demos"><img src="' . $theme['a_images'] . 'demos.gif" alt="" /><br />' . $l['webuzo_demos'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons122" value="' . $l['webuzo_ratings'] . '">
													<a href="' . $globals['ind'] . 'act=ratings"><img src="' . $theme['a_images'] . 'ratings.gif" alt="" /><br />' . $l['webuzo_ratings'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons123" value="' . $l['webuzo_installations'] . '">
													<a href="' . $globals['ind'] . 'act=installations"><img src="' . $theme['a_images'] . 'installations.gif" alt="" /><br />' . $l['webuzo_installations'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons124" value="' . $l['webuzo_backups'] . '">
													<a href="' . $globals['ind'] . 'act=backups"><img src="' . $theme['a_images'] . 'backups.gif" alt="" /><br />' . $l['webuzo_backups'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons125">
												</td>	
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr class="sai_heading_full">
									<th align="center" width="25%" style="height:25px">' . $l['webuzo_cpuinfo'] . '</th>
									<th align="center" width="25%">' . $l['webuzo_raminfo'] . '</th>
									<th align="center" width="25%">' . $l['webuzo_diskinfo'] . '</th>
									<th align="center" width="25%">' . $l['webuzo_bandwidthinfo'] . '</th>
								</tr>
								<tr>
									<td align="center" valign="top"><br />
										<div id="server_cpu" class="server_graph"></div>
										<br /><div id="server_cpu_text">&nbsp;</div>
									</td>
									<td align="center"  valign="top"><br />
										<div id="server_ram" class="server_graph"></div>
										<br /><div id="server_ram_text">&nbsp;</div>
									</td>				
									<td align="center" valign="top"><br />
										<div id="server_disk" class="server_graph"></div>
										<br /><div id="server_disk_text">&nbsp;</div>
									</td>
									<td align="center" valign="top"><br />
										<div id="server_bandwidth" class="server_graph"></div>
										<br /><div id="server_bandwidth_text">&nbsp;</div><br />
									</td>
								</tr>					
							</table>
						</div>
					</td>
				</tr>	
			</table>
			<br /><br /><br />';
    } elseif ($globals['softpanel'] == 'ampps') {
        $BinVer = $softpanel->currentBinary();
        echo '<center><span class="sai_newhead">' . $l['ampps'] . '</span></center><br />
			<table cellpadding="8" cellspacing="1" border="0">
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_config'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=secure"><img src="' . $theme['a_images'] . 'secure.gif" alt="" /><br />' . $l['ampps_secure'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=security"><img src="' . $theme['a_images'] . 'security.gif" alt="" /><br />' . $l['ampps_security'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=status"><img src="' . $theme['a_images'] . 'status.gif" alt="" /><br />' . $l['ampps_status'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=ampps_domainmanage"><img src="' . $theme['a_images'] . 'domains.gif" alt="" /><br />' . $l['ampps_mandom'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=ampps_domainadd"><img src="' . $theme['a_images'] . 'adddomain.gif" alt="" /><br />' . $l['ampps_adddom'] . '</a>
				</td>
			</tr>
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_mysql'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="http://' . $globals['HTTP_HOST'] . '/sqlite" target="_blank"><img src="' . $theme['a_images'] . 'sqlite.gif" alt="" /><br />' . $l['ampps_sqlite'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="http://' . $globals['HTTP_HOST'] . '/phpmyadmin/index.php?server=1&target=server_databases.php" target="_blank"><img src="' . $theme['a_images'] . 'adddb.gif" alt="" /><br />' . $l['ampps_adddb'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="http://' . $globals['HTTP_HOST'] . '/phpmyadmin" target="_blank"><img src="' . $theme['a_images'] . 'phpmyadmin.gif" alt="phpMyAdmin" /><br />' . $l['ampps_phpmyadmin'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=mysqlsettings"><img src="' . $theme['a_images'] . 'mysqlsettings.gif" alt="Change Password" /><br />' . $l['ampps_mysqlsettings'] . '</a>
				</td>';
        if ($BinVer > 15) {
            echo '<td class="ampps_icons" align="center" valign="top">
						<a href="http://' . $globals['HTTP_HOST'] . '/rockmongo" target="_blank"><img src="' . $theme['a_images'] . 'rockmongo.gif" alt="RockMongo" /><br />' . $l['ampps_rockmongo'] . '</a>
					</td>';
        }
        echo '</tr>
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_features'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			<tr>';
        if ($BinVer > 15) {
            echo '<td class="ampps_icons" align="center" valign="top">
						<a href="' . $globals['ind'] . 'act=alias"><img src="' . $theme['a_images'] . 'alias.gif" alt="" /><br />' . $l['ampps_alias'] . '</a>
					</td>';
        }
        if ($BinVer > 16) {
            echo '<td class="webuzo_icons" align="center" valign="top">
						<a href="' . $globals['ind'] . 'act=ftpmanage"><img src="' . $theme['images'] . 'ftp.gif" alt="" /><br />' . $l['ampps_ftp'] . '</a>
					</td>
					<td class="webuzo_icons" align="center" valign="top">
						<a href="' . $globals['ind'] . 'act=ftpadd"><img src="' . $theme['a_images'] . 'addftp.gif" alt="" /><br />' . $l['ampps_ftp_account'] . '</a>
					</td>';
        }
        echo '</tr>
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_info'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . ($BinVer < 21 ? $globals['ind'] . 'act=phpinfo' : 'http://' . $globals['HTTP_HOST'] . '/cgi-bin/phpinfo.cgi') . '"><img src="' . $theme['a_images'] . 'phpinfo.gif" alt="" /><br />' . $l['ampps_phpinfo'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="http://' . $globals['HTTP_HOST'] . '/cgi-bin/perlinfo.pl"><img src="' . $theme['a_images'] . 'perlinfo.gif" alt="" /><br />' . $l['ampps_perlinfo'] . '</a>
				</td>
			</tr>
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_quick_conf'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=editini"><img src="' . $theme['a_images'] . 'php_conf.gif" alt="" /><br />' . $l['ampps_php'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top"  width="140px">
					<a href="' . $globals['ind'] . 'act=apache_conf"><img src="' . $theme['a_images'] . 'apache_conf.gif" alt="" /><br />' . $l['ampps_apache'] . '</a>
				</td>
			</tr>
			
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_scripts'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=demos"><img src="' . $theme['images'] . 'demos.gif" alt="" /><br />' . $l['ampps_demos'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=ratings"><img src="' . $theme['images'] . 'ratings.gif" alt="" /><br />' . $l['ampps_ratings'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=installations"><img src="' . $theme['images'] . 'installations.gif" alt="" /><br />' . $l['ampps_installations'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=backups"><img src="' . $theme['images'] . 'backups.gif" alt="" /><br />' . $l['ampps_backups'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">		
					<a href="' . $globals['ind'] . 'act=email"><img src="' . $theme['images'] . 'emails.gif" alt="" /><br />' . $l['ampps_email'] . '</a>
				</td>
			</tr>
			</table>
			<br /><br /><br />';
    } else {
        $info_head1 = !empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 'col-md-11 col-sm-10 col-xs-9' : 'col-md-10 col-sm-10 col-xs-9' : 'col-md-11 col-sm-10 col-xs-9';
        echo '<div class="bg bg_usi"><br />
					<div class="row">
						<div class="' . $info_head1 . '" style="text-align:center;">
							<span class="sai_newhead">' . $globals['sn'] . '</span>
						</div>
							
						<div class="topscripts">
							<img src="' . $theme['images'] . 'top_star.png" width="30" height="30" class="someclass" title="Top Scripts" style="border:none;"/>&nbsp;&nbsp;							
						</div>
					</div>
					
					<hr><br />
				
					<div class="row">
						<div style="width:20%; float:left;">
							<img src="' . $theme['images'] . 'autoinstaller.jpg" alt="" class="img-responsive"/>
						</div>
						<div style="width:80%; float:right; padding:0 20px;">
							<font class="sai_newhead">' . $l['auto_installer'] . '</font>
							<br /><br />
							<font class="sai_feature_exp">' . $l['auto_installer_exp'] . '</font>
						</div>
					</div>
					
					<br /><br />
				
					<div class="row">
						<div style="width:80%; float:left; padding-right:50px;">		
							<font class="sai_newhead">' . $l['view_demos'] . '</font>
							<br /><br />
							<font class="sai_feature_exp">' . $l['view_demos_exp'] . '</font>
						</div>
						<div style="width:20%; float:right;">	
							<a href="' . $globals['ind'] . 'act=demos"><img src="' . $theme['images'] . 'exp_demos.gif" alt="" class="img-responsive"/></a>
						</div>
					</div>
					
					<br /><br />
				
					<div class="row">
						<div style="width:20%; float:left;">	
							<a href="' . $globals['ind'] . 'act=ratings"><img src="' . $theme['images'] . 'rate_it.jpg" alt="" class="img-responsive"/></a>
						</div>
						<div style="width:80%; float:right; padding:0 20px;">	
							<font class="sai_newhead">' . $l['rate_it'] . '</font>
							<br /><br />
							<font class="sai_feature_exp">' . $l['rate_it_exp'] . '</font>
						</div>
					</div>
					
					<br /><br />
				
					<div class="row">
						<div style="width:80%; float:left; padding-right:50px;">
							<font class="sai_newhead">' . $l['build_sites'] . '</font>
							<br /><br />
							<font class="sai_feature_exp">' . $l['build_sites_exp'] . '</font>
						</div>
						<div style="width:20%; float:right;">	
							<img src="' . $theme['images'] . 'build.jpg" alt="" class="img-responsive"/>
						</div>
					</div><br /><br />
				</div><!--end of bg class-->';
    }
    //THIS IS THE CLOSING OF TAB2 DIV
    echo '
		</div>
	</div>';
    // news updates box
    if (empty($globals['eu_news_off'])) {
        echo '<script language="javascript" type="text/javascript"  id="news"></script>
		
		<script type="text/javascript">
		function load_soft_info(){
			if(!$_("softnews")){ // Is the news DIV there ?
				return true;
			}
			$_("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;
			}
		}
		addonload(\'load_soft_info();\');
		
		</script>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" >	
			<tr>
				<td style="padding-top:40px;" colspan="3">
					<table width="90%" align="center" border="0" cellspacing="0" cellpadding="0" >
						<tr>
							<td class="news_content_header">
								' . $l['news'] . '
							</td>
						</tr>
						<tr>
							<td id="softnewsholder">
								<div class="news_content">
									<div class="softnews" id="softnews"' . (!empty($softpanel->pheader) ? 'style="overflow: auto;width:auto"' : '') . '></div>
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>';
    }
    softfooter();
}
function ftp_connections_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $ftp_list, $done, $tuser;
    // Ajax response for deleting a ftp connection
    if (optGET('ajaxdel')) {
        // Error
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Success
        if (!empty($done)) {
            echo '1' . $l['delete'];
            return true;
        }
    }
    softheader($l['<title>']);
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
			// For msgbox
			var message_box = function() {			
				return {
					show_message: function(title, body , image) {			
						var okbutton = \'<input  style="width:75px" class="sai_graybluebut" type="button" onclick="message_box.close_message();" value="OK" />\';
						if(image == "1"){
							var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
						}else{
							var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
						}					
						if(jQuery(\'.sai_message_box\').html() === null) {
							var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
							jQuery(document.body).append( message );								
							jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
						}else{
							var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
							jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
							jQuery(\'.sai_message_box\').html( message );
						}
					},
					delete_message: function(title, body ,did) {								
						var yesbutton = \'<input type="button" style="width:75px" onclick="message_box.yes_close_message(\\\'\'+did+\'\\\');" value="YES" class="sai_graybluebut"/>\';
						var nobutton = \'<input type="button" style="width:75px" onclick="message_box.no_close_message();" value="NO" class="sai_graybluebut" />\';
						var img = \'<img src="' . $theme['images'] . 'remove_big.gif" />\';
						if(jQuery(\'.sai_message_box\').html() === null) {
							var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1" height="10%">\' +  title + \'</td></tr><tr ><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table></div>\';				
							jQuery(document.body).append( message );								
							jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
						}else{
							var message = \' <table  border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1" height="10%">\' + title + \'</td></tr><tr><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table>\'
							jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
							jQuery(\'.sai_message_box\').html( message );
						}
					},
					close_message: function() {
						jQuery(\'.sai_message_box\').hide(\'fast\');
					},
					yes_close_message: function(did){
						$(\'#did\'+did).attr("src","' . $theme['images'] . 'progress.gif");
						jQuery(\'.sai_message_box\').hide(\'fast\');
						$.ajax({
							type: "POST",
							url: window.location+"&ajaxdel=1&ftp_connection_pid="+did,
							// Checking the results
							success: function(data){
								var result = data.substring(0,1);
								var msg = data.substring(1);
								if(result == "1"){
									message_box.show_message( "Delete ",msg,2);
									$("#tr"+did).fadeOut(2000);
								}
								if(result == "0"){
									message_box.show_message( "Error ",msg,1);
								}
							},
							error: function(request,error){
								message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);
							}
						});
					},
					no_close_message: function(){
						jQuery(\'.sai_message_box\').hide(\'fast\');
					}
					
				}
			}();
				
			$(document).ready(function(){
				
				$(".sai_altrowstable tr").mouseover(function(){
					
					var old_class = $(this).attr("class");
					$(this).attr("class", "sai_tr_bgcolor");
					
					$(this).mouseout(function(){
						$(this).attr("class", old_class);
					});
					
				});
				
				// FOR DELETING THE FTP CONNECTION
				$(".delete").click(function(){
					var did = $(this).attr(\'id\');
					did = did.substr(3);
					message_box.delete_message(\'Warning\',\'' . $l['record_del_conf'] . '\',did);
				});
						
			});
			
		// ]]></script>
			
	<center>
		<div class="sai_tit">
			<img src="' . $theme['a_images'] . 'ftp_connections.gif" alt="" />&nbsp;' . $l['ftp_connections_head'] . '
		</div>
	</center>	
	<table border="0" cellpadding="8" cellspacing="1" width="100%" align="center" class="sai_altrowstable">
		<tr>
			<th>' . $l['ftp_user'] . '</th>
			<th>' . $l['ftp_logged_in'] . '</th>
			<th>' . $l['ftp_log_time'] . '</th>
			<th>' . $l['ftp_status'] . '</th>
			<th>' . $l['ftp_disconnect'] . '</th>
			<th>' . $l['ftp_process_id'] . '</th>
		</tr>';
    if (!empty($ftp_list)) {
        $i = 1;
        foreach ($ftp_list as $key => $value) {
            echo '
					<tr class="' . ($i % 2 == 0 ? "sai_evenrowcolor" : "sai_oddrowcolor") . '" id="tr' . $key . '">
					<td>' . $value['ftp_user'] . '</td>
					<td>' . $value['log_from'] . '</td>
					<td>' . datify($value['ftp_timestamp'], 1, 1, 0) . '</td>
					<td>' . $value['status'] . '</td>
					<td><img title="Delete" class="delete" id="did' . $key . '" src="' . $theme['images'] . 'remove.gif" style="cursor:pointer" /></td>
					<td>' . $key . '</td>
					</tr>';
            $i++;
        }
    } else {
        echo '<tr class="sai_oddrowcolor">
					<td colspan="6" align="center">' . $l['no_ftp_connections_found'] . '</td>
				</tr>';
    }
    echo '
	</table>';
    softfooter();
}
Exemple #8
0
function sslcsr_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $error, $done, $domain_list, $domain_name, $csr_list, $detailcsr;
    // For delete
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['delete'];
            showcert();
            return true;
        }
    }
    // For detail
    if (optGET('ajaxdetail')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            showdetail();
            return true;
        }
    }
    softheader($l['<title>']);
    error_handle($error, '100%');
    if (!empty($done)) {
        echo '<div class="sai_success">' . $done . '</div>';
    }
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'sslcsr.gif" />&nbsp;' . $l['lbl_head'] . '</center>';
    if (empty($domain_list)) {
        echo ' <center ><h2>' . $l['no_key_file'] . '</h2></center>';
    } else {
        echo '<div id="showrectab">';
        showcert();
        echo '</div>
	<div id="detailrectab" style="display:none">';
        echo '</div><br /><br />
		
		<form accept-charset="' . $globals['charset'] . '" name="createssl" method="post" action="">
		<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding-left:15px; padding-top:15px;" >
		<tr>
			<td>
				<span class="sai_head">' . $l['key'] . '</span><br />
			</td>	
			<td>
				<select class="input" name="selectkey" id="selectkey">';
        foreach ($domain_list as $key => $value) {
            $ext = get_extension($value);
            if ($ext == 'key') {
                $file = get_filename($value);
                if (!in_array($file . '.csr', $csr_list)) {
                    echo '<option value=' . $file . '>' . $file . '</option>';
                }
            }
        }
        echo '<option value=newkey>' . $l['genrate'] . '</option>';
        echo '</select>
			</td>
		</tr>
		<tr>
			<td>
				<span class="sai_head">' . $l['domain'] . '</span><br />
				<span class="sai_exp">' . $l['domain_desc'] . '</span></td>
			</td>
			<td>
				<input type="text" name="domain" id="domain" size="30" ' . (!empty($error) ? 'value="' . POSTval('domain', '') . '"' : '') . ' />
			</td>
		</tr>	
		<tr>
			<td width="40%">
				<span class="sai_head">' . $l['country'] . '</span><br />
				<span class="sai_exp">' . $l['country_desc'] . '</span></td>
			<td>
				<input type="text" name="country" id="country" size="30" ' . (!empty($error) ? 'value="' . POSTval('country', '') . '"' : '') . ' />
			</td>
		</tr>
		<tr>
			<td width="40%">
				<span class="sai_head">' . $l['state'] . '</span><br />
				<span class="sai_exp">' . $l['state_desc'] . '</span></td>
			<td>
				<input type="text" name="state" id="state" size="30" ' . (!empty($error) ? 'value="' . POSTval('state', '') . '"' : '') . ' />
			</td>
		</tr>
		
		<tr>
			<td width="40%">
				<span class="sai_head">' . $l['locality'] . '</span><br />
				<span class="sai_exp">' . $l['locality_desc'] . '</span></td>
			<td>
				<input type="text" name="locality" id="locality" size="30" ' . (!empty($error) ? 'value="' . POSTval('locality', '') . '"' : '') . ' />
			</td>
		</tr>
		<tr>
			<td width="40%">
				<span class="sai_head">' . $l['organisation'] . '</span><br />
				<span class="sai_exp">' . $l['organisation_desc'] . '</span></td>
			<td>
				<input type="text" name="organisation" id="organisation" size="30" ' . (!empty($error) ? 'value="' . POSTval('organisation', '') . '"' : '') . ' />
			</td>
		</tr>
		<tr>
			<td width="40%">
				<span class="sai_head">' . $l['org_unit'] . '</span><br />
				<span class="sai_exp">' . $l['org_unit_desc'] . '</span></td>
			<td>
				<input type="text" name="orgunit" id="orgunit" size="30" ' . (!empty($error) ? 'value="' . POSTval('orgunit', '') . '"' : '') . ' />
			</td>
		</tr>		
		<tr>
			<td width="40%">
				<span class="sai_head">' . $l['email'] . '</span><br />
				<span class="sai_exp">' . $l['email_desc'] . '</span></td>
			<td>
				<input type="text" name="email" id="email" size="30" ' . (!empty($error) ? 'value="' . POSTval('email', '') . '"' : '') . ' />
			</td>
		</tr>
		<tr>
			<td width="40%">
				<span class="sai_head">' . $l['pass_pharse'] . '</span><br />
				<span class="sai_exp">' . $l['pass_pharse_desc'] . '</span></td>
			<td>
				<input type="text" name="pass" id="pass" size="30" ' . (!empty($error) ? 'value="' . POSTval('pass', '') . '"' : '') . ' />
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<p align="center"><input type="submit"  name="createcsr" value="' . $l['createcsr'] . '" class="sai_graybluebut" /></p>
			</td>
		</tr>
		</table>		
		</form>';
    }
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[	
	
	var message_box = function(){			
		return{
			show_message: function(title, body , image) {			
				var okbutton = \'<input  style="width:75px" class="sai_graybluebut" type="button" onclick="message_box.close_message();" value="OK" />\';
				if(image == "1"){
					var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
				}else{
					var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
				}					
				if(jQuery(\'.sai_message_box\').html() === null) {
					var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
					jQuery(document.body).append( message );								
					jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
				}else{
					var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
					jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
					jQuery(\'.sai_message_box\').html( message );
				}
			},
			delete_message: function(title, body ,did) {			
				var yesbutton = \'<input type="button" style="width:75px" onclick="message_box.yes_close_message(\\\'\'+did+\'\\\');" value="YES" class="sai_graybluebut"/>\';
				var nobutton = \'<input type="button" style="width:75px" onclick="message_box.no_close_message();" value="NO" class="sai_graybluebut" />\';
				var img = \'<img src="' . $theme['images'] . 'remove_big.gif" />\';
				if(jQuery(\'.sai_message_box\').html() === null) {
					var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1" height="10%">\' +  title + \'</td></tr><tr ><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table></div>\';				
					jQuery(document.body).append( message );								
					jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
				}else{
					var message = \' <table  border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1" height="10%">\' + title + \'</td></tr><tr><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table>\'
					jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
					jQuery(\'.sai_message_box\').html( message );
				}
			},
			close_message: function() {
				jQuery(\'.sai_message_box\').hide(\'fast\');
			},
			yes_close_message: function(did) {	
				$(\'#did\'+did).attr("src","' . $theme['images'] . 'progress.gif");	
				jQuery(\'.sai_message_box\').hide(\'fast\');					
				$.ajax({				
					type: "POST",				
					url: window.location+"&ajaxdel=1&delete_record="+did,				
					// checking for error
					success: function(data){
						var result = data.substring(0,1);					
						var msg = data.substring(1);
						if(result == "1"){
							var msg = data.substring(1,data.indexOf("<table"));
							var output = data.substring(data.indexOf("<table"));							
							message_box.show_message( "Delete ",msg,2);
							$("#showrectab").html(output);																																			
						}
						if(result == "0"){
							message_box.show_message( "Error ",msg,1);																																			
							$(\'#did\'+did).attr("src","' . $theme['images'] . 'remove.gif");																																							
						}
					},				
					error: function(request,error) {
						message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);					
					}
				});					
			},
			no_close_message: function() {
				jQuery(\'.sai_message_box\').hide(\'fast\');			
			}
		}
	}();
	
	$(document).ready(function(){	
		$(".sai_altrowstable tr").mouseover(function(){
			var old_class = $(this).attr(\'class\');		
			$(this).attr("class", \'sai_tr_bgcolor\');		
			$(this).mouseout(function(){
			$(this).attr(\'class\', old_class);
			});
		});				
	});	
	// ]]></script>';
    softfooter();
}
function pass_protect_dir_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $done;
    // For Delete
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '{err}' . current($error) . '{/err}';
            return false;
        }
        if (!empty($done)) {
            echo '{suc}' . $l['delete'] . '{/suc}';
            return true;
        }
    }
    // For Adding a Record
    if (optGET('add_pass_protect')) {
        if (!empty($error)) {
            echo '{err}' . current($error) . '{/err}';
            return false;
        }
        if (!empty($done)) {
            echo '{suc}' . $l['add_pass_protect'] . '{/suc}';
            show_protected_user_accts();
            return true;
        }
    }
    softheader($l['<title>']);
    echo '
<center class="sai_tit">
	<img src="' . $theme['a_images'] . 'email_account.gif" />&nbsp;' . $l['lbl_head'] . '
</center>

<form accept-charset="' . $globals['charset'] . '" action="" method="post" name="frm_protect_dir" id="frm_protect_dir">

	<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding-left:15px; padding-top:15px;" >
	<tr>
		<td width="35%">
			<span class="sai_head">' . $l['dir_path'] . '</span><br />
			<span class="sai_exp">' . $l['exp_dir_path'] . '</span>
		</td>
		<td>
			' . $softpanel->user['homedir'] . '/<input type="text" name="dir_path" id="dir_path" size="30"  value="' . stripslashes(POSTval('dir_path', 'public_html/')) . '" onfocus="" />
		</td>
	</tr>
	<tr>
		<td width="35%">
			<span class="sai_head">' . $l['dir_name'] . '</span><br />
			<span class="sai_exp">' . $l['exp_dir_name'] . '</span>
		</td>
		<td>
			<input type="text" name="dir_name" id="dir_name" size="30" size="30" value="' . POSTval('dir_name', '') . '" />
		</td>
	</tr>
	<tr>
		<td width="35%">
			<span class="sai_head">' . $l['username'] . '</span><br />
			<span class="sai_exp">' . $l['exp_username'] . '</span>
		</td>
		<td>
			<input type="text" name="username" id="username" size="30" size="30" value="' . POSTval('username', '') . '" />
		</td>
	</tr>
	<tr>
		<td>
			<span class="sai_head">' . $l['password'] . '</span><br />
			<span class="sai_exp">' . $l['exp_password'] . '</span>
		</td>
		<td>
			<input type="password" name="password" id="password" size="30" value="" />
		</td>
	</tr>
	<tr>
		<td>
			<span class="sai_head">' . $l['re_password'] . '</span><br />
			<span class="sai_exp">' . $l['exp_re_password'] . '</span>
		</td>
		<td>
			<input type="password" name="re_password" id="re_password" size="30" value="" />
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<p align="center">
				<input type="hidden" name="add_pass_protect" value="1" />
				<input type="submit" style="cursor:pointer" value="' . $l['submit_pass_protect'] . '" name="submit_pass_protect" class="sai_graybluebut" id="submit_pass_protect" />&nbsp;<img id="add_pass_proc_loader" src="' . $theme['images'] . 'progress.gif" style="display:none" />
			</p>
		</td>
	</tr>
	</table>
</form>

<center>
	</br></br>
	<span class="sai_head">' . $l['record_table'] . '<br /><br />
</center>

<div id="showrectab">';
    show_protected_user_accts();
    echo '</div>

<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	$(document).ready(function(){
			
		// For Adding Password Protected Directories
		$("#submit_pass_protect").click(function(){
			
			// The Revolving Loader !!!
			$("#add_pass_proc_loader").css("display", "");
			
			$.ajax({
				type: "POST",
				url: window.location+"&add_pass_protect=1",
				data: $("#frm_protect_dir").serialize(),
				
				// Checking for error
				success: function(data){
					$("#add_pass_proc_loader").css("display", "none");
					
					// Do we have a success string ?
					var suc_index = data.indexOf("{suc}");
					if(suc_index != -1){
						
						var suc_end_index = data.indexOf("{/suc}");
						var suc_data = data.substring(suc_index+5,suc_end_index);
						
						if(suc_data != ""){
							// Clean Up
							$_("dir_path").value = "";
							$_("dir_name").value = "";
							$_("username").value = "";
							$_("password").value = "";
							$_("re_password").value = "";
							
							message_box.show_message("Done", suc_data, 2);
							
							$("#showrectab").html(data.substring(data.indexOf("<table")));
							
							return true;
						}
					}
					
					var err_index = data.indexOf("{err}");
					var err_end_index = data.indexOf("{/err}");
					var err_data = data.substring(err_index+5, err_end_index);
					
					if(err_data != ""){
						message_box.show_message( "Error",err_data,1);
						return true;
					}
					
				},
				error: function() {
					message_box.show_message("Error", "' . $l['connect_error'] . '", 1);
				}
			});
			return false;
		});
	});
	// ]]></script>';
    softfooter();
}
Exemple #10
0
function classes_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts;
    global $software, $cid, $info, $settings, $init_tab, $overwrite_option, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $show_installtype, $protocols, $nopackage;
    // 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;
    }
    //First add the installation info
    if (empty($installed)) {
        $info['install'] = '<div id="fadeout_div"><form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware" class="form-horizontal">
						' . error_handle($error, "100%", 0, 1) . '
						
<script language="javascript" src="' . $theme['url'] . '/js/jquery-ui-custom.js?' . $GLOBALS['globals']['version'] . '" type="text/javascript"></script>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function checkform(dosubmit){
	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;
	
};

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

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

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

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);
						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=js&soft=' . $cid . '&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("@");
			$_(x).value = temp[0] + "@" + $_(sofdom).value;
		}
	}catch(e){
		return false;
	}
};

function change_aefer_path(){
	try{
		var str = $_("softdomain").value;
		var apath = ' . json_encode($softpanel->domains) . ';
		$_("aef_path").innerHTML = $_("aef_span_lang").innerHTML = $_("aef_span_lang_a").innerHTML = apath[str]["path"]+"/";
	}catch(e){
		return false;
	}
};

$(document).ready(function(){
	$("#check_all_classes").on("click", function(event){
		if(this.checked == true){
			$(".check_all_classes").prop("checked", true);
		}else{
			$(".check_all_classes").prop("checked", false);
		}
	});
	change_aefer_path();
});

' . (!empty($_POST) ? '' : 'addonload(\'softmail();\');');
        $info['install'] .= '// ]]></script>';
        $info['install'] .= '
	<div class="bg">
		<div class="sai_sub_head">' . $l['setup'] . '</div><hr>';
        if (aefer() || ent()) {
            $info['install'] .= '
				<div class="row">
						<div class="col-sm-5">
							<label for="softdomain" class="sai_head">' . $l['choose_domain'] . '</span><br />
							<span class="sai_exp">' . $l['choose_domain_exp'] . '</span>
						</div>
						<div class="col-sm-7">
							<select name="softdomain" id="softdomain" onchange="change_aefer_path();" class="form-control">';
            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>';
        }
        $info['install'] .= '
			<div class="row">
				<div class="col-sm-5">
					<label for="softdirectory" class="sai_head">' . $l['in_directory'] . '</label><br />
					<span class="sai_exp2">' . lang_vars(aefer() || ent() ? $l['aef_in_directory_exp'] : $l['in_directory_exp'], array($softpanel->user['homedir'])) . '</span>
				</div>
				<div class="col-sm-7">
					<span id="aef_path">' . $softpanel->user['homedir'] . '/</span><br><input type="text" name="softdirectory" id="softdirectory" class="form-control" size="30" value="' . POSTval('softdirectory', $software['softname']) . '" />
				</div>
			</div>';
        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') {
                    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>') : '<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']) && (!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('/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)
        // 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>
			<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>	
		</div>	
	</div><!--end of bg--><br /><br />';
        $info['install'] .= '
	<p align="center" class="sai_head">
		<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
		<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']) ? $l['ins_emailto'] . ' : <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; display: none; width:100%;">
	<br /><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>
</div>
<br />';
    } elseif (!empty($installed)) {
        $info['install'] = '
	<div class="bg2">
		<h4>' . $l['congrats'] . '</h4><br />
		' . $software['name'] . ' ' . $l['succesful'] . ' : <br />
		<b>' . $__settings['softpath'] . '</b>
		<br /><br />
		' . $l['enjoy'] . '<br /><br />
		' . (!empty($notes) ? $l['install_notes'] . ' : <br />
		<div class="sai_notes">' . softparse($notes, $cid) . '</div><br /><br />' : '') . '
		' . $l['please_note'] . '<br /><br />
		' . $l['regards'] . ',<br />
		' . $l['softinstaller'] . '<br /><br />
		<center><b><a href="' . $globals['ind'] . 'act=classes&cid=' . $cid . '">' . $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'] .= '
	</div><!--end of bg class--><!--PROC_DONE-->
	<br /><br /><br /><br />
';
    }
    softheader($l['<title>'] . $software['name']);
    $loadedinfo = array('install', 'overview', 'file', 'reviews', '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 language="JavaScript" id="file_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();');

function loadraterev(){
	$_('ratings_js_file').src = '<?php 
    echo $globals['api_nuphp2'] . 'rating.php?cid=' . $cid . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '&rating=1';
    ?>
';
	$_('review_js_file').src = '<?php 
    echo $globals['api_nuphp2'] . 'review.php?cid=' . $cid . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '&review=1';
    ?>
';
	$_('reviews_js_file').src = '<?php 
    echo $globals['api_nuphp2'] . 'reviews.php?cid=' . $cid . '&user='******'name'] . '&timezone=' . $globals['timezone'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '&reviews=1';
    ?>
';
	if(tabs.inittab == 'file'){
	filecodeview.loadDirStruct();
}

}
</script>
<?php 
    $url = $theme['images'];
    $ratings = array();
    $deduct = 1;
    $r = $software['ratings'];
    for ($i_r = 1; $i_r <= 5; $i_r++) {
        if ($r >= 1) {
            $ratings[$i_r] = '<img src="' . $url . 'star.png' . '" alt="(' . number_format($software['ratings'], 2) . ' out of 5)" />';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($software['ratings'], 2) . ' out of 5)" />';
        } else {
            $ratings[$i_r] = '<img src="' . $url . 'nostar.png' . '" alt="(' . number_format($software['ratings'], 2) . ' out of 5)" />';
        }
        $r = $r - $deduct;
    }
    echo '
<div class="bg">
	<div id="currentrating" style="display:none"></div>
	
	<div class="row" style="margin-left:-5px;">
		<span class="sai_process_heading" colspan="4">' . $software['name'] . '</span>
	</div><br />
	<div class="row">
		<div class="col-sm-3"><div class="someclass" title="' . $scripts[$k]['ratings'] . '">' . implode('', $ratings) . '</div></div>
		<div class="col-sm-4">
			' . $l['software_ver'] . ' : <span class="sai_head"><font size="4">' . $software['version'] . '</font></span> &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">
			' . $l['software_category'] . ' : <span class="sai_head"><font size="4">' . $l['classes_' . $software['category']] . '</font></span>
		</div>
	</div><br />
	
	<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(\'file\'); filecodeview.loadDirStruct();" class="sai_tab" id="file">' . $l['file'] . '</a></td>
			' . (empty($globals['off_rating_link']) ? '<td><a href="javascript:tabs.tab(\'ratings\')" class="sai_tab" id="ratings">' . $l['ratings'] . '</a></td>' : '') . '
			' . (empty($globals['off_review_link']) ? '<td><a href="javascript:tabs.tab(\'reviews\')" class="sai_tab" id="reviews">' . $l['reviews'] . '</a></td>' : '') . '
		</tr>
	</table><br />';
    ?>
	<script type="text/javascript">
	$_(tabs.inittab).className = tabs.tabbedclass;
	var softid = <?php 
    echo $cid;
    ?>
;

	tabs.override = function(id){
		if(id == 'install'){
			$_('install').className = 'sai_insbutclicked';
		}else{		
			$_('install').className = 'sai_insbut';
		}
	};
	</script>
	<?php 
    //Parse and take care of images
    $info['overview'] = '<table width="100%" cellpadding="8" cellspacing="1" border="0">
	<tr>
		<td valign="top" style="padding:10px;">
			' . softparse($info['overview'], $cid) . '<br /><br />
			<table width="100%" cellpadding="4" cellspacing="1" border="0">
				<tr>
					<td width="52" valign="top" align="center"><font color="#447edf"><i class="fa sai-disk fa-3x"></i></font></td>
					<td valign="top">
						<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>
					</td>
				</tr>
				<tr>
					<td valign="top" align="center"><a href="' . $info['support'] . '"><font color="#447edf"><i class="fa sai-question fa-3x"></i></font></a></td>
					<td valign="top">
						<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>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	</table>';
    if (!empty($installations)) {
        $info['overview'] .= '<br /><br />
			<div class="sai_sub_head" align="center">' . $l['current_ins'] . '</div><hr>';
        $info['overview'] .= '<table border="0" cellpadding="5" cellspacing="0" width="100%" class="table table-hover">
			<tr>
				<thead class="sai_head2" style="background:#333; color:#fff;">
					<th><b>' . $l['link'] . '</b></th>
					<th width="180"><b>' . $l['ins_time'] . '</b></th>
					<th width="80"><b>' . $l['version'] . '</b></th>
					<th width="120"><b>' . $l['remove'] . '</b></th>
					<th width="50"><input type="checkbox" id="check_all_classes"></th>
				<thead>
			</tr>';
        foreach ($installations as $ik => $iv) {
            $info['overview'] .= '<tr>
				<td>' . $iv['softpath'] . '</td>
				<td width="180">' . datify($iv['itime']) . '</td>
				<td width="80">' . $iv['ver'] . ($software['ver'] != $iv['ver'] && file_exists($software['path'] . '/upgrade.xml') ? ' <a href="' . $globals['ind'] . 'act=upgrade&cinsid=' . $ik . '"><img src="' . $theme['images'] . 'updates.gif" alt="' . $l['upd_to'] . ' ' . $scripts[$cid]['ver'] . '" /></a>' : '') . '</td>
				<td width="120"><a href="' . $globals['ind'] . 'act=classes_remove&cinsid=' . $ik . '" title="' . $l['remove'] . '"><img src="' . $theme['images'] . 'remove.gif" /></a></td>
				<td width="50"><input type="checkbox" class="check_all_classes" name="insids[]" value="' . $ik . '"></td>
			</tr>';
        }
        $info['overview'] .= '</table><br />
			<p align="right">
				' . $l['with_selected'] . ': 
				<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" class="sai_graybluebut" value="' . $l['go'] . '" onclick="show_confirm()">
				<br />
			</p>
			<div id="rem_div"></div>
		
	<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=classes_remove&cinsid="+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+ "<br /></p>";
				return true;
			}catch(e){
				return false;
			}
		}
		$_("rem_div").innerHTML = "";
		alert("' . $l['inst_remvd'] . '");
		location.reload(true);
		return true;
	}
	$(document).ready(function(){

		$(".sai_altrowstable tr").mouseover(function(){
			var old_class = $(this).attr("class");
			//alert(old_class);
			$(this).attr("class", "sai_tr_bgcolor");
			
			$(this).mouseout(function(){
				$(this).attr("class", old_class);
			});
		});

	});

	// ]]></script>';
    }
    $info['file'] = '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

	var filecodeview = {
		dir : "",
		data_obj : ' . $software['dirstruct'] . ',
		
		loadDirStruct : function(direction){
				var size = new Number((' . $software['zip_size'] . '/1024)+"").toFixed(parseInt(2));
				size = size+" kb";
				var right = "right";
				var back_path_div = \'<table border="0" width="100%"><tr><td><a href="javascript:void(0);" onclick="filecodeview.loadDirStruct(\\\'\'+right+\'\\\');" style="font-size:15px;color:#09F;text-decoration:none;">' . $software['name'] . '</a>&nbsp;&nbsp;/&nbsp;&nbsp;<div id="back_path" style="display:inline;"></div></td><td align="right" width="33%"><a href="' . $globals['api_nuphp'] . 'download.php?cid=' . $cid . '&file=package" taget="_blank" style="text-decoration:none">' . $l['download_zip'] . '&nbsp;(\'+size+\')&nbsp;<img src="' . $theme['images'] . 'zip.gif" alt="Download" title="Download" height="35px" width="30px"></a></td></tr></table><div id="soft_dir"></div>\';
				 $("#file_win").html(back_path_div);
				 var soft_dirs = \'<table border="0" cellpadding="10" cellspacing="0" width="100%" class="table table-hover"><th width="50%" class="sai_exp2">' . $l['files'] . '</th><th width="25%" class="sai_exp2">' . $l['size'] . '</th><th width="25%" class="sai_exp2" colspan="2">' . $l['modified_time'] . '</th>\';
				var tr_i = 1;
				 $.each(filecodeview.data_obj, function (i, item) {
					 
					if(tr_i % 2 == 0){
						tr_class = "sai_evenrowcolor";
					}else{
						tr_class = "sai_oddrowcolor";
					}
					
					var download_td = "<td></td>";
					
					if(item.is_dir == 1){
						var file_ext_ico = "dir.png";
					}else{
						var file_ext_ico = "txt.png";
						download_td = \'<td><a href="' . $globals['api_nuphp'] . 'download.php?cid=' . $cid . '&file=\'+i+\'" taget="_blank" style="text_decoration:none";><img src="' . $theme['images'] . 'downloadbutton.png" alt="Download" title="Download" height="20px" width="20px"></a></td>\';
					}
					var size = new Number((item.size/1024)+"").toFixed(parseInt(2));
					size = size+" kb";
					if(item.modified == "" || typeof(item.modified) == "undefined"){
						var m_time = "--";
					}else{
						var m_time = filecodeview.timeConverter(item.modified);
					}
					
					if(i.search("/") <= 0){
						var right = "right";
						soft_dirs += \'<tr class=\'+tr_class+\'><td><img src="' . $theme['images'] . '\'+file_ext_ico+\'" width="20px" height="20px"/>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="filecodeview.show_tree(\\\'\'+i+\'\\\', \\\'\'+right+\'\\\');" style="text-decoration:none;">\'+i+\'</td><td>\'+size+\'</td><td>\'+m_time+\'</td>\'+download_td+\'</tr>\';
						tr_i += 1;
					}
										
				 });// end of each loop

			soft_dirs += "</table>";
			
			$("#soft_dir").css("display", "none");
			$("#soft_dir").html(soft_dirs);
			$("#soft_dir").show("slide", {direction : "left"}, 700);
		
			$(".sai_altrowstable tr").mouseover(function(){
				var old_class = $(this).attr("class");
				//alert(old_class);
				$(this).attr("class", "sai_tr_bgcolor");
				
				$(this).mouseout(function(){
					$(this).attr("class", old_class);
				});
			});
			 
		}, // End of loadDirStruct

		show_tree : function(current, direction){
		//alert(current);
			if(filecodeview.data_obj[current].is_dir == 0){
				var size = new Number((filecodeview.data_obj[current].size/1024)+"").toFixed(parseInt(2));
				size = size+" kb";
				download_td = \'<a href="' . $globals['api_nuphp'] . 'download.php?cid=' . $cid . '&file=\'+current+\'" taget="_blank" style="text_decoration:none";><img src="' . $theme['images'] . 'downloadbutton.png" alt="Download" title="Download" height="20px" width="20px"></a>\';
				var soft_file = \'<div style="height:600px;width:100%;"><div style="background-color:#E8E8E8;box-shadow: 0 5px 5px 0 #CCCCCC;text-shadow: 2px 2px 2px #FFFFFF;padding:10px;font-size:13px;">\'+current.substr((current.lastIndexOf("/")+1))+\'&nbsp;&nbsp;<img src="' . $theme['images'] . 'action_separator.png">&nbsp;&nbsp;\'+size+\'&nbsp;&nbsp;<img src="' . $theme['images'] . 'action_separator.png">&nbsp;&nbsp;\'+download_td+\'</div><iframe src="' . $globals['api_nuphp'] . 'file_giver.php?cid=' . $cid . '&giveinfo=codeview&file=\'+current+\'" width="100%" height="100%" frameborder="0" class="sai_iframe_class" id="filecode"></iframe></div>\';
				//$("#soft_dir").css("display", "none");
				$("#soft_dir").html(soft_file);
				$("#soft_dir").show("slide", {direction : "right"}, 700);
				
			}else{
				
				var soft_dirs = \'<div id="back_path" ></div><table border="0" cellpadding="10" cellspacing="0" width="100%" class="table table-hover"><tr><th width="50%" class="sai_exp2">' . $l['files'] . '</th><th width="25%" class="sai_exp2">' . $l['size'] . '</th><th width="25%" class="sai_exp2" colspan="2">' . $l['modified_time'] . '</th></tr>\';
			 var tr_i = 1;
			 $.each(filecodeview.data_obj, function (i, item) {
				 
				if(tr_i % 2 == 0){
					tr_class = "sai_evenrowcolor";
				}else{
					tr_class = "sai_oddrowcolor";
				}
				
				var download_td = "<td></td>";
				if(item.is_dir == 1){
					var file_ext_ico = "dir.png";
				}else{
					var file_ext_ico = "txt.png";
					download_td = \'<td><a href="' . $globals['api_nuphp'] . 'download.php?cid=' . $cid . '&file=\'+i+\'"><img src="' . $theme['images'] . 'downloadbutton.png" alt="Download" title="Download" height="20px" width="20px"></a></td>\';
				}

				var rgxp = new RegExp("^"+current, "i");
				var rgxpnot = new RegExp("^"+current+"/(.*)/(.*)", "gi");
				if(i.match(rgxpnot)){
					return;
				}
				
				if(i.match(rgxp)){
					// This new_i is defined because we are changing the value of i for display purpose
					var new_i = i;
					// We are adding / to i bcoz same filename as folder should not be replaced otherwise only extension will be displayed
					if(item.is_dir == 1){
						i = i + "/";
					}
					
					// If we are not in the directory why should we go ahead right !!
					if(!i.match(current+"/")) return;
					
					i = i.replace(current+"/","");
					
					var size = new Number((item.size/1024)+"").toFixed(parseInt(2));
					size = size+" kb";
					if(item.modified == "" || typeof(item.modified) == "undefined"){
						var m_time = "--";
					}else{
						var m_time = filecodeview.timeConverter(item.modified);
					}
					
					// Now count the / occured bcoz only the current folder we have to display
					var count_i = i.split("/");
					// For checking the right file to be displayed
					if((count_i.length) <= 2 && i.length > 0){
						
						var right = "right";
						soft_dirs += \'<tr class=\'+tr_class+\'><td><img src="' . $theme['images'] . '\'+file_ext_ico+\'" width="20px" height="20px"/>&nbsp;<a href="javascript:void(0)" onclick="filecodeview.show_tree(\\\'\'+new_i+\'\\\', \\\'\'+right+\'\\\');" style="text-decoration:none;">\'+i+\'</td><td>\'+size+\'</td><td>\'+m_time+\'</td>\'+download_td+\'</tr>\';
						tr_i += 1;
					}
				}
									
			 });// end of each loop
		
				soft_dirs += "</table>";
				var seperated_path = new Array();
				var new_joined_path = "";
				var final_path = "";
				if(current.search("/") >= 0){
					
					var new_back_path = current.substr(current.lastIndexOf("/"));
					seperated_path = current.split("/");
					for(var i = 0; i < (seperated_path.length); i++){
						if(i>0){
							var seperator = "/";
						}else{
							var seperator = "";
						}
						var left = "left";
						new_joined_path += seperator+seperated_path[i]; 
						final_path += \'<a href="javascript:void(0);" onclick="filecodeview.show_tree(\\\'\'+new_joined_path+\'\\\', \\\'\'+left+\'\\\');" style="font-size:16px;color:#09F;text-decoration:none;">\'+seperated_path[i]+\'</a>&nbsp;&nbsp;/&nbsp;&nbsp;\';
					}
					
				}else{
					var left = "left";
					var new_back_path = current;
					final_path += \'<a href="javascript:void(0);" onclick="filecodeview.show_tree(\\\'\'+current+\'\\\', \\\'\'+left+\'\\\');" style="font-size:16px;color:#09F;text-decoration:none;">\'+current+\' </a>\';	
				}
				
				
				
				
				$("#back_path").html(final_path);
				$("#soft_dir").css("display", "none");
				$("#soft_dir").html(soft_dirs);
				$("#soft_dir").show("slide", {direction : direction}, 700);
				
				
			}// End of else
			$(".sai_altrowstable tr").mouseover(function(){
					var old_class = $(this).attr("class");
					//alert(old_class);
					$(this).attr("class", "sai_tr_bgcolor");
					
					$(this).mouseout(function(){
						$(this).attr("class", old_class);
					});
				});
		}, //End of show_tree
		
		timeConverter : function(timestamp){
			
			 var a = new Date(timestamp*1000);
			 var months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
			 var year = a.getFullYear();
			 var month = months[a.getMonth()];
			 var date = a.getDate();
			 var hour = a.getHours();
			 var min = a.getMinutes();
			 var sec = a.getSeconds();
			 var time = date+","+month+" "+year+" "+hour+":"+min+":"+sec ;
			 return time;
		 }
		 
	};// end of filecodeview

	// ]]></script>';
    $info['ratings'] = '';
    $info['reviews'] = '<div id="allreviews"></div>';
    foreach ($info as $k => $v) {
        if (in_array($k, array('demo', 'support'))) {
            continue;
        }
        echo '<div id="' . $k . '_win" style="display: ' . ($init_tab == $k ? "block" : "none") . ';">
		' . $v . '
		</div>';
    }
    echo '</div><!--end of bg class-->';
    softfooter();
}
Exemple #11
0
function csf_conf_theme()
{
    global $user, $globals, $iscripts, $l, $theme, $softpanel, $csf_conf, $done, $error;
    // For Updating Entire File
    if (optGET('ajaxcsf')) {
        // Error
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Success
        if (!empty($done)) {
            echo '1' . $l['change_final_file'];
            return true;
        }
    }
    softheader($l['<title>']);
    error_handle($error, '100%');
    $linecount = count($csf_conf['all']);
    echo '<center><div class="sai_heading"><img src="' . $theme['a_images'] . 'firewalls.gif"  alt=""  />&nbsp;' . $l['lbl_head'] . '</div>
	<form accept-charset="' . $globals['charset'] . '" name="editemailsettings" method="post" action="" id="editcsf">
	<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding:15px;" >	
		<tr>
			<td>
				<span class="sai_head">' . $l['file_part'] . '</span>&nbsp;&nbsp;<br />
			</td>	
			<td>
				<select class="input" name="select_section" id="select_section">';
    echo '<option value=all>All</option>';
    foreach ($csf_conf['part'] as $key => $value) {
        $test = explode(" ", $value['name']);
        echo '<option value=' . trim($test[0]) . '-' . trim($test[1]) . '>' . $value['name'] . '</option>';
    }
    echo '</select> &nbsp;<img id="create_err_log" src="' . $theme['images'] . 'progress.gif" style="display:none"></td>	
		</tr>				
	</table>
	<br /><br />
	<div id="all" style="height:400px; width:700px; overflow:auto; border: 2px solid #CCC; margin:0px auto;" class="ContentDivs">
		<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad">
			<tr>
				<td style="background-color:#CCC;vertical-align:top;font-size:12px;">';
    for ($i = 1; $i <= $linecount; $i++) {
        echo $i . "<br />";
    }
    echo '</td>
			<td nowrap="nowrap"><textarea style=" overflow:hidden; font-size:12px; border:none; resize: none;" WRAP=OFF name="csf_data_all" id="csf_data_all" rows=' . $linecount . ' cols=120 >' . htmlentities(implode($csf_conf['all']), ENT_QUOTES, "UTF-8") . '</textarea>
				</td>
			</tr>
		</table>
	</div>';
    foreach ($csf_conf['part'] as $key => $value) {
        $test = explode(" ", $value['name']);
        $parts = trim($test[0]) . '-' . trim($test[1]);
        echo '<div id=' . $parts . ' style="height:400px; width:700px; overflow:auto; border: 2px solid #CCC; margin:0px auto; display:none;" class="ContentDivs" >
		<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad">
			<tr>
				<td style="background-color:#CCC;vertical-align:top;font-size:12px;">';
        $k = 0;
        for ($i = $value['startpoint']; $i <= $value['endpoint']; $i++) {
            echo $i . "<br />";
            $temp_data[$parts][$k] = $csf_conf['all'][$i];
            $k++;
        }
        echo '</td>
			<td nowrap="nowrap"><textarea style=" overflow:hidden; font-size:12px; border:none; resize: none;" WRAP=OFF name="csf_data_' . $parts . '" id="csf_data_' . $parts . '" rows=' . count($temp_data[$parts]) . ' cols=120 >' . htmlentities(implode($temp_data[$parts]), ENT_QUOTES, "UTF-8") . '</textarea>
				</td>
			</tr>
		</table>
	</div>';
    }
    echo '<p align="center">
		<input type="submit" value="' . $l['save'] . '" name="savecsf" class="sai_graybluebut" id="savecsf" /> &nbsp;<img id="save_csf" src="' . $theme['images'] . 'progress.gif" style="display:none">
	</p><br />
	<p align="center">' . $l['note'] . '</p>
	</form>';
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
		
	$(document).ready(function(){
		
		// For 
		$("#select_section").change( function() {
			var new_id = $("#select_section").val();
			$(".ContentDivs:visible").fadeOut("fast");
			$("#"+new_id).fadeIn("slow");
		});				
			
		// For updating entire file
		$("#savecsf").click(function(){
			
			$("#save_csf").css("display", "");
			var new_id = $("#select_section").val();		
			
			$.ajax({
				type: "POST",
				url: window.location+"&ajaxcsf=1&savecsf=1",
				data: "csfdata=csf_data_"+new_id+"&"+$("#editcsf").serialize(),
				
				// Checking for error
				success: function(data){
					$("#save_csf").css("display", "none");
					var result = data.substring(0,1);
					if(result == "1"){
						var msg = data.substring(1);
						message_box.show_message( "Done ",msg,2);
					}
					if(result == "0"){
						var msg = data.substring(1);
						message_box.show_message( "Error",msg,1);
					}
				},
				error: function(){
					message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);
				}
			});
			return false;
		});
	});
	
	var message_box = function(){
		return {
			show_message: function(title, body , image) {
				var okbutton = \'<input  style="width:75px" class="sai_submit" type="button" onclick="message_box.close_message();" value="OK" />\';
				if(image == "1"){
					var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
				}else{
					var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';
				}
									
				if(jQuery(\'.sai_message_box\').html() === null) {
					var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
					jQuery(document.body).append( message );
					jQuery(".sai_message_box").css("top", jQuery("html, body").scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
				}else{
					var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
					jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
					jQuery(\'.sai_message_box\').html( message );
				}
			},
			close_message: function() {
				jQuery(\'.sai_message_box\').hide(\'fast\');
				window.location=window.location;
			}
		}
	}();
		
	// ]]></script>';
    softfooter();
}
Exemple #12
0
function listdomains_theme()
{
    global $theme, $globals, $user, $l, $langs, $error, $done, $softpanel, $listdomains;
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['delete'];
            return true;
        }
    }
    // Ajax part for update privaliges
    if (optGET('ajaxedit')) {
        if (!empty($error)) {
            echo '0 ' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['domain_edited'];
            showdomains();
            return true;
        }
    }
    // Privaliges page for popup
    if (optGET('editdomain')) {
        $eowner = POST('owner');
        $eusername = POST('username');
        $edomain = POST('domain');
        $epath = POST('path');
        $ereplace_path = POST('replace_path');
        $ebackup_dir = POST('backup_dir');
        $edata_dir = POST('data_dir');
        echo '<style type="text/css">
		.ui_titlebar {
			padding: 0.4em 1em;
			background-color: #CCCCCC;
			border: 1px solid #AAAAAA;
			color: #222222;
			font-weight: bold;
			border-radius: 4px;
		}
		
		.sai_popup_add {
			width:500px;
			height:460px;
			position:absolute;
			top:50%;
			left:50%;
			margin:0 auto;
			display:none;
			background:#FFFFFF;
			border:#666 1px solid;
			padding:5px;
		}
		
		.close {
			float:right;
			position:relative;
			z-index:99999;
			margin:3px 6px 0;
		}
		#scroller-body {		
			width=100%;
			padding-bottom:30px;
			height: 100%;
		}
	</style>
	<script language="javascript" type="text/javascript" ><!-- // --><![CDATA[	
		$(document).ready(function(){
			
			$("#submitdomain").click(function() {
			
				var eusername = $("#eusername").val();
				var edomain = $("#edomain").val();
				var oldedomain = $("#oldedomain").val();
				var epath = $("#epath").val();
				var ereplace_path = $("#ereplace_path").val();
				var ebackup_dir = $("#ebackup_dir").val();
				var edata_dir = $("#edata_dir").val();
				
				$("#comsg").css("display", "none");
				$("#ermsg").css("display", "none");
				
				var w_l = window.location.toString();
				if(w_l.indexOf("#") > 0){
					w_l = w_l.substring(0, w_l.indexOf("#"));
				}
				$.ajax({
					type: "POST",
					url: w_l+"&submitdomain=1&ajaxedit=1",
					data: "feusername="******"&fedomain="+edomain+"&foldedomain="+oldedomain+"&fepath="+epath+"&fereplace_path="+ereplace_path+"&febackup_dir="+ebackup_dir+"&fedata_dir="+edata_dir,
					
					// checking for error
					success: function(data){
						var result = data.substring(0,1);
						if(result == "1"){
						var msg = data.substring(1,data.indexOf("<table"));
						var output = data.substring(data.indexOf("<table"));
							$(".sai_popup_add")
								.css({"height" : "480px"});
							$("#comsg").css("display", "");
							$("#comsg").html(msg);
							$("#showdomaintab").html(output);
							$(".sai_altrowstable tr").mouseover(function(){
								var old_class = $(this).attr("class");		
								$(this).attr("class", "sai_tr_bgcolor");		
								$(this).mouseout(function(){
									$(this).attr("class", old_class);
								});
							});
						}
						if(result == "0"){
							var msg = data.substring(1);
							$("#ermsg").css("display", "");
							$("#ermsg").html(msg);
						}
					},
					error: function(ts,errorThrown) {
						message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);
					}
				});
			});
		});
	// ]]></script>';
        echo '<div class="ui_titlebar" style="width:95%" >
			<a title="Close" class="close"><img src="' . $theme['images'] . 'remove.gif" style="cursor:pointer; float:right;" alt="close" height="20" width="20" onclick="popup_close();" /></a>			
			<center class="sai_tit"><img src="' . $theme['images'] . 'domains.gif" />&nbsp; Edit ' . $edomain . '</center>
			<center id="comsg" style="display:none" class="sai_notice"></center>
			<center id="ermsg" style="display:none; background-color: #FF9999;" class="sai_notice" ></center>		
		<form accept-charset="' . $globals['charset'] . '" name="importsoftware" method="post" action="" ></div>';
        echo '<table border="0" cellpadding="8" cellspacing="8" width="99%" class="sai_divroundshad">
			<tr>
				<td width="50%">
					<span class="sai_head">' . $l['eusername'] . '</span><br />
					<span class="sai_exp2">' . $l['exp_eusername'] . '</span>
				</td>
				<td valign="top">
					<input type="text" id="eusername" name="eusername" size="40" value="' . $eusername . '">
				</td>
			</tr>
			<tr>
				<td width="50%">
					<span class="sai_head">' . $l['edomain'] . '</span><br />
					<span class="sai_exp2">' . $l['exp_edomain'] . '</span>
				</td>
				<td valign="top">
					<input type="text" id="edomain" name="edomain" size="40" value="' . $edomain . '">
					<input type="hidden" id="oldedomain" name="oldedomain" value="' . $edomain . '">
				</td>
			</tr>
			<tr>
				<td width="50%">
					<span class="sai_head">' . $l['epath'] . '</span><br />
					<span class="sai_exp2">' . $l['exp_epath'] . '</span>
				</td>
				<td valign="top">
					<input type="text" id="epath" name="epath" size="40" value="' . $epath . '">
				</td>
			</tr>
			<tr>
				<td width="50%">
					<span class="sai_head">' . $l['ebackup_dir'] . '</span><br />
					<span class="sai_exp2">' . $l['exp_ebackup_dir'] . '</span>
				</td>
				<td valign="top">
					<input type="text" id="ebackup_dir" name="ebackup_dir" size="40" value="' . $ebackup_dir . '">
				</td>
			</tr>
			<tr>
				<td width="50%">
					<span class="sai_head">' . $l['ereplace_path'] . '</span><br />
					<span class="sai_exp2">' . $l['exp_ereplace_path'] . '</span>
				</td>
				<td valign="top">
					<input type="text" id="ereplace_path" name="ereplace_path" size="40" value="' . $ereplace_path . '">
				</td>
			</tr>
			<tr>
				<td width="50%">
					<span class="sai_head">' . $l['edata_dir'] . '</span><br />
					<span class="sai_exp2">' . $l['exp_edata_dir'] . '</span>
				</td>
				<td valign="top">
					<input type="text" id="edata_dir" name="edata_dir" size="40" value="' . $edata_dir . '">
				</td>
			</tr>
			</table>';
        echo '</div>';
        echo '<p align="center"><input type="button" class="sai_graybluebut" id="submitdomain" style="cursor:pointer" name="submitdomain" value="' . $l['submitdomain'] . '" /></p>
		</form> ';
        return true;
    }
    softheader($l['<title>']);
    echo '<br /><form accept-charset="' . $globals['charset'] . '" name="listuser" method="post" action="">
<div id="scroller-body">
<div class="sai_heading" align="center"><img src="' . $theme['images'] . 'admin/addplan.gif" />&nbsp; ' . $l['title'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br /><br />';
    error_handle($error);
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
		
// Function for close popup
function popup_close(){
	$(".sai_popup_add").fadeOut(1000);
	$("#comsg").css("display", "none");
	$("#ermsg").css("display", "none");
};

// Function for show popup
function show_popup(domain){
	var obj = JSON.parse(domain);			 																
	var height = $("#scroller-body").height();
	var width = $("#scroller-body").width();
	var spanHeight = 50;
	var spanWidth = 50;	
	var w_l = window.location.toString();				
	if(w_l.indexOf("#") > 0){
		w_l = w_l.substring(0, w_l.indexOf("#"));
	}					
	$.ajax({
		type: "POST",
		url: w_l+"&editdomain=1",					
		data: "owner="+obj.owner+"&username="******"&domain="+obj.domain+"&path="+obj.path+"&replace_path="+obj.replace_path+"&backup_dir="+obj.backup_dir+"&data_dir="+obj.data_dir+"&username="******".sai_popup_add").html(data);
		},
		error: function() {
			message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
		}	
	});
	setTimeout(function() {
		display();
	},1000);
};	

function display(){
	$(".sai_popup_add")
		.css({"margin-left" : "-250px"})
		.css({"margin-top" : "-150px"})
		.fadeIn(500);
};
	
// For msgbox
var message_box = function() {			
	return {
		show_message: function(title, body , image) {			
			var okbutton = \'<input  style="width:75px" class="sai_graybluebut" type="button" onclick="message_box.close_message();" value="OK" />\';
			if(image == "1"){
				var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
			}else{
				var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
			}					
			if(jQuery(\'.sai_message_box\').html() === null) {
				var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
				jQuery(document.body).append( message );
				jQuery(\'.sai_message_box\').css(\'top\', scrolledy() + 150);							
				jQuery(\'.sai_message_box\').show(\'slow\');
			}else{
				var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';
				jQuery(\'.sai_message_box\').css(\'top\', scrolledy() + 150);
				jQuery(\'.sai_message_box\').show(\'slow\');
				jQuery(\'.sai_message_box\').html( message );
			}
		},
		delete_message: function(title, body ,did) {
			var yesbutton = \'<input type="button" style="width:75px" onclick="message_box.yes_close_message(\\\'\'+did+\'\\\');" value="YES" class="sai_graybluebut"/>\';
			var nobutton = \'<input type="button" style="width:75px" onclick="message_box.no_close_message();" value="NO" class="sai_graybluebut" />\';
			var img = \'<img src="' . $theme['images'] . 'remove_big.gif" />\';
			if(jQuery(\'.sai_message_box\').html() === null) {
				var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1" height="10%">\' +  title + \'</td></tr><tr ><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table></div>\';
				jQuery(document.body).append( message );
				jQuery(\'.sai_message_box\').css(\'top\', scrolledy() + 150);							
				jQuery(\'.sai_message_box\').show(\'slow\');
			}else{
				var message = \' <table  border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1" height="10%">\' + title + \'</td></tr><tr><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table>\';
				jQuery(\'.sai_message_box\').css(\'top\', scrolledy() + 150);
				jQuery(\'.sai_message_box\').show(\'slow\');
				jQuery(\'.sai_message_box\').html( message );
			}
		},
		close_message: function() {
			jQuery(\'.sai_message_box\').hide(\'fast\');
		},
		yes_close_message: function(did) {
			$(\'#did\'+did).attr("src","' . $theme['images'] . 'progress.gif");						
			jQuery(\'.sai_message_box\').hide(\'fast\');
			var deltmp = did.split("--soft--");
			$.ajax({				
				type: "POST",				
				url: window.location+"&ajaxdel=1&deletedomain=1&deluser="******"&delowner="+deltmp[0]+"&deldomain="+deltmp[2],
				// checking for error
				success: function(data){
					var result = data.substring(0,1);					
					var msg = data.substring(1);
					if(result == "1"){
						message_box.show_message("Delete ", msg, 2);
						$_("tr"+did).style.display = "none";
					}
					if(result == "0"){
						message_box.show_message("Error ", msg, 1);
					}
				},				
				error: function(request,error) {
					message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);					
				}
			});					
		},
		no_close_message: function() {
			jQuery(\'.sai_message_box\').hide(\'fast\');			
		}
	}
}();
	
$(document).ready(function(){
	$(".sai_altrowstable tr").mouseover(function(){
		var old_class = $(this).attr("class");
		$(this).attr("class", "sai_tr_bgcolor");
		$(this).mouseout(function(){
			$(this).attr("class", old_class);
		});
	});
	
	// For deleting record
	$(".delete").click(function() {
		var did = $(this).attr(\'id\');
		did = did.substr(3);
		var tmp_ress = did.split("--soft--");
		message_box.delete_message (\'Warning\',\'' . $l['del_domain'] . '\'+tmp_ress[2]+\' ?\', did);			
	});
	
	// Cancel
	$(".cancel").click(function() {
		var cid = $(this).attr(\'id\');
		cid = cid.substr(3);
		$("#cid"+cid).css("display", "none");
		$("#eid"+cid).attr("src","' . $theme['images'] . 'editdetail.gif");
		$("#nof_entry"+cid).css("display", "none");
		$("#nof"+cid).css("display", "");
		if(' . ent() . '){
				$("#uid_entry"+cid).css("display", "none");
				$("#uid"+cid).css("display", "");
				$("#gid_entry"+cid).css("display", "none");
				$("#gid"+cid).css("display", "");
		}
	});
});
	
// ]]></script>';
    echo '<link href="https://www.softaculous.net/images/sprites/20.css" rel="stylesheet" type="text/css" />
<table width="721" cellpadding="6" cellspacing="0" border="0" style="margin:0px auto;" class="sai_reviewform">
	<tr>
	<td colspan="2">
		<table class="sai_ribboneffect" width="107%" style="left:-21px;" border="0"> 
			<tr>
				<td width="2%"></td>
				<td valign="top"><br />
					<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['user_details'] . '</b></font> 
				</td>
			</tr>
		</table>';
    if (!empty($listdomains)) {
        echo '<div class="sai_popup_add"></div>
		<div id="showdomaintab" class="showdomaintab">';
        showdomains();
        echo '</div>';
    } else {
        echo '<div class="sai_notice">' . $l['no_domains'] . '</div>';
    }
    echo '</td>
	</tr>
	<tr>
		
	</tr>
	</td>
	</tr>
	<tr><td></td></tr>
</table>
<br/>
<p align="center"><a href="' . $globals['ind'] . 'act=adddomain" style="text-decoration:none;"><span class="sai_graybluebut">Add Domain</a></p>
</div>
</form>';
    softfooter();
}
Exemple #13
0
# SOFTACULOUS RESELLER PANEL IS DISABLED
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (!empty($globals['disable_reseller_panel']) && defined('SOFTRESELLER')) {
    reporterror($l['disable_reseller_admin_t'], $l['disable_reseller_admin'], $l['disable_reseller_admin_t']);
}
//////////////
// LETS START
//////////////
// Is it an API call ??
if (isset($_GET['api'])) {
    $globals['theme_folder'] = 'api';
}
$start_time = microtime_float();
//Time Stops for no one
if (empty($act)) {
    $act = optGET('act');
}
switch ($act) {
    //The DEFAULT Page
    default:
        include_once $globals['adminfiles'] . '/adminindex.php';
        adminindex();
        break;
        //The categories
    //The categories
    case 'categories':
        include_once $globals['adminfiles'] . '/categories.php';
        categories();
        break;
        //The Settings
    //The Settings
function apps_installations_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $error, $apps;
    if (!empty($user['apps_ins']) && optGET('api')) {
        _api($user['apps_ins'], optGET('api'));
        return;
    }
    softheader($l['<title>']);
    error_handle($error, '100%');
    if (optGET('showupdates')) {
        echo '<center class="sai_anotice">
<a href="' . $globals['ind'] . 'act=apps_installations">' . $l['showing_only'] . ' ' . $l['see_all'] . '</a>
</center>
<br />';
    }
    // For APPS INSTALLATION LIST
    ksort($user['apps_ins']);
    echo '<br /><br /><center>
	<span class="sai_newhead">' . $l['apps_ins'] . '</span>
</center><br /><br />';
    echo '<table border="0" cellpadding="2" cellspacing="0" width="100%" >
<tr>
	<td><b>' . $l['path'] . '</b></td>
	<td width="180"><b>' . $l['ins_time'] . '</b></td>
	<td width="80"><b>' . $l['version'] . '</b></td>
	<td width="120"><b>' . $l['options'] . '</b></td>
</tr>
</table>
';
    $i = 1;
    $th = 0;
    if (count($user['apps_ins']) > 0) {
        //r_print($user['apps_ins']);
        echo '<table border="0" cellpadding="5" cellspacing="0" width="100%" class="sai_altrowstable">';
        foreach ($user['apps_ins'] as $k => $v) {
            foreach ($v as $ik => $iv) {
                if ($th == 0) {
                    echo '<tr>
				<th colspan="5">' . $apps[$iv['aid']]['name'] . '</th>
			</tr>';
                }
                echo '<tr id="trid' . $ik . '" class="' . ($i % 2 == 0 ? "sai_evenrowcolor" : "sai_oddrowcolor") . '">
			<td>' . (empty($iv['path']['base']) ? $l['default_apps_base'] : $iv['path']['base']) . '</td>
			<td width="180">' . datify($iv['itime']) . '</td>
			<td width="80">' . $iv['version'] . '</td>
			<td width="120"><a href="' . $globals['ind'] . 'act=apps&app=' . $iv['aid'] . '" title="' . $l['remove'] . '"><img src="' . $theme['images'] . 'remove.gif" /></a>&nbsp;<input type="checkbox" name="ainsids[]" value="' . $iv['aid'] . '">
			</td>
		</tr>';
                $i++;
                $th = 1;
            }
            $th = 0;
        }
        echo '</table><br /><br />
	
<p align="right">
		' . $l['with_selected'] . ': 
		<select name="multi_options_apps" id="multi_options_apps">
			<option name="todo_apps" id="todo_apps" value="0">---</option>
			<option name="todo_apps" id="todo_apps" value="mult_rem">' . $l['remove_apps'] . '</option>
		</select>
		<input type="button" value="' . $l['go'] . '" onclick="show_confirm_apps()">
		<br />
	</p>
	<div id="rem_div_apps"></div>
	
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
ainsids = new Array();
removed = new Object();

function show_confirm_apps(){
	
	ainsids = new Array();
	removed = new Object();
	
	if($_("multi_options_apps").value != "mult_rem"){
		return false;
	}

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

function remove_by_id_apps(ainsid, re, oldainsid){

	removed[ainsid] = false;
	
	if(re.length > 0 && oldainsid > 0){
		if(re == "removed"){
			removed[ainsid] = true;
		}
	}
	
	nextainsid = 0;
	
	// Find the next INSTALLATION to remove
	for(i = 0; i < ainsids.length; i++){
		if(typeof(removed[ainsids[i]]) != "undefined"){
			continue;
		}
		nextainsid = ainsids[i];
		break;
	}
	
	// If there is something left to be removed
	if(ainsid != 0){
		try{
			AJAX("' . $globals['index'] . 'act=apps&app="+ainsid+"&remove=1&ajax=1&random="+Math.random(), "remove_by_id_apps(\'"+nextainsid+"\', re, \'"+ainsid+"\')");
			$_("rem_div_apps").innerHTML = "<br /><br /><p align=\\"center\\"><img src=\\"' . $theme['images'] . 'ajax_remove.gif\\"> <br />' . $l['rem_inst_id'] . ' ID: " +ainsid+ "<br /></p>";
			return true;
		}catch(e){
			alert(e.description);
			return false;
		}
	}
	$_("rem_div_apps").innerHTML = "";
	alert("' . $l['inst_remvd'] . '");
	location.reload(true);
	return true;
}

// ]]></script>';
    } else {
        echo '<center>' . $l['no_ins'] . '</center>';
    }
    softfooter();
}
Exemple #15
0
function top14_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $categories, $iscripts, $updates_available, $allcatwise, $scripts, $cscripts;
    $top = array();
    foreach ($scripts as $k => $v) {
        if (empty($iscripts[$k])) {
            continue;
        }
        $top[$k] = $v['ratings'] * $v['votes'];
    }
    // Sorting according to top ratings
    arsort($top);
    //To fill up the scripts if less than 7 are selected by admin
    $ext_fill = array();
    $ext_fill = $top;
    if (file_exists($globals['path'] . '/conf/top_scripts.php')) {
        $top = unserialize(file_get_contents($globals['path'] . '/conf/top_scripts.php'));
    }
    // If Admin has checked Append scripts than only append the scripts. Otherwise Only Selected Scripts will be displayed.
    if (count($top) < 7 && !empty($globals['append_apps'])) {
        foreach ($ext_fill as $k => $v) {
            $top[$k] = $k;
        }
        array_unique($top);
    }
    //r_print($globals);
    if (!empty($globals['show_cscript_in_top'])) {
        //r_print($top_custom_list);
        foreach ($cscripts as $ck => $cv) {
            if (array_key_exists($ck, $iscripts)) {
                $top_custom[$ck] = $ck;
            }
        }
        $tmp_top = $top;
        // Do we need to add any other default scripts ?
        if (!empty($top_custom)) {
            $top = $top_custom;
        }
        if (!empty($tmp_top)) {
            $top += $tmp_top;
        }
    }
    foreach ($scripts as $k => $v) {
        // We have to remove the scripts which are not enabled AND yet coming from top_scripts.php (i.e. Admin have saved it from top scripts)
        if (!array_key_exists($k, $iscripts) && !empty($top[$k])) {
            unset($top[$k]);
        }
        if (empty($iscripts[$k]) || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
            continue;
        }
        $top[$k] = $v['ratings'] * $v['votes'];
    }
    //r_print($top);
    $updates_available = 0;
    foreach ($user['ins'] as $insid => $soft) {
        if (!empty($iscripts[$soft['sid']])) {
            if (is_upgradable($insid)) {
                $updates_available++;
            }
        }
    }
    $cat_image_path = 'themes/default/images/cats/';
    if ($globals['softpanel'] == 'directadmin') {
        $fullurl = 'CMD_PLUGINS/softaculous';
        $cat_image_path = 'images/themes/default/images/cats/';
    } elseif ($globals['softpanel'] == 'cpanel') {
        $fullurl = 'softaculous';
    } elseif ($globals['softpanel'] == 'plesk') {
        $fullurl = '/modules/softaculous';
    } else {
        $fullurl = 'http://localhost/ampps';
    }
    $cat_width = 24;
    $cat_height = 40;
    if ($globals['theme'] != 'default' && substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0) {
        $cat_image_path = 'themes/default/';
        if ($globals['softpanel'] == 'directadmin') {
            $fullurl = 'CMD_PLUGINS/softaculous';
            $cat_image_path = 'images/themes/default/';
        } elseif ($globals['softpanel'] == 'cpanel') {
            $fullurl = 'softaculous';
        } elseif ($globals['softpanel'] == 'plesk') {
            $fullurl = '/modules/softaculous';
        } else {
            $fullurl = 'http://localhost/ampps';
        }
        $cat_width = 90;
        $cat_height = 40;
    }
    $custome_width = optGET('width');
    $no_cat = !empty($globals['disable_cats']) ? $globals['disable_cats'] : optGET('nocat');
    $my_ins = !empty($globals['enable_myins']) ? $globals['enable_myins'] : optGET('noins');
    if ($globals['softpanel'] == 'plesk') {
        $width = '450px';
        $s_width = '455px';
    } else {
        $width = 'auto';
        $s_width = 'auto';
    }
    if (!empty($custome_width) && is_numeric($custome_width)) {
        $width = $custome_width . 'px';
        $s_width = $custome_width + 5 . 'px';
    }
    $str = '
<link rel="stylesheet" type="text/css" href="' . $fullurl . '/' . $cat_image_path . 'font-awesome.css?' . $GLOBALS['globals']['version'] . '" />
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="' . $fullurl . '/' . $cat_image_path . 'ie7.css?' . $GLOBALS['globals']['version'] . '">
<![endif]-->
<style type="text/css">
.top14catbg{
width:' . $cat_width . 'px;
height:' . $cat_height . 'px;
padding:5px;
margin-top:5px;
font-size:19px;
color:#348AC4;
}

#soft_div1{
font-size: 11px;
padding: 0px;
width:500px;
font-family: Verdana, Tahoma, Arial, "Trebuchet MS", "Times New Roman", Georgia, sans-serif, serif;
}

.softac_cat {
  vertical-align:middle;padding:5px;text-align:left;background-color: #DDD;
}

   
</style>';
    $url = $globals['mirror_images'];
    if ($globals['softpanel'] == 'directadmin') {
        $str .= '<img src="' . $fullurl . '/' . $theme['images'] . 'da.gif" align="left"/><br /><br /><br />
	<div style="margin-left:70px;margin-right:15px"><br /><br />';
    }
    if ($globals['softpanel'] == 'plesk') {
        $str .= '<center><img src="' . $fullurl . '/' . $theme['images'] . 'plesk.gif" /></center>';
    }
    if (!empty($updates_available)) {
        $str .= '<div style="background-color:#FAFBD9;width:auto;padding:7px;"><center>
	<a href="' . $fullurl . '/' . $globals['ind'] . 'act=installations&showupdates=true" alt="Updates" style="background-color: #FAFBD9;font-size:13px;padding:8px;text-decoration:none;"><img src="' . $fullurl . '/' . $theme['images'] . 'notice.gif" border="0" align="middle" /> &nbsp; ' . lang_vars($l['updates_available'], array($updates_available)) . '</a></center></div>';
    }
    // For Users installations
    if (!empty($my_ins)) {
        $str .= '<div class="softac_ins" style="vertical-align:middle;padding:5px;text-align:left;background-color: #EEE;width:' . $width . ';"><b>' . $l['my_installations'] . ' :</b></div>
		<table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed;" width="100%"><tr>
		<td width="15px" onmouseover="mousemove(\'softins_div\', event);" onmouseout="softstop(\'softins_div\', event);" align="center">
			<img src="' . $fullurl . '/' . $theme['images'] . 'move_left.png" alt="Left" border="0"/>
		</td>
		<td>
		<div style="overflow:hidden;display: block;width:' . $s_width . ';" id="softins_div" onclick="softstop(this.id, event);">
		<table border="0" cellpadding="7" cellspacing="3" style="table-layout:fixed;" width="100%"><tr>';
        // We want the new installations first
        $user_ins = array_reverse($user['ins']);
        foreach ($user_ins as $uk => $uv) {
            // We have to make some chnages as per the theme (i.e for x3 and paper_lantern)
            if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0) {
                $img_path = 'top15/48/' . $scripts[$uv['sid']]['softname'] . '.png';
                $td_width = 100;
                $td_height = 80;
            } else {
                $img_path = 'softimages/32/' . $uv['sid'] . '__logo.gif';
                $td_width = 50;
                $td_height = 50;
            }
            // custom scripts logos path
            if ($uv['sid'] > 10000) {
                if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 && file_exists($theme['images'] . 'topscripts/48/' . $uv['sid'] . '__logo.gif')) {
                    $cscript_img_path = 'softaculous/' . $theme['images'] . 'topscripts/48/' . $uv['sid'] . '__logo.gif"';
                } elseif (file_exists($theme['images'] . 'topscripts/32/' . $uv['sid'] . '__logo.gif')) {
                    $cscript_img_path = 'softaculous/' . $theme['images'] . 'topscripts/32/' . $uv['sid'] . '__logo.gif"';
                } else {
                    $cscript_img_path = $fullurl . '/' . $theme['images'] . 'top14_custom_script.png"';
                }
            }
            $_site_name = @unserialize($uv['site_name']);
            $str .= '<td width="' . $td_width . '" valign="middle" align="center" height="' . $td_height . '"><a href="' . $fullurl . '/' . $globals['ind'] . 'act=' . ($iscripts[$uv['sid']]['type'] == 'perl' ? 'perl' : ($iscripts[$uv['sid']]['type'] == 'js' ? 'js' : 'software')) . '&soft=' . $uv['sid'] . '" style="text-decoration:none;"><img src="' . ($uv['sid'] > 10000 ? $cscript_img_path : $url . $img_path . '"') . ' border="0" /><br />' . (!empty($uv['site_name']) ? !empty($_site_name) ? $_site_name : $uv['site_name'] : $iscripts[$uv['sid']]['name']) . '</a></td>';
        }
        $str .= '</tr></table></div></td>
		<td width="15px" onmouseover="mousemove(\'softins_div\', event);" onmouseout="softstop(\'softins_div\', event);" align="center">
		<img src="' . $fullurl . '/' . $theme['images'] . 'move_right.png" alt="Right" border="0"/>
		</td>
		</tr></table>';
    }
    // End of $my_ins
    if (empty($no_cat) || !empty($my_ins)) {
        $str .= '<div class="softac_cat" style="vertical-align:middle;padding:5px;text-align:left;background-color: #EEE;width:' . $width . ';"><b>' . $l['script'] . ':</b></div>';
    }
    $str .= '<table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed;" width="100%"><tr>
		<td width="15px" onmouseover="mousemove(\'script_div\', event);" onmouseout="softstop(\'script_div\', event);" align="center">
			<img src="' . $fullurl . '/' . $theme['images'] . 'move_left.png" alt="Left" border="0"/>
		</td>
		<td>
		<div style="overflow:hidden;display: block;width:' . $s_width . ';" id="script_div" onclick="softstop(this.id, event);">
		<table border="0" cellpadding="7" cellspacing="3" id="script_table" style="table-layout: fixed;" width="100%"><tr>';
    $i = 1;
    foreach ($top as $k => $v) {
        if (empty($iscripts[$k])) {
            continue;
        }
        // We have to make some chnages as per the theme (i.e for x3 and paper_lantern)
        if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0) {
            $img_path = 'top15/48/' . $scripts[$k]['softname'] . '.png';
            $td_width = 100;
            $td_height = 80;
        } else {
            $img_path = 'softimages/32/' . $k . '__logo.gif';
            $td_width = 50;
            $td_height = 50;
        }
        // custom scripts logos path
        if ($k > 10000) {
            if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 && file_exists($theme['images'] . 'topscripts/48/' . $k . '__logo.gif')) {
                $cscript_img_path = 'softaculous/' . $theme['images'] . 'topscripts/48/' . $k . '__logo.gif"';
            } elseif (file_exists($theme['images'] . 'topscripts/32/' . $k . '__logo.gif')) {
                $cscript_img_path = 'softaculous/' . $theme['images'] . 'topscripts/32/' . $k . '__logo.gif"';
            } else {
                $cscript_img_path = $fullurl . '/' . $theme['images'] . 'top14_custom_script.png"';
            }
        }
        $str .= '<td width="' . $td_width . '" valign="middle" align="center" height="' . $td_height . '"><a href="' . $fullurl . '/' . $globals['ind'] . 'act=' . ($iscripts[$k]['type'] == 'perl' ? 'perl' : ($iscripts[$v]['type'] == 'js' ? 'js' : 'software')) . '&soft=' . $k . '" style="text-decoration:none;"><img src="' . ($k > 10000 ? $cscript_img_path : $url . $img_path . '"') . ' border="0" /><br />' . $iscripts[$k]['name'] . '</a></td>';
        $i++;
        if ($i == 15 && !empty($globals['append_apps'])) {
            break;
        } elseif (!file_exists($globals['path'] . '/conf/top_scripts.php') && empty($globals['append_apps']) && $i == 15) {
            // This is the DEFAULT case if scripts are not selected AND append_apps is not checked then display 14 scripts by default.
            break;
        }
    }
    $str .= '</tr></table></div></td>
		<td width="15px" onmouseover="mousemove(\'script_div\', event);" onmouseout="softstop(\'script_div\', event);" align="center">
		<img src="' . $fullurl . '/' . $theme['images'] . 'move_right.png" alt="Right" border="0"/>
		</td>
		</tr></table>';
    // Disable category
    if (empty($no_cat)) {
        $str .= '<div class="softac_cat" style="vertical-align:middle;padding:5px;text-align:left;background-color: #EEE;width:' . $width . ';"><b>' . $l['category'] . ' :</b></div>
		<table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed;" width="100%"><tr>
		<td width="15px" onmouseover="mousemove(\'softcat_div\', event);" onmouseout="softstop(\'softcat_div\', event);" align="center">
			<img src="' . $fullurl . '/' . $theme['images'] . 'move_left.png" alt="Left" border="0"/>
		</td>
		<td>
		<div style="overflow:hidden;display: block;width:' . $s_width . ';" id="softcat_div" onclick="softstop(this.id, event);">
		<table border="0" cellpadding="7" cellspacing="0" style="table-layout:fixed;"><tr>';
        foreach ($allcatwise as $type => $cats) {
            foreach ($cats as $k => $v) {
                $str .= ' <td width="' . $td_width . '" valign="top" align="center"><a href="' . $fullurl . '/' . $globals['index'] . 'act=listsoftwares&cat=' . $k . '" style="text-decoration:none;" class="desc">' . (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? '<div class="top14catbg"><i class="fa sai-' . $k . ' fa-2x"></i></div>' : '<img src="' . $fullurl . '/' . $cat_image_path . $type . '_' . $k . '.gif" title="' . strtoupper($type) . ' ' . strtoupper($k) . '" border="0" >') . '<br />' . $l['cat_' . $type . '_' . $k] . '</a></td>';
            }
        }
        $str .= '</tr></table></div></td>
		<td width="15px" onmouseover="mousemove(\'softcat_div\', event);" onmouseout="softstop(\'softcat_div\', event);" align="center">
		<img src="' . $fullurl . '/' . $theme['images'] . 'move_right.png" alt="Right" border="0"/>
		</td>
		</tr></table>';
    }
    // End of $no_cat
    // If its Dirctadmin than Closing the DIV
    if ($globals['softpanel'] == 'directadmin') {
        $str .= '</div>';
    }
    echo 'var softOffsets = function(e){
	e = e || window.event;
	 
	var
	//cache document variables
	_d = document, _dBody = _d.body, _dDocEl = _d.documentElement, _o = null,
	 
	//calculate scroll values
	_scroll_left = _dDocEl.scrollLeft ? _dDocEl.scrollLeft : 0 + _dBody.scrollLeft ? _dBody.scrollLeft : 0,
	_scroll_top = _dDocEl.scrollTop ? _dDocEl.scrollTop : 0 + _dBody.scrollTop ? _dBody.scrollTop : 0,
	 
	
	window_pos = {
	_x: (e.pageX || e.clientX) + _scroll_left, _y: (e.pageY || e.clientY) + _scroll_top
	},
	 
	
	viewport_pos = {
	_x: (e.pageX || e.clientX), _y: (e.pageY || e.clientY)
	},
	 
	
	_console = function(o, type) {
	o = (typeof o === "object") ? o : _d.getElementById(o);
	o.innerHTML = type + " = [ " +
	" X: " + ((type === "viewport") ? viewport_pos._x : window_pos._x) +
	" Y: " + ((type === "viewport") ? viewport_pos._y : window_pos._y) +
	" ] Foo: " + Math.random()
	};
	 
	return {
	ViewPortX: viewport_pos._x,
	ViewPortY: viewport_pos._y,
	 
	WindowX: window_pos._x,
	WindowY: window_pos._y,
	 
	ViewPort: [viewport_pos._x, viewport_pos._y],
	Window: [window_pos._x, window_pos._y],
	 
	ToString: _console
	};
};

//Finds the position of the element
function findelpos(ele){
	var curleft = 0;
	var curtop = 0;
	if(ele.offsetParent){
		while(1){
			curleft += ele.offsetLeft;
			curtop += ele.offsetTop;
			if(!ele.offsetParent){
				break;
			}
			ele = ele.offsetParent;
		}
	}else if(ele.x){
		curleft += ele.x;
		curtop += ele.y;
	}
	return [curleft,curtop];
};

function mousemove(id, e){

	if(typeof softac[id+"left"] == "undefined"){
		softac[id+"right"] = "";
		softac[id+"left"] = "";
		softac[id+"entered"] = false;
	}
	
	if(softac[id+"entered"] == true){
		return false;
	}
	
	softac[id+"entered"] = true;
	
	var ele = document.getElementById(id);
	var mouse = softOffsets(e);
	mouse[0] = mouse.ViewPortX;	
	softac[id+"elpos"] = findelpos(ele);	
	softac[id+"menuwidth"] = ele.offsetWidth;	
	softac[id+"leftbound"] =((softac[id+"menuwidth"]-20)/2) + softac[id+"elpos"][0];
	softac[id+"rightbound"] =((softac[id+"menuwidth"]+20)/2) + softac[id+"elpos"][0];
	
	//alert(softac[id+"leftbound"]+" "+softac[id+"rightbound"]+" "+mouse[0]);	
	//document.getElementById("aaa").innerHTML = mouse[0]+"<br />"+document.getElementById("aaa").innerHTML;
	
	if (mouse[0]>softac[id+"rightbound"]){
		softLeft(id);
	}else if (mouse[0]<softac[id+"leftbound"]){
		softRight(id);
	}else{
		softstop(id, e);
	}
}
	
var softac = new Object();

function softLeft(id){
	clearTimeout(softac[id+"right"]);
	document.getElementById(id).scrollLeft += 1;
	softac[id+"right"] = setTimeout("softLeft(\'"+id+"\')",10);
};

function softRight(id){	
	clearTimeout(softac[id+"left"]);
	document.getElementById(id).scrollLeft -= 1;//alert(document.getElementById(id).scrollLeft);return;
	softac[id+"left"] = setTimeout("softRight(\'"+id+"\')",10);
};

function softstop(id, e){	
	clearTimeout(softac[id+"right"]); 
	clearTimeout(softac[id+"left"]);
	softac[id+"entered"] = false;
};';
    // cPanels Notice section code
    $notice = '<div style="width:195px;padding:7px;height:50px"><center>
			<a href="' . $fullurl . '/' . $globals['ind'] . 'act=installations&showupdates=true" alt="Updates" style="font-size:13px;padding:3px;text-decoration:none;"><img src="' . $fullurl . '/' . $theme['images'] . 'softaculous.gif" border="0" align="middle" height="30px" width="100px"/> <br />
&nbsp; ' . lang_vars($l['updates_available_notice'], array($updates_available)) . '</a></center></div>';
    echo 'var soft_html = \'' . str_replace(array('\'', "\n", "\r"), array('\\\'', '\'+"\\n"+\'', '\'+"\\n"+\''), $str) . '\';
';
    if ($globals['softpanel'] == 'directadmin') {
        echo 'document.getElementById("soft_div1").innerHTML = soft_html;';
    } elseif ($globals['softpanel'] == 'plesk') {
        echo 'document.getElementById("secondary").innerHTML = "<div class=\'applications-dashboard-box\'>" + soft_html+ "</div>"+document.getElementById("secondary").innerHTML;';
    } else {
        if (!empty($globals['show_top_scripts'])) {
            echo 'document.getElementById("soft_div-body").innerHTML = soft_html;';
        }
        if (!empty($globals['show_in_notice']) && $updates_available > 0) {
            echo 'var soft_notice = \'' . str_replace(array('\'', "\n", "\r"), array('\\\'', '\'+"\\n"+\'', '\'+"\\n"+\''), $notice) . '\';
			document.getElementById("noticeboard").innerHTML += soft_notice;';
        }
    }
}
Exemple #16
0
function ftpadd_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $done;
    // For adding FTP User
    if (optGET('ajaxftp')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Creating new table for display new DB
        if (!empty($done)) {
            echo '1' . $l['change_final'];
            return true;
        }
    }
    softheader($l['<title>']);
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'addftp.gif" />' . $l['ftp'] . '</center>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />';
    error_handle($error, '100%');
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

	var message_box = function(){			
		return {
			show_message: function(title, body , image) {			
				var okbutton = \'<input  style="width:75px" class="sai_submit" type="button" onclick="message_box.close_message();" value="OK" />\';
				if(image == "1"){
					var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
				}else{
					var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
				}
									
				if(jQuery(\'.sai_message_box\').html() === null) {
					var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
					jQuery(document.body).append( message );								
					jQuery(\'.sai_message_box\').css(\'top\', jQuery(\'html, body\').scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
				}else{
					var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
					jQuery(\'.sai_message_box\').css(\'top\', jQuery(\'html, body\').scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
					jQuery(\'.sai_message_box\').html( message );
				}
			},
			close_message: function() {
				jQuery(\'.sai_message_box\').hide(\'fast\');
			}
		}
	}();

	$(document).ready(function(){
			
			// For creating FTP accounts 
			$("#submitftp").click(function(){
				$("#createftp").css("display", "");	
				var login = ($("#login").val());
				var newpass = ($("#newpass").val());
				var conf = ($("#conf").val());
				var dir = ($("#dir").val());
				$.ajax({
					type: "POST",
					url: window.location+"&create_acc=1&ajaxftp=1",					
					data: "login="******"&newpass="******"&conf="+conf+"&dir="+dir,
					
					// Checking for error
					success: function(data){
						$("#createftp").css("display", "none");
						var result = data.substring(0,1);
						if(result == "1"){
							$_("login").value="";
							$_("newpass").value="";
							$_("conf").value="";
							$_("dir").value="";
							var msg = data.substring(1);
							message_box.show_message( "Done ",msg,2);																					
						}
						if(result == "0"){	
							$("#createmx").css("display", "none");
							var msg = data.substring(1);
							message_box.show_message( "Error",msg,1);
						}
					},
					error: function() {
						message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
					}															
				});													
			});	
	});
	
	var dir = false;
	function suggestdompath(domval){
		if(dir){
			return true;	
		}
		$_("dir").value = "' . cleanpath($softpanel->user['homedir']) . '/www/"+$_("login").value;
	}
	// ]]></script>
	
<form accept-charset="' . $globals['charset'] . '" action="" method="post" name="ftp_account">
<table border="0" cellpadding="8" cellspacing="8" width="100%">
	<tr>
		<td width="35%">
			<span class="sai_head">' . $l['loginname'] . '</span><br />
		</td>		
		<td> 
			<input type="text" name="login" id="login" size="30" onkeyup="suggestdompath(this);" size="30" value="' . POSTval('login', '') . '" />
		</td>
	</tr>
	<tr>
		<td>
			<span class="sai_head">' . $l['new_pass'] . '</span><br />
		</td>		
		<td> 
			<input type="password" name="newpass" id="newpass" size="30" value="" />
		</td>
	</tr>
	<tr>
		<td>
			<span class="sai_head">' . $l['retype_pass'] . '</span><br />
		</td>		
		<td> 
			<input type="password" name="conf" id="conf" size="30" value="" />
		</td>
	</tr>
	<tr>
		<td>
			<span class="sai_head">' . $l['directory'] . '</span><br /><span class="sai_exp">' . $l['path'] . '</span>			
		</td>				
		<td> 
			<input type="text" name="dir" id="dir" size="30"  value="' . stripslashes(POSTval('dir', cleanpath($softpanel->path) . '/www/')) . '" onfocus="" />
			<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
			//Add an event handler
			$_("dir").onkeydown = function(){
				dir = true;
			}
			// ]]></script>
		</td>
	</tr>
</table>
<table border="0" width="100%">
<td align="left" width="40%"><a href="http://' . $_SERVER['HTTP_HOST'] . '/ampps/index.php?act=ftpmanage">' . $l['lbl_ftp_manage'] . '</a></td>
<td align="left"><input type="button" style="cursor:pointer" value="' . $l['submit_button'] . '" name="create_acc" class="sai_submit" id="submitftp" /> &nbsp;<img id="createftp" src="' . $theme['images'] . 'progress.gif" style="display:none"></td></table>
</form>';
    softfooter();
}
Exemple #17
0
function advancedns_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $done, $domain_list, $dns_list, $domain_name;
    // For update
    if (optGET('ajaxup')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['edit'];
            return true;
        }
    }
    // To update domains links
    if (optGET('ajaxdom')) {
        showdns();
        return true;
    }
    // For adding DNS Record
    if (optGET('ajaxdns')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Creating new table for display new DB
        if (!empty($done)) {
            echo '1' . $l['change_final'];
            showdns();
            return true;
        }
    }
    // For delete
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['delete'];
            return true;
        }
    }
    softheader($l['<title>']);
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'advancedns.gif" />&nbsp;' . $l['advancedns'] . '</center>';
    echo '<form accept-charset="' . $globals['charset'] . '" action="" method="post" name="advancedns" id="editform">
	<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad"  style="padding-left:15px; padding-top:15px; ">
		<tr>
			<td>
				<span class="sai_head">' . $l['domain'] . '</span><br />
			</td>	
			<td>
				<select class="input" name="selectdomain" id="selectdomain" >';
    foreach ($domain_list as $key => $value) {
        if ($domain_name == $key) {
            echo '<option value=' . $key . ' selected=selected >' . $key . '</option>';
        } else {
            echo '<option value=' . $key . '>' . $key . '</option>';
        }
    }
    echo '</select>
			&nbsp;<img id="changedns" src="' . $theme['images'] . 'progress.gif" style="display:none"></td>		
		</tr>	
		<tr>
			<td width="35%">
				<span class="sai_head">' . $l['dns_name'] . '</span><br />
			</td>		
			<td> 
				<input type="text" name="name" id="name" size="30"  size="30" />.<span id="domainname">' . $domain_name . '</span>
			</td>
		</tr>
		<tr>
			<td>
				<span class="sai_head">' . $l['dns_ttl'] . '</span><br />
			</td>		
			<td> 
				<input type="text" name="ttl" id="ttl" size="30" value="14400" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="sai_head">' . $l['dns_type'] . '</span><br />
			</td>	
			<td>
				<select class="input" name="selecttype" id="selecttype" onchange="disp_type(this.value)">
				<option value="A">A</option>
				<option value="CNAME">CNAME</option>
				<option value="TXT">TXT</option>				
			</td>		
		</tr>	
		<tr>
			<td>
				<span class="sai_head" id="type">' . $l['typedefault'] . '</span><br />
			</td>				
			<td> 
				<input type="text" name="address" id="address" size="30" value="" />
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<p align="center">
					<input type="hidden" name="create_record" value="1" />
					<input type="submit" style="cursor:pointer" value="' . $l['submit_button'] . '" name="create_record" class="sai_graybluebut" id="submitdns"/> &nbsp; <img id="createdns" src="' . $theme['images'] . 'progress.gif" style="display:none"></center>
				</p>
			</td>
		</tr>
	</table>
	</br></br>
	</form>
		<center><span class="sai_head">' . $l['record_table'] . ' <span id="domain_file">' . $domain_name . '</span></center><br />
	<div id="showrectab">';
    showdns();
    echo '</div>
	
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[	
	
	$(document).ready(function(){
		
		$("#selectdomain").change(function(){
			$("#changedns").css("display", "");	
			var domain = $(this).val();
			$.ajax({				
				type: "POST",				
				url: window.location+"&ajaxdom=1&domain="+domain,
				success: function(data){
					$("#changedns").css("display", "none");
					$("#showrectab").html(data);
					$("#domainname").html(domain);
					$("#domain_file").html(domain);
				}															  
			});	
		});
						
		// For creating DNS	
		$("#submitdns").click(function(){
			$("#createdns").css("display", "");				
			$.ajax({
				type: "POST",
				url: window.location+"&create_record=1&ajaxdns=1",					
				data: $("#editform").serialize(),
				
				// Checking for error
				success: function(data){
					$("#createdns").css("display", "none");
					var result = data.substring(0,1);
					if(result == "1"){
						$_("name").value="";
						$_("address").value="";
						var msg = data.substring(1,data.indexOf("<table"));
						var output = data.substring(data.indexOf("<table"));							
						message_box.show_message( "Done ",msg,2);														
						$("#showrectab").html(output);																																
					}
					if(result == "0"){	
						$("#createdns").css("display", "none");
						var msg = data.substring(1);
						message_box.show_message( "Error",msg,1);
					}
				},
				error: function() {
					message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
				}															
			});	
			return false;												
		});	
	});	
	// ]]></script>';
    softfooter();
}
$l['manage'] = 'Manage';
$l['type'] = 'Type';
$l['priority'] = 'Priority';
$l['ttl'] = 'TTL';
$l['rdns'] = 'Add Reverse DNS Zone';
$l['pdns_zones'] = 'View Zones';
$l['edit_dnsrecords'] = 'Edit';
$l['del_dnsrecords'] = 'Delete';
$l['del_record'] = 'Delete Record';
$l['add_dnsrecord'] = 'Add record';
$l['dns_domain'] = 'Domain';
$l['dns_name'] = 'Name';
$l['domain_id'] = 'Zone ID';
$l['pdns_name'] = 'Server Name';
$l['rdns_ipaddress'] = 'IP Address';
$l['submit'] = 'Search';
$l['record_type'] = 'Record Type';
$l['no_rdns'] = 'There are no DNS Records.<a href="' . $globals['index'] . 'act=add_dnsrecord&pdnsid=' . optGET('pdnsid') . '">Add a DNS Record now</a>';
$l['no_res'] = 'No results were found for your search query';
$l['pdns_inuse'] = 'This server is included in a DNS plan. Please unassign it from the plan and then try deleting it again';
$l['unable_connect'] = 'Unable to connect to the server';
$l['success_connect'] = 'Connection successful !';
$l['test_pdns'] = 'Test';
$l['edit_pdns'] = 'Edit';
$l['delete_pdns'] = 'Delete';
$l['powerdns_note'] = 'Please go through the following guides :<br />
1) <a href="http://www.virtualizor.com/wiki/PowerDNS" target="_blank">PowerDNS Setup Guide</a><br />
2) <a href="http://www.virtualizor.com/wiki/Configure_PowerDNS" target="_blank">Adding PowerDNS to Virtualizor</a><br />
3) <a href="http://www.virtualizor.com/wiki/Configure_Reverse_DNS" target="_blank">Configure Reverse DNS</a>';
$l['err_delete'] = 'There was an error while deleting following records:';
$l['err_connect'] = 'Could not Connect to the remote database';
Exemple #19
0
function dbmanage_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $dbname, $dbuser, $pri_list, $dbdone, $db_list, $db_list_size, $db_with_user_list, $db_user_list;
    //Ajax part for add DB
    if (optGET('ajaxdb')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Creating new table for display new DB
        if (!empty($dbdone)) {
            echo '1' . $l['db_create'];
            showdb();
            return true;
        }
    }
    // Ajax part for add user
    if (optGET('ajax')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Creating new table for display new user
        if (!empty($dbdone)) {
            echo '1' . $l['user_added'];
            showuser();
            return true;
        }
    }
    // Ajax part for update privaliges
    if (optGET('ajaxpri')) {
        if (!empty($error)) {
            echo '0 ' . current($error);
            return false;
        }
        if (!empty($dbdone)) {
            echo '1' . $l['db_pri_updated'];
            showdb();
            return true;
        }
    }
    // Ajax part for delete user
    if (optGET('ajaxdeluser')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($dbdone)) {
            echo '1' . $l['db_user_del'];
            showdb();
            return true;
        }
    }
    // Ajax part for delete DB
    if (optGET('ajaxdeldb')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($dbdone)) {
            echo '1' . $l['db_db_del'];
            showdb();
            return true;
        }
    }
    if (optGET('editdb_user')) {
        $db_list = $softpanel->listdbs();
        $db_user_list = $softpanel->listdbusers();
        echo '<center><div class="sai_tit" style=" width:100%;"><img src="' . $theme['a_images'] . 'adddb.gif" alt="" />&nbsp;' . $l['user_db_add_label'] . '</div></center>';
        if (count($db_list) > 0 && count($db_user_list) > 0) {
            echo '<form accept-charset="' . $globals['charset'] . '" name="importsoftware" method="post" action="" >
				<br />
				<table border="0" cellpadding="8" cellspacing="8" width="90%" align="center" class="sai_divroundshad" sstyle="padding-left:15px; padding-top:15px;" >
					<tr>
						<td>
							<span class="sai_head">' . $l['user_label'] . '</span>
						</td>
						<td valign="top">
							<select name="sel_user" id="sel_user">';
            foreach ($db_user_list as $k => $v) {
                echo '<option value="' . $k . '" ' . (!empty($_POST['sel_user']) && $_POST['sel_user'] == $k ? 'selected="selected"' : '') . '>' . $v . '</option>';
            }
            echo '</select>
						</td>
					</tr>        	
					<tr>
						<td>
							<span class="sai_head">' . $l['db_set_label'] . '</span>
						</td>
						<td valign="top">
							<select name="sel_db" id="sel_db">';
            foreach ($db_list as $k => $v) {
                echo '<option value="' . $k . '" ' . (!empty($_POST['sel_db']) && $_POST['sel_db'] == $k ? 'selected="selected"' : '') . '>' . $v . '</option>';
            }
            echo '</select>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<p align="center"><input type="button" class="sai_graybluebut" id="submit1" style="cursor:pointer" name="submitselectuser" value="' . $l['submitselectuser'] . '" /></p>
						</td>
					</tr>
				</table>				
				</form>					
				<script language="javascript" type="text/javascript" ><!-- // --><![CDATA[				
					
					// For popup			
					$("#submit1").click(function() {
						var dbname = ($("#sel_db").val());
						var dbuser = ($("#sel_user").val());
						show_popup(dbname,dbuser);	
					});									
				// ]]></script>';
            echo '<div class="sai_popup" ></div>';
        } else {
            echo '<center><h2>' . $l['err_nodata'] . '</h2></center>';
        }
        return true;
    }
    // Privaliges page for popup
    if (optGET('editpri')) {
        $dbname = POST('dbname');
        $dbuser = POST('dbuser');
        // Get user db privileges
        $db_pri = $softpanel->getDbPrivileges($dbname, $dbuser);
        echo '<script language="javascript" type="text/javascript" ><!-- // --><![CDATA[						
			$(document).ready(function(){	
				$(".sai_altrowstable tr").mouseover(function(){
					var old_class = $(this).attr("class");		
					$(this).attr("class", "sai_tr_bgcolor");		
					$(this).mouseout(function(){
						$(this).attr("class", old_class);
					});
				});			
							
				$("#submitpri").click(function() {
					$("#comsg").css("display", "none");	
					$("#ermsg").css("display", "none");							
					var prilist = Array()				
					ids = new Array("' . implode('", "', $pri_list) . '");				
					for(x in ids){
						if($_("pri["+ids[x]+"]").checked){													
							prilist[x] = ids[x];							
						}
					}
					var host = ($("#selecttype").val());				
					if(host == "Use text field"){					
						host =($("#hname").val());
					}			
					var w_l = window.location.toString();				
					if(w_l.indexOf("#") > 0){
						w_l = w_l.substring(0, w_l.indexOf("#"));
					}					
					$.ajax({
						type: "POST",
						url: w_l+"&submitpri=1&ajaxpri=1 ",					
						data: "dbname=' . $dbname . '&dbuser='******'&host=" +host+"&prilist=" +prilist,
						// checking for error
						success: function(data){												
							var result = data.substring(0,1);	
							if(result == "1"){
							var msg = data.substring(1,data.indexOf("<table"));
							var output = data.substring(data.indexOf("<table"));								
								$("#comsg").css("display", "");																																		
								$("#comsg").html(msg);
								$("#showdbtab").html(output);
							}	
							if(result == "0"){	
								var msg = data.substring(1);
								$("#ermsg").css("display", "");																																		
								$("#ermsg").html(msg);								
							}						
						},
						error: function() {
							message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
						}															
					});								
				});	
				$("#chk_table tr").click(function(e){				
					var $checkbox = $(this).find(":checkbox");
					$("#chk_table:checkbox").not($checkbox).removeAttr("checked");
					if (e.target.type == "checkbox") {
						$checkbox.attr("checked");
					}else{
						$checkbox.attr("checked", !$checkbox.attr("checked"));
						$(this).filter(":has(:checkbox)").toggleClass("selected", $checkbox.attr("checked"));
					}				
				});
			});
		// ]]></script>';
        echo '<div class="ui_titlebar" style="width:95%" >
			<a title="Close" class="close"><img src="' . $theme['images'] . 'remove.gif" style="cursor:pointer; float:right;" alt="close" height="20" width="20" onclick="popup_close();" /></a>			
			<center class="sai_tit"><img src="' . $theme['images'] . 'mysql_1.gif" />&nbsp; ' . $l['db_headling_pri'] . ' For Database ' . $dbname . ' To User ' . $dbuser . '</center>
			<center id="comsg" style="display:none" class="sai_notice"></center>
			<center id="ermsg" style="display:none; background-color: #FF9999;" class="sai_notice" ></center>		
		<form accept-charset="' . $globals['charset'] . '" name="importsoftware" method="post" action="" ></div>		
			<table border="0" cellpadding="0" cellspacing="0" width="99%" class="sai_altrowstable">
				<tr>
					<th align="center" class="sai_summaryTitle" colspan="1">' . $l['db_pri'] . '</th>
					<th align="center" class="sai_summaryTitle" colspan="1">' . $l['pri_option'] . '<input type="checkbox" onclick="checkall(this);" /></th>
				</tr>';
        foreach ($pri_list as $key => $value) {
            $k = ucfirst(strtolower($value)) . '_priv';
            $check[$key] = isset($db_pri[$k]) && $db_pri[$k] == 'Y' ? 'checked="checked"' : '';
            $label[$key] = ucfirst(str_replace('_', ' ', strtolower($value)));
        }
        echo '<tr>
					<td width="50%">
						<table border="0" cellpadding="8" cellspacing="0" width="100%" class="sai_altrowstable" id="chk_table">';
        for ($j = 0; $j <= count($pri_list) / 2 - 1; $j++) {
            echo '<tr class="' . ($j % 2 == 0 ? "sai_evenrowcolor" : "sai_oddrowcolor") . '" height="40px">
								<td width="70%">' . $label[$j] . '</td>
								<td align="center" width="25%"><input ' . $check[$j] . ' type="checkbox" name="pri[' . $pri_list[$j] . ']" id="pri[' . $pri_list[$j] . ']" value="Y" /></td>
							</tr>';
        }
        echo '</table>
					</td>	
					<td width="50%">
						<table border="0" cellpadding="8" cellspacing="0" width="100%" class="sai_altrowstable" id="chk_table">';
        for ($j = count($pri_list) / 2; $j <= count($pri_list) - 1; $j++) {
            echo '<tr class="' . ($j % 2 == 0 ? "sai_evenrowcolor" : "sai_oddrowcolor") . '" height="40px">
								<td width="70%" >' . $label[$j] . '</td>
								<td align="center" width="25%"><input ' . $check[$j] . ' type="checkbox" name="pri[' . $pri_list[$j] . ']" id="pri[' . $pri_list[$j] . ']" value="Y" /></td>
							</tr>';
        }
        echo '
						</table>
					</td>	
				</tr>
			</table>';
        echo '<table>
			<tr>
				<td width="25%">
					<span class="sai_head">' . $l['select_host'] . '</span> 
				<td>		
				<td width="25%">							
					<select class="input" name="selecttype" id="selecttype" onchange="disp_type(this.value)">
						<option value="' . $l['local'] . '" ' . ($db_pri['Host'] == $l['local'] ? 'selected=selected' : '') . '>' . $l['local'] . '</option>
						<option value="' . $l['anyhost'] . '" ' . ($db_pri['Host'] == '%' ? 'selected=selected' : '') . '>' . $l['anyhost'] . '</option>
						<option value="' . $l['text'] . '"  ' . ($db_pri['Host'] != $l['local'] && $db_pri['Host'] != '%' && $db_pri['Host'] != '' ? 'selected=selected' : '') . '>' . $l['text'] . '</option>		
					</select>								
				</td>
				<td width ="50%">
					<input type="text" id="hname" name="hname" id="address" size="30" ' . ($db_pri['Host'] != $l['local'] && $db_pri['Host'] != '%' && $db_pri['Host'] != '' ? 'value=' . $db_pri['Host'] . '' : 'style="display:none" ') . ' />
				</td>		
			</tr>	
		</table>
		<p align="center"><input type="button" class="sai_graybluebut" id="submitpri" style="cursor:pointer" name="submitpri" value="' . $l['submitpri'] . '" /></p>
		</form> ';
        return true;
    }
    softheader($l['<title>']);
    echo '<script language="javascript" src="' . js_url('js/jquery.scrollTo.js') . '" type="text/javascript"></script>';
    $db_prefix = $softpanel->user['name'] . '_';
    echo '<style type="text/css">
		.ui_titlebar {
			padding: 0.4em 1em;
			background-color: #CCCCCC;
			border: 1px solid #AAAAAA;
			color: #222222;
			font-weight: bold;
			border-radius: 4px;
		}	
		
		.sai_popup {
			position:absolute;
			background:#FFFFFF;
			border:#666 1px solid;
			display:none;
			z-index:10000;
			min-height:200px;
			margin:0 auto;
			padding:5px;
		}
		
		.sai_popup_add {
			position:absolute;
			background:#FFFFFF;
			border:#666 1px solid;
			display:none;
			z-index:10000;
			min-height:200px;
			margin:0 auto;
			padding:5px;
		}
		
		.close {
			float:right;
			position:relative;
			z-index:99999;
			margin:3px 6px 0;
		}
		#scroller-body {		
			width=100%;
			padding-bottom:30px;
			height: 100%;
		}
		#mask {		
			width:700px;
			overflow:hidden;
			margin:0 auto;
			height: 100%;
		}
		#panel div {
			float:left;			
		}
		a.selected {
			border-radius: 5px;
			border :2px solid #B8B8B8;			
			background: #EFEFEF;		
			padding: 8px;		
			font-size:18px;
			color:#333333;
			margin-top:20px;
			margin-bottom:5px;
			font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;		
		}	
		.heading_a{
			border-radius: 5px;
			border :2px solid  #FFFFFF;			
			background: #FFFFFF;
			padding: 8px;	
			font-size:18px;
			color:#333333;
			margin-top:20px;
			margin-bottom:5px;
			font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
		}	
	</style>';
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[		
		var message_box = function() {			
			return {
				show_message: function(title, body , image) {			
					var okbutton = \'<input  style="width:75px" class="sai_graybluebut" type="button" onclick="message_box.close_message();" value="OK" />\';
					if(image == "1"){
						var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
					}else{
						var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
					}					
					if(jQuery(\'.sai_message_box\').html() === null) {
						var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
						jQuery(document.body).append( message );								
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
					}else{
						var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
						jQuery(\'.sai_message_box\').html( message );
					}
				},
				delete_message: function(title, body ,delact) {					
					var yesbutton = \'<input type="button" style="width:75px" onclick="message_box.yes_close_message(\\\'\'+delact+\'\\\');" value="YES" class="sai_graybluebut"/>\';
					var nobutton = \'<input type="button" style="width:75px" onclick="message_box.no_close_message();" value="NO" class="sai_graybluebut" />\';
					var img = \'<img src="' . $theme['images'] . 'remove_big.gif" />\';
					if(jQuery(\'.sai_message_box\').html() === null) {
						var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1" height="10%">\' +  title + \'</td></tr><tr ><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table></div>\';				
						jQuery(document.body).append( message );								
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
					}else{
						var message = \' <table  border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1" height="10%">\' + title + \'</td></tr><tr><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table>\'
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
						jQuery(\'.sai_message_box\').html( message );
					}
				},
				close_message: function() {
					jQuery(\'.sai_message_box\').hide(\'fast\');
				},
				yes_close_message: function(delact) {
					delaction = delact.substr(0,3)
					delrecord = delact.substr(3);						
					if(delaction == "did"){
						$(\'#did\'+delrecord).attr("src","' . $theme['images'] . 'progress.gif");
						url = "&delete_db=" +delrecord+"&ajaxdeldb=1";
					}else{
						$(\'#uid\'+delrecord).attr("src","' . $theme['images'] . 'progress.gif");
						url = "&delete_dbuser="******"&ajaxdeluser=1";	
					}
					jQuery(\'.sai_message_box\').hide(\'fast\');		
					var w_l = window.location.toString();				
					if(w_l.indexOf("#") > 0){
						w_l = w_l.substring(0, w_l.indexOf("#"));
					}					
					$.ajax({
						type: "POST",
						url: w_l+url,						
						success: function(data){													
							var result = data.substring(0,1);										
							var msg = data.substring(1,data.indexOf("<table"));
							var output = data.substring(data.indexOf("<table"));
							if(result == "1"){
								message_box.show_message("Delete",msg,2);
								if(delaction == "did"){
									$("#tr"+trim(delrecord)).fadeOut(2000);	
								}else{
									$("#ur"+trim(delrecord)).fadeOut(2000);	
								}
								$("#showdbtab").html(output);
							}
							if(result == "0"){
								message_box.show_message("Error",msg,1);																																			
							}
						},
						error: function() {
							message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
						}															  
					});					
				},
				no_close_message: function() {
					jQuery(\'.sai_message_box\').hide(\'fast\');			
				}
			}
		}();
       	
		// for deleting db or user		
		function deleterecord(delact){			
			delaction = delact.substr(0,3)
			if(delaction == "did"){	
				message_box.delete_message (\'Warning\',\'' . $l['db_del_conf'] . '\', delact);
			}else{
				message_box.delete_message (\'Warning\',\'' . $l['dbuser_del_conf'] . '\', delact);
			}		
		};
		
		// Function for checkbox check all
		ids = new Array("' . implode('", "', $pri_list) . '");
		function checkall(checker){	
			for(x in ids){
				$_("pri["+ids[x]+"]").checked = checker.checked;
			}				
		};
		
		// Function for show host
		function disp_type(str){
			if(str == "Use text field"){
				$("#hname").css("display", "");
			}else{
				$("#hname").css("display", "none");
			}
		} ;	
		
		// Function for close popup
		function popup_close(){			
			$(".sai_popup").fadeOut(1000);
			$(".sai_popup_add").fadeOut(1000);
			$("#comsg").css("display", "none");	
			$("#ermsg").css("display", "none");	
		};						
		
		// Function for show popup
		function show_popup(dbname, dbuser,div_id)
		{			 																
			var height = $("#scroller-body").height();
			var width = $("#scroller-body").width();
			var spanHeight = 50;
			var spanWidth = 50;	
			var w_l = window.location.toString();				
			if(w_l.indexOf("#") > 0){
				w_l = w_l.substring(0, w_l.indexOf("#"));
			}					
			$.ajax({
				type: "POST",
				url: w_l+"&editpri=1",					
				data: "dbname="+dbname+"&dbuser="******".sai_popup_add").html(data);
					}else{
						$(".sai_popup_add").html(data);
					}
				},
				error: function() {
					message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
				}	
			});	
			if(div_id ==1){									
				$(".sai_popup_add")
					.css({ "top" :  height/3 - spanHeight/3 })
					.css({ "left" : width/2 - spanWidth/2})
					.css({ "width" : width/2 + 50})				
					.fadeIn(500);	
			}else{
				$(".sai_popup_add")
					.css({ "top" :  height/3 - spanHeight/3 })
					.css({ "left" : width/2 - spanWidth/2})
					.css({ "width" : width/2 + 50})				
					.fadeIn(500);
			}
		};	
		
		function mod_escape(value) {
		  value = escape(value);
		  return value.replace(/\\+/g, \'%2B\');
		}
		
		$(document).ready(function(){							
			$(".sai_altrowstable tr").mouseover(function(){
				var old_class = $(this).attr("class");		
				$(this).attr("class", "sai_tr_bgcolor");		
				$(this).mouseout(function(){
					$(this).attr("class", old_class);
				});
			});			
			
			// For selecting tab
			try{
			var select_tab = window.location.hash;
			if(select_tab.length > 0){
				$(select_tab+"_a").addClass("selected");
			}else{
				$("#currentdb_a").addClass("selected");
			}
			}catch(e){}
				
			// for adding db	
			$("#submitdb").click(function() {
				$("#createdb").css("display", "");	
				var db = ($("#db").val());
				var w_l = window.location.toString();				
				if(w_l.indexOf("#") > 0){
					w_l = w_l.substring(0, w_l.indexOf("#"));
				}					
				$.ajax({
					type: "POST",
					url: w_l+"&submitdb=1&ajaxdb=1",					
					data: "db="+db,
					// checking for error
					success: function(data){
						$("#createdb").css("display", "none");						
						var result = data.substring(0,1);
						if(result == "1"){
							$_("db").value="";				
							var msg = data.substring(1,data.indexOf("<table"));
							var output = data.substring(data.indexOf("<table"));							
							message_box.show_message( "Done ",msg,2);														
							$("#showdbtab").html(output);
							$(".sai_altrowstable tr").mouseover(function(){
								var old_class = $(this).attr("class");		
								$(this).attr("class", "sai_tr_bgcolor");		
								$(this).mouseout(function(){
									$(this).attr("class", old_class);
								});
							});																											
						}
						if(result == "0"){	
							$("#createdb").css("display", "none");
							var msg = data.substring(1);
							message_box.show_message( "Error",msg,1);
						}
					},
					error: function() {
						message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
					}															
				});													
			});				
			// for adding user	
			$("#submituser").click(function() {	
				$("#createuser").css("display", "");			
				var dbuser = ($("#dbuser").val());				
				var userpass = ($("#dbpassword").val());
				userpass =  mod_escape(userpass);
				var w_l = window.location.toString();				
				if(w_l.indexOf("#") > 0){
					w_l = w_l.substring(0, w_l.indexOf("#"));
				}					
				$.ajax({
					type: "POST",
					url: w_l+"&submituserdb=1&ajax=1",					
					data: "dbuser="******"&dbpassword="******"#createuser").css("display", "none");																		
						var result = data.substring(0,1);														
						if(result == "1"){	
							$_("dbuser").value="";
							$_("dbpassword").value="";			
							var msg = data.substring(1,data.indexOf("<table"));							
							var output = data.substring(data.indexOf("<table"));							
							message_box.show_message( "Done ",msg,2);
							var height = $("#mask").height();
							$("#mask").css({ "height" :  height + 50 });
							chkdbvalue();							
							$("#showusertab").html(output);
							
							$(".sai_altrowstable tr").mouseover(function(){
								var old_class = $(this).attr("class");		
								$(this).attr("class", "sai_tr_bgcolor");		
								$(this).mouseout(function(){
									$(this).attr("class", old_class);
								});
							});																											
						}
						if(result == "0"){
							$("#createuser").css("display", "none");	
							var msg = data.substring(1);
							message_box.show_message( "Error",msg,1);
						}
					},	
					error: function() {
						message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
					}														
				});													
			});			
				
			//Get the height of the first item
			$("#mask").css({"height":"100%"});	
		
			//Calculate the total width - sum of all sub-panels width
			//Width is generated according to the width of #mask * total of sub-panels
			$("#panel").width(parseInt($("#mask").width() * $("#panel div").length));
			
			//Set the sub-panel width according to the #mask width (width of #mask and sub-panel must be same)
			$("#panel div").width($("#mask").width());			
			
			//Get all the links with rel as panel
			$("a[rel=panel]").click(function () {	
				
				//Get the height of the sub-panel
				var panelheight = $($(this).attr("href")).height()+200;				
				
				//Set class for the selected item
				$("a[rel=panel]").removeClass("selected");
				$(this).addClass("selected");			
				
				//Resize the height
				$("#mask").animate({"height":panelheight},{queue:false, duration:500});			
				
				//Scroll to the correct panel, the panel id is grabbed from the href attribute of the anchor
				$("#mask").scrollTo($(this).attr("href"), 800);	
				
				//Discard the link default behavior
				return false;
			});			
		});		
		
		function chkdbvalue(){			
			var w_l = window.location.toString();
			if(w_l.indexOf("#") > 0){
				w_l = w_l.substring(0, w_l.indexOf("#"));
			}					
			$.ajax({
				type: "POST",
				url: w_l+"&editdb_user=1",								
				success: function(data){																		
					$("#dbtouser_disp").css("display", "");									
					$("#dbtouser_disp").html(data);					
				},
				error: function() {
					message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
				}	
			});					
		}
	// ]]></script>
	
	<center>
		<div id="scroller-header">
			<br />
			<a href="#currentdb" rel="panel" class="heading_a" style="text-decoration:none" id="currentdb_a">' . $l['db_headling'] . '</a>
			<a href="#adddb" rel="panel" class="heading_a"  style="text-decoration:none" id="adddb_a">' . $l['db_add_label'] . '</a>
			<a href="#currentuser" rel="panel" class="heading_a" style="text-decoration:none" id="currentuser_a">' . $l['db_user_add_label'] . '</a>
			<a href="#dbtouser" rel="panel" class="heading_a" style="text-decoration:none" onclick="chkdbvalue();" id="dbtouser_a">' . $l['user_db_add_label'] . '</a>
		</div>
	</center>
	<br />
	<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /></br></br>';
    echo '<div id="scroller-body" >
		<div id="mask">
			<div id="panel">
				<div id="currentdb"  height="100%" width="700px">
					<center class="sai_tit"><img src="' . $theme['a_images'] . 'database.gif" />&nbsp; ' . $l['db_headling'] . '</center>
					<div class="sai_popup_add"></div>
					<div id="showdbtab">';
    showdb();
    echo '</div>
					
				</div>
				<div id="adddb"  height="100%" width="700px">';
    echo '<form accept-charset="' . $globals['charset'] . '" name="importsoftware" method="post" action="" >
					<center><div class="sai_tit"><img src="' . $theme['a_images'] . 'adddb.gif" alt="" />&nbsp;' . $l['db_add_label'] . '</div></center>						
					<br />
					<table border="0" cellpadding="8" cellspacing="8" width="90%" align="center" class="sai_divroundshad" sstyle="padding-left:15px; padding-top:15px;" >
						<tr>
							<td>
								<span class="sai_head">' . $l['db_label'] . '</span>
							</td>
							<td valign="top">
								' . $db_prefix . '<input type="text" name="db" id="db" size="30" value="' . POSTval('db', '') . '" />
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<p align="center"><input type="button" class="sai_graybluebut" id="submitdb" style="cursor:pointer" name="submitdb" value="' . $l['submitdb'] . '" /> &nbsp;<img id="createdb" src="' . $theme['images'] . 'progress.gif" style="display:none"></p>	
							</td>
						</tr>
					</table>										
					</form></br></br></br>
				</div>';
    echo '<div id="currentuser" width="700px" >';
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'database.gif" />&nbsp; ' . $l['db_user_headling'] . '</center>
						<div id="showusertab">';
    showuser();
    echo '</div>
				</div>
				<div id="dbtouser" width="700px" style="height:800px"> ';
    echo '<form accept-charset="' . $globals['charset'] . '" name="importsoftware" method="post" action="" >
						<center><div class="sai_tit"><img src="' . $theme['a_images'] . 'adddb.gif" alt="" /> &nbsp;' . $l['db_user_create_label'] . '</div></center>				
						<br />
						<table border="0" cellpadding="8" cellspacing="8" width="90%" align="center" class="sai_divroundshad" style="padding-left:15px; padding-top:15px;" >
							<tr>
								<td>
									<span class="sai_head">' . $l['db_user_label'] . '</span>
								</td>
								<td valign="top">
									' . $db_prefix . '<input type="text" name="dbuser" id="dbuser" size="23" value="" />
								</td>
							</tr>
							<tr>
								<td>
									<span class="sai_head">' . $l['db_user_password'] . '</span>
								</td>
								<td valign="top">
									<input type="text" name="dbpassword" id="dbpassword" size="30" value="" />
									<a href="javascript: void(0);" onclick="$_(\'dbpassword\').value=randstr(8);return false;" title="' . $l['randpass'] . '"><img src="' . $theme['images'] . 'randpass.gif" /></a>
								</td>
							</tr>
							<tr>
							<td colspan="2">
								<p align="center"><input type="button" class="sai_graybluebut" id="submituser" style="cursor:pointer" name="submituserdb" value="' . $l['submituserdb'] . '" /> &nbsp;<img id="createuser" src="' . $theme['images'] . 'progress.gif" style="display:none"></p>
							</td>
						</tr>
						</table>						
						</form>
						<div id="dbtouser_disp"></div>											
				</div>
			</div>
		</div>
	</div>';
    softfooter();
}
Exemple #20
0
function ftp_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $ftp_list, $done, $tuser;
    // for delete
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['delete'];
            return true;
        }
    }
    // for delete
    if (optGET('ajaxup')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['update'];
            return true;
        }
    }
    $__tmp = explode(':', !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost');
    $__ip = $__tmp[0];
    softheader($l['<title>']);
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
			// For msgbox
			var message_box = function() {			
				return {
					show_message: function(title, body , image) {			
						var okbutton = \'<input  style="width:75px" class="sai_graybluebut" type="button" onclick="message_box.close_message();" value="OK" />\';
						if(image == "1"){
							var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
						}else{
							var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
						}					
						if(jQuery(\'.sai_message_box\').html() === null) {
							var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
							jQuery(document.body).append( message );								
							jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
						}else{
							var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
							jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
							jQuery(\'.sai_message_box\').html( message );
						}
					},
					delete_message: function(title, body ,did) {								
						var yesbutton = \'<input type="button" style="width:75px" onclick="message_box.yes_close_message(\\\'\'+did+\'\\\');" value="YES" class="sai_graybluebut"/>\';
						var nobutton = \'<input type="button" style="width:75px" onclick="message_box.no_close_message();" value="NO" class="sai_graybluebut" />\';
						var img = \'<img src="' . $theme['images'] . 'remove_big.gif" />\';
						if(jQuery(\'.sai_message_box\').html() === null) {
							var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1" height="10%">\' +  title + \'</td></tr><tr ><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table></div>\';				
							jQuery(document.body).append( message );								
							jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
						}else{
							var message = \' <table  border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1" height="10%">\' + title + \'</td></tr><tr><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table>\'
							jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
							jQuery(\'.sai_message_box\').show(\'slow\');
							jQuery(\'.sai_message_box\').html( message );
						}
					},
					close_message: function() {
						jQuery(\'.sai_message_box\').hide(\'fast\');
					},
					yes_close_message: function(did) {						
						$(\'#did\'+did).attr("src","' . $theme['images'] . 'progress.gif");						
						jQuery(\'.sai_message_box\').hide(\'fast\');		
						$.ajax({				
							type: "POST",				
							url: window.location+"&ajaxdel=1&delete_fuser_id="+did,				
							// checking for error
							success: function(data){								
								var result = data.substring(0,1);					
								var msg = data.substring(1);
								if(result == "1"){
									message_box.show_message( "Delete ",msg,2);
									$("#tr"+did).fadeOut(2000);																														
								}
								if(result == "0"){
									message_box.show_message( "Error ",msg,1);																																			
								}
							},				
							error: function(request,error) {
								message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);					
							}
						});					
					},
					no_close_message: function() {
						jQuery(\'.sai_message_box\').hide(\'fast\');			
					}
				}
			}();
				
			$(document).ready(function(){	
				$(".sai_altrowstable tr").mouseover(function(){
					var old_class = $(this).attr("class");		
					$(this).attr("class", "sai_tr_bgcolor");		
					$(this).mouseout(function(){
						$(this).attr("class", old_class);
					});
				});
				
				// for deleting record
				$(".delete").click(function() {	
					var did = $(this).attr(\'id\');
					did = did.substr(3);			
					message_box.delete_message (\'Warning\',\'' . $l['record_del_conf'] . '\',did);			
				});
				
				$(".edit").click(function() {
				var id = $(this).attr(\'id\');
				id = id.substr(3);	
				
				$("#cid"+id).css("display", "");	
					if($(this).attr(\'src\') == "' . $theme['images'] . 'save.gif"){						
						if($_("qlimit"+id).checked){				
							var quota_limit = ($("#qutamb"+id).val());							
							var tmp = "&quota=limit&quota_limit="+quota_limit;
						}else{
							var tmp ="&quota=unlimited";
						}			
						$.ajax({
							type: "POST",
							url: window.location+"&ajaxup=1&edit_record="+id,
							data: tmp,
						
							// checking for error
							success: function(data){					
								var result = data.substring(0,1);					
								var msg = data.substring(1);	
								if(result == "0"){																														
									message_box.show_message( "Error ",msg,1);
									$(\'#eid\'+id).attr("src","' . $theme['images'] . 'editdetail.gif");
								}	
								if(result == "1"){						
									message_box.show_message( "Done ",msg,2);	
									if($_("qlimit"+id).checked){																	
										$(\'#quo\'+id).html($("#qutamb"+id).val() +\'' . $l['limited'] . '\');
									}else{
										$(\'#quo\'+id).html(\'' . $l['ftp_quota_unlimit'] . '\');
									}																									
									$(\'#eid\'+id).attr("src","' . $theme['images'] . 'editdetail.gif");
								}	
							},
							error: function() {
								message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);							
							}
						});								
						
						$(this).attr("src","' . $theme['images'] . 'progress.gif");	
						$("#cid"+id).css("display", "none");						
						$("#quota_limit"+id).css("display", "none");
						$("#quo"+id).css("display", "");							
					}else{
						$(this).attr("src","' . $theme['images'] . 'save.gif");						
						$("#quo"+id).css("display", "none");										
						$("#quota_limit"+id)							
							.val($("#quo"+id).text())
							.css("display", "")
							.focus();						
					}
				});
			
				// For cancel
				$(".cancel").click(function() {
					var id = $(this).attr(\'id\');
					id = id.substr(3);	
					$("#cid"+id).css("display", "none");
					$(\'#eid\'+id).attr("src","' . $theme['images'] . 'editdetail.gif");
					$("#quota_limit"+id).css("display", "none");
					$("#quo"+id).css("display", "");								
				});				
			});	
			
			function enableinput(idi){				
				$_("qutamb"+idi).disabled=false;
			}
			
			function disableinput(idi){					
				$_("qutamb"+idi).disabled=true;
			}
		// ]]></script>
			
	<center><div class="sai_tit"><img src="' . $theme['a_images'] . 'ftp.gif" alt="" />&nbsp;' . $l['ftp_head'] . '</div></center>	
	<table border="0" cellpadding="8" cellspacing="1" width="100%" align="center" class="sai_altrowstable">';
    echo '<tr>
			<th width="20%">' . $l['ftp_name'] . '</th>
			<th width="20%">' . $l['ftp_path'] . '</th>
			<th width="10%">' . $l['ftp_usage'] . '</th>
			<th width="30%">' . $l['ftp_quota'] . '</th>
			<th width="20%">' . $l['ftp_option'] . '</th>
		</tr>';
    $i = 1;
    foreach ($ftp_list as $key => $value) {
        echo '<tr class="' . ($i % 2 == 0 ? "sai_evenrowcolor" : "sai_oddrowcolor") . '" id="tr' . $i . '"><td>' . $key . '</td>';
        echo '<td>' . $value['path'] . '</td>';
        echo '<td>' . $value['usage'] . '&nbsp;' . $l['limited'] . '</td>';
        if (preg_match('/unlimited/is', $value['quota'])) {
            echo '<td>
						<span id="quo' . $i . '">' . $l['ftp_quota_unlimit'] . '</span>
						<span id="quota_limit' . $i . '" style="display:none;" >
						<input type="radio" name="quota' . $i . '" id="qunlimit' . $i . '" value="unlimited" checked="checked" onchange="disableinput(' . $i . ')" /> ' . $l['unlimited'] . ' &nbsp;
			<input type="radio" name="quota' . $i . '" id="qlimit' . $i . '" value="limited" onchange="enableinput(' . $i . ')" /> <input type="text" name="qutamb" id="qutamb' . $i . '" size="5" value="1000" disabled="disabled" />' . $l['limited'] . '</span>
					</td>';
        } else {
            $qlimit = explode('(', $value['quota']);
            $q_limit = explode('M', $qlimit[0]);
            echo '<td>
						<span id="quo' . $i . '">' . trim($q_limit[0]) . '&nbsp' . $l['limited'] . '</span>
						<span id="quota_limit' . $i . '" style="display:none;">
						<input type="radio" name="quota' . $i . '" id="qunlimit' . $i . '" value="unlimited" onchange="disableinput(' . $i . ')" /> ' . $l['unlimited'] . ' &nbsp;
			<input type="radio" name="quota' . $i . '" id="qlimit' . $i . '" value="limited" checked="checked" onchange="enableinput(' . $i . ')" /> <input type="text" name="qutamb" id="qutamb' . $i . '" size="5" value="' . trim($q_limit[0]) . '" />' . $l['limited'] . '</span>
					</td>';
        }
        if ($key != $softpanel->getCurrentUser_webuzo()) {
            echo '<td ><img title="Delete" class="delete" id="did' . $i . '" src="' . $theme['images'] . 'remove.gif" style="cursor:pointer" /> &nbsp;<img title="Edit" style="cursor:pointer" class="edit" id="eid' . $i . '" src="' . $theme['images'] . 'editdetail.gif"  />&nbsp;<a href="' . $globals['ind'] . 'act=editftp&fuser_id=' . $i . '" title="' . $l['cpass'] . '"><img src="' . $theme['images'] . 'randpass.gif" /></a>&nbsp;<img title="Cancel" class="cancel" id="cid' . $i . '" src="' . $theme['images'] . 'del.gif" style="display:none;" /></td>';
        } else {
            echo '<td align="center">-</td>';
        }
        $i++;
    }
    echo '</tr>
	</table>	
	<br /><br /><br />	
	<center><a href="' . $globals['ind'] . 'act=ftp_account" class="sai_graybluebut" style="text-decoration:none" >' . $l['add_new'] . '</a></center>';
    softfooter();
}
Exemple #21
0
function network_tools_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $error, $done, $domain, $lookup, $action;
    // For Detail
    if (optGET('domain_lookup')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            showdetail();
            return true;
        }
    }
    softheader($l['<title>']);
    error_handle($error);
    if (!empty($done)) {
        echo '<div class="sai_success">' . $done . '</div><br /><br />';
    }
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'network_tools.gif" />&nbsp;' . $l['network_tools'] . '</center>
<form accept-charset="' . $globals['charset'] . '" name="domain_lookup" method="post" action="" id="domain_lookup">
<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding-left:15px; padding-top:15px;">
	<tr>
		<td width="50%">
			<span class="sai_head">' . $l['lbl_head'] . '</font></span><br/><span class="sai_exp">' . $l['lookup_desc'] . '</span>
		</td>
		<td>			
			<input type="text" name="domain_name" id="domain_name" size="30" value="' . POSTval('domain_name', '') . '" />
		</td>
	</tr>
	<tr>
		<td>
			<p align="right">
				<input type="button" class="sai_graybluebut" name="dns_lookup" value="' . $l['domain_lookup'] . '" id="dns_lookup"/>
			</p>
		</td>
		<td>
			<p align="left">
				<input type="button" class="sai_graybluebut" name="dns_traceroute" value="' . $l['domain_trace'] . '" id="dns_traceroute"/> &nbsp;<img id="trace_prog" src="' . $theme['images'] . 'progress.gif" style="display:none">
			</p>
		</td>
	</tr>
</table>
</form><br />

	<div id="domain_lookup_tab" style="display:none"></div></br>
	
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	
	var message_box = function(){			
			return{
				show_message: function(title, body , image) {			
					var okbutton = \'<input  style="width:75px" class="sai_graybluebut" type="button" onclick="message_box.close_message();" value="OK" />\';
					if(image == "1"){
						var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
					}else{
						var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
					}					
					if(jQuery(\'.sai_message_box\').html() === null) {
						var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
						jQuery(document.body).append( message );								
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
					}else{
						var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
						jQuery(\'.sai_message_box\').html( message );
					}
				},
				close_message: function() {
					jQuery(\'.sai_message_box\').hide(\'fast\');
				}
			}
		}();
		
		$(document).ready(function(){
						
			// For close details
			$(".dclose").click(function(){
				$("#domain_lookup_tab").slideUp(\'slide\',\'\',5000);
			});
			
			// Domain Lookup
			$("#dns_lookup").click(function(){
				
				var action = $(this).attr(\'id\');
				action = action.substr(4);
				var domain = $("#domain_name").val();
				
				$.ajax({
					type: "POST",
					url: window.location+"&domain_lookup=1&domain_name="+domain+"&action="+action,
					
					// Checking for error
					success: function(data){
						var result = data.substring(0,1);
						if(result == "0"){								
							var msg = data.substring(1);
							message_box.show_message( "Error",msg,1);
						}else{										
							$("#domain_lookup_tab").html(data);
							$("#domain_lookup_tab").slideDown(\'slide\',\'\',5000);
						}
					},
					error: function() {
						message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
					}															
				});		
														
			});	
			
			// Domain Lookup
			$("#dns_traceroute").click(function(){
				
				$("#trace_prog").css("display", "");
				var action = $(this).attr(\'id\');
				action = action.substr(4);
				var domain = $("#domain_name").val();
				
				$.ajax({
					type: "POST",
					url: window.location+"&domain_lookup=1&domain_name="+domain+"&action="+action,
					
					// Checking for error
					success: function(data){
						$("#trace_prog").css("display", "none");																		
						var result = data.substring(0,1);
						if(result == "0"){
							$("#trace_prog").css("display", "none");
							var msg = data.substring(1);
							message_box.show_message( "Error",msg,1);
						}else{										
							$("#domain_lookup_tab").html(data);
							$("#domain_lookup_tab").slideDown(\'slide\',\'\',5000);
						}
					},
					error: function() {
						message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
					}															
				});		
														
			});	
						
		});	
		// ]]></script>';
    softfooter();
}
Exemple #22
0
function ram_theme()
{
    global $theme, $globals, $user, $l, $ram;
    if (optGET('ajax')) {
        echo 'var server_ram = [
		{ label: "Used",  data: ' . $ram['used'] . '},
		{ label: "Free",  data: ' . $ram['free'] . '}
	];';
        return true;
    }
    softheader($l['<title>']);
    echo '
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="' . $theme['url'] . '/js/excanvas.min.js"></script><![endif]-->
<script language="javascript" src="' . $theme['url'] . '/js/jquery.flot.min.js" type="text/javascript"></script>
<script language="javascript" src="' . $theme['url'] . '/js/jquery.flot.pie.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[


function server_graph_data(re){		

	var server_ram = [
		{ label: "Used",  data: ' . $ram['used'] . '},
		{ label: "Free",  data: ' . $ram['free'] . '}
	];	
	if(re.length > 0){
		try{
			eval(re);
		}catch(e){ }
	}	
	
	// Fill in the Text
	$_("server_ram_text").innerHTML = server_ram[0].data+" MB / "+(server_ram[0].data+server_ram[1].data)+" MB";
		
	// CPU
	server_graph("server_ram", server_ram);
	
	
};
																			   
function getusage(){
	if(AJAX("' . $globals['index'] . 'act=ram&ajax=true", "server_graph_data(re)")){
		return false;
	}else{
		return true;	
	}
};

function startusage(){
	ajaxtimer = setInterval("getusage()", 5000);
};	

// Draw a Server Resource Graph
function server_graph(id, data){		

	$.plot($("#"+id), data, 
	{
		series: {
			pie: { 
				innerRadius: 0.7,
				radius: 1,
				show: true,
				label: {
					show: true,
					radius: 0,
					formatter: function(label, series){
						if(label != "Used") return "";
						return \'<div style="font-size:13px;"><b>\'+Math.round(series.percent)+\'%</b></div><div style="font-size:9px;">\'+label+\'</div>\';	
					}
				}
			}
		},
		legend: {
			show: false
		}
	});
}


addonload("server_graph_data(\'void(0);\'); startusage();");

// ]]></script>';
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'ram.gif" />&nbsp;' . $l['header'] . '</center><br />
<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad"  style="padding-left:15px; padding-top:15px; ">
<tr>
	<td valign="top" width="50%" style="border-right:1px solid #CCCCCC">
		<div class="sai_heading" align="center">' . $l['raminfo'] . '</div>
		<br />
		<br />		
		<table align="center" cellpadding="10" cellspacing="0" border="0">
		<tr>
			<td class="sai_head">' . $l['totalram'] . '</td>
			<td class="val">' . $ram['limit'] . ' MB</td>
		</tr>
		
		<tr>
			<td class="sai_head">' . (isset($ram['swap']) ? $l['swap'] : $l['burstable']) . ' : </td>
			<td class="val">' . (isset($ram['swap']) ? $ram['swap'] : $ram['burst']) . ' MB</td>
		</tr>	
		
		<tr>
			<td class="sai_head">' . $l['utilised'] . '</td>
			<td class="val" id="ramused">' . $ram['used'] . ' MB</td>
		</tr>		
		</table>
	</td>
	<td valign="top" align="center" width="50%">
		<table align="center" cellpadding="10" cellspacing="10" border="0">
			<tr>
				<div class="sai_heading">' . $l['graphheader'] . '</div><br /><br />
			</tr>
			<tr>		
				<div id="server_ram" class="server_graph"></div>
				<br /><div id="server_ram_text">&nbsp;</div>
			</tr>
		</table>		
	</td>
</tr>
</table>

<br />

<br />

<br />';
    softfooter();
}
Exemple #23
0
function domainmanage_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $done, $domains_list, $primary_domain, $insid, $backed, $software, $soft, $hosts_list;
    // for delete
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            $hosts_list = $softpanel->getHosts();
            $domains_list = $softpanel->domains();
            echo '1' . $l['delete'];
            domainlist();
            hosttable();
            return true;
        }
    }
    softheader($l['<title>']);
    error_handle($error, '100%');
    echo '
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
		// For msgbox
		var message_box = function() {			
			return {
				show_message: function(title, body , image) {			
					var okbutton = \'<input  style="width:75px" class="sai_submit" type="button" onclick="message_box.close_message();" value="OK" />\';
					if(image == "1"){
						var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
					}else{
						var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
					}					
					if(jQuery(\'.sai_message_box\').html() === null) {
						var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
						jQuery(document.body).append( message );								
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
					}else{
						var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
						jQuery(\'.sai_message_box\').html( message );
					}
				},
				delete_message: function(title, body ,did) {								
					var yesbutton = \'<input type="button" style="width:75px" onclick="message_box.yes_close_message(\\\'\'+did+\'\\\');" value="YES" class="sai_submit"/>\';
					var nobutton = \'<input type="button" style="width:75px" onclick="message_box.no_close_message();" value="NO" class="sai_submit" />\';
					var img = \'<img src="' . $theme['images'] . 'remove_big.gif" />\';
					
					if(jQuery(\'.sai_message_box\').html() === null) {
						var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1" height="10%">\' +  title + \'</td></tr><tr ><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table></div>\';				
						jQuery(document.body).append( message );								
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
					}else{
						var message = \' <table  border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1" height="10%">\' + title + \'</td></tr><tr><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table>\'
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
						jQuery(\'.sai_message_box\').html( message );
					}
				},
				close_message: function() {
					jQuery(\'.sai_message_box\').hide(\'fast\');
				},
				yes_close_message: function(did){
					$(\'#did\'+did).attr("src","' . $theme['images'] . 'progress.gif");
					jQuery(\'.sai_message_box\').hide(\'fast\');
					$.ajax({				
						type: "POST",
						url: window.location+"&ajaxdel=1&delete_domain_id="+did,
						// checking for error
						success: function(data){
							var result = data.substring(0,1);
							var msg = data.substring(1, data.indexOf("<table"));
							var output1 = data.substring(data.indexOf("<table"), data.indexOf("</table"));
							var output2 = data.substring(data.indexOf("</table"));
							if(result == "1"){
								message_box.show_message( "Delete ",msg,2);
								$("#tr"+did).fadeOut(2000);
								$("#hosttable").html(output2);
								$("#domainlist").html(output1);
								$(document).ready(function(){
									$(".sai_altrowstable tr").mouseover(function(){
										var old_class = $(this).attr("class");
										$(this).attr("class", "sai_tr_bgcolor");
										$(this).mouseout(function(){
											$(this).attr("class", old_class);
										});
									});
									$(".delete").click(function(){
										var did = $(this).attr(\'id\');
										did = did.substr(3);
										message_box.delete_message (\'Warning\',\'' . $l['domain_del_conf'] . '\',did);
									});
								});
							}
							if(result == "0"){
								message_box.show_message( "Error ",msg,1);
							}
						},
						error: function(request,error){
							message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);
						}
					});
				},
				no_close_message: function() {
					jQuery(\'.sai_message_box\').hide(\'fast\');
				}
			}
		}();

	$(document).ready(function(){

		var r=1;
		$("#img").click(function(){
			if(r){
				$("#img").attr("src", "' . $theme['images'] . 'expanded.gif");
				jQuery(\'#hosttable\').slideDown(1000);
				r=0;
			}else{
				$("#img").attr("src", "' . $theme['images'] . 'collapsed.gif");
				jQuery(\'#hosttable\').hide(0);
				r=1;
			}
		});
		
		$(".sai_altrowstable tr").mouseover(function(){
			var old_class = $(this).attr("class");
			$(this).attr("class", "sai_tr_bgcolor");
			$(this).mouseout(function(){
				$(this).attr("class", old_class);
			});
		});
	});
	// ]]></script>';
    echo '<center class="sai_tit"><img src="' . $theme['images'] . 'domains.gif" />&nbsp; ' . $l['domain_headling'] . '</center>
	<div id="domainlist">';
    domainlist();
    echo '</div><br /><br />
	<!--<font size="2" style="text-align:right;"> ' . $l['host_list'] . '</font>-->
	<div id="img" style="cursor:pointer;"><span class="sai_head">' . $l['host_list'] . '</span>&nbsp;&nbsp;<img src="' . $theme['images'] . 'collapsed.gif" alt="" /></div><br/><br/>
	<div id="hosttable" style="display:none">';
    hosttable();
    echo '</div>
	<br /><br /><br />
	<center><a href="' . $globals['ind'] . 'act=ampps_domainadd" class="sai_abut">' . $l['add_new'] . '</a></center>';
    softfooter();
}
Exemple #24
0
function editini_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $list, $done, $iapps, $filename, $apps, $phpversion;
    // For Updating Entire File
    if (optGET('ajaxphpini')) {
        // Error
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Success
        if (!empty($done)) {
            echo '1' . $l['change_final_file'];
            return true;
        }
    }
    // On PHP Version Change
    if (optGET('ajaxdom')) {
        showconf();
        return true;
    }
    softheader($l['<title>']);
    echo '<br /><center class="sai_tit"><img src="' . $theme['a_images'] . 'php_conf.gif" />&nbsp;' . $l['phpinihead'] . '</center><br />

<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

	$(document).ready(function(){
		
		//For multiple version
		$("#phpversion").change(function(){
			$("#changedom").css("display", "");
			var version = $(this).val();
			$.ajax({
				type: "POST",
				url: window.location+"&ajaxdom=1&phpversion="+version,
				
				success: function(data){
					$("#changedom").css("display", "none");
					$("#dispconf").html(data);
				}
			});
		});
		
	});
	
	// ]]></script>
	
	<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" >
		<tr>
			<td width="35%">
				<span class="sai_head">' . $l['version'] . '</span>
			</td>
			<td>
				<select class="input" name="phpversion" id="phpversion">
					<option value="1_1" ' . POSTselect('phpversion', '1_1', 1) . '>' . $apps['1']['name'] . '</option>
					<option value="2_1" ' . POSTselect('phpversion', '2_1') . '>' . $apps['2']['name'] . '</option>
					<option value="45_1" ' . POSTselect('phpversion', '45_1') . '>' . $apps['45']['name'] . '</option>
					<option value="124_1" ' . POSTselect('phpversion', '124_1') . '>' . $apps['124']['name'] . '</option>
				</select>&nbsp;<img id="changedom" src="' . $theme['images'] . 'progress.gif" style="display:none" />
			</td>
		</tr>
	</table>
	<div id="dispconf">';
    showconf();
    echo '</div>';
    softfooter();
}
Exemple #25
0
function js_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $allcatwise;
    global $software, $soft, $info, $settings, $init_tab, $overwrite_option, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $show_installtype, $protocols, $nopackage, $ajaxhttpsexists, $ajaxhttps, $new_insid;
    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($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)) {
        $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 checkform(dosubmit){
	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;
	
};

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

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

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

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();
						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=js&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=js&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;
};
  
// 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();\');');
        $info['install'] .= '// ]]></script>';
        $info['install'] .= '

<div class="bg">
	<div class="sai_sub_head">' . $l['setup'] . '</div><hr>';
        if (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();" 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', $software['softname']) . '" />
		</div>
	</div><br />';
        if (!empty($show_installtype)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="jsinstalltype" class="sai_head">' . $l['ins_type'] . '</label><br />
				<span class="sai_exp2">' . $l['ins_type_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="jsinstalltype" id="jsinstalltype" class="form-control">
					<option value="0" ' . POSTselect('jsinstalltype', 0) . '>' . $l['ori_pack'] . '</option>
					<option value="1" ' . POSTselect('jsinstalltype', 1, 1) . '>' . $l['just_lib'] . '</option>
				</select>
			</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 form-control 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>
					<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) . ');return false;" title="' . $l['randpass'] . '"><img src="' . $theme['images'] . 'randpass.gif" /></a>
						</div>
						' : '') . '							
			</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)
        // 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>
				<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="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>
		<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 bg class--><!--PROC_DONE-->
	<br /><br />';
    }
    softheader($l['<title>'] . $software['name']);
    $loadedinfo = array('install', 'overview', 'features', 'reviews', 'ratings');
    $url = $theme['images'];
    $ratings = array();
    $deduct = 1;
    $r = $scripts[$k]['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[$k]['ratings'], 2) . ' out of 5)" />';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
        } else {
            $ratings[$i_r] = '<img src="' . $url . 'nostar.png' . '" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
        }
        $r = $r - $deduct;
    }
    ?>
<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();');

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'] . '";';
    }
    ?>
};
</script>
<?php 
    // 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" style="margin-top:0px;">
			' . (!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_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>' : '') . '
			</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_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>
				</ul>
			</div>
		</nav>
	</div>';
    ?>
	<script type="text/javascript">
	$_(tabs.inittab).className = tabs.tabbedclass;
	var softid = <?php 
    echo $soft;
    ?>
;

	tabs.override = function(id){
		if(id == 'install'){
			$_('install').className = 'sai_insbutclicked';
		}else{		
			$_('install').className = 'sai_insbut';
		}
	};
	</script>
	<?php 
    //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">
			<div class="col-sm-12">
				' . softparse($info['overview'], $soft) . '<br /><br />
			</div>
			<div class="col-sm-6">
				<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 bg class-->';
    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['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) {
            $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>' . datify($iv['itime']) . '</td>
				<td>' . $iv['ver'] . ($software['ver'] != $iv['ver'] && file_exists($software['path'] . '/upgrade.xml') ? ' <a href="' . $globals['ind'] . 'act=upgrade&insid=' . $ik . '"><img src="' . $theme['images'] . 'updates.gif" alt="' . $l['upd_to'] . ' ' . $scripts[$soft]['ver'] . '" class="someclass" /></a>' : '') . '</td>
				<td>' . (!empty($is_cloneable) ? '<a href="' . $globals['ind'] . 'act=sclone&insid=' . $ik . '" title="' . $l['clone'] . '" class="someclass"><img src="' . $theme['images'] . 'clone.gif" /></a>&nbsp;' : '') . '&nbsp;<a href="' . $globals['ind'] . 'act=remove&insid=' . $ik . '" title="' . $l['remove'] . '" class="someclass"><img src="' . $theme['images'] . 'remove.gif" /></a></td>
				<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(c);
			
			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");
				//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 bg 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['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', '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 #26
0
function bandwidth_theme()
{
    global $theme, $globals, $kernel, $user, $l, $bandwidth, $month, $band, $done, $error;
    // For ajax bandwidth set
    if (optGET('ajaxband')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['save'];
            show_band();
            return true;
        }
    }
    // For ajax bandwidth Reset
    if (optGET('ajaxreset')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['reset'];
            show_band();
            return true;
        }
    }
    softheader($l['<title>']);
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'bandwidth.gif" />&nbsp;' . $l['heading'] . '</center><br />


<form accept-charset="' . $globals['charset'] . '" action="" method="post" name="bandwidthedit" id="bandwidthedit">
	<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad"  style="padding-left:15px; padding-top:15px; ">	
		<tr>
			<td>
				<span class="sai_head">' . $l['bandwidth_up_limit'] . '</span><br />
				<span class="sai_exp">' . $l['bandwidth_up_limit_exp'] . '</span>
			</td>
			<td valign="top">
				<input type="text"  id="bandwidth_up_limit" name="bandwidth_up_limit" size="30" value="' . POSTval('bandwidth_up_limit', '') . '" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="sai_head">' . $l['bandwidth_limit'] . '</span><br />
				<span class="sai_exp">' . $l['bandwidth_limit_exp'] . '</span>
			</td>
			<td valign="top">
				<input type="text" id="bandwidth_limit" name="bandwidth_limit" size="30" value="' . POSTval('bandwidth_limit', '') . '" />
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				
					<input type="hidden" name="bandwidth_record" value="1" />
					<input type="submit" style="cursor:pointer" value="' . $l['submit_button'] . '" name="create_record" class="sai_graybluebut" id="submitbandwidth"/> &nbsp; 				
					<input type="button" style="cursor:pointer" value="' . $l['reset_button'] . '" name="resetbandwidth" class="sai_graybluebut" id="resetbandwidth"/> &nbsp;<img id="reset_bandwidth" src="' . $theme['images'] . 'progress.gif" style="display:none">
				
			</td>
		</tr>	
	</table>
</from><br ><br >
<div id="showband">';
    show_band();
    echo '</div>

<script type="text/javascript" charset="utf-8"><!-- // --><![CDATA[	
	var message_box = function() {			
		return {
			show_message: function(title, body , image) {			
				var okbutton = \'<input  style="width:75px" class="sai_graybluebut" type="button" onclick="message_box.close_message();" value="OK" />\';
				if(image == "1"){
					var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
				}else{
					var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
				}					
				if(jQuery(\'.sai_message_box\').html() === null) {
					var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
					jQuery(document.body).append( message );								
					jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
				}else{
					var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
					jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
					jQuery(\'.sai_message_box\').show(\'slow\');
					jQuery(\'.sai_message_box\').html( message );
				}
			},		
			close_message: function() {
				jQuery(\'.sai_message_box\').hide(\'fast\');
			}
		}
	}();
	
	
$(document).ready(function(){
	
	// For Setting record
	$("#submitbandwidth").click(function(){
		$("#reset_bandwidth").css("display", "");	
		var band_alert =$("#bandwidth_limit").val();			
		$.ajax({
			type: "POST",
			url: window.location+"&ajaxband=1",					
			data: $("#bandwidthedit").serialize(),
			
			// Checking for error
			success: function(data){
				$("#reset_bandwidth").css("display", "none");
				var result = data.substring(0,1);
				if(result == "1"){
					$_("bandwidth_up_limit").value="";
					$_("bandwidth_limit").value="";							
					var msg = data.substring(1,data.indexOf("<table"));
					var output = data.substring(data.indexOf("<table"));							
					message_box.show_message( "Done ",msg,2);														
					$("#showband").html(output);
					if(band_alert){
						$("#alert_limit").html(band_alert+" GB");
					}
					server_graph_data();																																				
				}
				if(result == "0"){
					var msg = data.substring(1);
					message_box.show_message( "Error",msg,1);
				}
			},
			error: function() {
				message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
			}															
		});		
		return false;											
	});
	
	// For Setting record
	$("#resetbandwidth").click(function(){
		$("#reset_bandwidth").css("display", "");				
		$.ajax({
			type: "POST",
			url: window.location+"&ajaxreset=1&bandwidth_reset=1",
			
			// Checking for error
			success: function(data){
				$("#reset_bandwidth").css("display", "none");
				var result = data.substring(0,1);
				if(result == "1"){					
					var msg = data.substring(1,data.indexOf("<table"));
					var output = data.substring(data.indexOf("<table"));							
					message_box.show_message( "Done ",msg,2);														
					$("#showband").html(output);
					$("#alert_limit").html("' . $l['na'] . '");
					server_graph_data();																																				
				}
				if(result == "0"){
					var msg = data.substring(1);
					message_box.show_message( "Error",msg,1);
				}
			},
			error: function() {
				message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
			}															
		});		
		return false;											
	});
});


// ]]></script>';
    softfooter();
}
Exemple #27
0
function php_ext_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $list, $done, $apps, $ext_list, $iapps;
    // Make the AJAX CALL
    if (optGET('ajaxphpext')) {
        // Is there an Error ?
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Success Message
        if (!empty($done)) {
            echo '1' . $l['success_msg'];
            return true;
        }
    }
    softheader($l['<title>']);
    echo '<br /><center class="sai_tit"><img src="' . $theme['a_images'] . 'php_ext.gif" />&nbsp;' . $l['php_ext_head'] . '</center><br />

<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

	$(document).ready(function(){				
		
		// For updating entire file
		$("#savephpext").click(function(){		
			
			$("#progress_img").css("display", "");
			var extensions = [];		
			ids = new Array("' . implode('", "', array_keys($ext_list['php_ext'])) . '");				
			for(x in ids){
				if($_("extlist["+ids[x]+"]").checked){													
					extensions[x] = ids[x];							
				}
			}
			function isEmpty(str) {
				return (!str || 0 === str.length);
			}
			
			if(isEmpty(extensions)){
				extensions = ["disableall"];
			}
			
			$.ajax({
				type: "POST",
				url: window.location+"&ajaxphpext=1&save_ext=1",
				data: "extensions="+extensions,
				
				// Checking for error
				success: function(data){
					
					$("#progress_img").css("display", "none");
					var result = data.substring(0,1);
					if(result == "1"){							
						var msg = data.substring(1);
						message_box.show_message( "Done ",msg,2);																					
					}
					if(result == "0"){							
						var msg = data.substring(1);
						message_box.show_message( "Error",msg,1);
					}
				},
				error: function() {
					message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
				}															
			});	
			return false;												
		});	
	});
		
	// ]]></script>';
    if (empty($iapps['1_1']) && empty($iapps['2_1']) && empty($iapps['45_1']) && empty($iapps['124_1'])) {
        echo '<br /><br />
		<center><span class="sai_tit">' . $l['no_php'] . '</span></center>';
    } else {
        echo '<div id="dispconf">';
        showconf();
        echo '</div>';
    }
    softfooter();
}
Exemple #28
0
function upgrade_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts;
    global $software, $soft, $info, $settings, $softins, $dbtype, $dbs, $upgraded, $__settings, $setupcontinue, $installations, $notes, $upgradableto;
    // 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;
    }
    softheader($l['<title>'] . $software['name']);
    echo '
	<div id="install_win">';
    //First add the installation info
    if (empty($upgraded)) {
        if (!empty($GLOBALS['alreadyupdated'])) {
            echo '
				<form accept-charset="' . $globals['charset'] . '" method="post" name="uprec" id="uprec" action="">
					<input type="hidden" name="updaterecord" value="1" />
					
					<div class="alert alert-warning">
						<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
						<center><a href="javascript:$_(\'uprec\').submit();" style="text-decoration:none;"><img src="' . $theme['images'] . 'notice.gif" /> &nbsp;  ' . lang_vars($l['alreadyupdated'], array($GLOBALS['alreadyupdated'], $softins['ver'])) . '</a></center>
					</div>
					
				</form><br />';
        }
        // You may not need an upgrade anymore.
        if (!empty($GLOBALS['no_update_required'])) {
            echo '
				<div class="alert alert-warning">
					<center><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . $l['no_update_required'] . '<center>
				</div>
				<br />';
        } else {
            echo '
				<div id="fadeout_div">
					<form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware">
					
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						
						function checkform(dosubmit){
							try{
								if(!formcheck() || !checkdbname(\'softdb\', true)){
									return false;
								}
							}catch(e){
								//Do nothing
							}
							$_("softsubmitbut").disabled = true;
							
							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['upgrading'] . '");
							}
							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 = 0;
									sid = $_("softbranch").value;
								}catch(e){ 
									var sid = 0;
								}
								
								$.ajax({
									url: window.location+"&jsnohf=1&softbranch="+sid,
									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;
											});
											//alert(responseText);
											// 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);
												new_theme_funcs_init();
											}).delay(50).animate({opacity: 1}, 500,function(){
												if($("#setupcontinue_url").length > 0){
													$(".third_url").css({"border": "2px solid #FBDB0C", "width":"55%", "padding":"5px"});
													alert("' . $l['setup_partial'] . '");
													$(".third_url").css({"border-color": "#fff", "transition":"60s"});
												}				
											});
											
											//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 = "";
						}
						
						// Use the Progress Bar ?
						var useprog = 1;
						
						softemail = new Array();
						function softmail(){
							try{
								var sofdom = "softdomain";
								for(x in softemail){
									if(softemail[x] == true) continue;
									var temp = $_(x).value.split("@");
									$_(x).value = temp[0] + "@" + $_(sofdom).value;
								}
							}catch(e){
								return false;
							}
						};
						
						' . (!empty($_POST) ? '' : 'addonload(\'softmail();\');');
            echo '
						// ]]></script>';
            $array_keys = array_keys($upgradableto);
            echo '
						<div class="bg"><br />
							<div class="row sai_main_head" style="width:100%;" align="center">
								<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
									<i class="fa sai-sync fa-2x" style="color:#00A0D2;"></i>
								</div>
								<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_upgrading'] . $scripts[$array_keys[0]]['name'] . '</div>
							</div><hr>';
            if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
                echo '<br />
								<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>';
            }
            echo error_handle($error, "100%", 0, 1);
            echo '
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['softins_url'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info"><a href="' . $softins['softurl'] . '" target="_blank">' . $softins['softurl'] . '</a></span>
								</div>
							</div><br />
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['softins_path'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $softins['softpath'] . '</span>
								</div>
							</div><br />';
            if (!empty($scripts[$softins['sid']]['parent']) && count($array_keys) >= 2) {
                echo '
								<div class="row">
									<div class="col-sm-5">
										<label for="softbranch" class="sai_head">' . $l['select_version'] . '</label>
									</div>
									<div class="col-sm-7">
										<select name="softbranch" id="softbranch" class="form-control" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
                foreach ($upgradableto as $uk => $uv) {
                    echo '<option value=' . $uk . '>' . $uv . '</option>';
                }
                echo '
										</select>
									</div>
								</div>';
            }
            if (empty($globals['disable_backup_upgrade'])) {
                echo '
								<div class="row">
									<div class="col-sm-5">
										<label class="sai_head">' . $l['create_backup'] . '</label>
										<span class="sai_exp2">' . $l['create_backup_exp'] . '</span>
									</div>
									<div class="col-sm-7">
										<input type="checkbox" name="create_backup" id="create_backup" ' . POSTchecked('create_backup') . ' />
									</div>
								</div>';
            }
            if (!empty($settings)) {
                if (file_exists($software['path'] . '/upgrade.js')) {
                    echo '<script language="javascript" type="text/javascript"><!--// --><![CDATA[';
                    echo @parselanguages(str_replace('$(', '$_(', implode('', file($software['path'] . '/upgrade.js'))));
                    echo '// ]]></script>';
                }
                foreach ($settings as $group => $sets) {
                    if ($group == 'hidden') {
                        continue;
                    }
                    echo '<br /><br />
									<div class="bg">
										<div class="sai_sub_head">' . $group . '</div><hr>';
                    foreach ($sets as $sk => $sv) {
                        // Add class form-control
                        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']);
                        }
                        echo '
											<div class="row">
												<div class="col-sm-5">
													<label for="dbusername" class="sai_head">' . $sv['head'] . '</label>
													' . (empty($sv['exp']) ? '' : '<br /><span class="sai_exp">' . $sv['exp'] . '</span>') . '
												</div>
												<div class="col-sm-7">
													' . $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>
													' : '') . '
												</div>
											</div>';
                    }
                    echo '
									</div><br /><!---end of bg class--->';
                }
                //The Hidden groups
                if (!empty($settings['hidden'])) {
                    foreach ($settings['hidden'] as $sk => $sv) {
                        echo $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)) {
                echo '<br /><br />
								<div class="row" style="padding-left:15px;">
									<span class="sai_info">' . $l['softcopy_note'] . '</span>
								</div><br />';
            }
            echo '
							<div class="row" style="padding-left:15px;">
								<span class="sai_info">' . lang_vars($l['note_backup'], array($softins['insid'])) . '</span>
							</div><br />';
            if (count($array_keys) < 2) {
                echo '
								<div class="row" style="padding-left:15px;">
									<span class="sai_info">' . $l['upgrading_to'] . '<b>' . (!empty($scripts[$array_keys[0]]['name']) ? $scripts[$array_keys[0]]['name'] : $iscripts[$array_keys[0]]['name']) . '</b>, ' . $l['version'] . ' : <b>' . (!empty($scripts[$array_keys[0]]['version']) ? $scripts[$array_keys[0]]['version'] : $iscripts[$array_keys[0]]['ver']) . '</b></span>
								</div><br />';
            }
            echo '
							<p align="center">
								<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
								<input type="submit" name="softsubmitbut" class="flat-butt" id="softsubmitbut" value="' . $l['softsubmit'] . '" /><span id="show_txt" style="display:none;"></span>
							</p><br /><br />
									
							<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
							
							<center><b><a href="' . script_link($soft) . '" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />
							
						</div><br /><!--end of bg class-->
					</form>
				</div>
				
				<div id="progress_bar" style="display: none; width: 100%;">
					<br />
					<div class="bg">
						<center>
							<div class="row sai_main_head" style="width:100%;" align="center">
								<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
									<i class="fa sai-sync fa-2x" style="color:#00A0D2;"></i>
								</div>
								<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_upgrading'] . $scripts[$array_keys[0]]['name'] . '</div>
							</div>
							<br />
							<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;background-color:#efefef; 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>
						<br /><br />
					</div><!--end of bg class-->
				</div><br /><br />';
        }
    } elseif (!empty($upgraded)) {
        $tmp_admiurl = $__settings['softurl'] . '/' . (!empty($softins['admin_folder']) ? $softins['admin_folder'] : $software['adminurl']);
        echo '
			<div class="bg">
				<div class="third_url"><h4>' . (!empty($setupcontinue) ? $l['setup_partial'] . '</h4><div id="setupcontinue_url" style="display:none;"></div>
				' . $l['finish_update'] . '<br />
				<a href="' . $__settings['softurl'] . '/' . $setupcontinue . '" target="_blank">' . $__settings['softurl'] . '/' . $setupcontinue . '</a></div><br />' : $l['congrats'] . '</h4>') . '<br />
				' . (!empty($setupcontinue) ? lang_vars($l['finish_up_sucess'], array($software['name'])) : $software['name'] . ' ' . $l['succesful']) . ' : <br />
				<a href="' . $__settings['softurl'] . '" target="_blank">' . $__settings['softurl'] . '</a>
				' . (!empty($software['adminurl']) ? '<br />' . $l['admin_url'] . ' : <a href="' . $tmp_admiurl . '" target="_blank">' . $tmp_admiurl . '</a>' : '') . '<br /><br />
				' . $l['enjoy'] . '<br /><br />
				' . (!empty($notes) ? $l['upgrade_notes'] . ' : <br /> 
				<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
				' . $l['please_note'] . '<br /><br />
				' . $l['regards'] . ',<br />
				' . $l['softinstaller'] . '<br /><br />
				<center><b><a href="' . script_link($soft) . '&highlight=' . $softins['insid'] . '&postact=upgrade">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['upgrade_tweet_off']) || empty($globals['lictype'])) {
            echo '
					<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="+1"><b>' . $l['upgrade_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('upgrade_tweet', $l['upgrade_tweet']) . '</textarea>
									</div>
									<div class="col-sm-2 col-xs-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>';
        }
        echo '
			</div><!--end of bg class--><!--PROC_DONE-->
			<br /><br /><br /><br />';
    }
    echo '
	</div>';
    softfooter();
}
Exemple #29
0
function sslkey_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $error, $done, $domain_list, $key_list, $detailkey, $done;
    // For delete
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['delete'];
            showcert();
            return true;
        }
    }
    // For detail
    if (optGET('ajaxdetail')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            showdetail();
            return true;
        }
    }
    softheader($l['<title>']);
    error_handle($error, '100%');
    if (!empty($done)) {
        echo '<div class="sai_success">' . $done . '</div>';
    }
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'sslkey.gif" />&nbsp;' . $l['lbl_head'] . '</center>
	<div id="showrectab">';
    showcert();
    echo '<br/></div>
	<div id="detailrectab" style="display:none"></div><br /><br />
	<form accept-charset="' . $globals['charset'] . '" action="" method="post" enctype="multipart/form-data">
		<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding:15px;" >
			<tr>
				<td colspan="2">
					<span class="sai_head">' . $l['upload'] . '</span><br />
				</td>
			</tr>
			<tr>
				<td width="40%">
					<span class="sai_exp">' . $l['domain'] . '</span><br />
				</td>
				<td valign="top">
					<input type="text" name="selectdom" id="selectdom" size="30" value="" />
				</td>
			</tr>
			<tr>
				<td valign="top">
					<span class="sai_exp">' . $l['paste'] . '</span>
				</td>
				<td>
					<textarea name="kpaste" id="kpaste" rows="25" cols="70"></textarea><br /><br />
					<span class="sai_head" style="text-align:center">' . $l['or'] . '</span>
				</td>
			</tr>
			<tr>
				<td width="35%">
					<span class="sai_exp">' . $l['choose_file'] . '</span><br />
				</td>
				<td>
					<div id="filecabinet"><input type=file id="ukey" name="ukey" ></div>
				</td>
			</tr>
			<tr>
			<td colspan="2">
				<p align="center">
					<input type="submit" name="install_key" style="cursor:pointer" value="' . $l['install_button'] . '" class="sai_graybluebut" id="instkey"/>
				</p>
			</td>
		</tr>
		</table><br /><br />
	</form>
	
	<form accept-charset="' . $globals['charset'] . '" action="" method="post" >
		<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding:15px;" >
			<tr>
				<td width="35%">
					<span class="sai_head">' . $l['genrate'] . '</span>
				</td>
			</tr>
			<tr>
				<td>
					<span class="sai_exp">' . $l['domain'] . '</span><br />
				</td>
				<td valign="top">
					<input type="text" name="selectdom" id="selectdom" size="30" value="" />
				</td>
			</tr>
			<tr>
				<td width="35%">
					<span class="sai_exp">' . $l['ksize'] . '</span><br />
				</td>
				<td>
					<select class="input" name="keysize" id="keysize">
						<option value="2048">' . $l['2048'] . '</option>
						<option value="4096">' . $l['4096'] . '</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<p align="center">
						<input type="submit" name="create_key" style="cursor:pointer" value="' . $l['genrate_button'] . '" class="sai_graybluebut" id="create_key"/>
					</p>
				</td>
			</tr>
		</table>
	</form>
	
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[	
	
	var message_box = function(){			
		return{
			show_message: function(title, body, image) {
				var okbutton = \'<input  style="width:75px" class="sai_graybluebut" type="button" onclick="message_box.close_message();" value="OK" />\';
				if(image == "1"){
					var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
				}else{
					var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';
				}
				
				if(jQuery(".sai_message_box").html() === null) {
					var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
					jQuery(document.body).append( message );
					$(".sai_message_box")
						.css("top", $($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150)
						.show("slow");
				}else{
					var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';
					$(".sai_message_box")
						.css("top", $($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150)
						.show("slow")
						.html(message);
				}
			},
			delete_message: function(title, body, did) {
				var yesbutton = \'<input type="button" style="width:75px" onclick="message_box.yes_close_message(\\\'\'+did+\'\\\');" value="YES" class="sai_graybluebut"/>\';
				var nobutton = \'<input type="button" style="width:75px" onclick="message_box.no_close_message();" value="NO" class="sai_graybluebut" />\';
				var img = \'<img src="' . $theme['images'] . 'remove_big.gif" />\';
				if(jQuery(".sai_message_box").html() === null) {
					
					var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1" height="10%">\' +  title + \'</td></tr><tr ><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table></div>\';
					jQuery(document.body).append( message );
					$(".sai_message_box")
						.css("top", $($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150)
						.show("slow");
					
				}else{
					
					var message = \' <table  border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1" height="10%">\' + title + \'</td></tr><tr><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table>\';
					$(".sai_message_box")
						.css("top", $($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150)
						.show("slow")
						.html(message);
				}
			},
			close_message: function() {
				$(".sai_message_box").hide("fast");
			},
			yes_close_message: function(did) {
				$("#did"+did).attr("src", "' . $theme['images'] . 'progress.gif");
				$(".sai_message_box").hide("fast");
				$.ajax({
					type: "POST",
					url: window.location+"&ajaxdel=1&delete_record="+did,
					
					// Checking for error
					success: function(data){
						var result = data.substring(0,1);
						var msg = data.substring(1);
						
						if(result == "1"){
							var msg = data.substring(1, data.indexOf("<table"));
							var output = data.substring(data.indexOf("<table"));
							message_box.show_message( "Delete ", msg, 2);
							$("#showrectab").html(output);
						}else{
							message_box.show_message("Error ", msg, 1);
							$("#did"+did).attr("src", "' . $theme['images'] . 'remove.gif");
						}
					},
					error: function(request,error) {
						message_box.show_message("Error", "' . $l['connect_error'] . '", 1);
					}
				});
			},
			no_close_message: function() {
				$(".sai_message_box").hide("fast");
			}
		}
	}();
	
	$(document).ready(function(){
		
		$(".sai_altrowstable tr").mouseover(function(){
			var old_class = $(this).attr("class");		
			$(this)
				.attr("class", "sai_tr_bgcolor")
				.mouseout(function(){
					$(this).attr("class", old_class);
				});
		});
		
	});
	
	// ]]></script>';
    softfooter();
}
Exemple #30
0
function email_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $saved;
    // For email settings
    if (optGET('ajax_email')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($saved)) {
            echo '1' . $l['settings_saved'];
            return true;
        }
    }
    softheader($l['<title>']);
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

	var message_box = function(){			
			return {
				show_message: function(title, body , image) {			
					var okbutton = \'<input  style="width:75px; margin-top:5px; background:#00A0D2; color:#FFF;" class="sai_submit" type="button" onclick="message_box.close_message();" value="OK" />\';
					if(image == "1"){
						var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
					}else{
						var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
					}
										
					if(jQuery(\'.sai_message_box\').html() === null) {
						var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="30%" > \'+ img + \'</td><td width="70%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2">\' + okbutton + \'</td></tr></table></div>\';
						jQuery(document.body).append( message );								
						jQuery(\'.sai_message_box\').css(\'top\', jQuery(\'html, body\').scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
					}else{
						var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="30%">\'+ img +  \'</td><td widt="70%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2">\' + okbutton + \'</td></tr></table>\';				
						jQuery(\'.sai_message_box\').css(\'top\', jQuery(\'html, body\').scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
						jQuery(\'.sai_message_box\').html( message );
					}
				},
				close_message: function() {
					jQuery(\'.sai_message_box\').hide(\'fast\');
				}
			}
		}();

	$(document).ready(function(){
			
		// For email settings
		$("#editform").submit(function(){
			
			$("#create_email").css("display", "");
			
			$.ajax({
				type: "POST",
				url: window.location+"&ajax_email=1",					
				data: $("#editform").serialize(),
				
				// Checking for error
				success: function(data){
					$("#create_email").css("display", "none");
					var result = data.substring(0,1);
					if(result == "1"){
						var msg = data.substring(1);
						message_box.show_message( "Done ",msg,2);																					
					}
					if(result == "0"){
						var msg = data.substring(1);
						message_box.show_message( "Error",msg,1);
					}
				},
				error: function() {
					message_box.show_message("Error", "Oops ... the connection was lost", 1);
				}													
			});
			
			return false;
														
		});	
	});
	// ]]></script>';
    echo '<form accept-charset="' . $globals['charset'] . '" name="editemailsettings" method="post" action="" id="editform" class="form-horizontal">
<div class="bg"><br />
	<div class="row sai_main_head" style="width:100%;" align="center">
		<div class="col-sm-6 col-xs-5" style="padding:0px 10px 0 0; text-align:right;">
			<i class="fa sai-mail fa-2x" style="color:#00A0D2;"></i>
		</div>
		<div class="col-sm-6 col-xs-7" style="padding-top:5px; padding-left:0px; text-align:left;">' . $l['emailsettings'] . '</div>
	</div><hr>';
    error_handle($error);
    if (!empty($saved)) {
        echo '<div class="alert alert-success">' . $l['settings_saved'] . '</div>';
    }
    echo '
	<div class="row">
		<div class="col-sm-5">
			<label  for="email" class="sai_head">' . $l['email_address'] . '</label>
			<span class="sai_exp">' . $l['email_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" id="email" name="email" class="form-control" size="30" value="' . POSTval('email', $user['email']) . '" softmail="true">
		</div>
	</div><br /><!---row end--->';
    // If admin has disabled installation email than dont show.
    if (empty($globals['off_install_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['ins_email'] . '</label>
					<span class="sai_exp">' . $l['ins_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="ins_email" name="ins_email" ' . POSTchecked('ins_email', $user['ins_email']) . ' />
				</div>
			</div><br />';
    }
    // If admin has disabled remove email than dont show.
    if (empty($globals['off_remove_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['rem_email'] . '</label>
					<span class="sai_exp">' . $l['rem_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="rem_email" name="rem_email" ' . POSTchecked('rem_email', $user['rem_email']) . ' />
				</div>
			</div><br />';
    }
    // If admin has disabled edit email than dont show.
    if (empty($globals['off_edit_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['editdetail_email'] . '</label>
					<span class="sai_exp">' . $l['editdetail_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="editdetail_email" name="editdetail_email" ' . POSTchecked('editdetail_email', $user['editdetail_email']) . ' />
				</div>
			</div><br />';
    }
    // If admin has disabled backup email than dont show.
    if (empty($globals['off_backup_mail']) && empty($globals['disable_backup_restore'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['backup_email'] . '</label>
					<span class="sai_exp">' . $l['backup_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="backup_email" name="backup_email" ' . POSTchecked('backup_email', $user['backup_email']) . ' />
				</div>
			</div><br />';
    }
    // Restore email settings
    if (empty($globals['off_restore_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['restore_email'] . '</label>
					<span class="sai_exp">' . $l['restore_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="restore_email" name="restore_email" ' . POSTchecked('restore_email', empty($user['disable_restore_email']) ? 1 : 0) . ' />
				</div>
			</div><br />';
    }
    // Clone email settings
    if (empty($globals['off_clone_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['clone_email'] . '</label>
					<span class="sai_exp">' . $l['clone_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="clone_email" name="clone_email" ' . POSTchecked('clone_email', empty($user['disable_clone_email']) ? 1 : 0) . ' />
				</div>
			</div><br />';
    }
    echo '<div class="row">
			<div class="col-sm-5">
				<label class="sai_head">' . $l['disable_all_notify_update'] . '</label>
				<span class="sai_exp">' . $l['disable_all_notify_update_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="checkbox" id="disable_all_notify_update" name="disable_all_notify_update" ' . POSTchecked('disable_all_notify_update', $user['disable_all_notify_update']) . ' />
			</div>
		</div><br />
	
		<p align="center">
			<input type="hidden" name="editemailsettings" value="1" />
			<input type="submit" name="editsubmit" value="' . $l['edit_settings'] . '" class="flat-butt" /> <br /><img id="create_email" src="' . $theme['images'] . 'progress.gif" style="display:none">
		</p>
</form>
</div><br /><!--end of bg class-->';
    softfooter();
}