Commit 48322c1b by Azhan Hannan

changes chargeable form

parent 2c8b58a1
...@@ -156,43 +156,19 @@ input[type=number] { ...@@ -156,43 +156,19 @@ input[type=number] {
$total += data_get($valuehour,'td_hours'); $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']}}');"> <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> </td>
@endfor @endfor
@endif @endif
<td> <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> </td>
</tr> </tr>
<?php $all += $total; ?> <?php $all += $total; ?>
@endforeach @endforeach
</tbody> </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> </table>
@if($projectlist == []) @if($projectlist == [])
<button type="submit" class="ui right floated aligned ui blue compact labeled icon button"> <button type="submit" class="ui right floated aligned ui blue compact labeled icon button">
...@@ -238,7 +214,7 @@ input[type=number] { ...@@ -238,7 +214,7 @@ input[type=number] {
}); });
function limiter(input,pid,lasttd,key) { function limiter(input,pid) {
var currenttotal = 0; var currenttotal = 0;
var all = 0; var all = 0;
...@@ -281,18 +257,21 @@ input[type=number] { ...@@ -281,18 +257,21 @@ input[type=number] {
} }
// console.log("currenttotal --> " + currenttotal); // console.log("currenttotal --> " + currenttotal);
document.getElementById('total-'+key).value = currenttotal; document.getElementById('total-'+pid).value = currenttotal;
var y = 0;
for(var j = 1; j < key+1; j++){ // var y = 0;
var allid = document.getElementById('total-'+j); // for(var j = 1; j < key+1; j++){
if (document.getElementById('total-'+j)) { // var allid = document.getElementById('total-'+j);
y = document.getElementById('total-'+j).value; // if (document.getElementById('total-'+j)) {
value = parseFloat(parseFloat(y).toFixed(1)); // y = document.getElementById('total-'+j).value;
all += value; // value = parseFloat(parseFloat(y).toFixed(1));
} // // all += value;
} // }
console.log(all); // }
document.getElementById('all').value = all; // console.log(all);
// document.getElementById('all').value = all;
// document.getElementById('total-'+pid).value = currenttotal;
} }
</script> </script>
......
...@@ -147,7 +147,7 @@ input[type=number] { ...@@ -147,7 +147,7 @@ input[type=number] {
$total += data_get($valuehour,'td_hours'); $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']}}');"> <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> </td>
@endfor @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