<?

/*
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 versions page
	// ========================================================================================
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_info.gif" width="21" height="20"> '.$MsgText[0][57];
	$BrowserTitle = $MsgText[0][57];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="'.$MainURL.'/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[0][57];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[1] == 'y') {
		
			$query = "SELECT VERSION() AS version";
			$result = mysql_query($query) or die (mysql_error());
			$row = mysql_fetch_array($result);
			
			$MySQLVersion = $row['version'];
			
			$PHPVersion = @phpversion();
			
			$Platform = $HTTP_SERVER_VARS["SERVER_SOFTWARE"];
			$Platform = str_replace(' ','<br>',$Platform); 
			
			
			$LicenseLevels[1] = $MsgText[0][23];
			$LicenseLevels[2] = $MsgText[0][24];
			$LicenseLevels[3] = $MsgText[0][25];
			$LicenseLevels[4] = 'Special';
			
			
			if (function_exists("gd_info")) {
				$GDInfo = @gd_info();
			}
			if ($GDInfo['GIF Create Support'] == true) {
				$GIFWriteSupport = $MsgText[0][118];
			}
			else {
				$GIFWriteSupport = $MsgText[0][119];
			}
			
			
			
			$ManageSubLink = '<a href="'.$MainURL.'/admin/settings-baseurl2.html">'.$MsgText[0][19].'</a>';
			
			
	
			$PageContents = '<br><b>'.$MsgText[0][369].':</b><br><table width="100%" border="0" cellpadding="5" cellspacing="0"><tr><td width="50%" valign="top"><font face="'.$FontFace.'" size="'.$FontSize.'"><b>'.$MsgText[0][370].':</b><br>'.$Platform.'</td><td width="50%" valign="top"><font face="'.$FontFace.'" size="'.$FontSize.'"><b>' . $MsgText[0][371] . ':</b><br>'.$PHPVersion.'<br>'.$MsgText[0][539].': '.$GDInfo['GD Version'].'<br>'.$MsgText[0][538].': '.$GIFWriteSupport.'<br><br><b>' .$MsgText[0][372]. ':</b><br>'.$MySQLVersion.'<br><br><b>'.$MsgText[0][373]. ':</b><br>'.$_SERVER['SERVER_ADDR'].'</td></tr></table><br><br><b>'. $MsgText[0][374].':</b><br><table width="100%" border="0" cellpadding="5" cellspacing="0"><tr><td width="50%" valign="top"><font face="'.$FontFace.'" size="'.$FontSize.'">'.$Settings['SPN'].' '.$MsgText[0][569].': v'.$Settings['VS'].'<br>'.$MsgText[0][375].': '.$Settings['VD'].'<br><br>'.$MsgText[0][20].': '.date('F j, Y',$Settings['id']).'</td><td width="50%" valign="top"><font face="'.$FontFace.'" size="'.$FontSize.'">'.$MsgText[0][21].':<br>'.$LicenseLevels[$Settings['l'.'v'.'l']].'<br><br>'.$ManageSubLink.'</td></tr></table>';


			$ModuleNames['core'] = $MsgText[0][377];
			$ModuleNames['cl'] = $MsgText[1][1];
			$ModuleNames['mb'] = $MsgText[2][1];
			$ModuleNames['pg'] = $MsgText[3][1];
			$ModuleNames['cs'] = $MsgText[4][1];
			$ModuleNames['nl'] = $MsgText[5][1];
			$ModuleNames['gb'] = $MsgText[6][1];
			$ModuleNames['na'] = $MsgText[7][1];
			$ModuleNames['lm'] = $MsgText[8][1];
			$ModuleNames['ec'] = $MsgText[9][1];
			
			$ModuleCodes = array('core','cl','mb','pg','cs','nl','gb','na','lm','ec');
			

			$query = "show table status";
			$result = mysql_query($query) or die (mysql_error());
			while ($row = mysql_fetch_array($result)) {
			
				if ($Settings['DBPrefix'] != '') {
					list ($Trash,$FullTableName) = explode($Settings['DBPrefix'],$row['Name'],2);
					list ($ModuleCode,$TableName) = explode('-',$FullTableName,2);
				}
				else {
					list ($ModuleCode,$TableName) = explode('-',$row['Name'],2);
				}
				
				if ($ModuleCode != '') {
					$SpaceUsed[$ModuleCode] = ($SpaceUsed[$ModuleCode] + $row['Data_length'] + $row['Index_length']);
					$TotalSpaceUsed = ($TotalSpaceUsed + $row['Data_length'] + $row['Index_length']);
				}
			
			}
			
			
			$PageContents .= '<br><br><b>'.$MsgText[0][378].':</b><br><table border="0" cellpadding="2" cellspacing="0" border="0"><tr>
			      <td align="left"><font face="'.$FontFace.'" size="'.$FontSize.'"><b>'.$MsgText[0][379].'</b>&nbsp;&nbsp;</td>
			      <td align="center"><font face="'.$FontFace.'" size="'.$FontSize.'"><b>'.$MsgText[0][380].'</b></td>
    			</tr>';
			
			for ($i = 0; $i < count($ModuleCodes); $i++) {
			
				$PageContents .= '<tr>
			      <td align="left"><font face="'.$FontFace.'" size="'.$FontSize.'">'.$ModuleNames[$ModuleCodes[$i]].'&nbsp;&nbsp;</td>
			      <td align="center"><font face="'.$FontFace.'" size="'.$FontSize.'">'.number_format($SpaceUsed[$ModuleCodes[$i]]/1024,1).' KB</td>
    			</tr>';
			
			}
			
			$PageContents .= '<tr>
			      <td align="right"><font face="'.$FontFace.'" size="'.$FontSize.'"><b>'.$MsgText[0][381].': </b></td>
			      <td align="center"><font face="'.$FontFace.'" size="'.$FontSize.'"><b>'.number_format($TotalSpaceUsed/1024,1).' KB</b></td>
    			</tr></table>';



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

	}
	else {
	
		RedirectToLogin();
	
	}

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




?>
