65 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			65 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php 
 | 
						|
$form ='
 | 
						|
	<form action="'.htmlspecialchars($_SERVER["PHP_SELF"]).'" method="post">
 | 
						|
	<input type = hidden name="ac" value = "presence_new">
 | 
						|
		<input type="submit" value='.$this->oLang->texts['NEW_PRESENCE'].'>
 | 
						|
	</form>';
 | 
						|
echo $form;
 | 
						|
 | 
						|
$table = "<table border='1'>";
 | 
						|
		$table .=
 | 
						|
		'<tr>
 | 
						|
		<th>'.$this->oLang->texts['FORENAME'].'</th>
 | 
						|
		<th>'.$this->oLang->texts['SURNAME'].'</th>
 | 
						|
		<th>'.$this->oLang->texts['CHECKIN_AT'].'</th>
 | 
						|
		<th>'.$this->oLang->texts['CHECKOUT_AT'].'</th>';
 | 
						|
if ($_SESSION['admin']==1){
 | 
						|
	$table .= '
 | 
						|
		<th>'.$this->oLang->texts['BUTTON_CHANGE'].'</th>
 | 
						|
		<th>'.$this->oLang->texts['BUTTON_CHECKOUT'].'</th>
 | 
						|
		<th>'.$this->oLang->texts['BUTTON_DELETE'].'</th>';
 | 
						|
}
 | 
						|
$table .= "</tr>";
 | 
						|
foreach ($this->aPresence as $presence_ID => $aResult){
 | 
						|
	if(isset($this->all_user[$aResult['UID']]['forename'])){
 | 
						|
			$table .=
 | 
						|
			'<tr>
 | 
						|
			<td>'.$this->all_user[$aResult['UID']]['forename'].'</td>
 | 
						|
			<td>'.$this->all_user[$aResult['UID']]['surname'].'</td>
 | 
						|
			<td>'.$aResult['checkin_time'].'</td>
 | 
						|
			<td>';
 | 
						|
		if($aResult['checkout_time'] == "0000-00-00 00:00:00"){
 | 
						|
			$table .= $this->oLang->texts['STATUS_PRESENT'];
 | 
						|
		}
 | 
						|
		else{
 | 
						|
			$table.= $aResult['checkout_time'];
 | 
						|
		}
 | 
						|
			$table .= '</td>';
 | 
						|
			if($_SESSION['admin']==1){
 | 
						|
			$table .=
 | 
						|
			'<td> <a href="index.php?ac=presence_change&presence_ID='.$aResult['presence_ID'].'" >'.$this->oLang->texts['BUTTON_CHANGE'].' </<> </td>
 | 
						|
';
 | 
						|
 | 
						|
			if ($aResult['checkout_time'] == "0000-00-00 00:00:00"){
 | 
						|
				$table .='
 | 
						|
					<td> <a href="index.php?ac=presence_checkout&UID='.$aResult["UID"].'" >'.$this->oLang->texts['BUTTON_CHECKOUT'].' </<> </td>';
 | 
						|
			}
 | 
						|
 | 
						|
			else{
 | 
						|
				$table .=' 
 | 
						|
					<td>'.$this->oLang->texts['ALREADY_CHECKED_OUT'].'</td>';
 | 
						|
			}
 | 
						|
 | 
						|
			$table .=
 | 
						|
				'<td> <a href="index.php?ac=presence_delete&presence_ID='.$aResult['presence_ID'].'" >'.$this->oLang->texts['BUTTON_DELETE'].' </<> </td>
 | 
						|
				</tr>';
 | 
						|
			}
 | 
						|
	}
 | 
						|
}	
 | 
						|
$table = $table."</table>";
 | 
						|
 | 
						|
echo $table;
 | 
						|
 | 
						|
?>
 | 
						|
 |