×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Валентин Наумов
Added: Oct 7, 2015 1:11 PM
Views: 4
Tags: asdasd
dasdas
  1.  $start = $counter = $end = 0;
  2.         $progress = $this->progress;
  3.         $total = count($progress);
  4.         for ($i = 0; $i < $total; $i++) {
  5.             if ($progress[$i]->state === RestoreProgress::STATE_ON_WORK) {
  6.                 $start = $progress[$i]->date;
  7.                 if ($i == $total - 1) {
  8.                     $counter += $this->countRange($start, date('Y-m-d H:i:s'));
  9.                 }
  10.             } elseif ($start != 0) {
  11.                 $counter += $this->countRange($start, $progress[$i]->date);
  12.                 $start = 0;
  13.             }
  14.         }