<?

/*
FlexCMS (http://www.flexcms.com)
Flexible, Powerful, Affordable.

Contents of this file are protected by the copyright
notice found at http://www.flexcms.com/flex/pages/copyright.html,
and its usage is subject to the terms of the licensing agreement 
available at http://www.flexcms.com/flex/pages/license.html
*/



	// ========================================================================================
	// admin settings page
	// ========================================================================================
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_settings.gif" width="23" height="20"> '.$MsgText[0][64];
	$BrowserTitle = $MsgText[0][64];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="'.$MainURL.'/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[0][64];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[8] == 'y') {
		
			
			$ServerTZOffset = (date('Z')/60/60);
			if (date('I',mktime(0,0,0,1,1,date('Y'))) == 1 || date('I',mktime(0,0,0,7,1,date('Y'))) == 1) {
				$ServerDST = $MsgText[0][118];
				$ServerTZOffset--;
			}
			else {
				$ServerDST = $MsgText[0][119];
			}
			
			
			$query55 = "select * from `".$Settings['DBPrefix']."core-Settings` where Name='TimezoneOffset' limit 1";
			$result55 = mysql_query($query55) or die (mysql_error());
			$row55 = mysql_fetch_array($result55);
			if ($row55['Value'] != '') {
				$Settings['TimezoneOffset'] = $row55['Value'];
			}
			
			if ($Settings['TimezoneOffset'] != '') {
				$TimezoneOffsetSelected[$Settings['TimezoneOffset']] = ' selected';
			}
			else {
				$TimezoneOffsetSelected[$ServerTZOffset] = ' selected';
			}
			
			
			if ($Settings['WindowsQSPatch'] == 'y') {
				$ScriptNameDisplay = substr($Settings['ScriptName'],0,strlen($Settings['ScriptName'])-1);
			}
			else {
				$ScriptNameDisplay = $Settings['ScriptName'];
			}
		
	
			$PageContents = '<br>'.$MsgText[0][469].'<br><br><font color="#ff0000"><b>'.$MsgText[0][470].'</b></font><br><br>
<form action="'.$MainURL.'/admin/settings-save" method="post">

<br><b>'.$MsgText[0][471].':</b><br>'.$Settings['BaseURL'].'<br><b><a href="'.$MainURL.'/admin/settings-baseurl.html">'.$MsgText[0][662].'</a></b><br><font size="1">'.$MsgText[0][472].'<br></font>

<br><b>'.$MsgText[0][473].':</b><br><input type="text" name="ImagesURL" size="50" value="'.$Settings['ImagesURL'].'"><br><font size="1">'.$MsgText[0][474].'<br></font>

<br><b>'.$MsgText[0][475].':</b><br><input type="text" name="ScriptName" size="20" value="'.$ScriptNameDisplay.'"><br><font size="1">'.$MsgText[0][476].'<br></font>

<br><b>'.$MsgText[0][477].':</b><br><input type="text" name="CookieName" size="30" value="'.$Settings['CookieName'].'"><br><font size="1">'.$MsgText[0][478].'<br></font>


<br><br>

<br><b>'.$MsgText[0][524].':</b><br><select name="TimezoneOffset">
<option value="-12"'.$TimezoneOffsetSelected['-12'].'>GMT - 12:00</option>
<option value="-11"'.$TimezoneOffsetSelected['-11'].'>GMT - 11:00</option>
<option value="-10"'.$TimezoneOffsetSelected['-10'].'>GMT - 10:00</option>
<option value="-9"'.$TimezoneOffsetSelected['-9'].'>GMT - 9:00</option>
<option value="-8"'.$TimezoneOffsetSelected['-8'].'>GMT - 8:00</option>
<option value="-7"'.$TimezoneOffsetSelected['-7'].'>GMT - 7:00</option>
<option value="-6"'.$TimezoneOffsetSelected['-6'].'>GMT - 6:00</option>
<option value="-5"'.$TimezoneOffsetSelected['-5'].'>GMT - 5:00</option>
<option value="-4"'.$TimezoneOffsetSelected['-4'].'>GMT - 4:00</option>
<option value="-3.5"'.$TimezoneOffsetSelected['-3.5'].'>GMT - 3:30</option>
<option value="-3"'.$TimezoneOffsetSelected['-3'].'>GMT - 3:00</option>
<option value="-2"'.$TimezoneOffsetSelected['-2'].'>GMT - 2:00</option>
<option value="-1"'.$TimezoneOffsetSelected['-1'].'>GMT - 1:00</option>
<option value="0"'.$TimezoneOffsetSelected['0'].'>GMT</option>
<option value="1"'.$TimezoneOffsetSelected['1'].'>GMT + 1:00</option>
<option value="2"'.$TimezoneOffsetSelected['2'].'>GMT + 2:00</option>
<option value="3"'.$TimezoneOffsetSelected['3'].'>GMT + 3:00</option>
<option value="3.5"'.$TimezoneOffsetSelected['3.5'].'>GMT + 3:30</option>
<option value="4"'.$TimezoneOffsetSelected['4'].'>GMT + 4:00</option>
<option value="4.5"'.$TimezoneOffsetSelected['4.5'].'>GMT + 4:30</option>
<option value="5"'.$TimezoneOffsetSelected['5'].'>GMT + 5:00</option>
<option value="5.5"'.$TimezoneOffsetSelected['5.5'].'>GMT + 5:30</option>
<option value="6"'.$TimezoneOffsetSelected['6'].'>GMT + 6:00</option>
<option value="7"'.$TimezoneOffsetSelected['7'].'>GMT + 7:00</option>
<option value="8"'.$TimezoneOffsetSelected['8'].'>GMT + 8:00</option>
<option value="9"'.$TimezoneOffsetSelected['9'].'>GMT + 9:00</option>
<option value="9.5"'.$TimezoneOffsetSelected['9.5'].'>GMT + 9:30</option>
<option value="10"'.$TimezoneOffsetSelected['10'].'>GMT + 10:00</option>
<option value="11"'.$TimezoneOffsetSelected['11'].'>GMT + 11:00</option>
<option value="12"'.$TimezoneOffsetSelected['12'].'>GMT + 12:00</option>
</select>
<br><font size="1">'.$MsgText[0][525].'<br></font>
<br>
<div align="center"><table width="395" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td bgcolor="'.$Colors['Text'].'">
<table width="100%" border="0" cellpadding="5" cellspacing="1">
    <tr>
      <td bgcolor="'.$Colors['BG'].'"><font face="'.$FontFace.'" size="1">&nbsp;</td>
      <td bgcolor="'.$Colors['BG'].'"><div align="center"><font face="'.$FontFace.'" size="1"><b>'.$MsgText[0][532].'</b></div></td>
      <td bgcolor="'.$Colors['BG'].'"><div align="center"><font face="'.$FontFace.'" size="1"><b>'.$MsgText[0][533].'</b></div></td>
    </tr>
    <tr>
      <td bgcolor="'.$Colors['BG'].'"><font face="'.$FontFace.'" size="1">'.$MsgText[0][534].'</td>
      <td bgcolor="'.$Colors['BG'].'" align="center"><font face="'.$FontFace.'" size="1">'.date('D, M j, Y').'<br>'.date('g:i:sa').'</td>
      <td bgcolor="'.$Colors['BG'].'" align="center"><font face="'.$FontFace.'" size="1"><script>
	  var Today = new Date();
	  var Days = new Array(\'Sun\',\'Mon\',\'Tue\',\'Wed\',\'Thu\',\'Fri\',\'Sat\');
	  var Months = new Array(\'Jan\',\'Feb\',\'Mar\',\'Apr\',\'May\',\'Jun\',\'Jul\',\'Aug\',\'Sep\',\'Oct\',\'Nov\',\'Dec\');
	  var Year = Today.getYear(); if (Year < 1000) { Year += 1900; }
	  var Day = Today.getDate();
	  var Hour = Today.getHours();
	  var AmPm = \'am\';
	  if (Hour >= 12) {
		Hour -= 12;
		AmPm = \'pm\';
	  }
	  if (Hour == 0) {
	  	Hour = 12;
	  }
	  var Minute = Today.getMinutes();
	  if (Minute < 10) {
	  	Minute = \'0\'+Minute;
	  }
	  var Second = Today.getSeconds();
	  if (Second < 10) {
	  	Second = \'0\'+Second;
	  }
	  document.write( Days[Today.getDay()] + \', \' + Months[Today.getMonth()] + \' \' + Day + \', \' + Year + \'<br>\' + Hour + \':\' + Minute + \':\' + Second + AmPm );
	   </script></td>
    </tr>
	<tr>
      <td bgcolor="'.$Colors['BG'].'"><font face="'.$FontFace.'" size="1">'.$MsgText[0][535].'</td>
      <td bgcolor="'.$Colors['BG'].'" align="center"><font face="'.$FontFace.'" size="1">'.$ServerTZOffset.'</td>
      <td bgcolor="'.$Colors['BG'].'" align="center"><font face="'.$FontFace.'" size="1">
	  <script>
	  	var CurrentDateObject = new Date();
		var Date1 = new Date(CurrentDateObject.getFullYear(),0,1,0,0,0,0);
		var TZOffset = ((Date1.getTimezoneOffset()/60)*-1);
		
		if (TZOffset >= 0) {
			document.write("+"+TZOffset);
		}
		else {
			document.write(TZOffset);
		}
	  </script>
	  </td>
    </tr>
	<tr>
      <td bgcolor="'.$Colors['BG'].'"><font face="'.$FontFace.'" size="1">'.$MsgText[0][536].'</td>
      <td bgcolor="'.$Colors['BG'].'" align="center"><font face="'.$FontFace.'" size="1">'.$ServerDST.'</td>
      <td bgcolor="'.$Colors['BG'].'" align="center"><font face="'.$FontFace.'" size="1">
	  <script>
	  var PrintStrings = new Array(\''.str_replace("'",'',$MsgText[0][119]).'\',\''.str_replace("'",'',$MsgText[0][118]).'\');

var CurrentDateObject = new Date();
var Date1 = new Date(CurrentDateObject.getFullYear(),0,1,0,0,0,0);
var Date2 = new Date(CurrentDateObject.getFullYear(),6,1,0,0,0,0);
var GMTString1 = Date1.toGMTString();
var Date1b = new Date(GMTString1.substring(0, GMTString1.lastIndexOf(" ")-1));
var GMTString2 = Date2.toGMTString();
var Date2b = new Date(GMTString2.substring(0, GMTString2.lastIndexOf(" ")-1));

var HoursDifference1 = ((Date1-Date1b)/(1000*60*60));
var HoursDifference2 = ((Date2-Date2b)/(1000*60*60));

if (HoursDifference1 == HoursDifference2) {
	document.write(PrintStrings[0]);
	var DSTObserved = false;
}
else {
	document.write(PrintStrings[1]);
	var DSTObserved = true;
}
	</script>
	  </td>
    </tr>
</table>
</td>
    </tr>
</table></div>


<br><br><br><div align="center"><input type="submit" value="'.$MsgText[0][123].'">
</div>

</form>';



		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}

	// ========================================================================================




?>
