芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/www/breadwinnerv2/application/controllers/Manager.php
load->model('manager_model', 'manager'); $this->load->library("Aauth"); if (!$this->aauth->is_loggedin()) { redirect('/user/', 'refresh'); } } public function todo() { $head['usernm'] = $this->aauth->get_user()->username; $head['title'] = 'ToDo List'; $this->load->view('fixed/header', $head); $this->load->view('todo/employee'); $this->load->view('fixed/footer'); } public function set_task() { $id = $this->input->post('tid'); $stat = $this->input->post('stat'); $this->manager->settask($id, $stat); echo json_encode(array('status' => 'Success', 'message' => $this->lang->line('UPDATED'), 'pstatus' => 'Success')); } public function view_task() { $id = $this->input->post('tid'); $task = $this->manager->viewtask($id); echo json_encode(array('name' => $task['name'], 'description' => $task['description'], 'employee' => $task['emp'], 'assign' => $task['assign'], 'priority' => $task['priority'])); } public function todo_load_list() { $cday = $this->input->get('cday'); $list = $this->manager->task_datatables($cday); $data = array(); $no = $this->input->post('start'); foreach ($list as $task) { $no++; $name = '
' . $task->name . '
'; if ($task->status == 'Done') { $name = '
' . $task->name . '
'; } $row = array(); $row[] = $no; $row[] = '
SET
' . $name; $row[] = $task->duedate; $row[] = $task->start; $row[] = '
' . $task->status . '
'; $row[] = '
View
'; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->manager->task_count_all($cday), "recordsFiltered" => $this->manager->task_count_filtered($cday), "data" => $data, ); echo json_encode($output); } public function pendingtasks() { $user = $this->aauth->get_user()->id; $tasks = $this->manager->pending_tasks_user($user); $tlist = ''; $tc = 0; foreach ($tasks as $row) { $tlist .= '
' . $row['name'] . '
Due date is ' . $row['duedate'] . '.
Start date
' . $row['start'] . '
'; $tc++; } echo json_encode(array('tasks' => $tlist, 'tcount' => $tc)); } }