public function thread($permalink) { $employee_id = permalink_id($permalink); $data = array(); $data["content"] = "website/pages/public/account_thread"; $data["employee"] = $this->employee_model->read($employee_id); $data["page"] = $data["employee"]["emp_name"]; $data["threads"] = $this->thread_model->read_by_author(null, null, $employee_id); $this->load->view("website/template", $data); }
public function activate($id) { if (UserModel::is_authorize(UserModel::$TYPE_ADMINISTRATOR)) { $id = permalink_id($id); $result = $this->employee_model->activating($id); if ($result) { $this->alert->success_alert("Employee has been activated successfully"); } else { $this->alert->danger_alert("Something is getting wrong"); } redirect("employee/suspended"); } else { redirect("show404"); } }
public function thread($permalink) { $this->load->library('form_validation'); $valid_permalink = false; $threads = $this->thread_model->read(); foreach ($threads as $thread) { if ($thread["permalink"] == $permalink) { $valid_permalink = true; break; } } if ($valid_permalink) { $thread_id = permalink_id($permalink); $this->thread_model->updated_reader_total($thread_id); $thread = $this->thread_model->read_by_id($thread_id); $comments = $this->comment_model->read_by_thread($thread_id); $data = array(); $data["thread"] = $thread; $data["comments"] = $comments; $data["page"] = $data["thread"]["title"]; $data["menu"] = "forum"; $data["content"] = "website/pages/public/thread"; $this->load->view("website/template", $data); } else { redirect("Error404"); } }
private function _repopulate_people($permalink) { $people_id = permalink_id($permalink); $data = array(); $data["page"] = "People Photo"; $data["menu"] = "people"; $data["content"] = "website/pages/company/people_photo"; $data["photos"] = $this->people_photo_model->read_by_people($people_id); $data["operation"] = "warning"; $data["message"] = validation_errors(); $this->load->view("website/template", $data); }
public function delete($permalink) { if (UserModel::is_authorize(UserModel::$TYPE_EMPLOYEE)) { if ($this->_is_valid_permalink($permalink)) { $thread_id = permalink_id($permalink); $result = $this->thread_model->delete($thread_id); if ($result) { $this->alert->success_alert("Thread has been removed successfully"); } else { $this->alert->danger_alert("Something is getting wrong"); } } else { $this->alert->danger_alert("Invalid permalink reference"); } redirect("thread"); } else { redirect("page/login"); } }
public function delete($permalink) { if (UserModel::is_authorize(UserModel::$TYPE_COMPANY)) { if ($this->_is_valid_permalink($permalink)) { $job_id = permalink_id($permalink); $company_id = $this->session->userdata(UserModel::$SESSION_ID); $result = $this->job_model->delete($job_id, $company_id); if ($result) { $this->alert->success_alert("Job has been removed successfully"); } else { $this->alert->danger_alert("Something is getting wrong"); } } else { $this->alert->danger_alert("Invalid permalink reference"); } redirect("job"); } else { redirect("page/login"); } }
public function photo($permalink) { $company_id = $this->session->userdata(UserModel::$SESSION_ID); $people_id = permalink_id($permalink); $data = array(); $data["page"] = "People Photo"; $data["menu"] = "people"; $data["content"] = "website/pages/company/people_photo"; $data["photos"] = $this->people_photo_model->read_by_people($people_id); $data["people"] = $this->people_model->read($people_id, $company_id); $this->load->view("website/template", $data); }
public function job($company) { $id = permalink_id($company); $data = array(); $data["page"] = "Company Job"; $data["menu"] = "company"; $data["content"] = "website/pages/public/company_jobs"; $data["company"] = $this->company_model->read_by_id($id); $data["jobs"] = $this->job_model->read_by_company($id); $this->load->view("website/template", $data); }