소스 검색

Adjusted month total columns layout.

Adam Day 9 년 전
부모
커밋
7362c4f6f7

+ 2 - 0
application/controllers/timesheetController.php

@@ -96,12 +96,14 @@ class timesheetController extends Staple_Controller
         if($year == null)
         {
             $date = new DateTime();
+            $date->setTime(0,0,0);
             $year = $date->format('Y');
         }
 
         if($month == null)
         {
             $date = new DateTime();
+            $date->setTime(0,0,0);
             if($date->format("j") >= 26)
             {
                 $month = $date->modify('+1 month')->format('m');

+ 1 - 1
application/layouts/main.phtml

@@ -69,7 +69,6 @@
                                 <ul class=\"dropdown\">
                                     <li><a href=\"".$this->link(array('accounts')) ."\"><i class=\"fa fa-users\"></i> Accounts</a></li>
                                     <li><a href=\"".$this->link(array('timesheet','admininsert'))."\" ><i class=\"fa fa-plus\" ></i > Admin Time Insert </a ></li >
-                                    <li><a href=\"".$this->link(array('audit')) ."\" ><i class=\"fa fa-list-alt\" ></i > Audit Log</a ></li>
                                     <li><a href=\"".$this->link(array('reports','unlock'))."\"><i class=\"fa fa-unlock\"></i> Time Unlock</a></li>
                                 </ul>
                             </li>
@@ -78,6 +77,7 @@
                                 <ul class=\"dropdown\">
                                     <li><a href=\"".$this->link(array('reports','payroll'))."\"><i class=\"fa fa-file\"></i> Month Totals</a></li>
                                     <li><a href=\"".$this->link(array('reports','payperiod'))."\"><i class=\"fa fa-file\"></i> Daily Totals</a></li>
+                                    <li><a href=\"".$this->link(array('audit')) ."\" ><i class=\"fa fa-list-alt\" ></i > Audit Log</a ></li>
                                 </ul>
                             </li>
                             ";

+ 2 - 2
application/models/codeModel.php

@@ -105,11 +105,11 @@
 
 			if($type == 'part')
 			{
-				$sql = "SELECT id, name FROM timeCodes WHERE type = 'part' ORDER BY name ASC";
+				$sql = "SELECT id, name FROM timeCodes WHERE type = 'part' ORDER BY listOrder ASC";
 			}
 			else
 			{
-				$sql = "SELECT id, name FROM timeCodes WHERE 1 ORDER BY name ASC";
+				$sql = "SELECT id, name FROM timeCodes WHERE 1 ORDER BY listOrder ASC";
 			}
 
 			if($this->db->query($sql)->fetch_row() > 0)

+ 6 - 3
application/models/timesheetModel.php

@@ -319,10 +319,11 @@
 
 			//Current Dates
 			$currentDate = new DateTime();
+			$currentDate->setTime(0,0,0);
 			$currentDate->setDate($year, $month, 1);
 
 			//Just added for test. Might need to keep. Fixed the wrong
-			$currentDate->setTime(0,0,0);
+			//$currentDate->setTime(0,0,0);
 
 
 			$this->currentYear = $currentDate->format('Y');
@@ -335,11 +336,12 @@
 
 			$currentDate->setDate($year, $month, 1);
 
-			$this->endDate = $currentDate->modify('+25 day')->format('Y-m-d');
+			$this->endDate = $currentDate->setTime(23,59.59)->modify('+25 day')->format('Y-m-d');
 			$this->endDateTimeString = strtotime($this->endDate);
 
 			//Previous Dates
 			$previousDate = new DateTime();
+			$previousDate->setTime(0,0,0);
 			$previousDate->setDate($year, $month, 1);
 			$previousDate->modify('-1 month');
 			$this->previousMonth = $previousDate->format('m');
@@ -350,6 +352,7 @@
 
 			//Future Dates
 			$furtureDate = new DateTime();
+			$furtureDate->setTime(23,59,59);
 			$furtureDate->setDate($year, $month, 1);
 			$furtureDate->modify('+1 month');
 			$this->nextMonth = $furtureDate->format('m');
@@ -455,7 +458,7 @@
 			}
 
 			//$sql = "SELECT ROUND((TIME_TO_SEC(SEC_TO_TIME(SUM(outTime - inTime)-SUM(lessTime*60)))/3600)*4)/4 AS 'totalTime' FROM timeEntries WHERE inTime > UNIX_TIMESTAMP('$startDate 00:00:00') AND outTime < UNIX_TIMESTAMP('$endDate 23:59:59') AND userId = $userId AND codeId = $code;";
-			$sql = "SELECT inTime, outTime, lessTime FROM timeEntries WHERE inTime > UNIX_TIMESTAMP('$startDate 00:00:00') AND outTime < UNIX_TIMESTAMP('$endDate 23:59:59') AND userId = $userId AND codeId = $code;";
+			$sql = "SELECT inTime, outTime, lessTime FROM timeEntries WHERE inTime > UNIX_TIMESTAMP('$startDate 00:00:00') AND outTime < UNIX_TIMESTAMP('$endDate 0:0:0') AND userId = $userId AND codeId = $code;";
 
 			if($this->db->query($sql)->fetch_row() > 0)
 			{

+ 2 - 0
application/models/userModel.php

@@ -205,6 +205,8 @@
 					$data[] = $result;
 				}
 				return $data;
+
+
 			}
 
 		}

+ 8 - 0
application/views/reports/index.phtml

@@ -170,6 +170,14 @@
                 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\">

+ 1 - 0
application/views/reports/payroll.phtml

@@ -74,6 +74,7 @@
                     </tr>
                     </thead>
                     <tbody>
+
                     <?php
 
                     foreach($this->report as $user=>$codes)