javascript - Modify a value in a foreach to change another one -
i've got question foreach
loop:
foreach ($result $row) { $html.='<tr> <td>'.$row['product_name'].'</td> <td>'.recuphourminsec($row['date_add']).'</td> <td><input type="text" name="preparationtime" id="preparationtime" value="15" /></td> <td>'.date('h:i:s', strtotime("+$preparationtime mins".$row['date_add'])).'</td> <td>'.$row['lastname'].' '.$row['firstname'].'</td> <td>'.$row['phone'].'</td> <td>'.$row['phone_mobile'].'</td>'.'</tr>'; }
i change value of textbox
on website time when order ready.
i want add value of text field preperationtime
time order taken, 20:00:00 example, , display on page, 20:15:00 in example.
how value of preparationtime
text box every time change modify time when order ready ?
you need use date
, strtotime
this:-
<td>'.date('h:i:s', strtotime('+15 mins'.$row['date_add'])).'</td>
as comment earlier, try this:-
$value = 10; '<td>'.date('h:i:s', strtotime("+$value mins".$row['date_add'])).'</td>';
you can change $value
dynamically.thanks.
Comments
Post a Comment