index.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. if (cfr('EMPLOYEE')) {
  3. if (ubRouting::checkGet('username')) {
  4. $username = ubRouting::get('username');
  5. if (ubRouting::checkPost('addjob')) {
  6. if (cfr('JOBSMGMT')) {
  7. $date = ubRouting::post('jobdate');
  8. $worker_id = ubRouting::post('worker');
  9. $jobtype_id = ubRouting::post('jobtype');
  10. $job_notes = ubRouting::post('notes');
  11. stg_add_new_job($username, $date, $worker_id, $jobtype_id, $job_notes);
  12. ubRouting::nav("?module=jobs&username=" . $username);
  13. } else {
  14. show_error(__('Access denied'));
  15. log_register('JOB ADD FAIL ACCESS VIOLATION');
  16. }
  17. }
  18. if (ubRouting::checkGet('deletejob')) {
  19. if (cfr('JOBSMGMT')) {
  20. stg_delete_job(ubRouting::get('deletejob'));
  21. ubRouting::nav("?module=jobs&username=" . $username);
  22. } else {
  23. show_error(__('Access denied'));
  24. log_register('JOB DELETE FAIL ACCESS VIOLATION');
  25. }
  26. }
  27. //just render jobs list
  28. web_showPreviousJobs($username);
  29. //previous tasks
  30. if (cfr('TASKMAN')) {
  31. $previousUserTasks = ts_PreviousUserTasksRender($username, '', true);
  32. if (!empty($previousUserTasks)) {
  33. show_window(__('Previous user tasks'), $previousUserTasks);
  34. }
  35. }
  36. show_window('', web_UserControls($username));
  37. }
  38. } else {
  39. show_error(__('Access denied'));
  40. }