Browse Source

Updated the time entry removal feedback.

Adam Day 9 năm trước cách đây
mục cha
commit
1787e70efb

+ 4 - 5
application/controllers/timesheetController.php

@@ -149,19 +149,18 @@ class timesheetController extends Staple_Controller
         $this->view->changeYearForm = $changeYearForm;
     }
 
-    public function remove($id)
+    public function remove($id = null)
     {
         if($id != null)
         {
             //Confirm entry for user
             $timeEntry = new timeEntryModel($id);
-
             if($timeEntry->getId() !== NULL)
             {
                 //Remove Entry
                 if($timeEntry->remove($timeEntry->getId()))
                 {
-                    $this->view->message = "Entry removed.";
+                    $this->view->message = "<i class=\"fa fa-check\"></i> Removed successfully.";
                 }
                 else
                 {
@@ -170,12 +169,12 @@ class timesheetController extends Staple_Controller
             }
             else
             {
-                //header("location: ".$this->_link(array('timesheet'))."");
+                header("location: ".$this->_link(array('timesheet'))."");
             }
         }
         else
         {
-            //header("location: ".$this->_link(array('timesheet'))."");
+            header("location: ".$this->_link(array('timesheet'))."");
         }
     }
 

+ 11 - 2
application/views/timesheet/remove.phtml

@@ -1,10 +1,19 @@
 <div class="section">
     <div class="row">
-        <div class="small-12 columns">
+        <div class="small-4 columns">
             <a class="button secondary radius" href="<?php echo $this->link(array('timesheet')) ?>"><i class="fa fa-chevron-left"></i> Back</a>
+        </div>
+        <div class="small-4 columns text-center">
+            <h2><i class="fa fa-trash"></i> Remove Entry</h2>
+        </div>
+        <div class="small-4 columns text-right">
+
         </div>
         <div class="small-12 columns">
-            <?php echo $this->message ?>
+            <div data-alert class="alert-box secondary">
+                <?php echo $this->message ?>
+                <a href="#" class="close">&times;</a>
+            </div>
         </div>
     </div>
 </div>