Mange tak igen..
Kan ikke få den til at vise noget.
her er mit script
<?php
// time tæller
function get_time_difference( $start, $end )
{
$uts['start'] = strtotime( $start );
$uts['end'] = strtotime( $end );
if( $uts['start']!==-1 && $uts['end']!==-1 )
{
if( $uts['end'] >= $uts['start'] )
{
$diff = $uts['end'] - $uts['start'];
if( $days=intval((floor($diff/86400))) )
$diff = $diff % 86400;
if( $hours=intval((floor($diff/3600))) )
$diff = $diff % 3600;
if( $minutes=intval((floor($diff/60))) )
$diff = $diff % 60;
$diff = intval( $diff );
return( array('days'=>$days, 'hours'=>$hours, 'minutes'=>$minutes, 'seconds'=>$diff) );
}
else
{
trigger_error( "Ending date/time is earlier than the start date/time", E_USER_WARNING );
}
}
else
{
trigger_error( "Invalid date/time data detected", E_USER_WARNING );
}
return( false );
}
?>
<?php include('inc/connection.php');
$datoer = array();
$query = mysql_query("SELECT * FROM time_reg WHERE user='".$_GET[user]."' AND add_date >= '".$_GET[from_date]."' AND add_date <= '".$_GET[to_date]."' GROUP BY add_date ORDER BY add_date desc");
while($row = mysql_fetch_assoc($query)){ $datoer[] = $row['add_date']; }
foreach($datoer as $dato){
$query = "SELECT * FROM time_reg GROUP BY add_date ORDER BY add_date desc";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
?>
<table width="700" border="0" cellspacing="0" cellpadding="0" class="tid_dag">
<tr>
<td><h3> <?= strftime ("%A", strtotime($dato));?> Den
<?= date("d/m/Y", strtotime($dato));?> - Medarbejder - <?= $row[user]; ?>
</h3>
<table width="700px">
<tr>
<td width="80">Start</td>
<td width="80">Slut</td>
<td width="215">Kunde</td>
<td width="215">Sag</td>
<td width="203">Samlet tid</td>
<td width="203">Tjek ip</td>
</tr>
<?php
$query = mysql_query("SELECT * FROM time_reg WHERE add_date = '".$dato."'");
while($row = mysql_fetch_assoc($query)){
$start = $row[start_time];
$end = $row['end_time'];
list($t1, $m1) = sscanf($start, "%d:%d");
list($t2, $m2) = sscanf($end, "%d:%d");
$timer = ($t2 - $t1) + ($m2 - $m1) / 60;
if($timer < 0){ $timer = $timer + 24; }
?>
<tr>
<td><?=$start; ?></td>
<td><?=$end; ?></td>
<td><?=$row['what_case']; ?></td>
<td><?=$row['place']; ?></td>
<td>
<?php
// a START time value
$start = $row[start_time];
// an END time value
$end = $row[end_time];
// what is the time difference between $end and $start?
if( $diff=@get_time_difference($start, $end) )
{
echo sprintf( '%02d:%02d', $diff['hours'], $diff['minutes'] );
}
else
{
echo "Angiv slut tidspunkt";
}
?></td>
<td><a href="
http://whatismyipaddress.com/ip/<?=$row[ip]?>" target="_blank">Spor ip</a></td>
</tr>
<?php
}
?>
</table>
<?php
}
?>
har en lille opgave mere til dig, men opretter en tråd mere på den hvis du har lyst til at hjælpe lidt mere