function add_new_client() { $user_id = $this->session->userdata('user_id'); $client_data = array('client_name' => ['db_filed_name' => 'client_name', 'value' => $this->input->post('client_name'), 'cond' => 'required'], 'res_person' => ['db_filed_name' => 'res_person', 'value' => $this->input->post('res_person'), 'cond' => 'required'], 'client_logo' => ['db_filed_name' => 'client_logo', 'value' => $this->input->post('client_logo'), 'cond' => 'required'], 'client_phone' => ['db_filed_name' => 'client_phone', 'value' => $this->input->post('client_phone'), 'cond' => 'required'], 'followup' => ['db_filed_name' => 'user_parent_id', 'value' => $this->input->post('followup'), 'cond' => 'required'], 'client_location' => ['db_filed_name' => 'client_location', 'value' => $this->input->post('client_location'), 'cond' => 'required'], 'added_on' => ['db_filed_name' => 'added_on', 'value' => $this->input->post('added_on'), 'cond' => 'required'], 'client_prof' => ['db_filed_name' => 'client_prof', 'value' => $this->input->post('client_prof'), 'cond' => 'required'], 'client_info' => ['db_filed_name' => 'client_info', 'value' => $this->input->post('client_info'), 'cond' => '']); $crud = new \DAS\CrudEngine\Crud(); $crud->add_record($client_data, 'clients', true); }
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); }
public function add_todo_list() { $today_date = date("m/d/Y h:i A"); $user_id = $this->session->userdata('user_id'); $todo_data = array('todo_text' => ['db_filed_name' => 'todo_text', 'value' => $this->input->post('todo_text'), 'cond' => 'required'], 'todo_status' => ['db_filed_name' => 'todo_status', 'value' => 0, 'cond' => ''], 'user_id' => ['db_filed_name' => 'user_parent_id', 'value' => $user_id, 'cond' => ''], 'todo_date' => ['db_filed_name' => 'todo_date', 'value' => $today_date, 'cond' => '']); $crud = new \DAS\CrudEngine\Crud(); $crud->add_record($todo_data, 'todo', true, true); }
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'], ''); } }