Ver código fonte

Merge pull request #16 from advation/dashboard

Dashboard
Adam 9 anos atrás
pai
commit
d9cf7b3ef4

+ 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();

+ 46 - 16
application/views/index/index.phtml

@@ -18,23 +18,53 @@
 ?>
 <div class="section">
     <div class="row">
-        <div class="small-12 medium-4 columns text-center">
-            <div class="radius">
-                <h5>Hours this week</h5>
-                <div class="circular">38</div>
-            </div>
+        <div class="small-12 columns text-center">
+            <h2>Current Pay Period</h2>
+            <h3 class="subheader"><?php echo date('F') ?> <?php echo date('Y') ?></h3>
         </div>
-        <div class="small-12 medium-4 columns text-center">
-            <div class="radius">
-                <h5>Total Vacation Time</h5>
-                <div class="circular">121</div>
-            </div>
+    </div>
+    <div class="row">
+        <div class="small-12 columns">
+            <ul class="small-block-grid-3">
+                <li>
+                    <div class="card primary">
+                        <div class="title">Title</div>
+                        <div class="value">Value</div>
+                    </div>
+                </li>
+                <li>
+                    <div class="card">
+                        <div class="title">Title</div>
+                        <div class="value">Value</div>
+                    </div>
+                </li>
+                <li>
+                    <div class="card">
+                        <div class="title">Title</div>
+                        <div class="value">Value</div>
+                    </div>
+                </li>
+            </ul>
         </div>
-        <div class="small-12 medium-4 columns text-center">
-            <div class="radius">
-                <h5>Total Sick Time</h5>
-                <div class="circular">70</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>
+</div>

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
public/style/app.css


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
public/style/app.css.map


+ 17 - 14
public/timetrackerStyle/scss/_settings.scss

@@ -149,20 +149,6 @@ $primary-color: #315476;
   background-color:#fff;
 }
 
-.circular {
-  font-size:3em !important;
-  background-color:$info-color;
-  border-radius:50%;
-  width:125px;
-  height:125px;
-  margin-left:auto;
-  margin-right:auto;
-  padding-top:21px;
-  border:7px solid #fff;
-  box-shadow: 0px 0px 10px #888888;
-  margin-bottom:30px;
-}
-
 .warning {
   background-color:$warning-color !important;
   color:#fff !important;
@@ -223,6 +209,23 @@ $primary-color: #315476;
   color:$primary-color;
 }
 
+.card {
+  border:1px solid #eaeaea;
+  margin:0px;
+  padding:20px;
+}
+
+.card .title {
+  text-align:center;
+  font-size:1.5em;
+  text-transform: uppercase;
+}
+
+.card .value {
+  text-align:center;
+  font-size:3.0em;
+}
+
 // We use these to control various global styles
 // $body-bg: $white;
 // $body-font-color: $jet;

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff