Os pongo el código:
Código PHP:
{foreach from=$tasks item=task}
<tr {if $task.isRunning}class="runningJobs"{/if}>
<td><input class="editMe" style="text-align:right" type="text" name="rate[{$task.id}]" value="{$task.rate|default:"0.00"}" size="6"></td>
<td align="center"><input type="text" name="fecha[{$task.id}]" size="12" value="{$task.fecha|default:"0000-00-00"}" class="editMe" size="10" style="text-align:right"></td>
Código PHP:
<?php
foreach ($_REQUEST['task'] as $key=>$value)
{
//...... This allows us to reset the punch clock
$taskTime = $_REQUEST['taskTime'];
//...... Parse the time fields
$pt = $ts->parseTime($taskTime[$key]);
//...... If we alread have a punchout time
$Q="SELECT punchOut from clock WHERE id='".intval($key)."'";
list($po) = mysql_fetch_row(mysql_query($Q));
if ($po)
{
$pt = $po - $pt;
}
else
{
$pt = time() - $pt;
}
//.........................................
//...... Update the task clock
$Q="UPDATE clock
SET punchDesc='".addslashes($value)."',
punchIn='".$pt."',
rate='".floatval($rate[$key])."',
WHERE id='".intval($key)."'
AND user_id='$_SESSION[id]' LIMIT 1";
mysql_query($Q);
}
if ($_REQUEST['REF'])
{
header("Location: ".base64_decode($_REQUEST[REF]));
}
else header("Location: $_SERVER[HTTP_REFERER]");
?>
Espero me puedan ayudar porque ando muy atascado con esto ;) GRACIAS.