<?

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


	
	// ========================================================================================
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_backup.gif" width="20" height="21" align="middle"> '.$MsgText[0][584];
	$BrowserTitle = $MsgText[0][584];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[0][584];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[23] == 'y') {
		
			ReadFormArguments();
			Global $FormArguments;
			
			if (count($FormArguments) > 0) {
			
				$ItemCodes['D'] = ' - '.$MsgText[0][601];
				$ItemCodes['S'] = ' - '.$MsgText[0][602];
				$ItemCodes['I'] = ' - '.$MsgText[0][603];
				
				
				$FileHandle = fopen('./backups/'.$FormArguments['BackupFile'], "rb");
				$FileContents = fread($FileHandle, 500);
				fclose($FileHandle);
				
				list ($BackupFileData, $Trash) = explode('$%$%$%$%$%$%$', $FileContents, 2);
									
				list ($DateCreated, $ItemsList, $FlexVersion) = explode('+', $BackupFileData, 3);
				
				
				$ItemsListPrint = '';
				$ItemsListSplit = explode('-', $ItemsList);
				for ($z = 0; $z < count($ItemsListSplit); $z++) {
					if ($ItemsListPrint != '') {
						$ItemsListPrint .= '<br>';
					}
					$ItemsListPrint .= $ItemCodes[$ItemsListSplit[$z]];
				}
		
		
				$PageContents = '<form action="'.$MainURL.'/admin/backup-restore-confirm2" method="post"><input type="hidden" name="BackupFile" value="'.$FormArguments['BackupFile'].'"><b>'.$MsgText[0][604].' ('.date('M j, Y @ g:ia',$DateCreated).')<br><br>'.$MsgText[0][605].':<br>'.$ItemsListPrint.'</b><br><br><br><br><input type="submit" value="'.$MsgText[0][584].'" style="'.$FormStyle.'"><br><br><b>'.$MsgText[0][606].'</b></form>';
				
			
			}
			else {
				$PageContents = $MsgText[0][98];
			}
			
		
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}



?>
