Location: PHPKode > projects > Ptk-forensics > ptk/lib/modal_file_content.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
include("check_session_image.php");
include("lib_commands.php");
$offset = sanitize($_GET['arg1'],INT);
$inode = sanitize($_GET['arg2'],PARANOID);

$name = $_GET['arg3'];
$name = sanitize(RemoveXSS($name),PARANOID); 
$page_offset = 100;
unset($_SESSION['is_graphic']);
$type = get_file_type($_SESSION['image_path'], $offset, $inode);

$n = preg_replace("/\s\(deleted\)/", "", $name);
$n = urlencode($n);


$nm = preg_replace("/\//", "", $name);
$nm = preg_replace("/\s\(deleted\)/", "", $nm);	
$nm = urlencode($nm);
?>
<div style="overflow:auto">

<img src='../img/progress.gif'  class="progress" id="progress<?=$inode;?>">

<b style="float:left">File content: <?=$name;?></b><img id="close_box" style="float:right; cursor: pointer" src="../img/cancel.png" onclick="closeMessage()">
<br><hr>
<div style="float:left">
	<button onclick="hideDiv('picture<?=$inode;?>'); showDiv('pagination<?=$inode;?>'); showDiv('<?=$inode;?>'); document.getElementById('curr_page').innerHTML=1; document.getElementById('total_page').innerHTML=1; document.getElementById('analysis_type').value='ascii'; ajax_request_file_content('get_file_content.php?arg1=<?=$offset;?>&arg2=<?=$inode;?>&arg3=ascii', '<?=$inode;?>', 'true', 0); ">Ascii</button>
	<button onclick="hideDiv('picture<?=$inode;?>'); showDiv('pagination<?=$inode;?>'); showDiv('<?=$inode;?>'); document.getElementById('curr_page').innerHTML=1; document.getElementById('total_page').innerHTML=1; document.getElementById('analysis_type').value='hex';ajax_request_file_content('get_file_content.php?arg1=<?=$offset;?>&arg2=<?=$inode;?>&arg3=hex', '<?=$inode;?>', 'true', 0); ">Hex</button>
	<button onclick="hideDiv('picture<?=$inode;?>'); showDiv('pagination<?=$inode;?>'); showDiv('<?=$inode;?>'); document.getElementById('curr_page').innerHTML=1; document.getElementById('total_page').innerHTML=1; document.getElementById('analysis_type').value='asciistrings';ajax_request_file_content('get_file_content.php?arg1=<?=$offset;?>&arg2=<?=$inode;?>&arg3=asciistrings', '<?=$inode;?>', 'true', 0); ">Strings</button>
	<?if($_SESSION['is_graphic']){?>
	<button onclick="hideDiv('<?=$inode;?>'); hideDiv('pagination<?=$inode;?>'); showDiv('picture<?=$inode;?>');">Preview</button>
	<?}?>	
	<button onclick="window.location = 'export_file.php?arg1=<?=$offset;?>&arg2=<?=$inode;?>&arg3=<?=$n;?>';">Export</button>
</div>

<input type="hidden" id="analysis_type" value="">
<?if($_SESSION['is_graphic']){?>
	<div id="pagination<?=$inode;?>" style="float:left; margin-left: 20px; text-align:center;display:none">
<?}else{?>
	<div id="pagination<?=$inode;?>" style="float:left; margin-left: 20px; text-align:center">
<?}?>
	<img src="../img/left.png" style="cursor:pointer" onclick="contentBack('<?=$offset?>', '<?=$inode?>', 'true')">
	<b id="curr_page">1</b>/<b id="total_page">1</b>
	<img src="../img/arrow.png" style="cursor:pointer" onclick="contentForward('<?=$offset?>', '<?=$inode?>', 'true')">
	&nbsp;
	<tag style="font-size:8pt">Go to page: </tag><input type="text" id="goto_page" style="width: 50px; height: 20px; margin-top: 5px" onchange="gotoPage(this.value, '<?=$offset?>', '<?=$inode?>', 'true')">	
	&nbsp;
	<tag style="font-size:8pt">Page size: </tag><input type="text" id="page_size" value="<?=$page_offset?>" style="width: 50px; height: 20px; margin-top: 5px" onchange=""><tag style="font-size:8pt"> Unit</tag>	
	&nbsp;<input type="checkbox" id="show_all" onclick="switchPageSize()"><tag style="font-size:8pt"> Show all</tag>	
</div>

<div style="margin-top: 40px;font-size:8pt" id="file_type_<?=$inode;?>"><?=$type;?></div>

<?if($_SESSION['is_graphic']){?>
<a id="picture<?=$inode;?>" href="picture.php?offset=<?=$offset;?>&inode=<?=$inode;?>&name=<?=$nm;?>" class="menu" target="blank"><img class="analysis" src="picture.php?offset=<?=$offset;?>&inode=<?=$inode;?>&name=<?=$nm;?>"></a>
<div id="<?=$inode;?>" class="file_content" style="display:none;float:left"></div>
<?
unset($_SESSION['is_graphic']);
}else{?>
<img id="picture<?=$inode;?>" style="display:none">
<div id="<?=$inode;?>" class="file_content" style="float:left"></div>
<?}?>

</div>
Return current item: Ptk-forensics