public function updateUnit($id)
 {
     if (Session::has('username') && (Session::get('user_type') == "Root" || Session::get('user_type') == "Admin")) {
         $view = View::make('Settings.Employees.settings_update_unit');
         $view->unit = Unit::find($id);
         if (!$view->unit) {
             return Redirect::to("settings/employees/units");
         }
         $getBusinessLines = BusinessLine::all();
         $businessLines = array("" => "--Select One--");
         foreach ($getBusinessLines as $businessLine) {
             $businessLines[$businessLine["id"]] = $businessLine["name"];
         }
         $view->businessLines = $businessLines;
         $view->nav = "system";
         return $view;
     } else {
         return Redirect::to("/");
     }
 }
 public function updateEmployee($id)
 {
     if (Session::has('username') && (Session::get('user_type') == "Root" || Session::get('user_type') == "Admin")) {
         $view = View::make('Employees.update_employee');
         $employee = Employee::where("employee_number", "=", $id)->first();
         if (!$employee) {
             return Redirect::to('employees');
         }
         $view->employee = $employee;
         $getManagers = Manager::orderBy('last_name', 'asc')->get();
         $managers = array("" => "None");
         foreach ($getManagers as $manager) {
             if (!empty($manager["first_name"])) {
                 $managers[$manager["id"]] = $manager["last_name"] . ", " . $manager["first_name"];
             } else {
                 $managers[$manager["id"]] = $manager["last_name"];
             }
         }
         $getBusinessLines = BusinessLine::all();
         $businessLines = array("" => "None");
         foreach ($getBusinessLines as $businessLine) {
             $businessLines[$businessLine["id"]] = $businessLine["name"];
         }
         $getUnits = Unit::orderBy("name", "asc")->get();
         $units = array("" => "None");
         foreach ($getUnits as $unit) {
             $units[$unit["id"]] = $unit["name"];
         }
         $view->managers = $managers;
         $view->businessLines = $businessLines;
         $view->units = $units;
         $view->nav = "employees";
         return $view;
     } else {
         return Redirect::to('/');
     }
 }