Commit 48322c1b by Azhan Hannan

changes chargeable form

parent 2c8b58a1
......@@ -156,43 +156,19 @@ input[type=number] {
$total += data_get($valuehour,'td_hours');
}
?>
<td >
<td>
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@endfor
@endif
<td>
<input class="center aligned" type="text" name="total-{{$project['td_project']}}" id="total-{{$key+1}}" style="padding-right: 4px;padding-left: 4px;" readonly="readonly" value={{$total}}>
<input class="center aligned" type="text" name="total-{{$project['td_project']}}" id="total-{{$key+1}}" style="padding-right: 4px;padding-left: 4px;" onchange="limiter(this,'{{$project['td_project']}}');" readonly="readonly" value={{$total}}>
</td>
</tr>
<?php $all += $total; ?>
@endforeach
</tbody>
<!-- <tfoot>
<tr>
<th colspan="2">
Total Hours
</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>
<input class="center aligned" type="text" name="thour-{{$project['td_project']}}" id="thours[{{$i+1}}][{{$key+1}}]" style="padding-right: 4px;padding-left: 4px;" readonly="readonly" value="{{$cday[$i]}}">
</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>
<input class="center aligned" type="text" name="thour-{{$project['td_project']}}" id="thours[{{$i+1}}][{{$key+1}}]" style="padding-right: 4px;padding-left: 4px;" readonly="readonly" value="{{$cday[$i]}}">
</th>
@endfor
@endif
<th>
<input class="center aligned" type="text" onkeypress="onlynumber(event)" name="all" id="all" readonly="readonly" value="{{$all}}">
</th>
</tr>
</tfoot> -->
</table>
@if($projectlist == [])
<button type="submit" class="ui right floated aligned ui blue compact labeled icon button">
......@@ -238,7 +214,7 @@ input[type=number] {
});
function limiter(input,pid,lasttd,key) {
function limiter(input,pid) {
var currenttotal = 0;
var all = 0;
......@@ -281,18 +257,21 @@ input[type=number] {
}
// console.log("currenttotal --> " + currenttotal);
document.getElementById('total-'+key).value = currenttotal;
var y = 0;
for(var j = 1; j < key+1; j++){
var allid = document.getElementById('total-'+j);
if (document.getElementById('total-'+j)) {
y = document.getElementById('total-'+j).value;
value = parseFloat(parseFloat(y).toFixed(1));
all += value;
}
}
console.log(all);
document.getElementById('all').value = all;
document.getElementById('total-'+pid).value = currenttotal;
// var y = 0;
// for(var j = 1; j < key+1; j++){
// var allid = document.getElementById('total-'+j);
// if (document.getElementById('total-'+j)) {
// y = document.getElementById('total-'+j).value;
// value = parseFloat(parseFloat(y).toFixed(1));
// // all += value;
// }
// }
// console.log(all);
// document.getElementById('all').value = all;
// document.getElementById('total-'+pid).value = currenttotal;
}
</script>
......
......@@ -147,7 +147,7 @@ input[type=number] {
$total += data_get($valuehour,'td_hours');
}
?>
<td >
<td>
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@endfor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment