Location: PHPKode > projects > Ptk-forensics > ptk/lib/home.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("header.php");
$case = array(); $case = case_list();
$user = array(); $user = user_list();
include("message.php");
?>
<br>
<div id="left_container">
<img src="../img/open_case.png" style="vertical-align:text-bottom"><b> Case gallery</b>
	<div id="d1" style="display:block">	
		<div id="container">
			<? if($_SESSION['user']=='admin'){
				$new_case_token = md5(uniqid(rand(), TRUE));
                                $_SESSION['new_case_token'] = $new_case_token;
                                $_SESSION['new_case_token_time'] = time();?>
			<div id="add_content"  style="margin-top:-30px;" onclick="displayMessage('modal_case.php?tk=<?=$new_case_token?>', '330', '230');return false"  title="Add new case">
				<img src="../img/add.png" style="vertical-align:text-bottom"><b> Add</b>
			</div>			
			<?}?>
			
			<?if (sizeof($case)==0){?>
				<i>No cases available</i>
			<?}?>
			<table class="cases">
				<?

				$case_token = md5(uniqid(rand(), TRUE));
				$_SESSION['case_token'] = $case_token;
				$_SESSION['case_token_time'] = time();

				$get_inve = md5(uniqid(rand(), TRUE));
                                $_SESSION['inv_get_token'] = $get_inve;
				
				for($i=0;$i<sizeof($case);$i++){
					?>
					<?if($i%2==0){?><tr id="row<?=$i;?>"><?}else{?><tr class="odd"  id="row<?=$i;?>"><?}?>
					<td  onmouseover="showPanel(<?echo $i;?>)" onmouseout="hidePanel(<?echo $i;?>)" <?if(($_SESSION['user']=='admin')or($case[$i]['is_locked']==0)){?> onclick="update_info_zone(0,'<?=$case[$i]['name'];?>'); ajax_request('get_images.php?id=<?echo $case[$i]['id'];?>', 'right_container'); switchAppear('right_container');" <?}?>>
						<?echo stripslashes($case[$i]['name']);?>
					</td>					
					<td style="text-align: right" onmouseover="showPanel(<?echo $i;?>)" onmouseout="hidePanel(<?echo $i;?>)">
					<? if(($_SESSION['user']=='admin')or(($_SESSION['user']!='admin')and($case[$i]['is_locked']==0))){?>
						<div id="panel<?echo $i;?>" style="display:none">
							<img src="../img/image_small.png" title="Manage images" onclick="update_info_zone(0,'<?=$case[$i]['name'];?>'); ajax_request('get_images.php?id=<?echo $case[$i]['id'];?>', 'right_container'); switchAppear('right_container');">
							
							<? if($_SESSION['user']=='admin'){?>
								<img src="../img/investigator_small.png" title="Manage investigators" onclick="update_info_zone(0,'<?=$case[$i]['name'];?>'); ajax_request_investigators('get_investigators.php?tk=<?=$get_inve?>&id=<?echo $case[$i]['id'];?>', 'right_container', '<?echo sizeof($user);?>'); switchAppear('right_container');">								
							<?}?>
							
							<img src="../img/info_small.png" title="Show case info" onclick="update_info_zone(0,'<?=$case[$i]['name'];?>'); ajax_request('get_case_info.php?tk=<?=$case_token?>&id=<?echo $case[$i]['id'];?>', 'right_container'); switchAppear('right_container');">
							
							<? if($_SESSION['user']=='admin'){?>
								<img src="../img/separator.png">
								<img src="../img/remove_small.png" title="Remove case" onclick="deleteCase(<?echo $case[$i]['id'];?>,'<?echo $case_token;?>')">
								<?if ($case[$i]['is_locked']==0){?>
									<img src="../img/case_unlocked.png" title="Lock case" onclick="if(confirmSubmit()) location.href = 'lock_case.php?id=<?echo $case[$i]['id'];?>&tk=<?=$case_token?>'">
								<?}?>
							<?}?>
						</div>
					<?}?>
						<?if ($case[$i]['is_locked']==1){?>
							<? if($_SESSION['user']=='admin'){?>
								<img src="../img/case_locked.png" title="Unlock case" onclick="if(confirmSubmit()) location.href = 'lock_case.php?id=<?echo $case[$i]['id'];?>&tk=<?=$case_token?>'">
							<?}else{?>
								<img src="../img/case_locked.png" title="Case locked" onclick="alert('Sorry, this case is locked, you can\'t work on it.')">
							<?}?>	
						<?}?>
					</td>
					</tr>
				<?}?>
			</table>
		</div>
	</div>
</div>

<div id="right_container" style="display: none">
</div>

<?include("footer.php");?>
Return current item: Ptk-forensics