Răsfoiți Sursa

Added additional navigation buttons to the dashboard for easier navigation from the dashboard page.

Adam Day 9 ani în urmă
părinte
comite
a7a483bef9

+ 10 - 1
application/controllers/indexController.php

@@ -1,15 +1,24 @@
 <?php
 class indexController extends Staple_Controller
 {
+	private $authLevel;
+
 	public function _start()
 	{
-
+		$auth = Staple_Auth::get();
+		$user = new userModel();
+		$this->authLevel = $user->getAuthLevel();
 	}
 
 	public function index()
 	{
+		$this->view->authLevel = $this->authLevel;
+
 		$messages = array("The library will be closed on Monday for whatever reason. Just remember to not come in!");
 		//$this->view->messages = $messages;
+
+		$timesheet = new timesheetModel(date('Y'),date('m'));
+		$this->view->timesheet = $timesheet;
 	}
 }
 ?>

+ 0 - 105
application/models/timesheetModel.php

@@ -26,13 +26,6 @@
 
 		private $totals;
 
-		private $vacationUsed;
-		private $normalWorked;
-		private $sickUsed;
-		private $holidayUsed;
-		private $holidayWorkedUsed;
-		private $payPeriodTotal;
-
 		/**
 		 * @return string
 		 */
@@ -273,102 +266,6 @@
 			$this->entries = $entries;
 		}
 
-		/**
-		 * @return float|int
-		 */
-		public function getVacationUsed()
-		{
-			return $this->vacationUsed;
-		}
-
-		/**
-		 * @param float|int $vacationUsed
-		 */
-		public function setVacationUsed($vacationUsed)
-		{
-			$this->vacationUsed = $vacationUsed;
-		}
-
-		/**
-		 * @return float|int
-		 */
-		public function getNormalWorked()
-		{
-			return $this->normalWorked;
-		}
-
-		/**
-		 * @param float|int $normalWorked
-		 */
-		public function setNormalWorked($normalWorked)
-		{
-			$this->normalWorked = $normalWorked;
-		}
-
-		/**
-		 * @return float|int
-		 */
-		public function getSickUsed()
-		{
-			return $this->sickUsed;
-		}
-
-		/**
-		 * @param float|int $sickUsed
-		 */
-		public function setSickUsed($sickUsed)
-		{
-			$this->sickUsed = $sickUsed;
-		}
-
-		/**
-		 * @return float|int
-		 */
-		public function getHolidayUsed()
-		{
-			return $this->holidayUsed;
-		}
-
-		/**
-		 * @param float|int $holidayUsed
-		 */
-		public function setHolidayUsed($holidayUsed)
-		{
-			$this->holidayUsed = $holidayUsed;
-		}
-
-		/**
-		 * @return float|int
-		 */
-		public function getHolidayWorkedUsed()
-		{
-			return $this->holidayWorkedUsed;
-		}
-
-		/**
-		 * @param float|int $holidayWorkedUsed
-		 */
-		public function setHolidayWorkedUsed($holidayWorkedUsed)
-		{
-			$this->holidayWorkedUsed = $holidayWorkedUsed;
-		}
-
-		/**
-		 * @return float|int
-		 */
-		public function getPayPeriodTotal()
-		{
-			return $this->payPeriodTotal;
-		}
-
-		/**
-		 * @param float|int $payPeriodTotal
-		 */
-		public function setPayPeriodTotal($payPeriodTotal)
-		{
-			$this->payPeriodTotal = $payPeriodTotal;
-		}
-
 		/**
 		 * @return mixed
 		 */
@@ -385,8 +282,6 @@
 			$this->totals = $totals;
 		}
 
-
-
 		function __construct($year, $month)
 		{
 			$this->db = Staple_DB::get();

+ 29 - 15
application/views/index/index.phtml

@@ -20,37 +20,51 @@
     <div class="row">
         <div class="small-12 columns text-center">
             <h2>Current Pay Period</h2>
-            <h3 class="subheader">November 26th 2015 to December 25th 2015</h3>
+            <h3 class="subheader"><?php echo date('F') ?> <?php echo date('Y') ?></h3>
         </div>
     </div>
     <div class="row">
         <div class="small-12 columns">
             <ul class="small-block-grid-3">
                 <li>
-                    <div class="card alert">
-                        <div class="title">Week Validated</div>
-                        <div class="value">20</div>
+                    <div class="card primary">
+                        <div class="title">Title</div>
+                        <div class="value">Value</div>
                     </div>
                 </li>
                 <li>
                     <div class="card">
-                        <div class="title">Month Validated</div>
-                        <div class="value">20</div>
+                        <div class="title">Title</div>
+                        <div class="value">Value</div>
                     </div>
                 </li>
                 <li>
                     <div class="card">
-                        <div class="title"></div>
-                        <div class="value">20</div>
-                    </div>
-                </li>
-                <li>
-                    <div class="card">
-                        <div class="title">Validated Week Hours</div>
-                        <div class="value">20</div>
+                        <div class="title">Title</div>
+                        <div class="value">Value</div>
                     </div>
                 </li>
             </ul>
         </div>
     </div>
-</div>
+    <div class="row">
+        <div class="small-12 columns text-center">
+            <ul class="button-group round">
+                <li><a class="button success" href="<?php echo $this->link(array("timesheet")) ?>"><i class="fa fa-plus"></i> New Time Entry</a></li>
+                <?php
+                    //Supervisor Level
+                    if($this->authLevel >= 500)
+                    {
+                        echo "<li><a class=\"button\" href=\"".$this->link(array("reports")) ."\"><i class=\"fa fa-file\"></i> View Reports</a></li>";
+                    }
+
+                    //Administrator Level
+                    if($this->authLevel >= 900)
+                    {
+                        echo "<li><a class=\"button\" href=\"".$this->link(array("timesheet")) ."\"><i class=\"fa fa-users\"></i> Manage Users</a></li>";
+                    }
+                ?>
+            </ul>
+        </div>
+    </div>
+</div>