Пример #1
0
 public function accounts($ids = null)
 {
     $user = new userModel();
     $id = $user->getId();
     $authLevel = $user->getAuthLevel();
     $accounts = new userModel();
     $users = $accounts->listAll();
     $data = array();
     if ($ids == null) {
         if ($user->getAuthLevel() >= 900) {
             $data['all'] = "All Accounts";
         }
         foreach ($users as $user) {
             if ($user['supervisorId'] == $id) {
                 $data[$user['id']] = $user['lastName'] . ", " . $user['firstName'] . " (" . $user['type'] . ")";
             } elseif ($authLevel >= 900) {
                 $data[$user['id']] = $user['lastName'] . ", " . $user['firstName'] . " (" . $user['type'] . ")";
             }
         }
     } else {
         $data[] = "all";
         foreach ($users as $user) {
             $data[] = $user['id'];
         }
     }
     return $data;
 }
Пример #2
0
 public function accounts($ids = null)
 {
     $accounts = new userModel();
     $users = $accounts->listAll();
     $data = array();
     foreach ($users as $user) {
         if ($user['authLevel'] >= 500) {
             if ($ids == 1) {
                 $data[] = $user['id'];
             } else {
                 $data[$user['id']] = $user['lastName'] . ", " . $user['firstName'] . "";
             }
         }
     }
     return $data;
 }
Пример #3
0
 public function index($currentUser = null)
 {
     if (array_key_exists('items', $_GET)) {
         $_SESSION['items'] = $_GET['items'];
     }
     if (array_key_exists('items', $_SESSION)) {
         $items = $_SESSION['items'];
     } else {
         $items = 20;
     }
     if (array_key_exists('page', $_GET)) {
         $page = $_GET['page'];
     } else {
         $page = 1;
     }
     $accounts = new userModel();
     $this->view->accounts = $accounts->listAll($currentUser);
     $this->view->currentUser = $currentUser;
     $audit = new auditModel();
     $auditLog = $audit->getAll($currentUser, $page, $items);
     $this->view->audit = $auditLog;
     $this->view->pager = $audit->getPager();
 }
Пример #4
0
 function payroll($year, $month)
 {
     $data = array();
     $users = new userModel();
     $accounts = $users->listAll();
     $date = new DateTime();
     $date->setTime(0, 0, 0);
     $date->setDate($year, $month, 26);
     $date->modify('-1 month');
     $startDate = $date->format('U');
     $endDate = $date->modify('+1 month -1 day')->setTime(23, 59, 59)->format('U');
     $i = 0;
     foreach ($accounts as $account) {
         $data[$i]['userInfo'] = $account;
         $timeCalulation = new calculateModel();
         $time = $timeCalulation->calculatedCodeTotals($data[$i]['userInfo']['id'], $startDate, $endDate);
         $data[$i]['totals'] = $time;
         $i++;
     }
     return $data;
 }
Пример #5
0
 public function inactive()
 {
     $accounts = new userModel();
     $this->view->accounts = $accounts->listInactive();
     $this->view->allAccounts = $accounts->listAll();
 }