Base
This commit is contained in:
15
resources/views/proyectos/avance.blade.php
Normal file
15
resources/views/proyectos/avance.blade.php
Normal file
@ -0,0 +1,15 @@
|
||||
<div class="progress">
|
||||
<?php
|
||||
$total = 1;
|
||||
if ($proyecto->estado()->tipo()->orden < max($estados) - 1 and count($proyecto->estados()) > 1) {
|
||||
$tf = \Carbon\Carbon::parse($proyecto->estado()->fecha, config('app.timezone'));
|
||||
$t0 = \Carbon\Carbon::parse($proyecto->estados()[0]->fecha, config('app.timezone'));
|
||||
$df = $tf->diffInSeconds($t0);
|
||||
$hoy = \Carbon\Carbon::now(config('app.timezone'));
|
||||
$dh = $hoy->diffInSeconds($t0);
|
||||
$total = $df / $dh;
|
||||
}
|
||||
$valor = round(($proyecto->estado()->tipo()->orden + 1) / max($estados) * 100 * $total);
|
||||
?>
|
||||
<div class="progress-bar" style="width: {{$valor}}%">{{$valor}}%</div>
|
||||
</div>
|
Reference in New Issue
Block a user