Exemplo n.º 1
0
 function add_comment($parameter)
 {
     $today_date = date("m/d/Y h:i A");
     $user_id = $this->session->userdata('user_id');
     $comment_data = array('user_parent_id' => ['db_filed_name' => 'user_parent_id', 'value' => $user_id, 'cond' => ''], 'task_parent_id' => ['db_filed_name' => 'task_parent_id', 'value' => $parameter, 'cond' => ''], 'comment' => ['db_filed_name' => 'comment', 'value' => $this->input->post('comment'), 'cond' => 'required'], 'date' => ['db_filed_name' => 'date', 'value' => $today_date, 'cond' => ''], 'status' => ['db_filed_name' => 'status', 'value' => 0, 'cond' => '']);
     $crud = new \DAS\CrudEngine\Crud();
     $crud->add_record($comment_data, 'comments', true);
 }
Exemplo n.º 2
0
 public function add_new_task()
 {
     $today_date = date("m/d/Y h:i A");
     $user_id = $this->session->userdata('user_id');
     $task_data = array('task_name' => ['db_filed_name' => 'task_name', 'value' => $this->input->post('task_name'), 'cond' => 'required'], 'task_number' => ['db_filed_name' => 'task_number', 'value' => parent::_get_last_data_entry_('tasks', 'task_id'), 'cond' => ''], 'user_id' => ['db_filed_name' => 'user_parent_id', 'value' => $user_id, 'cond' => ''], 'r_person' => ['db_filed_name' => 'r_person', 'value' => $this->input->post('r_person'), 'cond' => 'required'], 'task_division' => ['db_filed_name' => 'division_parent_id', 'value' => $this->input->post('task_division'), 'cond' => 'required'], 'client_id' => ['db_filed_name' => 'client_parent_id', 'value' => $this->input->post('client_id'), 'cond' => 'required'], 'deadline' => ['db_filed_name' => 'deadline', 'value' => $this->input->post('deadline'), 'cond' => 'required'], 'attachments' => ['db_filed_name' => 'attachments', 'value' => $this->input->post('attachments'), 'cond' => 'required'], 'date_start' => ['db_filed_name' => 'date_start', 'value' => $today_date, 'cond' => ''], 'task_priority' => ['db_filed_name' => 'task_priority', 'value' => $this->input->post('task_priority'), 'cond' => 'required'], 'task_desc' => ['db_filed_name' => 'task_desc', 'value' => $this->input->post('task_desc'), 'cond' => 'required'], 'task_notes' => ['db_filed_name' => 'task_notes', 'value' => $this->input->post('task_notes'), 'cond' => 'required']);
     $person_id = $this->input->post('r_person');
     $person_cap = parent::_get_all_data_('tasks', '`user_parent_id`', array('r_person' => $person_id, 'status' => 0), NULL, NULL, NULL, TRUE);
     if ($person_cap < 10) {
         $crud = new \DAS\CrudEngine\Crud();
         $crud->add_record($task_data, 'tasks', true);
     } else {
         $data['message'] = parent::_call_message_('add_record_fail_cap');
         parent::_ajax_response_(False, $data['message'], '');
     }
 }
Exemplo n.º 3
0
 function signout()
 {
     $user_id = $this->session->userdata('user_id');
     $user_data = array('online' => ['db_filed_name' => 'online', 'value' => 0, 'cond' => '']);
     $crud = new \DAS\CrudEngine\Crud();
     $crud->update_record($user_data, 'users', ['id_name' => 'user_id', 'id_value' => $user_id], false, false, false);
     session_destroy();
     $this->session->unset_userdata('name');
     $this->session->unset_userdata('email');
     $this->session->unset_userdata('user_id');
     $this->session->unset_userdata('logged_in');
     redirect('users/login', 'refresh');
 }
Exemplo n.º 4
0
 public function delete_client($user_id)
 {
     $crud = new \DAS\CrudEngine\Crud();
     $crud->delete_record('clients', array('client_id', $user_id), true, true);
 }
Exemplo n.º 5
0
 public function delete_todo_list($user_id)
 {
     $crud = new \DAS\CrudEngine\Crud();
     $crud->delete_record('todo', array('todo_id', $user_id), true, true);
 }