Forráskód Böngészése

Fixed small foreach bug for inactive account timesheets.

Adam Day 9 éve
szülő
commit
17488f5702

+ 41 - 47
application/views/reports/inactive.phtml

@@ -100,7 +100,9 @@
 
                 foreach($timesheet as $key=>$entry)
                 {
-                    echo "
+                    if($key !== 'id')
+                    {
+                        echo "
                         <tr>
                                <td>".date("l, F jS Y",strtotime($entry['date']))."</td>
                                <td>".date("g:i A",$entry['inTime'])."</td>
@@ -111,68 +113,60 @@
                                <td>".date("M. jS Y @ G:i A",strtotime($entry['timestamp']))."</td>
                                <td><div class='text-center'>";
 
-                    if($entry['validated'] == 1)
-                    {
-                        echo "<i class=\"fa fa-check green\"></i>";
-                    }
-                    else
-                    {
-                        echo "<i class=\"fa fa-close red\"></i>";
-                    }
+                        if($entry['validated'] == 1)
+                        {
+                            echo "<i class=\"fa fa-check green\"></i>";
+                        }
+                        else
+                        {
+                            echo "<i class=\"fa fa-close red\"></i>";
+                        }
 
-                    echo "</td>";
+                        echo "</td>";
 
-                    if($this->accountLevel >= 900)
-                    {
-                        echo "<td><a href=\"".$this->link(array('timesheet','remove',$key))."\"><i class=\"fa fa-trash\"></i> Remove</a></td>";
-                    }
+                        if($this->accountLevel >= 900)
+                        {
+                            echo "<td><a href=\"".$this->link(array('timesheet','remove',$key))."\"><i class=\"fa fa-trash\"></i> Remove</a></td>";
+                        }
 
-                    echo "</tr>";
+                        echo "</tr>";
 
-                    if(strlen($entry['note']) > 0)
-                    {
-                        echo "
+                        if(strlen($entry['note']) > 0)
+                        {
+                            echo "
                             <tr>
                                 <td colspan='9'>
                                     <b>Note:</b> ".$entry['note']."
                                 </td>
                             </tr>
                         ";
+                        }
+
+                        if($entry['validated'] == 1)
+                        {
+                            $totalValidated += $entry['timeWorked'];
+                        }
+
+                        if($entry['validated'] == 0)
+                        {
+                            $totalInvalid += $entry['timeWorked'];
+                        }
+
+                        if($entry['code'] == "Vacation")
+                        {
+                            $totalVacation += $entry['timeWorked'];
+                        }
+
+                        if($entry['code'] == "Sick")
+                        {
+                            $totalSick += $entry['timeWorked'];
+                        }
                     }
-
-                    if($entry['validated'] == 1)
-                    {
-                        $totalValidated += $entry['timeWorked'];
-                    }
-
-                    if($entry['validated'] == 0)
-                    {
-                        $totalInvalid += $entry['timeWorked'];
-                    }
-
-                    if($entry['code'] == "Vacation")
-                    {
-                        $totalVacation += $entry['timeWorked'];
-                    }
-
-                    if($entry['code'] == "Sick")
-                    {
-                        $totalSick += $entry['timeWorked'];
-                    }
-
                 }
 
                 if(count($timesheet) > 0)
                 {
                 echo "</table>";
-
-                echo "<div class=\"row\">";
-                        echo "<div class='small-12'>
-
-                        FORM GOES HERE
-
-                        </div>";
-                echo "</div>";
                 echo "<div class=\"row\">";
                 echo "<div class=\"small-6 medium-4 large-3 columns\">";
                                         echo "<div class=\"card successBg\">

+ 2 - 9
application/views/reports/payroll.phtml

@@ -76,10 +76,6 @@
                     <tbody>
 
                     <?php
-                    //Gets the unpaid leave time code ID. These entries will not be reflected in the total.
-                    $code = new codeModel();
-                    $codeId = $code->getIdFor("Unpaid Leave");
-
                     $grandTotal = 0;
                     foreach($this->report as $account)
                     {
@@ -105,11 +101,8 @@
                         $accountTotal = 0;
                         foreach($account['totals'] as $key => $value)
                         {
-                            if($key != $codeId['id'])
-                            {
-                                $accountTotal = $accountTotal + $value;
-                                $grandTotal = $grandTotal + $value;
-                            }
+                            $accountTotal = $accountTotal + $value;
+                            $grandTotal = $grandTotal + $value;
                         }
 
                         echo "<td class='text-center'><b>$accountTotal</b></td>";