Location: PHPKode > projects > Ptk-forensics > ptk/lib/modal_file_content_bookmark.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");
include("lib_std.php");
$offset = sanitize($_GET['arg1'],INT);;
$inode = sanitize($_GET['arg2'],PARANOID);;
$bk = bookmark_info_from_id(sanitize($_GET['arg3'],INT));
$name = preg_replace("/\s\|\s.+$/", "", $bk['title']);
$name = RemoveXSS($name);
$bm_type = sanitize($bk['type'],INT);
$part_id = sanitize($bk['id_partition'],INT);
$path = get_image_path_from_partition(sanitize($bk['id_partition'],INT));
$page_offset = 100;

unset($_SESSION['is_graphic']);
$type = get_file_type($path, $offset, $inode);
$n = preg_replace("/\s\(deleted\)/", "", $name);	
$n = urlencode($n);
$nm = preg_replace("/\s/", "_", $n);
$nm = preg_replace("/\*\*\*.+/", "", $n);
$nm = urlencode($nm);
?>
<div style="overflow:auto">
<img src='../img/progress.gif'  class="progress" id="progress<?=$inode;?>">

<b style="float:left">Bookmark content: <?=$name;?></b><img id="close_box" style="float:right; cursor: pointer" src="../img/cancel.png" onclick="closeMessage()">
<br><hr>
<?if($bm_type!=6 && $bm_type!=7){?>
	<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&arg4=<?=$part_id?>', '<?=$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&arg4=<?=$part_id?>', '<?=$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&arg4=<?=$part_id?>', '<?=$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;?>&arg4=<?=$part_id?>';">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;?>&part_id=<?=$part_id?>" class="menu" target="blank"><img class="analysis" src="picture.php?offset=<?=$offset;?>&inode=<?=$inode;?>&name=<?=$nm;?>&part_id=<?=$part_id?>"></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>
	<?}?>

<?}else{
	$bm = bookmark_info_from_id($inode);
	$output = $bm['reference'];
	?>	
	<div class="file_content" style="float:left; height:85%"><pre><?=$output?></pre></div>
<?}?>

</div>
Return current item: Ptk-forensics