Location: PHPKode > projects > Basic Announce > Basic Announce Version 4.0/system/panel_settings.php
<?php
################################################################################
##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                 #
## --------------------------------------------------------------------------- #
##  ApPHP AdminPanel Pro                                                       #
##  Developed by:  ApPHP <hide@address.com>                                      #
##  License:       GNU LGPL v.3                                                #
##  Site:          http://www.apphp.com/php-adminpanel/                        #
##  Copyright:     ApPHP AdminPanel (c) 2006-2011. All rights reserved.        #
##                                                                             #
################################################################################

  // Initialize the session.
  session_start();
  
  require_once("../inc/classes/session.class.php");	
  require_once("../inc/checkAdminPagePermissions.php");
  
  require_once("../inc/config.inc.php");
  require_once("../inc/settings.inc.php");
  require_once("../inc/functions.inc.php");
  require_once("../inc/languages/".$SETTINGS['site_language'].".php");
  
  if(!page_access_allowed($_SERVER['SCRIPT_NAME'])) redirect_to("access_denied.php");
  
  
  $mode = isset($_REQUEST['set_mode']) ? $_REQUEST['set_mode'] : "";
  $update_msg_addition = "";
  $passwords_encryption 		      = isset($_POST['stypasswords_encryption']) ? $_POST['stypasswords_encryption'] : "";
  $passwords_encryption_type 	      = isset($_POST['stypasswords_encryption_type']) ? $_POST['stypasswords_encryption_type'] : "";
  $passwords_encryption_readonly      = ($SETTINGS['passwords_encryption'] == "1" && $SETTINGS['passwords_encryption_type'] == "MD5") ? "true" : "false";
  $passwords_encryption_type_readonly = ($SETTINGS['passwords_encryption'] == "1") ? "true" : "false";
  $time_zone_offset                   = isset($_POST['stytime_zone_offset']) ? $_POST['stytime_zone_offset'] : "";
  $msg = "";  
  
  // Tabs component settings
  define ("TABS_DIR", "../modules/tabs/");
  require_once(TABS_DIR."tabs.class.php");
  
  $first_tab_content  = "";
  $second_tab_content = "";
  $third_tab_content  = "";
  $forth_tab_content  = "";
  $fifth_tab_content  = "";
  
  $tabid = isset($_REQUEST['tabid']) ? $_REQUEST['tabid'] : "1_1";
  $tabs = new Tabs(1, "xp", TABS_DIR, "");
  
  if($tabid == "1_1"){
	$first_tab_content 	= "&nbsp;".lang("msg_ps_first_tab_text");
  }else if($tabid == "1_2"){
	$second_tab_content = "&nbsp;".lang("msg_ps_second_tab_text");
  }else if($tabid == "1_3"){
	$third_tab_content = "&nbsp;".lang("msg_ps_third_tab_text");
  }else if($tabid == "1_4"){
	$forth_tab_content = "&nbsp;".lang("msg_ps_fourth_tab_text");
  }else if($tabid == "1_5"){
	$forth_tab_content = "&nbsp;".lang("msg_ps_fifth_tab_text");
  }
  
  $tab1=$tabs->AddTab(lang('general_settings'), $first_tab_content);
  $tab2=$tabs->AddTab(lang('visual_settings'), $second_tab_content);
  $tab3=$tabs->AddTab(lang('users_admins_settings'), $third_tab_content);
  $tab4=$tabs->AddTab(lang('security_settings'), $forth_tab_content);
  $tab5=$tabs->AddTab(lang('mail_settings'), $fifth_tab_content);
  
  ## +---------------------------------------------------------------------------+
  ## | 2. Customizing:                                                           |
  ## +---------------------------------------------------------------------------+
  ## *** set container's width in pixels (px), inches (in) or points (pt)
  $tabs->SetWidth("820px");
  ## *** set container's height in pixels (px), inches (in) or points (pt)
  $tabs->SetHeight("auto"); // "auto"
  ## *** set alignment inside the container (left, center or right)
  $tabs->SetAlign("left");
  ## *** set container's color in RGB format or using standard names
  /// $tabs->SetContainerColor("#64C864");
  ## *** set border's width in pixels (px), inches (in) or points (pt)
  /// $tabs->SetBorderWidth("5px");
  ## *** set border's color in RGB format or using standard names
  /// $tabs->SetBorderColor("#64C864");
  /// $tabs->SetBorderColor("blue");
  /// $tabs->SetBorderColor("#445566");
  ## *** show debug info - false|true
  $tabs->Debug(false);
  ## *** allow refresh selected tabs - false|true
  /// $tabs->AllowRefreshSelectedTabs(true);
  ## *** set form submission type: "get" or "post"
  $tabs->SetSubmissionType("get");

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

<html>
<head>
    <title><?php echo $SETTINGS['site_name']; ?> :: <?php echo lang('admin_panel'); ?> :: <?php echo lang('panel_settings'); ?></title>
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <link href="../styles/<?php echo $SETTINGS['css_style'];?>/style.css" type="text/css" rel="stylesheet">
    <script type="text/javascript">
        function EditLangFields(){
            var lnkLangEdit = (document.getElementById('lnkLangEdit')) ? document.getElementById('lnkLangEdit') : null;
            var lnkLangCancelEdit = (document.getElementById('lnkLangCancelEdit')) ? document.getElementById('lnkLangCancelEdit') : null;
            if(lnkLangEdit && lnkLangCancelEdit){
                lnkLangEdit.style.display = "none";
                lnkLangCancelEdit.style.display = "";
                document.getElementById('stysite_language').disabled = false;
            }
        }
        
        function BlockLangFields(){
            var lnkLangEdit = (document.getElementById('lnkLangEdit')) ? document.getElementById('lnkLangEdit') : null;
            var lnkLangCancelEdit = (document.getElementById('lnkLangCancelEdit')) ? document.getElementById('lnkLangCancelEdit') : null;
            if(lnkLangEdit && lnkLangCancelEdit){
                lnkLangEdit.style.display = "";
                lnkLangCancelEdit.style.display = "none";
                document.getElementById('stysite_language').disabled = true;
            }        
        }
		
		function Mailer_OnChange(){						
			var mailer_value = document.getElementById('stymailer').value;
			var disabled_state = (mailer_value == "phpmail") ? true : false;

			document.getElementById('syysmtp_address').disabled = disabled_state;
			document.getElementById('syysmtp_port').disabled = disabled_state;
			document.getElementById('syysmtp_username').disabled = disabled_state;
			document.getElementById('syysmtp_password').disabled = disabled_state;
		}
    </script>
	<style>
		fieldset { height:1px;}
	</style>
</head>


<!-- BEGIN MAIN CONTENT ARE -->
<body dir="<?php echo $SETTINGS['language_dir'];?>">
<?php echo page_breadcrumbs(); ?>
<br />

<?php

if(($mode == "") || ($mode == "cancel") ){
    $_REQUEST['set_mode'] = "edit";
    $_REQUEST['set_rid'] = 1;	
}

if($mode == "update" && (strtolower(_SITE_MODE) != "demo")){ 
	if(($passwords_encryption != "") && ($SETTINGS['passwords_encryption'] != $passwords_encryption)){
		if($passwords_encryption == "1"){
		    // encrypt
			if($passwords_encryption_type == "AES"){
				$sql = "UPDATE ".TABLE_ADMINS." SET password = AES_ENCRYPT(password, '".$SETTINGS['passwords_encrypt_key']."') ";
				$db->Exec($sql);
				if($db->AffectedRows() >= 0) $update_msg_addition = lang('msg_passwords_encrypted');
				if(module_istalled('users')){
					$sql = "UPDATE ".TABLE_USERS." SET password = AES_ENCRYPT(password, '".$SETTINGS['passwords_encrypt_key']."') ";
					$db->Exec($sql);
					if($db->AffectedRows() >= 0) $update_msg_addition = lang('msg_passwords_encrypted');				
				}
			}else if($passwords_encryption_type == "MD5"){
				$sql = "UPDATE ".TABLE_ADMINS." SET password = MD5(password)";
				$db->Exec($sql);
				if($db->AffectedRows() >= 0) $update_msg_addition = lang('msg_passwords_encrypted');
				if(module_istalled('users')){
					$sql = "UPDATE ".TABLE_USERS." SET password = MD5(password)";
					$db->Exec($sql);
					if($db->AffectedRows() >= 0) $update_msg_addition = lang('msg_passwords_encrypted');
				}
			}
		}else{
			// decrypt
			$sql = "UPDATE ".TABLE_ADMINS." SET password = AES_DECRYPT(password, '".$SETTINGS['passwords_encrypt_key']."') ";
			$db->Exec($sql);
			if($db->AffectedRows() >= 0) $update_msg_addition = lang('msg_passwords_decrypted');
			if(module_istalled('users')){
				$sql = "UPDATE ".TABLE_USERS." SET password = AES_DECRYPT(password, '".$SETTINGS['passwords_encrypt_key']."') ";
				$db->Exec($sql);
				if($db->AffectedRows() >= 0) $update_msg_addition = lang('msg_passwords_decrypted');				
			}
		}
	}
	
	if($time_zone_offset != ""){
		$timezone_name = get_timezone_by_offset($time_zone_offset);	
		$sql = "UPDATE ".TABLE_SETTINGS." SET time_zone_name = '".$timezone_name."'";
		$db->Exec($sql);
	}	
}

echo "<table align='center'>";	
echo "<tr><td><div style='font-size:14px; font-weight:bold; text-align:center; padding-bottom:0;'>".lang('adm_panel_settings')."</div></td></tr>";
echo "<tr><td>";
$tabs->Display();
echo "</td></tr>";
echo "</table>";

################################################################################
## +---------------------------------------------------------------------------+
## | 1. Creating & Calling:                                                    | 
## +---------------------------------------------------------------------------+
##  *** define a relative (virtual) path to datagrid.class.php file and "pear" 
##  *** directory (relatively to the current file)
##  *** RELATIVE PATH ONLY ***

  define ("DATAGRID_DIR", "../modules/datagrid/");  /* Ex.: "datagrid/" */ 
  define ("PEAR_DIR", "../modules/datagrid/pear/"); /* Ex.: "datagrid/pear/" */
  
  require_once(DATAGRID_DIR.'datagrid.class.php');
  require_once(PEAR_DIR.'PEAR.php');
  require_once(PEAR_DIR.'DB.php');

  ob_start();
  
  $config = new Config();
  $DB_USER = $config->getUser();
  $DB_PASS = $config->getPassword();
  $DB_HOST = $config->getHost();
  $DB_NAME = $config->getDatabase();
  $DB_TYPE = $config->getDatabaseType();
 
  $db_conn = DB::factory($DB_TYPE);  /* don't forget to change on appropriate db type */
  $result_conn = $db_conn->connect(DB::parseDSN($DB_TYPE.'://'.$DB_USER.':'.$DB_PASS.'@'.$DB_HOST.'/'.$DB_NAME));
  if(DB::isError($result_conn)){ die($result_conn->getDebugInfo()); }  
##  *** put a primary key on the first place 
  $sql = "SELECT
        id,
        site_name,
        site_address,
        header_text,
        site_language,
        css_style,
        datagrid_css_style,
        smtp_address,
        smtp_port,
        smtp_username,
        smtp_password
    FROM ".TABLE_SETTINGS;         
##  *** set needed options and create a new class instance 
  $debug_mode = false;        /* display SQL statements while processing */    
  $messaging = true;          /* display system messages on a screen */ 
  $unique_prefix = "set_";    /* prevent overlays - must be started with a letter */
  $dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix, DATAGRID_DIR);
  if(strtolower(_SITE_MODE) == "demo") $dgrid->isDemo = true;

##  *** set data source with needed options
  $default_order_field = "id";
  $default_order_type = "ASC";
  $dgrid->dataSource($db_conn, $sql, $default_order_field, $default_order_type);
  $dgrid->modeAfterUpdate = "edit";

## +---------------------------------------------------------------------------+
## | 2. General Settings:                                                      | 
## +---------------------------------------------------------------------------+
##  *** set encoding and collation (default: utf8/utf8_unicode_ci)
/// $dg_encoding = "utf8";
/// $dg_collation = "utf8_unicode_ci";
/// $dgrid->SetEncoding($dg_encoding, $dg_collation);
##  *** set interface language (default - English)
 $dg_language = $SETTINGS['site_language'];  
 $dgrid->setInterfaceLang($dg_language);
##  *** set direction: "ltr" or "rtr" (default - "ltr")
  $direction = $SETTINGS['language_dir'];  
  $dgrid->SetDirection($direction);
##  *** set layouts: "0" - tabular(horizontal) - default, "1" - columnar(vertical), "2" - customized 
/// $layouts = array("view"=>"0", "edit"=>"1", "details"=>"1", "filter"=>"1"); 
/// $dgrid->setLayouts($layouts);
/// $details_template = "<table><tr><td>{field_name_1}</td><td>{field_name_2}</td></tr>...</table>";
/// $dgrid->setTemplates("","",$details_template);
##  *** set modes for operations ("type" => "link|button|image") 
##  *** "byFieldValue"=>"fieldName" - make the field to be a link to edit mode page
 $modes = array(
     "add"	  =>array("view"=>false, "edit"=>false, "type"=>"link"),
     "edit"	  =>array("view"=>false, "edit"=>true,  "type"=>"link", "byFieldValue"=>""),
     "cancel"  =>array("view"=>false, "edit"=>true,  "type"=>"link"),
     "details" =>array("view"=>false, "edit"=>false, "type"=>"link"),
     "delete"  =>array("view"=>false, "edit"=>false,  "type"=>"image")
 );
 $dgrid->setModes($modes);
##  *** allow scrolling on datagrid
/// $scrolling_option = false;
/// $dgrid->allowScrollingSettings($scrolling_option);  
##  *** set scrolling settings (optional)
/// $scrolling_width = "90%";
/// $scrolling_height = "100%";
/// $dgrid->setScrollingSettings($scrolling_width, $scrolling_height);
##  *** allow mulirow operations
//  $multirow_option = true;
//  $dgrid->allowMultirowOperations($multirow_option);
/// $multirow_operations = array(
///     "delete"  => array("view"=>true),
///     "details" => array("view"=>true),
///     "my_operation_name" => array("view"=>true, "flag_name"=>"my_flag_name", "flag_value"=>"my_flag_value", "tooltip"=>"Do something with selected", "image"=>"image.gif")
/// );
/// $dgrid->setMultirowOperations($multirow_operations);  
##  *** set CSS class for datagrid
##  *** "default" or "blue" or "gray" or "green" or "pink" or your own css file 
 $css_class = $SETTINGS['datagrid_css_style'];
 $dgrid->setCssClass($css_class);
##  *** set variables that used to get access to the page (like: my_page.php?act=34&id=56 etc.) 
 $http_get_vars = array("tabid");
 $dgrid->setHttpGetVars($http_get_vars);
##  *** set other datagrid/s unique prefixes (if you use few datagrids on one page)
##  *** format (in which mode to allow processing of another datagrids)
##  *** array("unique_prefix"=>array("view"=>true|false, "edit"=>true|false, "details"=>true|false));
/// $anotherDatagrids = array("abcd_"=>array("view"=>true, "edit"=>true, "details"=>true));
/// $dgrid->setAnotherDatagrids($anotherDatagrids);  
##  *** set DataGrid caption
 //$dg_caption = lang('adm_panel_settings');
 //$dgrid->setCaption($dg_caption);

## +---------------------------------------------------------------------------+
## | 3. Printing & Exporting Settings:                                         | 
## +---------------------------------------------------------------------------+
##  *** set printing option: true(default) or false 
 $printing_option = false;
 $dgrid->allowPrinting($printing_option);
##  *** set exporting option: true(default) or false and relative (virtual) path
##  *** to export directory (relatively to datagrid.class.php file).
##  *** Ex.: "" - if we use current datagrid folder
 $exporting_option = false;
 $exporting_directory = "../tmp/export/";               
 $dgrid->allowExporting($exporting_option, $exporting_directory);

## +---------------------------------------------------------------------------+
## | 4. Sorting & Paging Settings:                                             | 
## +---------------------------------------------------------------------------+
##  *** set sorting option: true(default) or false 
/// $sorting_option = true;
/// $dgrid->allowSorting($sorting_option);               
##  *** set paging option: true(default) or false 
/// $paging_option = true;
/// $rows_numeration = false;
/// $numeration_sign = "N #";
/// $dgrid->allowPaging($paging_option, $rows_numeration, $numeration_sign);
##  *** set paging settings
 #$bottom_paging = array("results"=>true, "results_align"=>"left", "pages"=>true, "pages_align"=>"center", "page_size"=>true, "page_size_align"=>"right");
 #$top_paging = array();
 #$pages_array = array("10"=>"10", "25"=>"25", "50"=>"50", "100"=>"100", "250"=>"250", "500"=>"500", "1000"=>"1000");
 #$default_page_size = 10;
 #$paging_arrows = array("first"=>"|&lt;&lt;", "previous"=>"&lt;&lt;", "next"=>"&gt;&gt;", "last"=>"&gt;&gt;|");
 #$dgrid->setPagingSettings($bottom_paging, $top_paging, $pages_array, $default_page_size, $paging_arrows);

## +---------------------------------------------------------------------------+
## | 5. Filter Settings:                                                       | 
## +---------------------------------------------------------------------------+
##  *** set filtering option: true or false(default)
# $filtering_option = true;
# $show_search_type = true;
# $dgrid->allowFiltering($filtering_option, $show_search_type);
###  *** set aditional filtering settings
# //$fill_from_array = array("0"=>"No", "1"=>"Yes");  /* as "value"=>"option" */
# $filtering_fields = array(
# );
# $dgrid->setFieldsFiltering($filtering_fields);

## +---------------------------------------------------------------------------+
## | 6. View Mode Settings:                                                    | 
## +---------------------------------------------------------------------------+
##  *** set view mode table properties
// $vm_table_properties = array("width"=>"90%");
// $dgrid->setViewModeTableProperties($vm_table_properties);  
##  *** set columns in view mode
##  *** Ex.: "on_js_event"=>"onclick='alert(\"Yes!!!\");'"
##  ***      "barchart" : number format in SELECT SQL must be equal with number format in max_value
// $vm_colimns = array(  
// );
// $dgrid->setColumnsInViewMode($vm_colimns);
##  *** set auto-genereted columns in view mode
//  $auto_column_in_view_mode = false;
//  $dgrid->setAutoColumnsInViewMode($auto_column_in_view_mode);

## +---------------------------------------------------------------------------+
## | 7. Add/Edit/Details Mode Settings:                                        | 
## +---------------------------------------------------------------------------+
##  *** set add/edit mode table properties
 $em_table_properties = array("width"=>"820px");
 $dgrid->setEditModeTableProperties($em_table_properties);
##  *** set details mode table properties
/// $dm_table_properties = array("width"=>"70%");
/// $dgrid->setDetailsModeTableProperties($dm_table_properties);
##  ***  set settings for add/edit/details modes
  $table_name  = TABLE_SETTINGS;
  $primary_key = "id";
  $condition   = "";//"table_name.field = ".$_REQUEST['abc_rid'];
  $dgrid->setTableEdit($table_name, $primary_key, $condition);

##  *** set columns in edit mode
	// prepare css styles
	$arr_css_styles = read_directory_subfolders("../styles/"); 
	$fill_from_array_css_style = array();
	foreach($arr_css_styles as $key){
	   $fill_from_array_css_style[$key] = ucfirst($key);
	} 
	$fill_from_array_datagrid_style = array("default"=>"Default", "blue"=>"Blue", "x-blue"=>"X-Blue", "green"=>"Green", "x-gray"=>"X-Gray", "gray"=>"Gray", "pink"=>"Pink"); /* as "value"=>"option" */
	$fill_from_array_languages = $config->langsArray();
	$fill_from_array_lang_directions = array("ltr"=>lang("left_to_right"), "rtl"=>lang("right_to_left"));
	$fill_from_array_enctyptions = array("0"=>lang("no"), "1"=>lang("yes"));
	$fill_from_array_enctyption_types = array("AES"=>"AES", "MD5"=>"MD5");
	$fill_from_array_left_panel = array("0"=>lang("disable"), "1"=>lang("enable"));
	$fill_from_array_upe = array("0"=>lang("no"), "1"=>lang("yes"));
	$fill_from_array_home_panel = array("0"=>"Closed", "1"=>"Opened");
	$fill_from_array_alert_panel = array("0"=>"Closed", "1"=>"Opened");
	$fill_from_array_icons = array("0"=>"Categorized", "1"=>"Heap");
	$fill_from_array_breadcrumbs = array("0"=>lang("disable"), "1"=>lang("enable"));
	$fill_from_array_remember_me = array("0"=>lang("disable"), "1"=>lang("enable"));
	$fill_from_array_https = array("0"=>lang("no"), "1"=>lang("yes"));
	$fill_from_array_logins = array("1"=>"1", "2"=>"2", "3"=>"3", "4"=>"4", "5"=>"5", "6"=>"6", "7"=>"7", "8"=>"8", "9"=>"9", "10"=>"10");
	$fill_from_array_penalty = array("1"=>"1", "2"=>"2", "3"=>"3", "4"=>"4", "5"=>"5", "6"=>"6", "7"=>"7", "8"=>"8", "9"=>"9", "10"=>"10", "15"=>"15", "20"=>"20", "30"=>"30", "45"=>"45", "60"=>"60");
	$fill_from_array_apr = array("0"=>lang("no"), "1"=>lang("yes"));
	$fill_from_array_db_types = array(
	  "mysql"    => "MySQL",
	  "pgsql"    => "PostgreSQL",
	  "sqlite"   => "SQLite",
	  "oci"      => "Oracle",
	  "cubrid"   => "Cubrid",
	  "firebird" => "Firebird / Interbase",
	  "dblib"    => "FreeTDS / Microsoft SQL Server / Sybase",
	  "ibm"      => "IBM DB2",
	  "informix" => "IBM Informix Dynamic Server",
	  "odbc"     => "ODBC v3 (IBM DB2, unixODBC and win32 ODBC)"
	);
	
	$fill_from_array_mailers = array("phpmail"=>"PHPmail", "smtpmail"=>"SMTPmail");

	$arr_time_zones = array();
	$arr_time_zones["-12"] = "[UTC - 12] Baker Island Time";
	$arr_time_zones["-11"] = "[UTC - 11] Niue Time, Samoa Standard Time";
	$arr_time_zones["-10"] = "[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time";
	$arr_time_zones["-9.5"] = "[UTC - 9:30] Marquesas Islands Time";
	$arr_time_zones["-9"] = "[UTC - 9] Alaska Standard Time, Gambier Island Time";
	$arr_time_zones["-8"] = "[UTC - 8] Pacific Standard Time";
	$arr_time_zones["-7"] = "[UTC - 7] Mountain Standard Time";
	$arr_time_zones["-6"] = "[UTC - 6] Central Standard Time";
	$arr_time_zones["-5"] = "[UTC - 5] Eastern Standard Time";
	$arr_time_zones["-4.5"] = "[UTC - 4:30] Venezuelan Standard Time";
	$arr_time_zones["-4"] = "[UTC - 4] Atlantic Standard Time";
	$arr_time_zones["-3.5"] = "[UTC - 3:30] Newfoundland Standard Time";
	$arr_time_zones["-3"] = "[UTC - 3] Amazon Standard Time, Central Greenland Time";
	$arr_time_zones["-2"] = "[UTC - 2] Fernando de Noronha, S. Georgia &amp; the S. Sandwich Islands (Time)";
	$arr_time_zones["-1"] = "[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time";
	$arr_time_zones["0"] = "[UTC] Western European Time, Greenwich Mean Time";
	$arr_time_zones["1"] = "[UTC + 1] Central European Time, West African Time";
	$arr_time_zones["2"] = "[UTC + 2] Eastern European Time, Central African Time";
	$arr_time_zones["3"] = "[UTC + 3] Moscow Standard Time, Eastern African Time";
	$arr_time_zones["3.5"] = "[UTC + 3:30] Iran Standard Time";
	$arr_time_zones["4"] = "[UTC + 4] Gulf Standard Time, Samara Standard Time";
	$arr_time_zones["4.5"] = "[UTC + 4:30] Afghanistan Time";
	$arr_time_zones["5"] = "[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time";		
	$arr_time_zones["5.5"] = "[UTC + 5:30] Indian Standard Time, Sri Lanka Time";
	$arr_time_zones["5.75"] = "[UTC + 5:45] Nepal Time";
	$arr_time_zones["6"] = "[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time";
	$arr_time_zones["6.5"] = "[UTC + 6:30] Cocos Islands Time, Myanmar Time";
	$arr_time_zones["7"] = "[UTC + 7] Indochina Time, Krasnoyarsk Standard Time";
	$arr_time_zones["8"] = "[UTC + 8] Chinese, Australian Western, Irkutsk (Standard Time)";
	$arr_time_zones["8.75"] = "[UTC + 8:45] Southeastern Western Australia Standard Time";
	$arr_time_zones["9"] = "[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time";
	$arr_time_zones["9.30"] = "[UTC + 9:30] Australian Central Standard Time";
	$arr_time_zones["10"] = "[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time";
	$arr_time_zones["10.5"] = "[UTC + 10:30] Lord Howe Standard Time";
	$arr_time_zones["11"] = "[UTC + 11] Solomon Island Time, Magadan Standard Time";
	$arr_time_zones["11.5"] = "[UTC + 11:30] Norfolk Island Time";
	$arr_time_zones["12"] = "[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time";
	$arr_time_zones["12.75"] = "[UTC + 12:45] Chatham Islands Time";
	$arr_time_zones["13"] = "[UTC + 13] Tonga Time, Phoenix Islands Time";
	$arr_time_zones["14"] = "[UTC + 14] Line Island Time";

 $em_columns = array(); 
 if($tabid == "" || $tabid == "1_1"){
	$em_columns["delimiter_1"]   = array("inner_html"=>"<font style='font-size:13px;font-weight:bold;color:#336699'><i>".lang('general_settings').":</i></font><br />");
    $em_columns["site_name"]     = array("header"=>lang('site_name'), "type"=>"textbox",   "req_type"=>"sy", "width"=>"300px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"");
	$em_columns["site_address"]  = array("header"=>lang('site_address'), "type"=>"textbox",   "req_type"=>"sd", "width"=>"300px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "post_addition"=>" <input type='checkbox' name='__nc_update_ranks' id='chk_update_ranks' value='1' /> <label for='chk_update_ranks'>".lang('update_ranks')."</label>");
	$em_columns["admin_email"]   = array("header"=>lang('admin_email'), "type"=>"textbox",   "req_type"=>"se", "width"=>"250px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"");
	$em_columns["site_language"] = array("header"=>lang('default_language'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_languages, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4", "post_addition"=>" <a style='display:;' id='lnkLangEdit' href='javascript:EditLangFields()'>[".lang('edit')."]</a><a style='display:none;' id='lnkLangCancelEdit' href='javascript:BlockLangFields()'>[".lang('block')."]</a>");
	$em_columns["database_type"] = array("header"=>lang('database_type'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>true, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_db_types, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
 }else if($tabid == "1_2"){
	$em_columns["delimiter_2"]        = array("inner_html"=>"<font style='font-size:13px;font-weight:bold;color:#336699'><i>".lang('visual_settings').":</i></font><br />");
	$em_columns["header_text"]        = array("header"=>lang('header'), "type"=>"textarea",  "req_type"=>"ry", "width"=>"350px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "edit_type"=>"simple", "resizable"=>"true", "rows"=>"2", "cols"=>"50");
	$em_columns["css_style"]          = array("header"=>lang('panel_css_style'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_css_style, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["datagrid_css_style"] = array("header"=>lang('datagrid_css_style'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_datagrid_style, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["menu_style"]         = array("header"=>lang('menu_placement'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>"self", "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["left_panel_scrolling"] = array("header"=>lang('left_panel_scroll'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_left_panel, "view_type"=>"radiobutton", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["alert_panel_status"] = array("header"=>lang('alert_panel_state'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_alert_panel, "view_type"=>"radiobutton", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["home_panel_status"]  = array("header"=>lang('home_panel_state'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_home_panel, "view_type"=>"radiobutton", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["dashboard_icons"]    = array("header"=>lang('dashboard_icons'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_icons, "view_type"=>"radiobutton", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["allow_breadcrumbs"]  = array("header"=>lang('breadcrumbs'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_breadcrumbs, "view_type"=>"radiobutton", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["delimiter_3"] 		  = array("inner_html"=>"<font style='font-size:13px;font-weight:bold;color:#336699'><i>".lang('date_and_time').":</i></font><br />");
	$em_columns["time_zone_offset"]   = array("header"=>lang('time_zone'), "type"=>"enum",      "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$arr_time_zones, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
 }else if($tabid == "1_3"){
	$em_columns["allow_password_recovery"] = array("header"=>lang('allow_password_recovery'), "type"=>"enum",      "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_apr, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["excessive_logins_timeout"] = array("header"=>lang('excessive_logins_timeout'), "type"=>"enum",      "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_penalty, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4", "post_addition"=>" <span class='field_comment'>".lang('penalty_in_minutes')."</span>");
	$em_columns["delimiter_4a"] = array("inner_html"=>"<font style='font-size:13px;font-weight:bold;color:#336699'><i>".lang('users_settings').":</i></font><br />");
	$em_columns["user_password_editing"]  = array("header"=>lang('allow_edit_user_password'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>((module_istalled('users')) ? false : true), "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_upe, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["user_excessive_logins"]  = array("header"=>lang('user_excessive_logins'), "type"=>"enum",      "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_logins, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4", "post_addition"=>" <span class='field_comment'>".lang('attempts_allowed')."</span>");
	$em_columns["delimiter_4b"] = array("inner_html"=>"<font style='font-size:13px;font-weight:bold;color:#336699'><i>".lang('admins_settings').":</i></font><br />");
	$em_columns["admin_password_editing"] = array("header"=>lang('allow_edit_admin_password'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_upe, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4");
	$em_columns["admin_excessive_logins"]  = array("header"=>lang('admin_excessive_logins'), "type"=>"enum",      "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_logins, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4", "post_addition"=>" <span class='field_comment'>".lang('attempts_allowed')."</span>");
 }else if($tabid == "1_4"){	
	$https_addition_text = "
		<div class='field_comment'>".lang('msg_ps_https_addition_text')."<br /><br />
		RewriteEngine On <br />
		RewriteCond %{SERVER_PORT} 80 <br />
		RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
		</div>";
	
	$em_columns["delimiter_5"] 				 = array("inner_html"=>"<font style='font-size:13px;font-weight:bold;color:#336699'><i>".lang('security_settings').":</i></font><br />");
	$em_columns["session_timeout"] 			 = array("header"=>lang('session_timeout'), "type"=>"textbox",   "req_type"=>"rip", "width"=>"40px", "title"=>"", "readonly"=>false, "maxlength"=>"3", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "post_addition"=>" min.");
	$em_columns["passwords_encryption"] 	 = array("header"=>lang('passwords_encryption'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>$passwords_encryption_readonly, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_enctyptions, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4", "post_addition"=>"<br><span class='field_comment'>".lang('msg_ps_change_encryption_type')."</span>");
	$em_columns["passwords_encryption_type"] = array("header"=>lang('encryption_type'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>$passwords_encryption_type_readonly, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_enctyption_types, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4", "post_addition"=>"<br><span class='field_comment'>".lang('msg_ps_after_selecting_md5')."</span>");
	$em_columns["allow_remember_me"]         = array("header"=>lang('remember_me'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_remember_me, "view_type"=>"radiobutton", "radiobuttons_alignment"=>"horizontal", "multiple"=>false, "multiple_size"=>"4");
 	$em_columns["force_https_protocol"]      = array("header"=>lang('force_https_protocol'), "type"=>"enum", "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array_https, "view_type"=>"radiobutton", "radiobuttons_alignment"=>"horizontal", "multiple"=>false, "multiple_size"=>"4", "post_addition"=>$https_addition_text);
 }else if($tabid == "1_5"){	
	$em_columns["delimiter_2"]    = array("inner_html"=>"<font style='font-size:13px;font-weight:bold;color:#336699'><i>".lang('mail_settings').":</i></font><br />");
	$em_columns["mailer"]         = array("header"=>lang('mailer'), "type"=>"enum",  "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"onchange='Mailer_OnChange()'", "source"=>$fill_from_array_mailers, "view_type"=>"dropdownlist", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>false, "multiple_size"=>"4", "post_addition"=>"");
	$em_columns["smtp_address"]   = array("header"=>lang('smtp_address'), "type"=>"textbox",   "req_type"=>"sy", "width"=>"300px", "title"=>"", "readonly"=>false, "maxlength"=>"125", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"");
	$em_columns["smtp_port"]      = array("header"=>lang('smtp_port'), "type"=>"textbox",   "req_type"=>"sy", "width"=>"60px", "title"=>"", "readonly"=>false, "maxlength"=>"6", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"");
	$em_columns["smtp_username"]  = array("header"=>lang('smtp_username'), "type"=>"textbox",   "req_type"=>"sy", "width"=>"140px", "title"=>"", "readonly"=>false, "maxlength"=>"30", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"");
	$em_columns["smtp_password"]  = array("header"=>lang('smtp_password'), "type"=>"textbox",   "req_type"=>"sy", "width"=>"140px", "title"=>"", "readonly"=>false, "maxlength"=>"20", "default"=>"", "unique"=>false, "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"");
 }
 
 $dgrid->setColumnsInEditMode($em_columns);

## +---------------------------------------------------------------------------+
## | 8. Bind the DataGrid:                                                     | 
## +---------------------------------------------------------------------------+
##  *** bind the DataGrid and draw it on the screen

  $msg_ps_update_successful = str_replace("_MSG_ADD_", $update_msg_addition, lang('msg_ps_update_successful'));
  $update_msg = draw_message("success", $msg_ps_update_successful, false, "820px", "../");	
  
  $dgrid->SetDgMessages("", $update_msg, ""); 
  $dgrid->bind();
  
  if($dgrid->IsOperationCompleted()){
	$update_ranks = isset($_POST['__nc_update_ranks']) ? $_POST['__nc_update_ranks'] : "";
	$site_address = isset($_POST['sdysite_address']) ? $_POST['sdysite_address'] : "";
	if($update_ranks){
	  set_site_settings(array(
		  "rank_alexa"  => number_format(get_alexa_rank($site_address), "0", ".", ","),
		  "rank_google" => get_google_rank($site_address),
		  "rank_last_updated" => date("Y-m-d H:i:s")
	  ));
	}
	echo "<script type='text/javascript'>setTimeout('top.location.href=top.location.href', 3000);</script>";  
  }
  
  
  ob_end_flush();

################################################################################

?>
<br />

<script type="text/javascript">
<!--
BlockLangFields();
<?php
	if($tabid == "1_5"){
		echo "Mailer_OnChange();\n";
	}  
?>
//-->
</script>
<br />
</body>
</html>
Return current item: Basic Announce